小程序聊天室开发,发送文字,表情,图片,音频,视频,即时通讯,快速部署,可定制开发
效果图:
微信小程序聊天功能模块,现在已经支持发送图片,文字,音频,视频,表情,在线即时聊天啦。
需要做的可以联系我微信。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;
}
相关文章:

常用浏览器插件
modify headers :firefox的IP伪造插件 httpRequester:firefox的模拟http请求插件JSON-handle:chrome格式化json插件firebug:firefox查看http请求工具firepath:firefox中获取元素路径转载于:https://www.cnblogs.com/xx…

编码中统一更该变量的快捷键_更多项目想法,以提高您的编码技能
编码中统一更该变量的快捷键Two weeks ago I published an article containing 15 project ideas that you can build to level up your coding skills, and people were very excited about that resource.两周前,我发表了一篇文章,其中包含15个项目构想…
My97DatePicker日历控件日报、每周和每月的选择
My97DatePicker日历控件日报、每周和每月的选择 1、设计源代码 <% page language"java" import"java.util.*" pageEncoding"UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><h…

DotNet Core Console 程序使用NLog
参考:https://github.com/NLog/NLog/wiki/Tutorial 步骤: 1. 使用Nuget安装NLog.Extensions.Logging Install-Package NLog.Extensions.Logging 2.编写代码(到这步运行代码,不报错,但是也不会有log输出,因为…

小程序判断用户在线状态
在页面的两个生命周期组件里面 onShow() {console.log(-----上线线)let info wx.getStorageSync(chat_item)DB.collection(friends).where({_id: info._id}).get().then(res > {console.log(-----, res)if (res.data[0].a wx.getStorageSync(userInfo)._openid) {console.…

react.js做小程序_如何使用React.js构建现代的聊天应用程序
react.js做小程序In this tutorial, I will guide you to build your own group chat application using React, React Router, and CometChat Pro. Yes, rather than roll out our own server, we will instead use CometChat Pro to handle the real-time sending and receiv…

RAP Mock.js语法规范
Mock.js 的语法规范包括两部分: 数据模板定义规范(Data Template Definition,DTD)数据占位符定义规范(Data Placeholder Definition,DPD)1.数据模板定义规范 DTD 数据模板中的每个属性由 3 部分…

NSDictionary、NSMutableDictionary基本使用
郝萌主倾心贡献,尊重作者的劳动成果。请勿转载。假设文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额任意,重在心意^_^ 我要捐赠: 点击捐赠Cocos2d-X源代码下载:点我传送游戏官方下载:htt…

h5轮播图及效果图
效果图: 代码: <!doctype html> <html><head><meta charset"utf-8"><title>jQuery响应式卡片轮播切换代码</title><link rel"stylesheet" type"text/css" href"css/style.c…

性能测试回归测试_自动网站性能回归测试
性能测试回归测试by Adam Henson亚当汉森(Adam Henson) 如何使用Foo自动执行网站性能回归测试 (How to automate website performance regression testing with Foo) 使用部署后步骤自动执行连续交付工作流程中的性能回归测试 (Using a post deploy step to automate performa…

【html】【13】特效篇--下拉导航
html代码: 1 <!DOCTYPE html>2 <html>3 <head>4 <meta http-equiv"Content-Type" content"text/html; charsetUTF-8">5 <title>Bootstrap导航条鼠标悬停下拉菜单</title>6 <li…

小程序获取用户所在城市完整代码
小程序目录结构 插入提示: 1. 申请开发者密钥(key): 申请密钥 2. 下载微信小程序JavaScriptSDK,下载地址 下载完成后放入utils文件夹下引用即可 3. 安全域名设置,在“设置” -> “开发设置”中设置req…

prolog_如何通过观看权力的游戏学习Prolog
prologby Rachel Wiles瑞秋威尔斯(Rachel Wiles) 如何通过观看权力的游戏学习Prolog (How to learn Prolog by watching Game of Thrones) 他们死了吗? 他们还活着吗? 她是他的姨妈吗? 不用把精力浪费在2011年,而可以使用Prolog节…

身份证号码对应地区-官方措辞:行政区划代码
身份证前6位代表着该身份证的籍贯在哪里,而官方的措辞则为:行政区划代码 如何找到最新的行政区划代码了? 通过:http://blog.sina.com.cn/s/blog_5a76dae20100tqv5.html 此人的博客得知,行政区划代码是国家统计局统计的…

Jquery_操作cookies
首先引入jquery.cookie.js jquery.cookie.js下地址:http://plugins.jquery.com/cookie/ 操作文档: https://github.com/carhartl/jquery-cookie#readme 创建cookies: $.cookie(name, value); 设置有效期: 设置七天过期 $.cookie(n…

rem转rpx工具
对样式进行格式化,然后根据 “rem” 进行拆分,这样就会拆分成一个数组 [str1,str2,str3...,str6], 除了最后一个元素,前边的元素都会以 “rem” 样式的数值结尾, 然后在对数组中的元素字符串进行再次根据 “:” 进行…

colab中的变量怎么读取_Fizyr Retinanet在Colab中进行目标检测
colab中的变量怎么读取by RomRoc由RomRoc 带有Fizyr Retinanet的Google Colab中的对象检测 (Object Detection in Google Colab with Fizyr Retinanet) Let’s continue our journey to explore the best machine learning frameworks in computer vision.让我们继续我们的旅程…

c++重载(以运算符重载为主)
重载(OverLoading)是面向对象程序设计多态性的一种体现。所谓重载,是指“同一标识符”在同一作用域的不同场合具有不同的语义,这个标识符可以是函数名或运算符。也就是说,重载可以使多个函数使用同一个函数名ÿ…

记录-MySQL中的事件调度Event Scheduler
下面是自己的实例 /*查询event是否开启(查询结果Off为关闭 On为开启)*/show variables like %sche%; /*开启/关闭命令(1开启--0关闭)*/set global event_scheduler1; /*关闭事件任务: */alter event e_test_insert ON COMPLETION…

JS 实现下载Blod文件
实现代码: //下载Blod文件 const downLoadBlobFile (filename, res) > {if (!res) return;let a document.createElement(a);let blob new Blob([res], { type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charsetutf-8 });let blo…

盖尔-沙普利算法_盖尔定律-及其与初创企业的关系
盖尔-沙普利算法I realized something fascinating the other day: I realized that, as a startup entrepreneur and founder, I’m a builder of systems.前几天,我意识到了一件令人着迷的事情:我意识到,作为一名初创企业家和创始人&#x…

使用VS Code开发.Net Core 2.0 MVC Web应用程序教程之三(配置文件读取)
干了一天的活,还有点时间,给兄弟们写点东西吧。 大家有没有发现一个问题?那就是在.Net Core的MVC项目里面,没有.config文件了!!!同志们,没有config文件了啊,这样搞&#…

小程序云开发数据库在网站读取
使用TCB JS SDK Tencent Cloud Base(TCB) JavaScript SDK 介绍 TCB 提供开发应用所需服务和基础设施。TCB JS SDK 让你可以在网页端使用 JavaScript 代码服务访问 TCB 的的服务。你可以使用该 SDK 构建自己的公众号页面或者独立的网站等 Web 服务。 安装 TCB JS SDK 可以…

设计模式学习心得4
1.组合模式 定义一个父类,其中包括所有子类的方法接口,那么对于任何一个子类来说对外界都是封闭的,外界只调用父类的接口,而不知道子类是否有实现。 2.迭代器模式 这个很常见,在C中常常会用在标准模版类中,…

react创建组件_如何使用React创建时间轴组件
react创建组件These days I’ve been working on a new page for my website. I wanted to have a Timeline to showcase some of my professional accomplishments over the years.这些天来,我一直在为网站创建新页面。 我希望有一个时间表来展示我多年来的一些专业…

oracle根据一张表更新另外一张表
知道是两张表进行更新,之前作过mysql的,直接就写了: update a,b set a.code b.code wehre a.id b.id 然后就报错了,上网查了下知道oracle不能这样子写 之后找到如下的办法: UPDATE a set a.code (select b.code from b where…

应用内设置语言不重启方法
1、设置本应用方法网上有很多,大概如下 Resources resources getResources(); Configuration config resources.getConfiguration(); DisplayMetrics dm resources.getDisplayMetrics(); config.locale locale; //目标语言 resources.updateConfiguration(confi…

小程序内容审核违规过滤,在小程序使用security.msgSecCheck
使用微信提供的API security.msgSecCheck 查看文档 1.开通云开发,创建云环境。 2.在云函数的目录中,创建一个云函数(ContentCheck),如果小程序代码没有云函数的目录,可以在 project.config.json 目录中配置…

如何在JavaScript中切片和拼接数组
.slice() and .splice() are similar methods in JavaScript. They look similar, they sound similar, and they do similar things. For those reasons, it’s important to know the differences between them. Also, they’re used very often, so understanding their usa…

jQuery中getJSON跨域原理详解
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp28 jQuery中getJSON跨域原理详解 前几天我再开发一个叫 河蟹工具条 的时候,其中有个功能就是获取本页面的短网址。 这个想法是好的,可是在我付诸于行动的时候,发…