徐总多门店
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
17 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-70c08eac"],{2040:function(t,e,o){"use strict";o("3547")},3547:function(t,e,o){},7624:function(t,e,o){"use strict";e.a=["em-tlj-1","em-tlj-2","em-tlj-3","em-tlj-4","em-tlj-5","em-tlj-6","em-tlj-7","em-tlj-8","em-tlj-9","em-tlj-10","em-tlj-11","em-tlj-12","em-tlj-13","em-tlj-14","em-tlj-15","em-tlj-16","em-tlj-17","em-tlj-18","em-tlj-19","em-tlj-20","em-tlj-21","em-tlj-22","em-tlj-23","em-tlj-24","em-tlj-25","em-tlj-26","em-tlj-27","em-tlj-28","em-tlj-29","em-tlj-30","em-tlj-31","em-tlj-32","em-tlj-33","em-tlj-34","em-tlj-35","em-tlj-36","em-tlj-37","em-tlj-38","em-tlj-39","em-tlj-40","em-tlj-41","em-tlj-42","em-tlj-43","em-tlj-44","em-tlj-45","em-tlj-46","em-tlj-47","em-tlj-48","em-tlj-49","em-tlj-50","em-tlj-51","em-tlj-52","em-tlj-53","em-tlj-54","em-tlj-55","em-tlj-56","em-tlj-57","em-tlj-58","em-tlj-59","em-tlj-60","em-tlj-61","em-tlj-62","em-tlj-63","em-tlj-64","em-tlj-65","em-tlj-66","em-tlj-67","em-tlj-68","em-tlj-69","em-tlj-70","em-tlj-71","em-tlj-72","em-tlj-73","em-tlj-74","em-tlj-75","em-tlj-76","em-tlj-77","em-tlj-78","em-tlj-79","em-tlj-80","em-tlj-81","em-tlj-82","em-tlj-83","em-tlj-84","em-tlj-85","em-tlj-86","em-tlj-87","em-tlj-88","em-tlj-89","em-tlj-90","em-tlj-91","em-tlj-92","em-tlj-93","em-tlj-94","em-tlj-95","em-tlj-96"]},af7a:function(t,e,o){"use strict";o("df05")},df05:function(t,e,o){},eea8:function(t,e,o){"use strict";o.r(e),o("f9db");var i=o("7624"),n=o("49ea"),a=o("d708"),s=o("a78e"),r=o.n(s),c=o("42e3"),l={name:"feedback",props:{change:Boolean},data:function(){return{loading:!1,isShow:!1,formItem:{rela_name:"",content:"",phone:""},notice:"",ruleValidate:{rela_name:[{required:!0,message:"请输入您的姓名",trigger:"blur"}],content:[{required:!0,message:"请输入留言内容",trigger:"blur"}],phone:[{required:!0,message:"请填写手机号码",trigger:"change"},{pattern:/^1[3456789]\d{9}$/,message:"手机号码格式不正确",trigger:"blur"}]}}},mounted:function(){this.getNotice()},methods:{handleSubmit:function(t){var e=this;this.loading=!0,this.$refs[t].validate((function(t){t&&Object(c.i)(e.formItem).then((function(t){e.loading=!1,e.isShow=!0})).cache((function(t){e.loading=!1,e.$Message.error(t.msg)}))}))},close:function(){this.$emit("closeChange",!1)},getNotice:function(){var t=this;Object(c.h)().then((function(e){t.notice=e.data.feedback})).cache((function(e){t.$Message.error(e.msg)}))}}},d=(o("af7a"),o("2877"));function u(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?m(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=Array(e);o<e;o++)i[o]=t[o];return i}var f={name:"ChatRoom",auth:!1,components:{feedBack:Object(d.a)(l,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"feedback",class:!0===t.change?"on":""},[e("div",{staticClass:"feedback-header acea-row"},[e("span",{staticClass:"sp1"},[t._v("商城客服已离线")]),e("div",[e("Icon",{attrs:{type:"md-close",color:"#fff",size:"18"},on:{click:t.close}})],1)]),t.isShow?t._e():e("div",[e("div",{staticClass:"feedback-conent mb20"},[e("div",{staticClass:"ft",domProps:{textContent:t._s(t.notice)}})]),e("div",[e("Form",{ref:"formItem",staticClass:"pl15",attrs:{model:t.formItem,rules:t.ruleValidate}},[e("FormItem",{attrs:{prop:"rela_name"}},[e("Input",{attrs:{placeholder:"请输入您的姓名"},model:{value:t.formItem.rela_name,callback:function(e){t.$set(t.formItem,"rela_name",e)},expression:"formItem.rela_name"}})],1),e("FormItem",{attrs:{prop:"phone"}},[e("Input",{attrs:{placeholder:"请输入您的联系电话"},model:{value:t.formItem.phone,callback:function(e){t.$set(t.formItem,"phone",e)},expression:"formItem.phone"}})],1),e("FormItem",{attrs:{prop:"content"}},[e("Input",{staticClass:"mb10",attrs:{type:"textarea",placeholder:"请输入留言内容"},model:{value:t.formItem.content,callback:function(e){t.$set(t.formItem,"content",e)},expression:"formItem.content"}})],1),e("FormItem",[e("Button",{staticClass:"btn-add",attrs:{type:"primary",loading:t.loading},on:{click:function(e){return t.handleSubmit("formItem")}}},[t._v("提交留言")])],1)],1)],1)]),t.isShow?e("div",{staticClass:"sure"},[e("div",{staticClass:"sure-yuan"},[e("Icon",{attrs:{type:"md-checkmark",color:"#fff",size:"30"}})],1),e("div",{staticClass:"sp1 mb10"},[t._v("提交成功")]),e("div",{staticClass:"sp2 mb30"},[t._v("您的信息提交成功,我们会尽快与您取得联系!")]),e("Button",{attrs:{type:"primary"},on:{click:t.close}},[t._v("好的")])],1):t._e()]),e("div",{directives:[{name:"show",rawName:"v-show",value:!0===t.change,expression:"change === true"}],staticClass:"maskModel",on:{touchmove:function(t){t.preventDefault()}}})])}),[],!1,null,"cbc8b94c",null).exports},props:{chatOptions:{type:Object,default:function(){return{show:!1}}}},directives:{drag:{inserted:function(t){var e=0,o=0,i=0,n=0,a=!1;t.onmousedown=function(s){return e=s.clientX,o=s.clientY,i=t.parentNode.offsetLeft,n=t.parentNode.offsetTop,a=!0,t.style.cursor="move",window.onmousemove=function(s){if(0!=a){var r=s.clientX,c=s.clientY,l=r-(e-i),d=c-(o-n);t.parentNode.style.left=l+"px",t.parentNode.style.top=d+"px"}},window.onmouseup=function(){a=!1,t.style.cursor="default",window.onmousemove=null,window.onmouseup=null},!1}}}},data:function(){return{roterPre:a.a.roterPre,locations:"".concat(location.origin),change:!1,emojiGroup:function(t,e){e=1*e||1;var o=[];return t.forEach((function(t,i){i%e==0&&o.push([]),o[o.length-1].push(t)})),o}(i.a,20),emojiList:i.a,emojiShow:!1,recordList:[],limit:20,loading:!1,finished:!1,chatCont:"",service:null,serviceData:{},uploadAction:"",notice:"",audio:null,muted:!1,audioSrc:"",upperId:0,uploadData:{},is_tourist:1,text:"",isLoad:!1,page:1,tourist_avatar:"",tourist_uid:"",toUid:"",kufuToken:"",pageWs:""}},watch:{muted:function(t){this.audio.muted=t}},computed:{records:function(){var t=this;return this.recordList.map((function(e,o){return o&&new Date(e.add_time)-new Date(t.recordList[o-1].add_time)>=3e5?e.show=!0:e.show=!1,e}))}},created:function(){-1!=location.href.indexOf("".concat(a.a.routePreKF))&&(this.uploadAction=a.a.apiBaseURL.replace(/adminapi/,"kefuapi")+"/tourist/upload");var t=r.a.get("auth._token.local1");this.kufuToken=t?t.split("Bearer%20")[1]:""},mounted:function(){var t=this;window.addEventListener("click",(function(){t.emojiShow&&(t.emojiShow=!1)})),this.$wechat._isMobile()&&this.$router.replace("".concat(this.routePreKF,"/mobile_user_chat")),this.getService(),this.pageWs=Object(n.a)(!0,this.kufuToken,this.tourist_uid),this.text=this.replace_em("[em-smiling_imp]"),this.wsStart()},beforeDestroy:function(){this.pageWs.close()},methods:{wsStart:function(){var t=this;this.pageWs.then((function(e){t.kufuToken&&e.send({type:"login",data:t.kufuToken}),t.getService(),e.$on(["reply","chat"],(function(e){1==e.msn_type&&(e.msn=t.replace_em(e.msn)),t.recordList.push(e),setTimeout((function(e){t.$nextTick((function(){this.$refs.record.scrollTop=this.$refs.record.scrollHeight-this.$refs.record.clientHeight}))}),300)})),e.$on("to_transfer",(function(o){t.toUid=o.toUid,e.send({data:{id:t.toUid},type:"to_chat"})})),e.$on("socket_error",(function(){t.$Message.error("连接失败")})),e.$on("err_tip",(function(e){t.$Message.error(e.msg)})),e.$on("success",(function(e){t.is_tourist=0})),e.$on("timeout",(function(e){setTimeout((function(){t.wsRestart()}),2e3)}))})).catch((function(e){setTimeout((function(e){t.wsRestart()}),2e3)}))},wsRestart:function(){this.pageWs=Object(n.a)(!0,this.kufuToken,this.tourist_uid),this.wsStart()},onLook:function(t){window.open("".concat(location.origin,"/home/goods_detail/").concat(t))},closeChange:function(t){this.change=t},sendMsg:function(t,e){var o={type:"chat",data:{msn:t,type:e,is_tourist:this.is_tourist,to_uid:this.toUid,tourist_uid:this.tourist_uid,tourist_avatar:this.tourist_avatar,form_type:this.$wechat.isWeixin()?1:3}};this.pageWs.then((function(t){t.send(o)}))},getService:function(){var t=this;Object(c.O)({token:this.kufuToken||""}).then((function(e){t.serviceData=e.data,t.upperId=0,t.toUid=e.data.uid,t.tourist_uid=e.data.tourist_uid,t.tourist_avatar=e.data.tourist_avatar;var o={data:{id:e.data.uid,tourist_uid:t.tourist_uid},type:"to_chat"};t.pageWs.then((function(t){t.send(o)})),t.kufuToken&&t.getRecordList()})).catch((function(e){t.change=!0}))},roomClick:function(t){},ctrlEnter:function(t){13==t.keyCode&&t.preventDefault(),this.chatCont.trim()&&this.sendMessage()},close:function(){this.$emit("chat-close")},selectEmoji:function(t){this.emojiShow=!1,this.sendMsg("[".concat(t,"]"),1)},replace_em:function(t){return t.replace(/\[em-([\s\S]*?)\]/g,"<span class='em em-$1'/></span>")},onScroll:function(t){t.target.scrollTop<=30&&this.kufuToken&&this.getRecordList()},getRecordList:function(){var t=this;this.loading||this.finished||(this.loading=!0,Object(c.e)({uid:this.serviceData.uid,limit:this.limit,upperId:this.upperId,token:this.kufuToken}).then((function(e){if(0===e.data.length)return t.loading=!1;e.data.forEach((function(e){1==e.msn_type&&(e.msn=t.replace_em(e.msn))}));var o="";o=0==t.upperId?"chat_".concat(e.data[e.data.length-1].id):"chat_".concat(t.recordList[0].id),t.recordList=[].concat(u(e.data),u(t.recordList)),t.upperId=e.data.length>0?e.data[0].id:0,t.loading=!1,t.finished=e.data.length<t.limit,t.$nextTick((function(){this.setPageScrollTo(o)}))})).catch((function(e){t.$Message.error(e.msg)})))},setPageScrollTo:function(t){var e=this;this.$nextTick((function(){if(t)setTimeout((function(){var o=parseFloat(document.getElementById(t).offsetTop)-60;e.$refs.record.scrollTop=o}),0);else{var o=document.querySelector("#chat_scroll");e.$refs.record.scrollTop=o.offsetHeight,setTimeout((function(t){e.$refs.record.scrollTop!=e.$refs.scrollBox.offsetHeight&&(e.$refs.record.scrollTop=document.querySelector("#chat_scroll").offsetHeight)}),300)}}))},emojiSwitch:function(){this.emojiShow=!0},sendMessage:function(){this.sendMsg(this.chatCont,1),this.chatCont=""},chat:function(t){var e=this;t.uid!=this.$auth.user.uid&&this.audio&&this.audio.play(),this.recordList.push(t),this.$nextTick((function(){e.$refs.record.scrollTop=e.$refs.record.scrollHeight-e.$refs.record.clientHeight}))},sendGoods:function(){var t=this;this.chatOptions.goodsId&&this.pageWs.then((function(e){e.send({data:{msn:t.chatOptions.goodsId,type:5,to_uid:t.toUid},type:"to_chat"})}))},sendOrder:function(){var t=this;this.chatOptions.orderId&&this.pageWs.then((function(e){e.send({data:{msn:t.chatOptions.orderId,type:6,to_uid:t.toUid},type:"to_chat"})}))},chatEnd:function(){navigator.userAgent.indexOf("MSIE")>0?navigator.userAgent.indexOf("MSIE 6.0")>0?(window.opener=null,window.close()):(window.open("","_top"),window.top.close()):navigator.userAgent.indexOf("Firefox")>0?window.location.href="about:blank ":(window.opener=null,window.open("","_self",""),window.close())},getNotice:function(){var t=this;Object(c.j)().then((function(e){t.notice=e.data.content}))},beforeUpload:function(t){var e=this;return this.uploadData={filename:t,token:this.kufuToken},new Promise((function(t){e.$nextTick((function(){t(!0)}))}))},handleFormatError:function(t){this.$Message.error("上传图片只能是 jpg、jpg、jpeg、gif 格式!")},uploadSuccess:function(t){this.sendMsg(t.data.url,3)},uploadError:function(t){this.$message.error(t)}}},h=(o("2040"),Object(d.a)(f,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-room"},[e("div",{staticClass:"room",class:{win:!t.chatOptions.popup},on:{click:t.roomClick}},[e("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"head"},[e("div",{staticClass:"image"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.serviceData&&t.serviceData.avatar,expression:"serviceData && serviceData.avatar"}]})]),e("div",{staticClass:"name"},[t._v(t._s(t.serviceData&&t.serviceData.nickname))]),e("div",{class:["iconfont",t.muted?"icon-shengyinjingyinxianxing":"icon-shengyinyinliang"],on:{click:function(e){t.muted=!t.muted}}}),e("div",{staticClass:"iconfont icon-guanbi5",on:{click:t.close}})]),e("div",{staticClass:"main"},[e("div",{staticClass:"chat"},[e("div",{ref:"record",staticClass:"record",on:{scroll:t.onScroll}},[e("Spin",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}]},[e("Icon",{staticClass:"demo-spin-icon-load",attrs:{type:"ios-loading",size:"18"}}),e("div",[t._v("Loading")])],1),e("ul",[t._l(t.records,(function(o){return[e("li",{key:o.id,class:{right:o.to_uid===t.serviceData.uid}},[o.show?e("div",{staticClass:"time-tag"},[t._v("\n "+t._s(o.add_time)+"\n ")]):t._e(),e("div",{staticClass:"avatar"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:o.avatar,expression:"item.avatar"}]})]),e("div",{ref:"chatContent",refInFor:!0,staticClass:"content"},[1===o.msn_type?e("div",{staticClass:"text",domProps:{innerHTML:t._s(o.msn)}}):t._e(),2===o.msn_type?e("div",{staticClass:"image"},[e("div",{staticClass:"text"},[e("i",{class:"em ".concat(o.msn)})])]):t._e(),3===o.msn_type?e("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"image"},[e("img",{attrs:{src:o.msn}})]):t._e(),5===o.msn_type?e("div",{staticClass:"goods"},[e("div",{staticClass:"thumb"},[e("img",{attrs:{src:o.productInfo.image}})]),e("div",{staticClass:"intro"},[e("div",{staticClass:"name"},[t._v("\n "+t._s(o.productInfo.store_name)+"\n ")]),e("div",{staticClass:"attr"},[e("span",[t._v("库存:"+t._s(o.productInfo.stock))]),e("span",[t._v("销量:"+t._s(o.productInfo.sales))])]),e("div",{staticClass:"group"},[e("div",{staticClass:"money"},[t._v("\n ¥"+t._s(o.productInfo.price)+"\n ")]),e("nuxt-link",{attrs:{target:"_blank",to:{path:"/goods_detail/".concat(o.productInfo.id)}}},[t._v("查看商品 >")])],1)])]):t._e(),6===o.msn_type?t._l(o.orderInfo.cartInfo,(function(i){return e("div",{key:i.id,staticClass:"order"},[e("div",{staticClass:"thumb"},[e("img",{attrs:{src:i.productInfo.image}})]),e("div",{staticClass:"intro"},[e("div",{staticClass:"name"},[t._v("\n 订单ID:"+t._s(o.orderInfo.order_id)+"\n ")]),e("div",{staticClass:"attr"},[t._v("商品数量:"+t._s(i.cart_num))]),e("div",{staticClass:"group"},[e("div",{staticClass:"money"},[t._v("\n ¥"+t._s(i.productInfo.price)+"\n ")]),e("nuxt-link",{attrs:{target:"_blank",to:{path:"/order_detail",query:{orderId:o.orderInfo.order_id}}}},[t._v("查看订单 >")])],1)])])})):t._e()],2)])]}))],2)],1),e("div",{staticClass:"editor"},[e("div",{staticClass:"editor-hd"},[e("div",[e("button",{staticClass:"emoji-btn",attrs:{title:"表情"},on:{click:function(e){return e.stopPropagation(),t.emojiSwitch.apply(null,arguments)}}},[e("span",{staticClass:"iconfont iconbiaoqing1"})]),t.kufuToken?e("button",{attrs:{title:"图片"}},[e("Upload",{attrs:{"show-upload-list":!1,action:t.uploadAction,"before-upload":t.beforeUpload,format:["jpg","jpeg","png","gif"],"on-format-error":t.handleFormatError,data:t.uploadData,"on-success":t.uploadSuccess,"on-error":t.uploadError}},[e("span",{staticClass:"iconfont icontupian1"})])],1):t._e()]),t.emojiShow?e("div",{staticClass:"emoji-panel"},t._l(t.emojiList,(function(o,i){return e("i",{key:i,staticClass:"em",class:o,on:{click:function(e){return t.selectEmoji(o)}}})})),0):t._e()]),e("div",{staticClass:"editor-bd"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.chatCont,expression:"chatCont"}],attrs:{placeholder:"请输入文字内容"},domProps:{value:t.chatCont},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.ctrlEnter.apply(null,arguments)},input:function(e){e.target.composing||(t.chatCont=e.target.value)}}})]),e("div",{staticClass:"editor-ft"},[e("button",{attrs:{disabled:!t.chatCont},on:{click:t.sendMessage}},[t._v("发送")])])])]),e("div",{staticClass:"notice"},[t.notice?e("div",{staticClass:"rich",domProps:{innerHTML:t._s(t.notice)}}):t._e(),t._m(0)])]),e("audio",{ref:"audio",attrs:{src:t.audioSrc}})]),t.change?e("feed-back",{attrs:{change:t.change},on:{closeChange:function(e){return t.closeChange(e)}}}):t._e()],1)}),[function(){var t=this._self._c;return t("div",{staticClass:"copy"},[t("a",{attrs:{href:"http://www.RENZHOU.com/",target:"_blank"}},[this._v("RENZHOU提供技术支持")])])}],!1,null,"ae7bba6a",null));e.default=h.exports},f9db:function(t,e,o){}}]);