之前做过一版h5微信聊天移动端,这段时间闲来无事就整理了下之前项目,又重新在原先的那版基础上升级了下,如是就有了现在的h5仿微信聊天高仿版,新增了微聊、通讯录、探索、我四个模块 左右触摸滑屏切换,聊天页面优化了多图预览、视频播放,长按菜单ui,聊天底部编辑器重新优化整理(新增多表情),弹窗则用到了自己开发的wcpop.js,具体看项目效果图吧!
html代码片段:
<!-- //微聊底部功能面板 --><div class="wc__foottool-panel"> <!-- 输入框模块 --> <div class="wc__editor-panel wc__bort flexbox"> <div class="wrap-editor flex1"><div class="editor j__wceditor" contenteditable="true"></div></div> <i class="btn btn-emotion"></i> <i class="btn btn-choo"></i> <button class="btn-submit j__wchatsubmit">发送</button> </div> <!-- 表情、选择模块 --> <div class="wc__choo-panel wc__bort" style="display: none;"> <!-- 表情区域 --> <div class="wrap-emotion" style="display: none;"> <div class="emotion__cells flexbox flex__direction-column"> <div class="emotion__cells-swiper flex1" id="j__swiperemotion"> <div class="swiper-container"> <div class="swiper-wrapper"></div> <div class="pagination-emotion"></div> </div> 全国旅游路线 </div>爱情的爱; <div class="emotion__cells-footer" id="j__emotionfoottab"> <ul class="clearfix"> <li class="swipertmpl cur" tmpl="swiper__tmpl-emotion01"><img src="img/emotion/face01/face-lbl.png" alt=""></li> <li class="swipertmpl" tmpl="swiper__tmpl-emotion02"><img src="img/emotion/face02/face-lbl.gif" alt=""></li> <li class="swipertmpl" tmpl="swiper__tmpl-emotion03"><img src="img/emotion/face03/face-lbl.英语写信格式gif" alt=""></li> <li class="swipertmpl" tmpl="swiper__tmpl-emotion04"><img src="img/emotion/face04/face-lbl.gif" alt=""></li> <li class="swipertmpl" tmpl="swiper__tmpl-emotion05"><img src="img/emotion/face05/face-lbl.gif" alt=""></li> <li class="swipertmpl" tmpl="swiper__tmpl-emotion06"><img src="img/emotion/face06/face-lbl.gif" alt=""></li> <li class="swipertmplt"><img src="img/wchat/icon__emotion-t.png" alt=""></li> </ul> </div> </div> </div> <!-- 选择区域 --> <div class="wrap-choo" style="display: none;"> <div class="choo__cells"> <ul class="clearfix"> <li><a class="j__wchatzp" href="javascript:;"><span class="img"><img src="img/wchat/icon__choo-zp.png" /><input type="file" accept="image/*" /></span><em>照片</em></a></li> <li><a class="j__wchatsp" href="javascript:;"><span class="img"><img src="img/wchat/icon__choo-sp.png" /><input type="file" accept="video/*" /></span><em>视频</em></a></li> <li><a class="j__wchathb" href="javascript:;"><span class="img"><img src="img/wchat/icon__choo-hb.png" /></span><em>红包</em></a></li> <li><a class="j__wchatsc" href="javascript:;"><span class="img"><img src="img/wchat/icon__choo-sc.png" /></span><em>我的收藏</em></a></li> <li><a class="j__wchatwj" href="javascript:;"><span class="img"><img src="img/wchat/icon__choo-wj.png" /></span><em>文件</em></a></li> 江南古诗的意思 </ul> </div> </div> </div></div><div class="wc__choopanel-tmpl"> <!-- //红包模板.begin --> <div id="j__popuptmpl-hongbao" style="display:none;"> <div class="wc__popuptmpl tmpl-hongbao"> <i class="wc-xclo"></i> <ul class="clearfix"> <li class="item flexbox"> <label class="txt">总金额</label><input class="ipt-txt flex1" type="tel" name="hbamount" placeholder="0.00" /><em class="unit">元</em> </li> <li class="item flexbox"> <label class="txt">红包个数</label><input class="ipt-txt flex1" type="tel" name="hbnum" placeholder="填写个数" /><em class="unit">个</em> </li> <li class="tips">在线人数共<em class="memnum">186</em>人</li> <li class="item item-area"> <textarea class="describe" name="content" placeholder="恭喜发财,大吉大利"></textarea> </li> <li class="amounttotal">¥<em class="num">0.00</em></li> </ul> </div> </div> <!-- //红包模板.end --></div>
js代码片段:
// ...长按弹出菜单$("#j__chatmsglist").on("longtap", "li .msg", function(e){ var that = $(this), menutpl, menunode 最挣钱的行业= $("<div class='wc__chattapmenu animated anim-fadein'></div>"); that.addclass("taped"); that.parents("li").siblings().find(".msg").removeclass("taped"); var isrevoke = that.parents("li").hasclass("me"); var _revoke = isrevoke ? "<a href='#'><i class='ico i4'></i>撤回</a>" : ""; if(that.hasclass("picture")){ console.log("图片长按"); menutpl = "<div class='menu menu-picture'><a href='#'><i class='ico i1'></i>复制</a><a href='#'><i class='ico i2'></i>收藏</a><a href='#'><i class='ico i3'></i>另存为</a>"+ _revoke +"<a href='#'><i class='ico i5'></i>删除</a></div>"; }el if(that.hasclass("video")){ console.log("视频长按"); menutpl = "<div class='menu menu-video'><a href='#'><i class='ico i3'></i>另存为</a>" + _revoke +"<a href='#'><i class='ico i5'></i>删除</a></div>"; }el{ console.log("文字长按"); menutpl = "<div class='menu menu-text'><a href='#'><i class='ico i1'></i>复制</a><a href='#'><i class='ico i2'></i>收藏</a>" + _revoke +"<a href='#'><i class='ico i5'></i>删除</a></div>"; } if(!$(".wc__chattapmenu").length){ $(".wc__chatmsg-panel").append(menunode.html(menutpl)); autopos(); }el{ $(".wc__chattapmenu").hide().html(menutpl).fadein(250); autopos(); } function autopos(){ console.log(that.position().top) var _other = that.parents("li").hasclass("others"); $(".wc__chattapmenu").css({ position: "absolute", left: that.position().left + parint(that.css("marginleft")) + (_other ? 0 : that.outerwidth() - $(".wc__chattapmenu").outerwidth()), top: that.position().top - $(".wc__chattapmenu").outerheight() - 8 }); }});
效果图:
总结
以上所述是www.887551.com给大家介绍的html5高仿微信聊天、微信聊天表情|对话框|编辑器功能,希望对大家有所帮助
本文发布于:2023-04-06 10:28:43,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/191a13ca28bac8216379ad2679a0b413.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:HTML5高仿微信聊天、微信聊天表情.doc
本文 PDF 下载地址:HTML5高仿微信聊天、微信聊天表情.pdf
留言与评论(共有 0 条评论) |