1 line
74 KiB
JavaScript
1 line
74 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-chat-customer_list-chat"],{1472:function(t,e,a){"use strict";a("6a54");var o=a("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("bf0f"),a("2797"),a("aa9c"),a("e966"),a("c223"),a("dd2b"),a("5c47"),a("a1c1");var i=o(a("2f45")),r=o(a("adac")),n=o(a("5f97")),s=a("672a"),d=a("7e00"),c=a("d727"),l=a("5676"),u=o(a("af69")),f=a("aa10"),p=a("e44d"),m=a("96e0"),_=a("8f59"),v=function(t,e){e=1*e||1;var a=[];return t.forEach((function(t,o){o%e===0&&a.push([]),a[a.length-1].push(t)})),a},g=(getApp(),{name:"CustomerService",components:{Loading:u.default},props:{couponList:{type:Array,default:function(){return[]}}},computed:(0,m.configMap)(["hide_mer_status"],(0,_.mapGetters)(["isLogin","viewColor","uid"])),data:function(){return{url:"".concat(f.HTTP_REQUEST_URL,"/api/upload/image"),headers:{"Authori-zation":"Bearer "+this.$store.state.app.token},emojiGroup:v(i.default,21),active:!1,voice:!1,speak:"按住 说话",recording:!1,swiperOption:{pagination:{el:".swiper-pagination",clickable:!0},speed:1e3,observer:!0,observeParents:!0},percent:0,footerConH:0,footerH:1.08,socket:null,toUid:0,page:1,limit:30,loading:!1,loaded:!1,history:[],sendColor:!1,sendtxt:"",productId:0,presellId:0,combinationId:0,productInfo:{},orderId:"",orderInfo:{},cartInfo:{},autoplay:!1,circular:!0,interval:3e3,duration:500,upload_max:2,uploadImages:[],uploads:[],exceeded_list:[],windowH:0,isBQ:!1,scrollTop:0,textCon:"",iconColor:"#CCCCCC",mer_id:0,refund_order_id:0,refundDetail:"",userId:0,pageType:0,status:!1,storeInfo:"",isBack:!1,httpUrl:"",press:!1,index:0,j:0}},watch:{textCon:function(t,e){this.iconColor=""==t?"#CCCCCC":"#86C956"}},beforeDestroy:function(){uni.$off(["socket_open","reply","chat","send_chat","socket_error","socket_close"])},onUnload:function(){this.wsEnd()},onLoad:function(t){var e=this;this.toUid=t.uid||0,this.productId=parseInt(t.productId)||0,this.presellId=parseInt(t.presellId)||0,this.combinationId=parseInt(t.combinationId)||0,this.orderId=t.order_id||"",this.mer_id=t.mer_id||0,this.refund_order_id=t.refund_order_id||0,this.userId=t.userId||0,uni.getSystemInfo({success:function(t){e.windowH=t.windowHeight}}),this.$nextTick((function(){var t=new n.default(".copy-data");t.on("success",(function(t){e.$util.Tips({title:"复制成功"}),e.press=!1})),t.on("error",(function(t){e.$util.Tips({title:"复制失败"})}))}))},onReady:function(){this.httpUrl="".concat(f.HTTP_REQUEST_URL,"/static/look.png")},mounted:function(){var t=this,e=this;e.isLogin?(0==e.userId?(e.getHistory(),e.getproductInfo(),e.getOrderInfo(),e.getRefundDetail(),e.getStoreDetail()):e.getMerHistory(),uni.$on("socket_open",(function(){0==e.userId?e.socket.send({data:{mer_id:e.mer_id},type:"chat_start"}):e.socket.send({data:{uid:e.userId,mer_id:e.mer_id},type:"service_chat_start"})})),uni.$on(["reply","chat","send_chat"],(function(t){if(t.longpress=!1,e.history.length>0&&e.history[e.history.length-1]["children"].length>0){var a=e.history[e.history.length-1]["children"].length-1,o=e.history[e.history.length-1]["children"][a];t.send_time-o.send_time>300?e.history.push({time:t.create_time,children:[t]}):e.history[e.history.length-1]["children"].push(t)}else e.history.push({time:t.create_time,children:[t]});e.deleteMsg(t),e.height()})),uni.$on("socket_error",(function(){if(!e.isBack){var a=t;uni.showModal({title:"提示",content:"连接失败,是否重新连接",success:function(t){t.confirm?a.wsStart():t.cancel&&uni.navigateBack()}})}})),uni.$on("err_tip",(function(e){t.isBack||uni.showModal({title:"提示",content:e,success:function(t){t.confirm||t.cancel}})})),uni.$on("socket_close",(function(){if(!t.isBack){t.$mp.page.route;var e=t;uni.showModal({title:"提示",content:"连接断开,是否重新连接",success:function(t){t.confirm?e.wsStart():t.cancel&&uni.navigateBack()}})}})),e.hasService(),e.wsStart()):(0,p.toLogin)()},methods:{userDetail:function(t){this.wsEnd(),uni.redirectTo({url:"/pages/chat/customer_info/index?uid=".concat(t,"&mer_id=").concat(this.mer_id)})},hasService:f
|