pages-member-chat-ChatInfo.b76167cf.js 31 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-member-chat-ChatInfo"],{"0868":function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=a(i("5530")),n=i("26cb"),o=i("de79"),r={name:"MemberBase",data:function(){return{page:"",cartNumber:0}},props:{show:{type:Boolean,default:!0}},computed:(0,s.default)((0,s.default)({},(0,n.mapState)({user:function(t){return t.member.info},isOnline:function(t){return t.member.isOnline}})),{},{getCarCount:function(){return this.cartNumber>0&&this.cartNumber<100?this.cartNumber:this.cartNumber>=100?"99+":void 0}}),mounted:function(){var t=getCurrentPages(),e=t[t.length-1];this.page={route:e.route,options:e.options},this.user||uni.navigateTo({url:"/pages/home/memberlogin/Login?clear=1"}),this.getCartCount()},methods:{getCartCount:function(){var t=this;this.isOnline&&(0,o.cartQuantity)().then((function(e){e&&(t.cartNumber=e.result.cart_count)}))}}};e.default=r},"1cf8":function(t,e,i){var a=i("2eba");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var s=i("4f06").default;s("ae97d5ee",a,!0,{sourceMap:!1,shadowMode:!1})},"2d27":function(t,e,i){"use strict";i.r(e);var a=i("660b"),s=i("ce46");for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);i("75ca");var o=i("f0c5"),r=Object(o["a"])(s["default"],a["b"],a["c"],!1,null,"325a5669",null,!1,a["a"],void 0);e["default"]=r.exports},"2eba":function(t,e,i){var a=i("24fb"),s=i("1de5"),n=i("f597"),o=i("7972");e=a(!1);var r=s(n),c=s(o);e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.dstouch-chat-product[data-v-47b22951]{width:93%;margin:.5rem auto;padding:.5rem 0;border:solid .05rem #ddd;background-color:#fff;position:relative}.dstouch-chat-product .goods-pic[data-v-47b22951]{width:2.5rem;height:2.5rem;position:absolute;top:.5rem;left:.5rem}.dstouch-chat-product .goods-pic .img[data-v-47b22951]{width:100%}.dstouch-chat-product .goods-info[data-v-47b22951]{margin:0 .5rem 0 3.5rem}.dstouch-chat-product .goods-name[data-v-47b22951]{font-size:.7rem;line-height:.7rem;height:1.4rem;overflow:hidden;margin-bottom:.3rem;color:#000}.dstouch-chat-product .goods-price[data-v-47b22951]{font-size:.6rem;line-height:.9rem;height:.9rem;color:#f23030;font-weight:600}.chat-message .time[data-v-47b22951]{text-align:center;font-size:.6rem;color:grey}.chat-message .dl[data-v-47b22951]{position:relative;min-height:2.2rem;padding:.2rem 0;margin-bottom:.2rem;overflow:hidden}.chat-message .dl.msg-other[data-v-47b22951]{animation:optionMsgLeft-data-v-47b22951 .5s ease-in-out;-webkit-animation:optionMsgLeft-data-v-47b22951 .5s ease-in-out}@keyframes optionMsgLeft-data-v-47b22951{from{opacity:.5;left:-100%;right:100%}to{opacity:1;left:0;right:0}}@-webkit-keyframes optionMsgLeft-data-v-47b22951{from{opacity:.5;left:-100%;right:100%}to{opacity:1;left:0;right:0}}.chat-message .dl.msg-me[data-v-47b22951]{animation:optionMsgRight-data-v-47b22951 .5s ease-in-out;-webkit-animation:optionMsgRight-data-v-47b22951 .5s ease-in-out}@keyframes optionMsgRight-data-v-47b22951{from{opacity:.5;left:100%;right:-100%}to{opacity:1;left:0;right:0}}@-webkit-keyframes optionMsgRight-data-v-47b22951{from{opacity:.5;left:100%;right:-100%}to{opacity:1;left:0;right:0}}.chat-message .dl .dt[data-v-47b22951]{width:2rem;height:2rem;position:absolute;top:.3rem}.chat-message .dl .dt .i[data-v-47b22951]{width:.5rem;height:.5rem;position:absolute;top:.5rem;background-repeat:no-repeat;background-position:50% 50%;background-size:100%}.chat-message .dl .dt .img[data-v-47b22951]{max-width:2rem;max-height:2rem;border-radius:100%}.chat-message .dl.msg-other .dt[data-v-47b22951]{left:.4rem}.chat-message .dl.msg-other .dt .i[data-v-47b22951]{left:2.3rem;background-image:url('+r+")}.chat-message .dl.msg-me .dt[data-v-47b22951]{right:.4rem}.chat-message .dl.msg-me .dt .i[data-v-47b22951]{right:2.3rem;background-image:url("+c+")}.chat-message .dl .dd[data-v-47b22951]{display:block;max-width:10rem;padding:.4rem .6rem;border-radius:.4rem;min-height:.9rem;font-size:.7rem;line-height:.9rem;color:#000;word-wrap:break-word}.chat-message .dl .dd .img[data-v-47b22951]{background:#fff;max-width:8rem;max-height:8rem;padding:.2rem;border-radius:.3rem;vertical-align:text-bottom;margin:0 .2rem}.chat-message .dl.msg-other .dd[data-v-47b22951]{margin-left:3rem;float:left;background-color:#fff}.chat-message .dl.msg-me .dd[data-v-47b22951]{margin-right:3rem;float:right;background-color:#ffd779}",""]),t.exports=e},"39b2":function(t,e,i){var a=i("e0ba");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var s=i("4f06").default;s("dd56d550",a,!0,{sourceMap:!1,shadowMode:!1})},"5b94":function(t,e,i){"use strict";var a=i("1cf8"),s=i.n(a);s.a},"5cdc":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"div chat-message"},[1==t.item.instant_message_type?i("v-uni-view",{staticClass:"div"},[i("v-uni-view",{staticClass:"div dstouch-chat-product",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goNavigate("/pages/home/goodsdetail/Goodsdetail",{goods_id:t.item.instant_message.goods_id})}}},[i("v-uni-view",{staticClass:"div goods-pic"},[i("v-uni-image",{staticClass:"img",attrs:{mode:"aspectFit",src:t.item.instant_message.goods_image_url,alt:""}})],1),i("v-uni-view",{staticClass:"div goods-info"},[i("v-uni-view",{staticClass:"div goods-name"},[t._v(t._s(t.item.instant_message.goods_name))]),i("v-uni-view",{staticClass:"div goods-price"},[t._v("¥"+t._s(t.item.instant_message.goods_price))])],1)],1)],1):i("v-uni-view",{staticClass:"div"},[t.item.instant_message_from_id?i("v-uni-view",{staticClass:"div"},[t.item.if_show_time?i("v-uni-view",{staticClass:"div time"},[t._v(t._s(t.$moment.unix(t.item.instant_message_add_time).format("YYYY-MM-DD HH:mm")))]):t._e(),i("v-uni-view",{staticClass:"dl",class:t.item.instant_message_from_id!=t.t_id?"msg-me":"msg-other"},[i("v-uni-view",{staticClass:"dt"},[i("v-uni-image",{staticClass:"img",attrs:{mode:"aspectFit",src:(t.item.instant_message_from_id!=t.t_id?t.item.instant_message_to_avatar:t.item.instant_message_from_avatar)+"?"+t.time,alt:""}}),i("v-uni-text",{staticClass:"i"})],1),i("v-uni-rich-text",{staticClass:"dd",attrs:{nodes:t.getContent(t.item.instant_message)}})],1)],1):t._e()],1)],1)},s=[]},"660b":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return a}));var a={pageMeta:i("6d42").default,uniNavBar:i("7bfb").default,uniPopup:i("3ae3").default},s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",[i("page-meta",{attrs:{"root-font-size":t.fontSize+"px"}}),i("member-base",{attrs:{show:!1}},[i("v-uni-view",{staticClass:"scroll-view-wrapper scroll-view div container",style:"height:"+t.contentHeight+"px"},[i("v-uni-view",{staticClass:"div common-header-wrap"},[i("v-uni-view",{style:"height:"+t.navHeight+"px"}),i("v-uni-view",{staticClass:"common-header-holder"}),i("v-uni-view",{staticClass:"common-header-fixed"},[i("title-header"),i("uni-nav-bar",{staticClass:"common-header",attrs:{title:t.t_name,"left-icon":"back"},on:{clickLeft:function(e){arguments[0]=e=t.$handleEvent(e),t.goBack()}}},[i("v-uni-view",{staticClass:"div common-btn btn",attrs:{slot:"right"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.showPopup("historyVisible")}},slot:"right"},[t._v("聊天记录")])],1)],1)],1),i("v-uni-scroll-view",{staticClass:"scroll-view div",attrs:{"scroll-y":!0,"scroll-into-view":"msg_"+(t.msg_list.length-1)}},[i("v-uni-view",{staticClass:"dstouch-chat-con"},t._l(t.msg_list,(function(e,a){return i("v-uni-view",{key:a,staticClass:"div",attrs:{id:"msg_"+a}},[i("chat-message",{attrs:{item:t.getMessage(e,a,0),t_id:t.t_id}})],1)})),1)],1),i("v-uni-view",{staticClass:"div dstouch-chat-bottom"},[i("v-uni-view",{staticClass:"div chat-input-layout"},[i("v-uni-view",{staticClass:"span open-smile"},[i("v-uni-text",{staticClass:"a iconfont",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.open_smile.apply(void 0,arguments)}}},[t._v("")])],1),i("v-uni-view",{staticClass:"div input-box"},[i("v-uni-input",{attrs:{type:"text"},on:{blur:function(e){e.preventDefault(),arguments[0]=e=t.$handleEvent(e),t.inputLoseFocus.apply(void 0,arguments)}},model:{value:t.msg,callback:function(e){t.msg=e},expression:"msg"}}),i("v-uni-view",{staticClass:"div common-btn ds-button-small submit",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submit()}}},[t._v("发送")])],1)],1),t.smile_show?i("v-uni-view",{staticClass:"div chat-smile-layout"},[i("v-uni-view",{staticClass:"ul"},t._l(t.smilies_array,(function(e,a){return i("v-uni-view",{key:a,staticClass:"li",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.addSmile(a)}}},[i("v-uni-image",{staticClass:"img",attrs:{mode:"aspectFit",title:e.text,alt:e.text,src:t.getSmile(e.image)}})],1)})),1)],1):t._e()],1),i("uni-popup",{ref:"historyVisible",attrs:{"background-color":"#fff",type:"right"}},[i("v-uni-view",{staticClass:"scroll-view-wrapper common-popup-wrapper",style:"width:"+t.screenWidth+"px"},[i("v-uni-view",{staticClass:"div common-header-wrap"},[i("v-uni-view",{style:"height:"+t.navHeight+"px"}),i("v-uni-view",{staticClass:"common-header-holder"}),i("v-uni-view",{staticClass:"common-header-fixed"},[i("title-header"),i("uni-nav-bar",{staticClass:"common-header",attrs:{title:"聊天记录","left-icon":"back"},on:{clickLeft:function(e){arguments[0]=e=t.$handleEvent(e),t.hidePopup("historyVisible")}}})],1)],1),i("v-uni-view",{staticClass:"scroll-view div common-popup-content"},[i("v-uni-scroll-view",{staticStyle:{position:"absolute",top:"0",right:"0",left:"0",bottom:"0"},attrs:{"scroll-top":t.scrollTop,"scroll-y":"true"},on:{scrolltolower:function(e){arguments[0]=e=t.$handleEvent(e),t.loadMore.apply(void 0,arguments)}}},[t.historyList&&t.historyList.length?i("v-uni-view",{staticClass:"div"},t._l(t.historyList,(function(e,a){return i("chat-message",{key:e.instant_message_id,attrs:{item:t.getMessage(e,a,1),t_id:t.t_id}})})),1):t.historyList&&!t.historyList.length?i("empty-record"):t._e()],1)],1)],1)],1)],1)],1)],1)},n=[]},"69f5":function(t,e,i){"use strict";i.r(e);var a=i("0868"),s=i.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(n);e["default"]=s.a},"75ca":function(t,e,i){"use strict";var a=i("39b2"),s=i.n(a);s.a},7972:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeBAMAAADJHrORAAAAMFBMVEVMaXH/13n/13n/13n/13n/13n/13n/13n/13n/13n/13n/13n/13n/13n/13n/13ntlQCdAAAAD3RSTlMARBG73ZnuVWaIzHciM6o8MVdyAAAAkklEQVR4XpXMoQ3CUBzE4QODICQPQQiuM3SBVuAw3QOBRZMQLJIF6AxI2IBZ+kqbVvTIa9LA/RMEP3WfOfzb3Tg19qIpGH9xtAbbz8MsaUFuB04SdiC5iYLGix3ZBNNf5stjHlYNSoVxapwZO3UFdWNcGJ/VVaSuoc7UHupY/YK4dOLygL5V3vPqMPTY305P/OgNNOD0vHLrJacAAAAASUVORK5CYII="},"79b8":function(t,e,i){"use strict";i.r(e);var a=i("bba65"),s=i("8909");for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);var o=i("f0c5"),r=Object(o["a"])(s["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=r.exports},"7b4a":function(t,e,i){"use strict";i.r(e);var a=i("8034"),s=i("69f5");for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);i("dacb");var o=i("f0c5"),r=Object(o["a"])(s["default"],a["b"],a["c"],!1,null,"3e6c03f6",null,!1,a["a"],void 0);e["default"]=r.exports},8034:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"div member-base"},[a("v-uni-view",{staticClass:"status-holder"}),a("v-uni-view",{staticClass:"content"},[t._t("default")],2),t.show?a("v-uni-view",{staticClass:"div common-footer-wrap"},[a("v-uni-view",{staticClass:"common-footer"},[a("v-uni-view",{staticClass:"item-wrap",class:{active:"pages/home/index/Index"==t.page.route}},[a("v-uni-navigator",{staticClass:"item",attrs:{url:"/pages/home/index/Index","open-type":"reLaunch"}},["pages/home/index/Index"==t.page.route?a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("0207")}}):a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("241a")}}),a("v-uni-text",{staticClass:"span text"},[t._v("首页")])],1)],1),a("v-uni-view",{staticClass:"item-wrap",class:{active:"pages/home/goodsclass/Goodsclass"==t.page.route}},[a("v-uni-navigator",{staticClass:"item",attrs:{url:"/pages/home/goodsclass/Goodsclass"}},["pages/home/goodsclass/Goodsclass"==t.page.route?a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("79bf")}}):a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("d86e")}}),a("v-uni-text",{staticClass:"span text"},[t._v("分类")])],1)],1),a("v-uni-view",{staticClass:"item-wrap",class:{active:"pages/home/search/Search"==t.page.route}},[a("v-uni-navigator",{staticClass:"item",attrs:{url:"/pages/home/search/Search"}},["pages/home/search/Search"==t.page.route?a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("492b")}}):a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("1702")}}),a("v-uni-text",{staticClass:"span text"},[t._v("搜索")])],1)],1),a("v-uni-view",{staticClass:"item-wrap",class:{active:"pages/member/cart/Cart"==t.page.route}},[a("v-uni-navigator",{staticClass:"item",attrs:{url:"/pages/member/cart/Cart"}},["pages/member/cart/Cart"==t.page.route?a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("62a8")}}):a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("8559")}}),a("v-uni-text",{staticClass:"span text"},[t._v("购物车")]),t.cartNumber>0?a("v-uni-text",{staticClass:"span icon"},[t._v(t._s(t.getCarCount))]):t._e()],1)],1),a("v-uni-view",{staticClass:"item-wrap",class:{active:"pages/member/index/Index"==t.page.route}},[a("v-uni-navigator",{staticClass:"item",attrs:{url:"/pages/member/index/Index","open-type":"reLaunch"}},["pages/member/index/Index"==t.page.route?a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("857e")}}):a("v-uni-image",{staticClass:"img image",attrs:{mode:"aspectFit",src:i("e31d")}}),a("v-uni-text",{staticClass:"span text"},[t._v("我的")])],1)],1)],1)],1):t._e()],1)},s=[]},8909:function(t,e,i){"use strict";i.r(e);var a=i("a2ce"),s=i.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(n);e["default"]=s.a},"8a0c":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.status-holder[data-v-3e6c03f6]{background-color:#fff}.member-base[data-v-3e6c03f6]{display:flex;flex-direction:column}.content[data-v-3e6c03f6]{flex:1}.item-wrap[data-v-3e6c03f6]{position:relative}.image[data-v-3e6c03f6]{width:1rem;height:1rem;display:block;margin-left:auto;margin-right:auto;margin-top:.2rem;margin-bottom:.2rem}.icon[data-v-3e6c03f6]{position:absolute;right:.8rem;top:.2rem;font-size:.5rem;line-height:.7rem;width:.9rem;height:.7rem;background:#ef3338;border-radius:1rem;text-align:center;color:#fff}',""]),t.exports=e},a2ce:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={name:"EmptyRecord",data:function(){return{}},props:{},methods:{}}},b6cf:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("4d63"),i("c607"),i("ac1f"),i("2c3e"),i("25f0"),i("5319");var a=i("0b9f"),s=i("0d25"),n={data:function(){return{time:"",smilies_array:{":smile:":{image:"smile.gif",text:"微笑"},":sad:":{image:"sad.gif",text:"难过"},":biggrin:":{image:"biggrin.gif",text:"呲牙"},":cry:":{image:"cry.gif",text:"大哭"},":huffy:":{image:"huffy.gif",text:"发怒"},":shocked:":{image:"shocked.gif",text:"惊讶"},":tongue:":{image:"tongue.gif",text:"调皮"},":shy:":{image:"shy.gif",text:"害羞"},":titter:":{image:"titter.gif",text:"偷笑"},":sweat:":{image:"sweat.gif",text:"流汗"},":mad:":{image:"mad.gif",text:"抓狂"},":lol:":{image:"lol.gif",text:"阴险"},":loveliness:":{image:"loveliness.gif",text:"可爱"},":funk:":{image:"funk.gif",text:"惊恐"},":curse:":{image:"curse.gif",text:"咒骂"},":dizzy:":{image:"dizzy.gif",text:"晕"},":shutup:":{image:"shutup.gif",text:"闭嘴"},":sleepy:":{image:"sleepy.gif",text:"睡"},":hug:":{image:"hug.gif",text:"拥抱"},":victory:":{image:"victory.gif",text:"胜利"},":sun:":{image:"sun.gif",text:"太阳"},":moon:":{image:"moon.gif",text:"月亮"},":kiss:":{image:"kiss.gif",text:"示爱"},":handshake:":{image:"handshake.gif",text:"握手"}}}},props:{item:{},t_id:{}},created:function(){this.time=(new Date).getTime()},methods:{goNavigate:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];uni.navigateTo({url:t+(e?"?"+(0,a.urlencode)(e):"")})},getContent:function(t){for(var e in this.smilies_array){var i=this.smilies_array[e],a=new RegExp(""+e,"g");t=t.replace(a,"<image mode='aspectFit' class='img' title='"+i.text+"' alt='"+i.text+"' src='"+this.getSmile(i.image)+"'>")}return t},getSmile:function(t){return s.env.SITE_URL+"/static/plugins/js/smilies/images/"+t}}};e.default=n},ba97:function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("99af"),i("14d9");var s=a(i("5530")),n=i("0b9f"),o=a(i("cce0")),r=a(i("7b4a")),c=a(i("bc65")),u=a(i("79b8")),m=i("26cb"),d=i("d6fd"),l=i("0d25"),g={data:function(){return{canReconnect:!0,navHeight:0,scrollTop:0,screenWidth:0,contentHeight:0,params:{page:0,per_page:20},loading:!1,isMore:!0,historyList:!1,t_id:0,t_name:"",goods_id:0,smile_show:!1,socket_connect:0,msg_list:[],msg:"",lockReconnect:!1,timeOut:!1,smilies_array:{":smile:":{image:"smile.gif",text:"微笑"},":sad:":{image:"sad.gif",text:"难过"},":biggrin:":{image:"biggrin.gif",text:"呲牙"},":cry:":{image:"cry.gif",text:"大哭"},":huffy:":{image:"huffy.gif",text:"发怒"},":shocked:":{image:"shocked.gif",text:"惊讶"},":tongue:":{image:"tongue.gif",text:"调皮"},":shy:":{image:"shy.gif",text:"害羞"},":titter:":{image:"titter.gif",text:"偷笑"},":sweat:":{image:"sweat.gif",text:"流汗"},":mad:":{image:"mad.gif",text:"抓狂"},":lol:":{image:"lol.gif",text:"阴险"},":loveliness:":{image:"loveliness.gif",text:"可爱"},":funk:":{image:"funk.gif",text:"惊恐"},":curse:":{image:"curse.gif",text:"咒骂"},":dizzy:":{image:"dizzy.gif",text:"晕"},":shutup:":{image:"shutup.gif",text:"闭嘴"},":sleepy:":{image:"sleepy.gif",text:"睡"},":hug:":{image:"hug.gif",text:"拥抱"},":victory:":{image:"victory.gif",text:"胜利"},":sun:":{image:"sun.gif",text:"太阳"},":moon:":{image:"moon.gif",text:"月亮"},":kiss:":{image:"kiss.gif",text:"示爱"},":handshake:":{image:"handshake.gif",text:"握手"}}}},beforeDestroy:function(){this.canReconnect=!1,h.stop(),this.socket_connect=0},components:{TitleHeader:o.default,MemberBase:r.default,ChatMessage:c.default,EmptyRecord:u.default},computed:(0,s.default)({fontSize:function(){return(0,n.getFontSize)()}},(0,m.mapState)({config:function(t){return t.config.config},user:function(t){return t.member.info}})),mounted:function(){this.screenWidth=uni.getSystemInfoSync().screenWidth,this.contentHeight=uni.getSystemInfoSync().screenHeight-uni.getSystemInfoSync().statusBarHeight},onLoad:function(t){var e=this;this.t_id=t.t_id,this.t_name=t.t_name,this.goods_id=t.goods_id,this.t_id||(uni.showToast({icon:"none",title:"参数错误"}),uni.navigateBack({delta:1})),"1"==this.config.instant_message_open&&this.config.instant_message_gateway_url||(uni.showToast({icon:"none",title:"未开启即时聊天"}),uni.navigateBack({delta:1})),this.fetchConfig({}).then((function(t){e.createWebSocket(),e.goods_id&&e.submit(1)}),(function(t){uni.showToast({icon:"none",title:t.message})})),this.loadMore()},watch:{},methods:(0,s.default)((0,s.default)({showPopup:function(t){this.$refs[t].open()},hidePopup:function(t){this.$refs[t].close()},goBack:function(){uni.navigateBack({delta:1})}},(0,m.mapActions)({fetchConfig:"fetchConfig"})),{},{createWebSocket:function(){var t=this;uni.connectSocket({url:this.config.instant_message_gateway_url}).then((function(e){t.init()})).catch((function(e){t.reconnect()}))},init:function(){var t=this;uni.onSocketOpen((function(e){t.wsOpen()})),uni.onSocketMessage((function(e){t.wsMessage(e)})),uni.onSocketClose((function(e){t.wsClose(e)})),uni.onSocketError((function(e){t.wsError(e)}))},reconnect:function(){if(!this.lockReconnect){this.lockReconnect=!0,this.timeOut&&clearTimeout(this.timeOut);var t=this;this.timeOut=setTimeout((function(){t.createWebSocket(),t.lockReconnect=!1}),4e3)}},wsOpen:function(){this.socket_connect=1,h.start()},wsMessage:function(t){var e=JSON.parse(t.data);if(e){var i=e.type||"";switch(i){case"init":this.clientId=e.client_id,(0,d.joinChat)(this.clientId).then((function(t){})).catch((function(t){uni.showToast({icon:"none",title:t.message})}));break;case"leave":break;case"get_msg":this.filterMsg(e.msg_list);break;default:this.filterMsg([e])}h.start()}else uni.showToast({icon:"none",title:"消息转换失败:"+t.data})},wsClose:function(t){this.socket_connect=0,t.reason&&console.log("聊天系统连接断开:"+t.reason),this.canReconnect&&this.reconnect()},wsError:function(t){uni.showToast({icon:"none",title:t.errMsg}),this.reconnect()},inputLoseFocus:function(){var t=this;setTimeout((function(){t.scrollTop=0}),100)},loadMore:function(){this.loading=!0,this.params.page=++this.params.page,this.isMore&&(this.loading=!1,this.getHistoryList(!0))},getHistoryList:function(){var t=this;uni.showLoading({title:"加载中"}),(0,d.getChatHistory)(this.params,this.t_id).then((function(e){uni.hideLoading(),e.result.hasmore?t.isMore=!0:t.isMore=!1;var i=e.result.list;i&&(t.historyList?t.historyList=t.historyList.concat(i):t.historyList=i)})).catch((function(t){uni.hideLoading(),uni.showToast({icon:"none",title:t.message})}))},getMessage:function(t,e,i){return this.getTime(t,e,i),i?this.historyList[e]:this.msg_list[e]},getTime:function(t,e,i){var a=t.instant_message_add_time;i?(this.historyList[e]["if_show_time"]=!1,e?Math.abs(this.historyList[e-1]["show_time"]-a)>10?(this.historyList[e]["show_time"]=a,this.historyList[e]["if_show_time"]=!0):this.historyList[e]["show_time"]=this.historyList[e-1]["show_time"]:(this.historyList[e]["show_time"]=a,this.historyList[e]["if_show_time"]=!0)):(this.msg_list[e]["if_show_time"]=!1,e?Math.abs(this.msg_list[e-1]["show_time"]-a)>10?(this.msg_list[e]["show_time"]=a,this.msg_list[e]["if_show_time"]=!0):this.msg_list[e]["show_time"]=this.msg_list[e-1]["show_time"]:(this.msg_list[e]["show_time"]=a,this.msg_list[e]["if_show_time"]=!0))},open_smile:function(){this.smile_show=!this.smile_show},addSmile:function(t){this.msg+=t,this.smile_show=!1},submit:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0==i){if(""==this.msg)return void uni.showToast({icon:"none",title:"请填写内容"});t=this.msg}else t=this.goods_id;(0,d.addInstantMessage)({to_id:this.t_id,message:t,message_type:i}).then((function(t){e.msg="";var i=t.result.instant_message_data;e.msg_list.push(i)})).catch((function(t){uni.showToast({icon:"none",title:t.message})}))},getSmile:function(t){return l.env.SITE_URL+"/static/plugins/js/smilies/images/"+t},filterMsg:function(t){var e=!1;for(var i in t){var a=t[i];a.instant_message_to_id==this.user.member_id&&a.instant_message_from_id==this.t_id&&(e=a.instant_message_id,this.msg_list.push(a))}e&&this.socket_connect&&(0,d.setMessage)({max_id:e,f_id:this.t_id})}})};e.default=g;var h={timeout:3e3,timeoutObj:null,start:function(){this.timeoutObj&&clearInterval(this.timeoutObj),this.timeoutObj=setInterval((function(){uni.sendSocketMessage({data:"123456789"})}),this.timeout)},stop:function(){this.timeoutObj&&clearInterval(this.timeoutObj)}}},bba65:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var a=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view",{staticClass:"div common-empty-record"},[e("v-uni-text",{staticClass:"i iconfont"},[this._v("")]),e("v-uni-view",{staticClass:"p"},[this._v("没有找到相关记录")])],1)},s=[]},bc65:function(t,e,i){"use strict";i.r(e);var a=i("5cdc"),s=i("cb10");for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);i("5b94");var o=i("f0c5"),r=Object(o["a"])(s["default"],a["b"],a["c"],!1,null,"47b22951",null,!1,a["a"],void 0);e["default"]=r.exports},cb10:function(t,e,i){"use strict";i.r(e);var a=i("b6cf"),s=i.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(n);e["default"]=s.a},ce46:function(t,e,i){"use strict";i.r(e);var a=i("ba97"),s=i.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(n);e["default"]=s.a},d6fd:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.setMessage=e.joinChat=e.getChatList=e.getChatHistory=e.getChatCount=e.addInstantMessage=void 0;var a=i("887c");e.addInstantMessage=function(t){return(0,a.requestApi)("/member_instant_message/add","POST",t,"member")};e.joinChat=function(t){return(0,a.requestApi)("/member_instant_message/join","POST",{client_id:t},"member")};e.setMessage=function(t){return(0,a.requestApi)("/member_instant_message/set_message","POST",t,"member")};e.getChatHistory=function(t,e){return(0,a.requestApi)("/member_instant_message/get_chat_log","POST",{page:t.page,per_page:t.per_page,t_id:e},"member")};e.getChatList=function(){return(0,a.requestApi)("/member_instant_message/get_user_list","POST",{recent:1},"member")};e.getChatCount=function(){return(0,a.requestApi)("/member_instant_message/get_msg_count","POST",{},"member")}},dacb:function(t,e,i){"use strict";var a=i("f6c0"),s=i.n(a);s.a},e0ba:function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.scroll-view-wrapper[data-v-325a5669]{display:flex;flex-direction:column}.scroll-view[data-v-325a5669]{flex:1;padding-bottom:2rem}.common-header .btn[data-v-325a5669]{background:#000;color:#fff;box-shadow:0 2px 4px #d2d2d2}.dstouch-chat-con[data-v-325a5669]{height:100%;display:flex;flex-direction:column;justify-content:flex-end}.dstouch-chat-bottom[data-v-325a5669]{height:2rem;position:fixed;bottom:0;width:100%}.chat-input-layout[data-v-325a5669]{position:relative;z-index:1;display:block;height:2rem;background-color:hsla(0,0%,100%,.9)}.chat-input-layout .open-smile[data-v-325a5669]{display:block;width:1.5rem;height:1.5rem;padding:.25rem}.chat-input-layout .open-smile .a[data-v-325a5669]{display:block;width:1.5rem;height:1.5rem;font-size:1.5rem;color:#6eb6eb}.chat-input-layout .input-box[data-v-325a5669]{position:absolute;z-index:1;top:.24rem;right:.4rem;bottom:.24rem;left:2rem;background:#f5f5f5;border:solid .05rem #eee;border-radius:.2rem}.chat-input-layout .input-box uni-input[type="text"][data-v-325a5669]{background-color:initial;border:none;width:100%;height:100%;padding:.1rem 3rem .1rem .1rem;font-size:.6rem;box-sizing:border-box;display:block}.chat-input-layout .input-box .submit[data-v-325a5669]{position:absolute;z-index:1;top:0;right:0;display:block;height:1.4rem}.chat-smile-layout[data-v-325a5669]{display:block;width:100%;height:4.2rem;background-color:#fafafa;border-top:solid .05rem #ddd}.chat-smile-layout .ul[data-v-325a5669]{font-size:0}.chat-smile-layout .ul .li[data-v-325a5669]{display:inline-block;width:12.5%;height:1rem;padding:.3rem 0 0 0;text-align:center;vertical-align:middle}.chat-smile-layout .ul .li .img[data-v-325a5669]{display:inline-block;height:100%;vertical-align:middle}.common-popup-content[data-v-325a5669]{background:#f7f7f7;overflow-x:hidden}',""]),t.exports=e},f597:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeBAMAAADJHrORAAAAMFBMVEVMaXH////////////////////////////////////////////////////////////6w4mEAAAAD3RSTlMAd8wRZkRVu+7dM5kiqohzODCwAAAAkElEQVR4XqXQIQ7CMACF4Ue2LDDAoAaGIxRHcCR4ghkWQzUa1SMgOQAHWHaCHWFuB6mae6SGps/yu0888/BfC/EBp8QOzyNie6Lzl7g2xJb+N6lI3Mhx2AVla5LoSdK3tj47Bk+ZhKU4F2diOPFDPBPnYhhxI56I0YnnYlTi0qRGYVKjXL2C3pv45fVuP9DwBfF66Kvf15qeAAAAAElFTkSuQmCC"},f6c0:function(t,e,i){var a=i("8a0c");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var s=i("4f06").default;s("11f8896b",a,!0,{sourceMap:!1,shadowMode:!1})}}]);