UNPKG

@tencentcloud/ai-desk-customer-wechat

Version:

AI Desk customer UIKit for wechat mini program

3 lines (2 loc) 2.47 kB
"use strict";const r=require("../../common/vendor.js"),n=require("../../ai-desk-customer-uniapp/index.js"),S=require("../../ai-desk-customer-uniapp/adapter-vue.js"),h=()=>"../../ai-desk-customer-uniapp/components/CustomerServiceChat/index-uniapp.js",{reactive:C}=S.vue,I={components:{CustomerServiceChat:h},data(){const t=[],o=C({});return{toolbarButtonList:t,bottomQuickOrder:o,enableFeedback:0,enableAINote:1}},onLoad(t){r.index.__f__("log","at pages/index/index.vue:34","onLoad options:",t);const{SDKAppID:o,userID:s,userSig:i,nickName:a,avatar:x,toolbarButtonList:c,bottomQuickOrder:u,customerServiceIDList:d,customerServiceID:T,transferToHumanOptions:p,transferToTaskFlowOptions:l,enableFeedback:_,enableAINote:f}=t;if(c)try{const e=JSON.parse(c);Array.isArray(e)&&(this.toolbarButtonList=e)}catch{r.index.__f__("warn","at pages/index/index.vue:57","failed to parse toolbarButtonList",c)}if(u)try{const e=JSON.parse(u);Object.assign(this.bottomQuickOrder,e)}catch{r.index.__f__("warn","at pages/index/index.vue:66","failed to parse bottomQuickOrder",u)}if(d)try{const e=JSON.parse(d);Array.isArray(e)&&n.TUICustomerServer.setCustomerServiceIDList(e)}catch{r.index.__f__("warn","at pages/index/index.vue:77","failed to parse customerServiceIDList",d)}let m=!1,v;if(p)try{v=JSON.parse(p),m=!0}catch{m=!1,r.index.__f__("warn","at pages/index/index.vue:89","failed to parse transferToHumanOptions",p)}let b=!1,k;if(l)try{k=JSON.parse(l),b=!0}catch{b=!1,r.index.__f__("warn","at pages/index/index.vue:101","failed to parse transferToTaskFlowOptions",l)}if(_)try{this.enableFeedback=JSON.parse(_)}catch{this.enableFeedback=0,r.index.__f__("warn","at pages/index/index.vue:110","failed to parse enableFeedback",_)}if(f)try{this.enableAINote=JSON.parse(f)}catch{this.enableAINote=1,r.index.__f__("warn","at pages/index/index.vue:119","failed to parse enableAINote",f)}n.TUICustomerServer.initWithProfile({SDKAppID:o,userID:s,userSig:i,nickName:a,avatar:x,customerServiceID:T,scene:"aidesk-customer-uni-mp"}).then(()=>{m&&n.TUICustomerServer.transferToHuman(v),b&&n.TUICustomerServer.transferToTaskFlow(k)})}};Array||r.resolveComponent("CustomerServiceChat")();function O(t,o,s,i,a,x){return{a:r.p({toolbarButtonList:a.toolbarButtonList,bottomQuickOrder:a.bottomQuickOrder,enableFeedback:a.enableFeedback,enableAINote:a.enableAINote})}}const N=r._export_sfc(I,[["render",O]]);wx.createPage(N); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map