You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
44 KiB
1 lines
44 KiB
{"version":3,"sources":["uni-app:///main.js","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?17b6","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?e4fa","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?1b62","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?2d75","uni-app:///pages/msg/chat/chat.vue","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?39b8","webpack:////Users/yangjie/Desktop/uniApp/商城模板/pages/msg/chat/chat.vue?a4b7"],"names":["createPage","Page"],"mappings":";;;;;;;;;;kDAAA;AACA;AACA,8F;AACAA,UAAU,CAACC,aAAD,CAAV,C;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiH;AACjH;AACwD;AACL;AACc;;;AAGjE;AACmN;AACnN,gBAAgB,iNAAU;AAC1B,EAAE,0EAAM;AACR,EAAE,+EAAM;AACR,EAAE,wFAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,mFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAi1B,CAAgB,kyBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwGr2B;AACA,MADA,kBACA;AACA;AACA;;AAEA,iBAHA;AAIA;AACA,4BALA;AAMA,kBANA;AAOA,sBAPA;AAQA,iBARA;AASA,oBATA;AAUA,cAVA;AAWA;;AAEA;AACA,wCAdA;;AAgBA,oBAhBA;AAiBA,uBAjBA;AAkBA,4BAlBA;AAmBA,sBAnBA;AAoBA,qBApBA;AAqBA,wCArBA;AAsBA,uBAtBA;AAuBA,qBAvBA;AAwBA;AACA,0CAzBA;AA0BA,qBA1BA;AA2BA,sBA3BA;AA4BA;AACA,kBA7BA;AA8BA;AACA,g0BADA;AAEA,k0BAFA;AAGA,o0BAHA;AAIA,g1BAJA;AAKA,80BALA,CA9BA;;AAqCA;AACA,68FAtCA;;AAwCA,GA1CA;AA2CA,QA3CA,kBA2CA,MA3CA,EA2CA;AACA;AACA,wBADA;;AAGA;AACA;AACA;AACA;AACA,KAFA;;AAIA;AACA;AACA;AACA,KAFA;AAGA;AACA;AACA;AACA,KAFA;;AAIA,GA9DA;AA+DA;AACA,cADA,wBACA;AACA;AACA;AACA,qIADA;AAEA,iLAFA;AAGA,wKAHA;AAIA,0JAJA;AAKA,6JALA;AAMA,qKANA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAHA;AAIA,KAzBA;AA0BA;AACA,cA3BA,sBA2BA,GA3BA,EA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAzCA;AA0CA;AACA,aA3CA,qBA2CA,GA3CA,EA2CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBATA;;AAWA;AACA;AACA,OAFA;AAGA,KA9DA;AA+DA;AACA,eAhEA,yBAgEA;AACA;AACA,KAlEA;AAmEA;AACA,aApEA,uBAoEA;AACA;AACA,KAtEA;AAuEA;AACA,YAxEA,oBAwEA,EAxEA,EAwEA;AACA;AACA,KA1EA;AA2EA;AACA,YA5EA,sBA4EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KArFA;AAsFA;AACA,gBAvFA,wBAuFA,GAvFA,EAuFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAfA;AAgBA;AACA,KAzGA;AA0GA;AACA,eA3GA,yBA2GA;AACA;AACA;AACA,4CADA,EACA;AACA;AACA,WADA;AAEA;AACA,uCADA;AAEA;AACA;AACA;AACA;AACA;AACA,eAPA,IAFA,EACA;;AAUA;AACA,SAdA;;AAgBA,KA7HA;AA8HA;AACA,WA/HA,mBA+HA,OA/HA,EA+HA,IA/HA,EA+HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OALA,EAKA,IALA;AAMA,KA7IA;;AA+IA;AACA,cAhJA,sBAgJA,GAhJA,EAgJA;AACA;AACA,KAlJA;AAmJA;AACA,eApJA,uBAoJA,GApJA,EAoJA;AACA;AACA,KAtJA;AAuJA;AACA,aAxJA,qBAwJA,GAxJA,EAwJA;AACA;AACA;AACA;AACA,KA5JA;AA6JA;AACA,WA9JA,mBA8JA,GA9JA,EA8JA;AACA;AACA,yBADA;AAEA,4BAFA;AAGA,6BAHA;;AAKA,KApKA;AAqKA;AACA,aAtKA,qBAsKA,GAtKA,EAsKA;AACA;AACA;AACA;AACA;AACA,KA3KA;AA4KA;AACA,cA7KA,sBA6KA,CA7KA,EA6KA;AACA;AACA;AACA;AACA;AACA;AACA,6CANA,CAMA;AACA,KApLA;AAqLA;AACA,eAtLA,uBAsLA,CAtLA,EAsLA;AACA;AACA;AACA;AACA;AACA;AACA,OAFA,EAEA,IAFA;AAGA,KA7LA;AA8LA;AACA,eA/LA,yBA+LA;AACA;AACA;AACA;AACA,2BAJA,CAIA;AACA,2BALA,CAKA;AACA,KArMA;AAsMA;AACA,YAvMA,oBAuMA,CAvMA,EAuMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAHA,MAGA;AACA;AACA;AACA;AACA,KApNA;AAqNA;AACA,YAtNA,oBAsNA,CAtNA,EAsNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAPA,CAOA;AACA,KA9NA;;AAgOA;AACA,aAjOA,qBAiOA,CAjOA,EAiOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA;AAGA,SALA,EAKA;AACA;AACA,SAPA;AAQA;AACA;AACA,mBADA;AAEA,6BAFA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OApBA,MAoBA;AACA;AACA;AACA;AACA,KA3PA;AA4PA;AACA,eA7PA,yBA6PA;AACA;AACA;AACA,KAhQA;AAiQA,WAjQA,qBAiQA;AACA;AACA,KAnQA,EA/DA,E;;;;;;;;;;;;;ACxGA;AAAA;AAAA;AAAA;AAAshD,CAAgB,43CAAG,EAAC,C;;;;;;;;;;;ACA1iD;AACA,OAAO,KAAU,EAAE,kBAKd","file":"pages/msg/chat/chat.js","sourcesContent":["import 'uni-pages';\nimport Vue from 'vue'\nimport Page from './pages/msg/chat/chat.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./chat.vue?vue&type=template&id=3b8dca78&\"\nvar renderjs\nimport script from \"./chat.vue?vue&type=script&lang=js&\"\nexport * from \"./chat.vue?vue&type=script&lang=js&\"\nimport style0 from \"./chat.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/msg/chat/chat.vue\"\nexport default component.exports","export * from \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./chat.vue?vue&type=template&id=3b8dca78&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./chat.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./chat.vue?vue&type=script&lang=js&\"","<template>\n\t<view>\n\t\t<view class=\"content\" @touchstart=\"hideEmoji\">\r\n\t\t\t<scroll-view class=\"msg-list\" scroll-y=\"true\" :scroll-with-animation=\"scrollAnimation\" :scroll-top=\"scrollTop\" :scroll-into-view=\"scrollToView\">\r\n\t\t\t\t<view class=\"row\" v-for=\"(row,index) in msgList\" :key=\"index\" :id=\"'msg'+row.id\">\r\n\t\t\t\t\t<!-- 自己发出的消息 -->\r\n\t\t\t\t\t<view class=\"my\" v-if=\"row.uid==myuid\">\r\n\t\t\t\t\t\t<view class=\"left\">\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='text'\" class=\"bubble\">\r\n\t\t\t\t\t\t\t\t<rich-text :nodes=\"row.msg.content\"></rich-text>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='voice'\" class=\"bubble voice\" @tap=\"playVoice(row)\" :class=\"playMsgid == row.id?'play':''\">\r\n\t\t\t\t\t\t\t\t<view class=\"length\">{{row.msg.length}}</view>\r\n\t\t\t\t\t\t\t\t<view class=\"icon my-voice\"></view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='img'\" class=\"bubble img\" @tap=\"showPic(row)\">\r\n\t\t\t\t\t\t\t\t<image :src=\"row.msg.url\" :style=\"{'width': row.msg.w+'px','height': row.msg.h+'px'}\"></image>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t<view class=\"right\">\r\n\t\t\t\t\t\t\t<image :src=\"row.face\"></image>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<!-- 别人发出的消息 -->\r\n\t\t\t\t\t<view class=\"other\" v-if=\"row.uid!=myuid\">\r\n\t\t\t\t\t\t<view class=\"left\">\r\n\t\t\t\t\t\t\t<image :src=\"row.face\"></image>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t<view class=\"right\">\r\n\t\t\t\t\t\t\t<view class=\"username\">\r\n\t\t\t\t\t\t\t\t<view class=\"name\">{{row.username}}</view> <view class=\"time\">{{row.time}}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='text'\" class=\"bubble\">\r\n\t\t\t\t\t\t\t\t<rich-text :nodes=\"row.msg.content\"></rich-text>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='voice'\" class=\"bubble voice\" @tap=\"playVoice(row)\" :class=\"playMsgid == row.id?'play':''\">\r\n\t\t\t\t\t\t\t\t<view class=\"icon other-voice\"></view>\r\n\t\t\t\t\t\t\t\t<view class=\"length\">{{row.msg.length}}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view v-if=\"row.type=='img'\" class=\"bubble img\" @tap=\"showPic(row)\">\r\n\t\t\t\t\t\t\t\t<image :src=\"row.msg.url\" :style=\"{'width': row.msg.w+'px','height': row.msg.h+'px'}\"></image>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</scroll-view>\r\n\t\t</view>\r\n\t\t<!-- 表情栏 -->\r\n\t\t<view class=\"emoji-box\" :class=\"showEmji\" @touchmove.stop.prevent=\"discard\">\r\n\t\t\t<swiper class=\"swiper\" indicator-dots=\"true\" duration=\"150\">\r\n\t\t\t\t<swiper-item v-for=\"(page,pid) in emojiList\" :key=\"pid\">\r\n\t\t\t\t\t<view v-for=\"(em,eid) in page\" :key=\"eid\" @tap=\"addEmoji(em)\">\r\n\t\t\t\t\t\t<image mode=\"widthFix\" :src=\"'/static/img/emoji/'+em.url\"></image>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</swiper-item>\r\n\t\t\t</swiper>\r\n\t\t</view>\r\n\t\t<!-- 底部输入栏 -->\r\n\t\t<view class=\"input-box\" :class=\"showEmji\" @touchmove.stop.prevent=\"discard\">\r\n\t\t\t<!-- H5下不能录音,输入栏布局改动一下 -->\r\n\t\t\t<!-- #ifndef H5 -->\r\n\t\t\t<view class=\"voice\">\r\n\t\t\t\t<view class=\"icon\" :class=\"isVoice?'jianpan':'yuyin'\" @tap=\"switchVoice\"></view>\r\n\t\t\t</view>\r\n\t\t\t<!-- #endif -->\r\n\t\t\t<!-- #ifdef H5 -->\r\n\t\t\t<view class=\"more\" @tap=\"chooseImage\">\r\n\t\t\t\t<view class=\"icon tupian\"></view>\r\n\t\t\t</view>\r\n\t\t\t<!-- #endif -->\r\n\t\t\t<view class=\"textbox\">\r\n\t\t\t\t<view class=\"voice-mode\" :class=\"[isVoice?'':'hidden',recording?'recording':'']\" @touchstart=\"voiceBegin\" @touchmove.stop.prevent=\"voiceIng\" @touchend=\"voiceEnd\" @touchcancel=\"voiceCancel\">{{voiceTis}}</view>\r\n\t\t\t\t<view class=\"text-mode\" :class=\"isVoice?'hidden':''\">\r\n\t\t\t\t\t<view class=\"box\">\r\n\t\t\t\t\t\t<textarea auto-height=\"true\" v-model=\"textMsg\" id=\"textMsg\" />\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"em\" @tap=\"chooseEmoji\">\r\n\t\t\t\t\t\t<view class=\"icon biaoqing\"></view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- #ifndef H5 -->\r\n\t\t\t<view class=\"more\" @tap=\"chooseImage\">\r\n\t\t\t\t<view class=\"icon tupian\"></view>\r\n\t\t\t</view>\r\n\t\t\t<!-- #endif -->\r\n\t\t\t<label for=\"textMsg\">\r\n\t\t\t<view class=\"send\" :class=\"isVoice?'hidden':''\" @tap=\"sendText\">\r\n\t\t\t\t<view class=\"btn\">\r\n\t\t\t\t\t发送\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t</label>\r\n\t\t</view>\r\n\t\t<!-- 录音效果(上滑取消) -->\r\n\t\t<view class=\"record\" :class=\"recording?'':'hidden'\">\r\n\t\t\t<view class=\"ing\" :class=\"willStop?'hidden':''\"><view class=\"icon luyin2\" ></view></view>\r\n\t\t\t<view class=\"cancel\" :class=\"willStop?'':'hidden'\"><view class=\"icon chehui\" ></view></view>\r\n\t\t\t<view class=\"tis\" :class=\"willStop?'change':''\">{{recordTis}}</view>\r\n\t\t</view>\n\t</view>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\r\n\t\t\t\t//文字消息\r\n\t\t\t\t\r\n\t\t\t\ttextMsg:'',\r\n\t\t\t\t//消息列表\r\n\t\t\t\tscrollAnimation:false,\r\n\t\t\t\tscrollTop:0,\r\n\t\t\t\tscrollToView:'',\r\n\t\t\t\tmsgList:[],\r\n\t\t\t\tmsgImgList:[],\r\n\t\t\t\tmyuid:0,\r\n\t\t\t\t//录音相关参数\r\n\t\t\t\t// #ifndef H5\r\n\t\t\t\t//H5不能录音\r\n\t\t\t\tRECORDER:uni.getRecorderManager(),\r\n\t\t\t\t// #endif\r\n\t\t\t\tisVoice:false,\r\n\t\t\t\tvoiceTis:'按住 说话',\r\n\t\t\t\trecordTis:\"手指上滑 取消发送\",\r\n\t\t\t\trecording:false,\r\n\t\t\t\twillStop:false,\r\n\t\t\t\tinitPoint:{identifier:0,Y:0},\r\n\t\t\t\trecordTimer:null,\r\n\t\t\t\trecordLength:0,\r\n\t\t\t\t//播放语音相关参数\r\n\t\t\t\tAUDIO:uni.createInnerAudioContext(),\r\n\t\t\t\tplayMsgid:null,\r\n\t\t\t\tVoiceTimer:null,\r\n\t\t\t\t//表情定义\r\n\t\t\t\tshowEmji:'',\r\n\t\t\t\temojiList:[\r\n\t\t\t\t\t[{\"url\":\"100.gif\",alt:\"[微笑]\"},{\"url\":\"101.gif\",alt:\"[伤心]\"},{\"url\":\"102.gif\",alt:\"[美女]\"},{\"url\":\"103.gif\",alt:\"[发呆]\"},{\"url\":\"104.gif\",alt:\"[墨镜]\"},{\"url\":\"105.gif\",alt:\"[哭]\"},{\"url\":\"106.gif\",alt:\"[羞]\"},{\"url\":\"107.gif\",alt:\"[哑]\"},{\"url\":\"108.gif\",alt:\"[睡]\"},{\"url\":\"109.gif\",alt:\"[哭]\"},{\"url\":\"110.gif\",alt:\"[囧]\"},{\"url\":\"111.gif\",alt:\"[怒]\"},{\"url\":\"112.gif\",alt:\"[调皮]\"},{\"url\":\"113.gif\",alt:\"[笑]\"},{\"url\":\"114.gif\",alt:\"[惊讶]\"},{\"url\":\"115.gif\",alt:\"[难过]\"},{\"url\":\"116.gif\",alt:\"[酷]\"},{\"url\":\"117.gif\",alt:\"[汗]\"},{\"url\":\"118.gif\",alt:\"[抓狂]\"},{\"url\":\"119.gif\",alt:\"[吐]\"},{\"url\":\"120.gif\",alt:\"[笑]\"},{\"url\":\"121.gif\",alt:\"[快乐]\"},{\"url\":\"122.gif\",alt:\"[奇]\"},{\"url\":\"123.gif\",alt:\"[傲]\"}],\r\n\t\t\t\t\t[{\"url\":\"124.gif\",alt:\"[饿]\"},{\"url\":\"125.gif\",alt:\"[累]\"},{\"url\":\"126.gif\",alt:\"[吓]\"},{\"url\":\"127.gif\",alt:\"[汗]\"},{\"url\":\"128.gif\",alt:\"[高兴]\"},{\"url\":\"129.gif\",alt:\"[闲]\"},{\"url\":\"130.gif\",alt:\"[努力]\"},{\"url\":\"131.gif\",alt:\"[骂]\"},{\"url\":\"132.gif\",alt:\"[疑问]\"},{\"url\":\"133.gif\",alt:\"[秘密]\"},{\"url\":\"134.gif\",alt:\"[乱]\"},{\"url\":\"135.gif\",alt:\"[疯]\"},{\"url\":\"136.gif\",alt:\"[哀]\"},{\"url\":\"137.gif\",alt:\"[鬼]\"},{\"url\":\"138.gif\",alt:\"[打击]\"},{\"url\":\"139.gif\",alt:\"[bye]\"},{\"url\":\"140.gif\",alt:\"[汗]\"},{\"url\":\"141.gif\",alt:\"[抠]\"},{\"url\":\"142.gif\",alt:\"[鼓掌]\"},{\"url\":\"143.gif\",alt:\"[糟糕]\"},{\"url\":\"144.gif\",alt:\"[恶搞]\"},{\"url\":\"145.gif\",alt:\"[什么]\"},{\"url\":\"146.gif\",alt:\"[什么]\"},{\"url\":\"147.gif\",alt:\"[累]\"}],\r\n\t\t\t\t\t[{\"url\":\"148.gif\",alt:\"[看]\"},{\"url\":\"149.gif\",alt:\"[难过]\"},{\"url\":\"150.gif\",alt:\"[难过]\"},{\"url\":\"151.gif\",alt:\"[坏]\"},{\"url\":\"152.gif\",alt:\"[亲]\"},{\"url\":\"153.gif\",alt:\"[吓]\"},{\"url\":\"154.gif\",alt:\"[可怜]\"},{\"url\":\"155.gif\",alt:\"[刀]\"},{\"url\":\"156.gif\",alt:\"[水果]\"},{\"url\":\"157.gif\",alt:\"[酒]\"},{\"url\":\"158.gif\",alt:\"[篮球]\"},{\"url\":\"159.gif\",alt:\"[乒乓]\"},{\"url\":\"160.gif\",alt:\"[咖啡]\"},{\"url\":\"161.gif\",alt:\"[美食]\"},{\"url\":\"162.gif\",alt:\"[动物]\"},{\"url\":\"163.gif\",alt:\"[鲜花]\"},{\"url\":\"164.gif\",alt:\"[枯]\"},{\"url\":\"165.gif\",alt:\"[唇]\"},{\"url\":\"166.gif\",alt:\"[爱]\"},{\"url\":\"167.gif\",alt:\"[分手]\"},{\"url\":\"168.gif\",alt:\"[生日]\"},{\"url\":\"169.gif\",alt:\"[电]\"},{\"url\":\"170.gif\",alt:\"[炸弹]\"},{\"url\":\"171.gif\",alt:\"[刀子]\"}],\r\n\t\t\t\t\t[{\"url\":\"172.gif\",alt:\"[足球]\"},{\"url\":\"173.gif\",alt:\"[瓢虫]\"},{\"url\":\"174.gif\",alt:\"[翔]\"},{\"url\":\"175.gif\",alt:\"[月亮]\"},{\"url\":\"176.gif\",alt:\"[太阳]\"},{\"url\":\"177.gif\",alt:\"[礼物]\"},{\"url\":\"178.gif\",alt:\"[抱抱]\"},{\"url\":\"179.gif\",alt:\"[拇指]\"},{\"url\":\"180.gif\",alt:\"[贬低]\"},{\"url\":\"181.gif\",alt:\"[握手]\"},{\"url\":\"182.gif\",alt:\"[剪刀手]\"},{\"url\":\"183.gif\",alt:\"[抱拳]\"},{\"url\":\"184.gif\",alt:\"[勾引]\"},{\"url\":\"185.gif\",alt:\"[拳头]\"},{\"url\":\"186.gif\",alt:\"[小拇指]\"},{\"url\":\"187.gif\",alt:\"[拇指八]\"},{\"url\":\"188.gif\",alt:\"[食指]\"},{\"url\":\"189.gif\",alt:\"[ok]\"},{\"url\":\"190.gif\",alt:\"[情侣]\"},{\"url\":\"191.gif\",alt:\"[爱心]\"},{\"url\":\"192.gif\",alt:\"[蹦哒]\"},{\"url\":\"193.gif\",alt:\"[颤抖]\"},{\"url\":\"194.gif\",alt:\"[怄气]\"},{\"url\":\"195.gif\",alt:\"[跳舞]\"}],\r\n\t\t\t\t\t[{\"url\":\"196.gif\",alt:\"[发呆]\"},{\"url\":\"197.gif\",alt:\"[背着]\"},{\"url\":\"198.gif\",alt:\"[伸手]\"},{\"url\":\"199.gif\",alt:\"[耍帅]\"},{\"url\":\"200.png\",alt:\"[微笑]\"},{\"url\":\"201.png\",alt:\"[生病]\"},{\"url\":\"202.png\",alt:\"[哭泣]\"},{\"url\":\"203.png\",alt:\"[吐舌]\"},{\"url\":\"204.png\",alt:\"[迷糊]\"},{\"url\":\"205.png\",alt:\"[瞪眼]\"},{\"url\":\"206.png\",alt:\"[恐怖]\"},{\"url\":\"207.png\",alt:\"[忧愁]\"},{\"url\":\"208.png\",alt:\"[眨眉]\"},{\"url\":\"209.png\",alt:\"[闭眼]\"},{\"url\":\"210.png\",alt:\"[鄙视]\"},{\"url\":\"211.png\",alt:\"[阴暗]\"},{\"url\":\"212.png\",alt:\"[小鬼]\"},{\"url\":\"213.png\",alt:\"[礼物]\"},{\"url\":\"214.png\",alt:\"[拜佛]\"},{\"url\":\"215.png\",alt:\"[力量]\"},{\"url\":\"216.png\",alt:\"[金钱]\"},{\"url\":\"217.png\",alt:\"[蛋糕]\"},{\"url\":\"218.png\",alt:\"[彩带]\"},{\"url\":\"219.png\",alt:\"[礼物]\"},]\t\t\t\t\r\n\t\t\t\t],\r\n\t\t\t\t//表情图片图床名称\r\n\t\t\t\tonlineEmoji:{\"100.gif\":\"AbNQgA.gif\",\"101.gif\":\"AbN3ut.gif\",\"102.gif\":\"AbNM3d.gif\",\"103.gif\":\"AbN8DP.gif\",\"104.gif\":\"AbNljI.gif\",\"105.gif\":\"AbNtUS.gif\",\"106.gif\":\"AbNGHf.gif\",\"107.gif\":\"AbNYE8.gif\",\"108.gif\":\"AbNaCQ.gif\",\"109.gif\":\"AbNN4g.gif\",\"110.gif\":\"AbN0vn.gif\",\"111.gif\":\"AbNd3j.gif\",\"112.gif\":\"AbNsbV.gif\",\"113.gif\":\"AbNwgs.gif\",\"114.gif\":\"AbNrD0.gif\",\"115.gif\":\"AbNDuq.gif\",\"116.gif\":\"AbNg5F.gif\",\"117.gif\":\"AbN6ET.gif\",\"118.gif\":\"AbNcUU.gif\",\"119.gif\":\"AbNRC4.gif\",\"120.gif\":\"AbNhvR.gif\",\"121.gif\":\"AbNf29.gif\",\"122.gif\":\"AbNW8J.gif\",\"123.gif\":\"AbNob6.gif\",\"124.gif\":\"AbN5K1.gif\",\"125.gif\":\"AbNHUO.gif\",\"126.gif\":\"AbNIDx.gif\",\"127.gif\":\"AbN7VK.gif\",\"128.gif\":\"AbNb5D.gif\",\"129.gif\":\"AbNX2d.gif\",\"130.gif\":\"AbNLPe.gif\",\"131.gif\":\"AbNjxA.gif\",\"132.gif\":\"AbNO8H.gif\",\"133.gif\":\"AbNxKI.gif\",\"134.gif\":\"AbNzrt.gif\",\"135.gif\":\"AbU9Vf.gif\",\"136.gif\":\"AbUSqP.gif\",\"137.gif\":\"AbUCa8.gif\",\"138.gif\":\"AbUkGQ.gif\",\"139.gif\":\"AbUFPg.gif\",\"140.gif\":\"AbUPIS.gif\",\"141.gif\":\"AbUZMn.gif\",\"142.gif\":\"AbUExs.gif\",\"143.gif\":\"AbUA2j.gif\",\"144.gif\":\"AbUMIU.gif\",\"145.gif\":\"AbUerq.gif\",\"146.gif\":\"AbUKaT.gif\",\"147.gif\":\"AbUmq0.gif\",\"148.gif\":\"AbUuZV.gif\",\"149.gif\":\"AbUliF.gif\",\"150.gif\":\"AbU1G4.gif\",\"151.gif\":\"AbU8z9.gif\",\"152.gif\":\"AbU3RJ.gif\",\"153.gif\":\"AbUYs1.gif\",\"154.gif\":\"AbUJMR.gif\",\"155.gif\":\"AbUadK.gif\",\"156.gif\":\"AbUtqx.gif\",\"157.gif\":\"AbUUZ6.gif\",\"158.gif\":\"AbUBJe.gif\",\"159.gif\":\"AbUdIO.gif\",\"160.gif\":\"AbU0iD.gif\",\"161.gif\":\"AbUrzd.gif\",\"162.gif\":\"AbUDRH.gif\",\"163.gif\":\"AbUyQA.gif\",\"164.gif\":\"AbUWo8.gif\",\"165.gif\":\"AbU6sI.gif\",\"166.gif\":\"AbU2eP.gif\",\"167.gif\":\"AbUcLt.gif\",\"168.gif\":\"AbU4Jg.gif\",\"169.gif\":\"AbURdf.gif\",\"170.gif\":\"AbUhFS.gif\",\"171.gif\":\"AbU5WQ.gif\",\"172.gif\":\"AbULwV.gif\",\"173.gif\":\"AbUIzj.gif\",\"174.gif\":\"AbUTQs.gif\",\"175.gif\":\"AbU7yn.gif\",\"176.gif\":\"AbUqe0.gif\",\"177.gif\":\"AbUHLq.gif\",\"178.gif\":\"AbUOoT.gif\",\"179.gif\":\"AbUvYF.gif\",\"180.gif\":\"AbUjFU.gif\",\"181.gif\":\"AbaSSJ.gif\",\"182.gif\":\"AbUxW4.gif\",\"183.gif\":\"AbaCO1.gif\",\"184.gif\":\"Abapl9.gif\",\"185.gif\":\"Aba9yR.gif\",\"186.gif\":\"AbaFw6.gif\",\"187.gif\":\"Abaiex.gif\",\"188.gif\":\"AbakTK.gif\",\"189.gif\":\"AbaZfe.png\",\"190.gif\":\"AbaEFO.gif\",\"191.gif\":\"AbaVYD.gif\",\"192.gif\":\"AbamSH.gif\",\"193.gif\":\"AbaKOI.gif\",\"194.gif\":\"Abanld.gif\",\"195.gif\":\"Abau6A.gif\",\"196.gif\":\"AbaQmt.gif\",\"197.gif\":\"Abal0P.gif\",\"198.gif\":\"AbatpQ.gif\",\"199.gif\":\"Aba1Tf.gif\",\"200.png\":\"Aba8k8.png\",\"201.png\":\"AbaGtS.png\",\"202.png\":\"AbaJfg.png\",\"203.png\":\"AbaNlj.png\",\"204.png\":\"Abawmq.png\",\"205.png\":\"AbaU6s.png\",\"206.png\":\"AbaaXn.png\",\"207.png\":\"Aba000.png\",\"208.png\":\"AbarkT.png\",\"209.png\":\"AbastU.png\",\"210.png\":\"AbaB7V.png\",\"211.png\":\"Abafn1.png\",\"212.png\":\"Abacp4.png\",\"213.png\":\"AbayhF.png\",\"214.png\":\"Abag1J.png\",\"215.png\":\"Aba2c9.png\",\"216.png\":\"AbaRXR.png\",\"217.png\":\"Aba476.png\",\"218.png\":\"Abah0x.png\",\"219.png\":\"Abdg58.png\"}\n\t\t\t};\n\t\t},\r\n\t\tonLoad(option) {\r\n\t\t\tuni.setNavigationBarTitle({\r\n\t\t\t\ttitle: option.name\r\n\t\t\t});\r\n\t\t\tthis.getMsgList();\r\n\t\t\t//语音自然播放结束\r\n\t\t\tthis.AUDIO.onEnded((res)=>{\r\n\t\t\t\tthis.playMsgid=null;\r\n\t\t\t});\r\n\t\t\t// #ifndef H5\r\n\t\t\t//录音开始事件\r\n\t\t\tthis.RECORDER.onStart((e)=>{\r\n\t\t\t\tthis.recordBegin(e);\r\n\t\t\t})\r\n\t\t\t//录音结束事件\r\n\t\t\tthis.RECORDER.onStop((e)=>{\r\n\t\t\t\tthis.recordEnd(e);\r\n\t\t\t})\r\n\t\t\t// #endif\r\n\t\t},\r\n\t\tmethods:{\r\n\t\t\tgetMsgList(){\r\n\t\t\t\t// 消息列表\r\n\t\t\t\tlet list = [\r\n\t\t\t\t\t{id:0,uid:0,username:\"大黑哥\",face:\"/static/img/face.jpg\",time:\"12:56\",type:\"text\",msg:{content:\"为什么温度会相差那么大?\"}},\r\n\t\t\t\t\t{id:1,uid:1,username:\"售后客服008\",face:\"/static/img/im/face/face_2.jpg\",time:\"12:57\",type:\"text\",msg:{content:\"这个是有偏差的,两个温度相差十几二十度是很正常的,如果相差五十度,那即是质量问题了。\"}},\r\n\t\t\t\t\t{id:2,uid:1,username:\"售后客服008\",face:\"/static/img/im/face/face_2.jpg\",time:\"12:59\",type:\"voice\",msg:{url:\"/static/voice/3.aac\",length:\"00:06\"}},\r\n\t\t\t\t\t{id:3,uid:0,username:\"大黑哥\",face:\"/static/img/face.jpg\",time:\"13:05\",type:\"voice\",msg:{url:\"/static/voice/2.mp3\",length:\"00:06\"}},\r\n\t\t\t\t\t{id:4,uid:0,username:\"大黑哥\",face:\"/static/img/face.jpg\",time:\"13:05\",type:\"img\",msg:{url:\"/static/img/goods/p10.jpg\",w:200,h:200}},\r\n\t\t\t\t\t{id:5,uid:1,username:\"售后客服008\",face:\"/static/img/im/face/face_2.jpg\",time:\"12:59\",type:\"img\",msg:{url:\"/static/img/q.jpg\",w:1920,h:1080}}\r\n\t\t\t\t]\r\n\t\t\t\t// 获取消息中的图片,并处理显示尺寸\r\n\t\t\t\tfor(let i=0;i<list.length;i++){\r\n\t\t\t\t\tif(list[i].type=='img'){\r\n\t\t\t\t\t\tlist[i] = this.setPicSize(list[i]);\r\n\t\t\t\t\t\tconsole.log(\"list[i]: \" + JSON.stringify(list[i]));\r\n\t\t\t\t\t\tthis.msgImgList.push(list[i].msg.url);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.msgList = list;\r\n\t\t\t\t// 滚动到底部\r\n\t\t\t\tthis.$nextTick(function() {\r\n\t\t\t\t\tthis.scrollTop = 9999;\r\n\t\t\t\t\tthis.scrollAnimation = true;\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t//处理图片尺寸,如果不处理宽高,新进入页面加载图片时候会闪\r\n\t\t\tsetPicSize(row){\r\n\t\t\t\tlet maxW = uni.upx2px(350);\r\n\t\t\t\tlet maxH = uni.upx2px(350);\r\n\t\t\t\tif(row.msg.w>maxW||row.msg.h>maxH){\r\n\t\t\t\t\tlet scale = row.msg.w/row.msg.h;\r\n\t\t\t\t\tif(row.msg.w>row.msg.h){\r\n\t\t\t\t\t\trow.msg.w = maxW;\r\n\t\t\t\t\t\trow.msg.h = row.msg.w/scale\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.msg.h = maxH;\r\n\t\t\t\t\t\trow.msg.w = row.msg.h*scale;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn row;\r\n\t\t\t},\r\n\t\t\t// 接受消息(筛选处理)\r\n\t\t\tscreenMsg(msg){\r\n\t\t\t\t//从长连接处转发给这个方法,进行筛选处理\r\n\t\t\t\tif(msg.uid!=this.myuid){\r\n\t\t\t\t\tuni.vibrateLong();\r\n\t\t\t\t}\r\n\t\t\t\tswitch (msg.type){\r\n\t\t\t\t\tcase 'text':\r\n\t\t\t\t\t\tthis.addTextMsg(msg);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'voice':\r\n\t\t\t\t\t\tthis.addVoiceMsg(msg);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'img':\r\n\t\t\t\t\t\tthis.addImgMsg(msg);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tthis.$nextTick(function() {\r\n\t\t\t\t\tthis.scrollToView = 'msg'+msg.id\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t// 选择表情\r\n\t\t\tchooseEmoji(){\r\n\t\t\t\tthis.showEmji = this.showEmji=='showEmoji'?'hideEmoji':'showEmoji';\r\n\t\t\t},\r\n\t\t\t// 隐藏表情\r\n\t\t\thideEmoji(){\r\n\t\t\t\tthis.showEmji = this.showEmji=='showEmoji'?'hideEmoji':'';\r\n\t\t\t},\r\n\t\t\t//添加表情\r\n\t\t\taddEmoji(em){\r\n\t\t\t\tthis.textMsg+=em.alt;\r\n\t\t\t},\r\n\t\t\t// 发送文字消息\r\n\t\t\tsendText(){\r\n\t\t\t\tthis.hideEmoji();\r\n\t\t\t\tif(!this.textMsg){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tlet content = this.replaceEmoji(this.textMsg);\r\n\t\t\t\tlet msg = {content:content}\r\n\t\t\t\tthis.sendMsg(msg,'text');\r\n\t\t\t\tthis.textMsg = '';\r\n\t\t\t},\r\n\t\t\t//替换表情符号为图片\r\n\t\t\treplaceEmoji(str){\r\n\t\t\t\tlet replacedStr = str.replace(/\\[([^(\\]|\\[)]*)\\]/g,(item, index)=>{\r\n\t\t\t\t\tconsole.log(\"item: \" + item);\r\n\t\t\t\t\tfor(let i=0;i<this.emojiList.length;i++){\r\n\t\t\t\t\t\tlet row = this.emojiList[i];\r\n\t\t\t\t\t\tfor(let j=0;j<row.length;j++){\r\n\t\t\t\t\t\t\tlet EM = row[j];\r\n\t\t\t\t\t\t\tif(EM.alt==item){\r\n\t\t\t\t\t\t\t\t//在线表情路径,图文混排必须使用网络路径\r\n\t\t\t\t\t\t\t\tlet onlinePath = 'https://s2.ax1x.com/2019/04/12/'\r\n\t\t\t\t\t\t\t\tlet imgstr = '<img src=\"'+onlinePath+this.onlineEmoji[EM.url]+'\">';\r\n\t\t\t\t\t\t\t\tconsole.log(\"imgstr: \" + imgstr);\r\n\t\t\t\t\t\t\t\treturn imgstr;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\treturn '<div style=\"display: flex;align-items: center;\">'+replacedStr+'</div>';\r\n\t\t\t},\r\n\t\t\t// 选择图片发送\r\n\t\t\tchooseImage(){\r\n\t\t\t\tthis.hideEmoji();\r\n\t\t\t\tuni.chooseImage({\r\n\t\t\t\t\tsizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有\r\n\t\t\t\t\tsuccess: (res)=>{\r\n\t\t\t\t\t\tfor(let i=0;i<res.tempFilePaths.length;i++){\r\n\t\t\t\t\t\t\tuni.getImageInfo({\r\n\t\t\t\t\t\t\t\tsrc: res.tempFilePaths[i],\r\n\t\t\t\t\t\t\t\tsuccess: (image)=>{\r\n\t\t\t\t\t\t\t\t\tconsole.log(image.width);\r\n\t\t\t\t\t\t\t\t\tconsole.log(image.height);\r\n\t\t\t\t\t\t\t\t\tlet msg = {url:res.tempFilePaths[i],w:image.width,h:image.height};\r\n\t\t\t\t\t\t\t\t\tthis.sendMsg(msg,'img');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t// 发送消息\r\n\t\t\tsendMsg(content,type){\r\n\t\t\t\t//实际应用中,此处应该提交长连接,模板仅做本地处理。\r\n\t\t\t\tvar nowDate = new Date();\r\n\t\t\t\tlet lastid = this.msgList[this.msgList.length-1].id;\r\n\t\t\t\tlastid++;\r\n\t\t\t\tlet msg = {id:lastid,uid:0,username:\"大黑哥\",face:\"/static/img/face.jpg\",time:nowDate.getHours()+\":\"+nowDate.getMinutes(),type:type,msg:content};\r\n\t\t\t\tthis.screenMsg(msg);\r\n\t\t\t\t// 定时器模拟对方回复,三秒\r\n\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\tlastid = this.msgList[this.msgList.length-1].id;\r\n\t\t\t\t\tlastid++;\r\n\t\t\t\t\tmsg = {id:lastid,uid:1,username:\"售后客服008\",face:\"/static/img/im/face/face_2.jpg\",time:nowDate.getHours()+\":\"+nowDate.getMinutes(),type:type,msg:content};\r\n\t\t\t\t\tthis.screenMsg(msg);\r\n\t\t\t\t},3000)\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 处理文字消息\r\n\t\t\taddTextMsg(msg){\r\n\t\t\t\tthis.msgList.push(msg);\r\n\t\t\t},\r\n\t\t\t// 处理语音消息\r\n\t\t\taddVoiceMsg(msg){\r\n\t\t\t\tthis.msgList.push(msg);\r\n\t\t\t},\r\n\t\t\t// 处理图片消息\r\n\t\t\taddImgMsg(msg){\r\n\t\t\t\tmsg = this.setPicSize(msg);\r\n\t\t\t\tthis.msgImgList.push(msg.msg.url);\r\n\t\t\t\tthis.msgList.push(msg);\r\n\t\t\t},\r\n\t\t\t// 预览图片\r\n\t\t\tshowPic(row){\r\n\t\t\t\tuni.previewImage({\r\n\t\t\t\t\tindicator:\"none\",\r\n\t\t\t\t\tcurrent:row.msg.url,\r\n\t\t\t\t\turls: this.msgImgList\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t// 播放语音\r\n\t\t\tplayVoice(msg){\r\n\t\t\t\tthis.playMsgid=msg.id;\r\n\t\t\t\tthis.AUDIO.src = msg.msg.url;\r\n\t\t\t\tconsole.log(\"msg.msg.url: \" + msg.msg.url);\r\n this.AUDIO.play();\r\n\t\t\t},\r\n\t\t\t// 录音开始\r\n\t\t\tvoiceBegin(e){\r\n\t\t\t\tif(e.touches.length>1){\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tthis.initPoint.Y = e.touches[0].clientY;\r\n\t\t\t\tthis.initPoint.identifier = e.touches[0].identifier;\r\n\t\t\t\tthis.RECORDER.start({format:\"aac\"});//录音开始,\r\n\t\t\t},\r\n\t\t\t//录音开始UI效果\r\n\t\t\trecordBegin(e){\r\n\t\t\t\tthis.recording = true;\r\n\t\t\t\tthis.voiceTis='松开 结束';\r\n\t\t\t\tthis.recordLength = 0;\r\n\t\t\t\tthis.recordTimer = setInterval(()=>{\r\n\t\t\t\t\tthis.recordLength++;\r\n\t\t\t\t},1000)\r\n\t\t\t},\r\n\t\t\t// 录音被打断\r\n\t\t\tvoiceCancel(){\r\n\t\t\t\tthis.recording = false;\r\n\t\t\t\tthis.voiceTis='按住 说话';\r\n\t\t\t\tthis.recordTis = '手指上滑 取消发送'\r\n\t\t\t\tthis.willStop = true;//不发送录音\r\n\t\t\t\tthis.RECORDER.stop();//录音结束\r\n\t\t\t},\r\n\t\t\t// 录音中(判断是否触发上滑取消发送)\r\n\t\t\tvoiceIng(e){\r\n\t\t\t\tif(!this.recording){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tlet touche = e.touches[0];\r\n\t\t\t\t//上滑一个导航栏的高度触发上滑取消发送\r\n\t\t\t\tif(this.initPoint.Y - touche.clientY>=uni.upx2px(100)){\r\n\t\t\t\t\tthis.willStop = true;\r\n\t\t\t\t\tthis.recordTis = '松开手指 取消发送'\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.willStop = false;\r\n\t\t\t\t\tthis.recordTis = '手指上滑 取消发送'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 结束录音\r\n\t\t\tvoiceEnd(e){\r\n\t\t\t\tif(!this.recording){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.recording = false;\r\n\t\t\t\tthis.voiceTis='按住 说话';\r\n\t\t\t\tthis.recordTis = '手指上滑 取消发送'\r\n\t\t\t\tthis.RECORDER.stop();//录音结束\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//录音结束(回调文件)\r\n\t\t\trecordEnd(e){\r\n\t\t\t\tclearInterval(this.recordTimer);\r\n\t\t\t\tif(!this.willStop){\r\n\t\t\t\t\tplus.io.resolveLocalFileSystemURL( e.tempFilePath, function( entry ) {\r\n\t\t\t\t\t\t// 可通过entry对象操作test.html文件 \r\n\t\t\t\t\t\tentry.file( function(file){\r\n\t\t\t\t\t\t\tconsole.log(file.size + '--' + file.name);\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\t}, function ( e ) {\r\n\t\t\t\t\t\talert( \"Resolve file URL failed: \" + e.message );\r\n\t\t\t\t\t} );\r\n\t\t\t\t\tconsole.log(\"e: \" + JSON.stringify(e));\r\n\t\t\t\t\tlet msg = {\r\n\t\t\t\t\t\tlength:0,\r\n\t\t\t\t\t\turl:e.tempFilePath\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet min = parseInt(this.recordLength/60);\r\n\t\t\t\t\tlet sec = this.recordLength%60;\r\n\t\t\t\t\tmin = min<10?'0'+min:min;\r\n\t\t\t\t\tsec = sec<10?'0'+sec:sec;\r\n\t\t\t\t\tmsg.length = min+':'+sec;\r\n\t\t\t\t\tthis.sendMsg(msg,'voice');\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.log('取消发送录音');\r\n\t\t\t\t}\r\n\t\t\t\tthis.willStop = false;\r\n\t\t\t},\r\n\t\t\t// 切换语音/文字输入\r\n\t\t\tswitchVoice(){\r\n\t\t\t\tthis.hideEmoji();\r\n\t\t\t\tthis.isVoice = this.isVoice?false:true;\r\n\t\t\t},\r\n\t\t\tdiscard(){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\n\t}\n</script>\n\n<style lang=\"scss\">\npage{\r\n\tbackground-color: #e5e5e5;\r\n}\r\n\r\n\t.icon {\r\n\t\tfont-size:56upx;\r\n\t\tcolor: #333;\r\n\t}\r\n.hidden{\r\n\tdisplay: none !important;\r\n}\r\n@keyframes showEM {\r\n\t0% {transform: translateY(0);}\r\n\t100% {transform: translateY(-42vw);}\r\n}\r\n@keyframes hideEM {\r\n\t0% {transform: translateY(-42vw);}\r\n\t100% {transform: translateY(0);}\r\n}\r\n.emoji-box{\r\n\t&.hideEmoji{animation: hideEM .15s linear both;}\r\n\t&.showEmoji{animation: showEM .15s linear both;}\r\n\twidth: 96%;\r\n\theight: 42vw;\r\n\tpadding: 20upx 2%;\r\n\tbackground-color: #f3f3f3;\r\n\tborder-top: solid 1upx #ddd;\r\n\tposition: fixed;\r\n\tz-index: 20;\r\n\ttop: 100%;\r\n\t.swiper{\r\n\t\tswiper-item{\r\n\t\t\tdisplay: flex;\r\n\t\t\tflex-wrap: wrap;\r\n\t\t\tview{\r\n\t\t\t\twidth: 12vw;\r\n\t\t\t\theight: 12vw;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\timage{\r\n\t\t\t\t\twidth: 60%;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n.input-box{\r\n\t&.hideEmoji{animation: hideEM .15s linear both;}\r\n\t&.showEmoji{animation: showEM .15s linear both;}\r\n\twidth: 98%;\r\n\tmin-height: 100upx;\r\n\tpadding: 0 1%;\r\n\tbackground-color: #f2f2f2;\r\n\tdisplay: flex;\r\n\tposition: fixed;\r\n\tz-index: 20;\r\n\tbottom: 0;\r\n\t.voice,.more{\r\n\t\tflex-shrink: 0;\r\n\t\twidth: 90upx;\r\n\t\theight: 100upx;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t}\r\n\t.send{\r\n\t\t//H5发送按钮左边距\r\n\t\t/* #ifdef H5 */\r\n\t\tmargin-left: 20upx;\r\n\t\t/* #endif */\r\n\t\tflex-shrink: 0;\r\n\t\twidth: 100upx;\r\n\t\theight: 100upx;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\t.btn{\r\n\t\t\twidth: 90upx;\r\n\t\t\theight: 56upx;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t\tbackground:linear-gradient(to right,#f09b37,#eb632c);\r\n\t\t\tcolor: #fff;\r\n\t\t\tborder-radius: 6upx;\r\n\t\t\tfont-size: 24upx;\r\n\t\t}\r\n\t}\r\n\t.textbox{\r\n\t\twidth: 100%;\r\n\t\tmin-height: 70upx;\r\n\t\tmargin-top: 15upx;\r\n\t\t.voice-mode{\r\n\t\t\twidth: calc(100% - 2upx);\r\n\t\t\theight: 68upx;\r\n\t\t\tborder-radius: 70upx;\r\n\t\t\tborder:solid 1upx #cdcdcd;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t\tfont-size: 28upx;\r\n\t\t\tbackground-color: #fff;\r\n\t\t\tcolor: #555;\r\n\t\t\t&.recording{\r\n\t\t\t\tbackground-color: #e5e5e5;\r\n\t\t\t}\r\n\t\t}\r\n\t\t.text-mode{\r\n\t\t\twidth: 100%;\r\n\t\t\tmin-height: 70upx;\r\n\t\t\tdisplay: flex;\r\n\t\t\tbackground-color: #fff;\r\n\t\t\tborder-radius: 40upx;\r\n\t\t\t.box{\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tpadding-left: 30upx;\r\n\t\t\t\tmin-height: 70upx;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\twidth: 100%;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t.em{\r\n\t\t\t\tflex-shrink: 0;\r\n\t\t\t\twidth: 80upx;\r\n\t\t\t\theight: 70upx;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n.record{\r\n\twidth: 40vw;\r\n\theight: 40vw;\r\n\tposition: fixed;\r\n\ttop: 55%;\r\n\tleft: 30%;\r\n\tbackground-color: rgba(0,0,0,.6);\r\n\tborder-radius: 20upx;\r\n\t.ing{\r\n\t\twidth: 100%;\r\n\t\theight: 30vw;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\t@keyframes volatility {\r\n\t\t\t0% {background-position: 0% 130%;}\r\n\t\t\t20% {background-position: 0% 150%;}\r\n\t\t\t30% {background-position: 0% 155%;}\r\n\t\t\t40% {background-position: 0% 150%;}\r\n\t\t\t50% {background-position: 0% 145%;}\r\n\t\t\t70% {background-position: 0% 150%;}\r\n\t\t\t80% {background-position: 0% 155%;}\r\n\t\t\t90% {background-position: 0% 140%;}\r\n\t\t\t100% {background-position: 0% 135%;}\r\n\t\t}\r\n\t\t.icon{\r\n\t\t\tbackground-image:linear-gradient(to bottom,#f09b37,#fff 50%); \r\n\t\t\tbackground-size:100% 200%;\r\n\t\t\tanimation: volatility 1.5s ease-in-out -1.5s infinite alternate;\r\n\t\t\t-webkit-background-clip:text; \r\n\t\t\t-webkit-text-fill-color:transparent; \r\n\t\t\tfont-size: 150upx;\r\n\t\t\tcolor: #f09b37;\r\n\t\t}\r\n\t}\r\n\t.cancel{\r\n\t\twidth: 100%;\r\n\t\theight: 30vw;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\t.icon{\r\n\t\t\tcolor: #fff;\r\n\t\t\tfont-size: 150upx;\r\n\t\t}\r\n\t}\r\n\t.tis{\r\n\t\twidth: 100%;\r\n\t\theight: 10vw;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\tfont-size: 28upx;\r\n\t\tcolor: #fff;\r\n\t\t&.change{\r\n\t\t\tcolor: #f09b37;\r\n\t\t}\r\n\t}\r\n}\r\n.content{\r\n\twidth: 100%;\r\n\t.msg-list{\r\n\t\twidth: 96%;\r\n\t\tpadding: 0 2%;\r\n\t\tposition: absolute;\r\n\t\ttop: 0;\r\n\t\tbottom: 100upx;\r\n\t\t.row{\r\n\t\t\t&:first-child{\r\n\t\t\t\tmargin-top: 20upx;\r\n\t\t\t}\r\n\t\t\tpadding: 20upx 0;\r\n\t\t\t.my .left,.other .right{\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\t.bubble{\r\n\t\t\t\t\tmax-width: 70%;\r\n\t\t\t\t\tmin-height: 50upx;\r\n\t\t\t\t\tborder-radius: 10upx;\r\n\t\t\t\t\tpadding: 15upx 20upx;\r\n\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\talign-items: center;\r\n\t\t\t\t\tfont-size: 32upx;\r\n\t\t\t\t\tword-break: break-word;\r\n\t\t\t\t\t&.img{\r\n\t\t\t\t\t\tbackground-color: transparent;\r\n\t\t\t\t\t\tpadding:0;\r\n\t\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\t\timage{\r\n\t\t\t\t\t\t\tmax-width: 350upx;\r\n\t\t\t\t\t\t\tmax-height: 350upx;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t&.voice{\r\n\t\t\t\t\t\t.icon{\r\n\t\t\t\t\t\t\tfont-size: 40upx;\r\n\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\talign-items: center;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t.icon:after\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontent:\" \";\r\n\t\t\t\t\t\t\twidth: 53upx;\r\n\t\t\t\t\t\t\theight: 53upx;\r\n\t\t\t\t\t\t\tborder-radius: 100%;\r\n\t\t\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t.length{\r\n\t\t\t\t\t\t\tfont-size: 28upx;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t.my .right,.other .left{\r\n\t\t\t\tflex-shrink: 0;\r\n\t\t\t\twidth: 80upx;\r\n\t\t\t\theight: 80upx;\r\n\t\t\t\timage{\r\n\t\t\t\t\twidth: 80upx;\r\n\t\t\t\t\theight: 80upx;\r\n\t\t\t\t\tborder-radius: 10upx;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t.my{\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: flex-end;\r\n\t\t\t\t.left{\r\n\t\t\t\t\tmin-height: 80upx;\r\n\t\t\t\t\t\r\n\t\t\t\t\talign-items: center;\r\n\t\t\t\t\tjustify-content: flex-end;\r\n\t\t\t\t\t.bubble{\r\n\t\t\t\t\t\tbackground-color: #f06c7a;\r\n\t\t\t\t\t\tcolor: #fff;\r\n\t\t\t\t\t\t&.voice{\r\n\t\t\t\t\t\t\t.icon{\r\n\t\t\t\t\t\t\t\tcolor: #fff;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t.length{\r\n\t\t\t\t\t\t\t\tmargin-right: 20upx;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t&.play{\r\n\t\t\t\t\t\t\t@keyframes my-play {\r\n\t\t\t\t\t\t\t\t0% {\r\n\t\t\t\t\t\t\t\t\ttransform: translateX(80%);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t100% {\r\n\t\t\t\t\t\t\t\t\ttransform: translateX(0%);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t.icon:after\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tborder-left: solid 10upx rgba(240,108,122,.5);\r\n\t\t\t\t\t\t\t\tanimation: my-play 1s linear infinite;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t.right{\r\n\t\t\t\t\tmargin-left: 15upx;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t.other{\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\t.left{\r\n\t\t\t\t\tmargin-right: 15upx;\r\n\t\t\t\t}\r\n\t\t\t\t.right{\r\n\t\t\t\t\tflex-wrap: wrap;\r\n\t\t\t\t\t.username{\r\n\t\t\t\t\t\twidth: 100%;\r\n\t\t\t\t\t\theight: 45upx;\r\n\t\t\t\t\t\tfont-size: 24upx;\r\n\t\t\t\t\t\tcolor: #999;\r\n\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t.name{\r\n\t\t\t\t\t\t\tmargin-right: 50upx;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t.bubble{\r\n\t\t\t\t\t\tbackground-color: #fff;\r\n\t\t\t\t\t\tcolor: #333;\r\n\t\t\t\t\t\t&.voice{\r\n\t\t\t\t\t\t\t.icon{\r\n\t\t\t\t\t\t\t\tcolor: #333;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t.length{\r\n\t\t\t\t\t\t\t\tmargin-left: 20upx;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t&.play{\r\n\t\t\t\t\t\t\t@keyframes other-play {\r\n\t\t\t\t\t\t\t\t0% {\r\n\t\t\t\t\t\t\t\t\ttransform: translateX(-80%);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t100% {\r\n\t\t\t\t\t\t\t\t\ttransform: translateX(0%);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t.icon:after\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tborder-right: solid 10upx rgba(255,255,255,.8);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tanimation: other-play 1s linear infinite;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\n</style>","import mod from \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./chat.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./chat.vue?vue&type=style&index=0&lang=scss&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1615167052059\n var cssReload = require(\"/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""} |