小程序聊天室开发,发送文字,表情,图片,音频,视频,即时通讯,快速部署,可定制开发

效果图:

微信小程序聊天功能模块,现在已经支持发送图片,文字,音频,视频,表情,在线即时聊天啦。

需要做的可以联系我微信。13977284413

上代码:

<view class="bo">
	<view class="cgzslj">
		<image wx:if='{{voice_icon_click}}' class="audi_icon ball" src="/images/audi_icon.png"></image>
	</view>
	<!-- <view class="top_bo"> -->
	<!-- <view bindtap="number">群成员({{userNumber}})</view>
    <view bindtap="upLoad" wx:if="{{prohibit=='0'}}">发图片</view>
    <view bindtap="prohibitTis" wx:if="{{prohibit=='1'}}">发图片</view>
		</view>
	</view> -->
	<scroll-view scroll-y="true" scroll-with-animation scroll-top="{{scrollTop}}">
		<block wx:if='{{!list}}'>
			<view class="noList">
				<view class="noMsg">暂无聊天数据</view>
			</view>
		</block>
		<block wx:else>
			<view class="tips"> 临时聊天室已建立
				线上互动交流过程中,请注意保护隐私</view>
			<view class="body" wx:for='{{list}}' wx:key='index'>

				<view wx:if='{{item.openid==openid}}' class="right_body">
					<view class="flexRoe posRit">
						<view class="textBo">
							<view class="dataTime">{{my_name}} {{item.dataTime}}</view>
							<view wx:if="{{item.txt!=''}}" class="ritTxt">{{item.txt}}</view>
							<image wx:if="{{item.type==2}}" bindtap="previewImage" mode='widthFix' data-src='{{item.img}}' src="{{item.img}}" class="textImg"></image>
							<video wx:if="{{item.type==3}}" class="textImg" id="myVideo" src="{{item.video}}" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls picture-in-picture-mode="{{['push', 'pop']}}" bindenterpictureinpicture='bindVideoEnterPictureInPicture' bindleavepictureinpicture='bindVideoLeavePictureInPicture'></video>
							<view wx:if="{{item.type==4}}" class="ritTxt2" bindtap='my_audio_click' data-src='{{item.voice}}'>
								<image class='my_audio' src='/images/audi_icon2.png'></image>
							</view>
						</view>
						<image class="head" style=" margin-left:20rpx " src="{{my_img}}"></image>
					</view>
				</view>
				<view wx:else class="p_r left_body">
					<view class="flexRoe ">
						<image class="head" style=" margin-left:20rpx " src="{{item.img}}"></image>
						<view class="lfBo">
							<view class="dataTime">{{item.nicheng}} {{item.dataTime}}</view>
							<view wx:if="{{item.type==1}}" class="lftTxt">{{item.txt}}</view>
							<image wx:if="{{item.type==2}}" bindtap="previewImage" mode='widthFix' data-src='{{item.img}}' src="{{item.img}}" class="textImg"></image>
							<video wx:if="{{item.type==3}}" class="textImg" id="myVideo" src="{{item.video}}" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls picture-in-picture-mode="{{['push', 'pop']}}" bindenterpictureinpicture='bindVideoEnterPictureInPicture' bindleavepictureinpicture='bindVideoLeavePictureInPicture'></video>
							<view wx:if="{{item.type==4}}" class="lftTxt2" bindtap='my_audio_click' data-src='{{item.voice}}'>
								<image class='my_audio' src='/images/audi_icon2.png'></image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</block>

	</scroll-view>
	<view class="sendBlock">
		<view class="sbItem" catchtap="upLoad">发送图片</view>
		<view class="sbItem" catchtouchstart='voice_ing_start' catchtouchend="voice_ing_end">发送音频</view>
		<view class="sbItem" catchtap="upVideo">发送视频</view>
	</view>
	<view class="comment">
		<view class="emoji_block" wx:if='{{emoji_block_show}}'>
			<view wx:for='{{connectemoji}}' catchtap="add_biaoqing" id="{{item}}" class="emoji" wx:key=''>{{item}}</view>
		</view>
		<view class="comment_footer">
			<view class="biaoqing" catchtap="emoji_block_show">😊</view>
			<input placeholder="聊天,在这里~" bindinput="input" value='{{txt}}'></input>
			<!-- <image class="upImg" catchtap="upLoad" src="/images/upImg.png"></image> -->
			<button bindtap="sendOut">发表</button>
		</view>
	</view>
	<!-- <view class="inp"> -->
	<view>
		<!-- <view class="p_r">
				<input class="input" placeholder-class='plaCC' bindinput="input" placeholder='聊天,在这里' value="{{txt}}"></input>
				<view class="yuyin" catchtap="sendOut">发送</view>

			</view> -->
		<!-- <view class="yuyin" catchtouchstart='voice_ing_start' catchtouchend="voice_ing_end">语音</view> -->
		<!-- <view wx:if="{{prohibit=='1'}}" bindtap="prohibitTis" class="prohibit">禁言中</view> -->
	</view>
	<!-- </view> -->
</view>

css


page {
  background: #f2f2f2;
}

.biaoqing{
  padding: 10rpx 20rpx 20rpx 10rpx;
  font-size: 40rpx;
}
.comment_footer {
  width: 100%;
  padding: 17rpx 30rpx;
  height: 110rpx;
  position: absolute;
  display: flex;
  flex-direction: row;
  bottom: 0;
  border-top: 2rpx solid #eee;
}
.comment {
  width: 100%;
  /* height: 1000rpx; */
  position: absolute;
  /* border-top-left-radius: 16rpx;
  border-top-right-radius: 16rpx; */
  bottom: 0;
  z-index: 222;
  background: #fff;
}
.sendBlock{
  width: 100%;
  display: flex;
  flex-direction: row;
  bottom: 120rpx;
  position: absolute;
  z-index: 223;
  color: #44426a;
}
.sbItem{
  flex: 1;
  text-align: center;
}
.emoji_block{
  display: flex;   flex-wrap:wrap;
  width: 100%;
  position: absolute;
  bottom: 110rpx;
  padding: 10rpx;
  font-size: 36rpx;

}
.audi_icon{
  /* z-index: 999; */
  animation-name: animation-name-you-pick;
  animation-duration: 2s;
  animation-delay: 2s;
  animation-iteration-count: 1000;
  animation-direction:alternate;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;

}
.cgzslj {
  /* background-color: rgba(0,0,0,0.4); */
  /* height: 50px; */
  text-align: center;
	height: 127rpx;
  position: fixed;
  width: 100%;
	bottom: 300rpx;
}
 
.audi_icon {
	animation: gt 2s infinite linear;
	height: 127rpx;
  width: 238rpx;
  position: relative;
  margin: auto;
  z-index: 999;
}
 
@keyframes gt {
	0% {
		height: 45px;
		/*margin-left: 0px;*/
	}
	25% {
		height: 60px;
		/*margin-left: 10px;*/
	}
	50% {
		height: 90px;
		/*margin-left: 20px;*/
	}
	75% {
		height: 60px;
		/*margin-left: 10px;*/
	}
	100% {
		height: 45px;
		/*margin-left: 0px;*/
	}
}
.emoji{
  margin-right: 20rpx;
}
.comment_footer input {
  width: 470rpx;
  height: 76rpx;
  border: 1px solid rgba(230, 230, 230, 1);
  border-radius: 12rpx;
  padding-left: 20rpx;
}
.upImg{
  margin: 18rpx 12rpx;
  height: 46rpx;
  width: 46rpx;
}
.comment_footer button {
  width: 120rpx;
  height: 66rpx;
  background: rgba(42, 192, 128, 1);
  border-radius: 8rpx;
  margin-top: 4rpx;
  color: #fff;
  font-size: 28rpx;
  line-height: 66rpx;
  text-align: center;
  float: right;
}

.top_bo {
  display: flex;
  background: white;
  flex-direction: row;
}
.mask_layer {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 999;
left:0;top:0;
  background: #000;
  opacity: 0.5;
  overflow: hidden;
}
.modal_box {
  width: 76%;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1001;
  background: #fafafa;
  margin: -150px 12% 0 12%;
  border-radius: 3px;
}
 
.title {
  padding: 15px;
  text-align: center;
  background-color: gazure;
}
 
.content {
  overflow-y: scroll; /*超出父盒子高度可滚动*/
}
 
 .input_show1{
   margin: 0 auto;
   width: 80%;
   border-bottom: 1px solid #999;
   margin-left: 10%;
   font-size: 32rpx;
   text-align: center;
 }
.btn1 {
  width: 100%;
  margin-top: 65rpx;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  background-color: white;
}
 
.cancel {
  width: 100%;
  padding: 10px;
  text-align: center;
  color: black;
}
 
.Sure {
  width: 100%;
  padding: 10px;
  color: #44b549;
  background-color: white;
  border-left: 1px solid #d0d0d0;
  text-align: center;
}
 
.modalMsg {
  text-align: center;
  margin-top: 45rpx;
  display: block;
}
.top_bo view {
  flex: 1;
  font-size: 28rpx;
  text-align: center;
  border: 1rpx solid #ccc;
  line-height: 80rpx;
}

scroll-view {
  height: 84vh;
  padding-bottom: 30rpx;
}

.noList {
  background: white;
  margin-top: 30rpx;
  /* height: 230rpx; */
  width: 100%;
  padding-top: 25%;
}

.noMsg {
  text-align: center;
  color: #999;
  font-size: 28rpx;
}

.inp {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: white;
  height: 100rpx;
}

.inp input {
  background: #d0d0d0;
  border-radius: 15rpx;
  padding-left: 20rpx;
  height: 84rpx;
  margin-top: 10rpx;
  width: 94%;
  margin-left: 2%;
}

.prohibit {
  background: #d0d0d0;
  border-radius: 15rpx;
  padding-left: 20rpx;
  height: 84rpx;
  margin-top: 10rpx;
  width: 94%;
  margin-left: 2%;
  text-align: center;
  line-height: 84rpx;
  color: rgb(34, 34, 34);
}

.plaCC {
  margin-left: 5rpx;
}

.p_r {
  display: flex;
  flex-direction: row;
}

.flexRoe {
  display: flex;
  flex-direction: row;
}

.body {
  width: 100%;
  position: relative;
  /* border: 1rpx solid #ccc; *//* height: 200rpx */
}

.right_body {
  width: 100%;
  /* border: 1rpx solid red; */
  padding: 20rpx;
  margin-top: 50rpx;
}

.left_body {
  margin-top: 50rpx;
}

.posRit {
  right: 20rpx;
}

.textBo {
  width: 620rpx;
  text-align: right;
}

.lfBo {
  margin-left: 10rpx;
}

.ritTxt {
  background: #44426a;
  padding: 10rpx 20rpx 10rpx 20rpx;
  color: white;
  border-radius: 15rpx 0 15rpx 15rpx;
  margin-top: 10rpx;
  float: right;
  max-width: 500rpx;
  word-wrap: break-word;
  text-align: left;
}

.ritTxt2 {
  background: white;
  color: white;
  border-radius: 15rpx 0 15rpx 15rpx;
  padding: 0rpx 20rpx 10rpx 20rpx;
  margin-top: 20rpx;
  float: right;
  max-width: 500rpx;
  word-wrap: break-word;
  text-align: left;
}

.lftTxt {
  background: #44426a;
  padding: 10rpx 20rpx 10rpx 20rpx;
  color: white;
  border-radius: 0rpx 15rpx 15rpx 15rpx;
  margin-top: 10rpx;
  float: left;
  max-width: 500rpx;
  word-wrap: break-word;
  text-align: left;
}
.lftTxt2 {
  background: #fff;
  padding: 0rpx 20rpx 10rpx 20rpx;
  color: white;
  border-radius: 0rpx 15rpx 15rpx 15rpx;
  margin-top: 20rpx;
  float: left;
  max-width: 500rpx;
  word-wrap: break-word;
  text-align: left;
}
.my_audio {
  height: 60rpx;
  width: 60rpx;
  z-index: 2;
  position: relative;
  top: 10rpx;
  left: 20rpx;
  margin-right: 30rpx;
}


.dataTime {
  font-size: 28rpx;
}

.textImg {
  width: 200rpx;
  margin-top: 5rpx;
}

.head {
  width: 80rpx;
  height: 80rpx;
}

._ {
  height: 130rpx;
  width: 100%;
  background: #ccc;
}

.inpBo {
  display: flex;
  flex-direction: row;
}

.yuyin {
  flex: 1;
  line-height: 104rpx;
  text-align: center;
}

.input {
  flex: 5;
}
.tips{
  text-align: left;
  background: white;
  padding: 30rpx;
  font-size: 28rpx;
  color: #999;
}

 

相关推荐
<p> <span style="color:#3D3D3D;"></span> </p> <span style="font-size:18px;">     本课程为JavaSE基础阶段的项目实战视频主要使用技术均为JavaSE基础手把手带你构建在线聊天需要JavaSE基础才能进行实战与开发学习前需要掌握的技能有:逻辑基础、面向对象、异常处理、集合框架、IO流、网络编程、多线程、GUI技术学完本套课程你会对JavaSE有一个更深入的认知为后续课程的学习打下一个坚实的基础。<br /> </span> <p> <br /> </p> <p> <br /> </p> <p> <span style="color:#3D3D3D;"><strong>课程大纲</strong></span> </p> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> <span style="font-size:18px;">1. </span><span style="color:#222222;">网络聊天室认知及原理</span><span style="font-size:18px;">;</span> </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> <span style="font-size:18px;">2. 登录、</span><span style="color:#222222;">聊天室、服务端界面制作</span><span style="font-size:18px;">;</span> </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> <span style="font-size:18px;">3. 客户端/服务端</span><span style="color:#222222;">网络通信实现</span><span style="font-size:18px;">;</span> </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> 4. 通信机制设计; </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> 5. 在线统计、消息收发主功能实现; </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> <span style="font-size:18px;">6. 服务端主功能实现;</span> </div> <span style="color:#3D3D3D;"> </span> <div style="text-align:left;"> 7. 字体及图片样式发送; </div>
微信小程序系统教程[初级阶段]微信小程序0基础学起讲解微信小程序开发的基础知识。 微信小程序系统教程共有“微信小程序系统教程[初级阶段]”、“微信小程序系统教程[中级阶段]——核心技术”、“微信小程序系统教程[阶段]客服消息+微信支付+九宝电商系统”。 “微信小程序系统教程[阶段]全套课程”包含: 1.微信小程序系统教程[阶段]_客服消息 2.微信小程序系统教程[阶段]_微信支付 3.微信小程序系统教程[阶段]_九宝电商系统 学习“微信小程序系统教程[阶段]”要求有微信小程序的基础。建议先学习“微信小程序系统教程[初级阶段]”、“微信小程序系统教程[中级阶段]”后在报名“微信小程序系统教程[阶段]”。 阶段讲解的客服消息是针对小程序的。后台程序用接近底层的技术没有使用三方技术。这样降低同学们学习成本。 微信支付这部分课程很有难度要求同学们认真听讲有不会的技术问题以请教老师。购买课程后请联系老师提供单号给你源程序。 九宝电商系统是一套十分适和学习、项目的课程。既以系统的学习微信小程序相关知识以修改后上线。 “微信小程序系统教程[中级阶段]——核心技术”重点讲解微信小程序事件、组件、API 微信小程序系统教程[初级阶段]微信小程序0基础学起讲解微信小程序开发的基础知识。 购买课程的同学赠送就九宝老师编写的《微信小程序开发宝典》。 购课请咨询qq2326321088
©️2020 CSDN 皮肤主题: 成长之路 设计师:Amelia_0503 返回首页
实付 49.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值