diff --git a/msh_single_uniapp/pages/index/index.vue b/msh_single_uniapp/pages/index/index.vue index 2b86c37..32bc362 100644 --- a/msh_single_uniapp/pages/index/index.vue +++ b/msh_single_uniapp/pages/index/index.vue @@ -548,10 +548,9 @@ let imgHost = res.data.logoUrl.split('crmebimage')[0]; that.imgHost = imgHost; that.$Cache.set('imgHost', imgHost + '/'); - // #ifdef H5 || APP-PLUS - that.$store.commit("SET_CHATURL", res.data.yzfUrl); - Cache.set('chatUrl', res.data.yzfUrl); - // #endif + // test-0415 反馈6-2:客服 chatUrl 在所有端均缓存(旧版仅 H5/APP-PLUS 设置,小程序客服按钮跳空白页) + that.$store.commit("SET_CHATURL", res.data.yzfUrl || ''); + Cache.set('chatUrl', res.data.yzfUrl || ''); that.$Cache.setItem({ name: 'categoryConfig', value: { diff --git a/msh_single_uniapp/pages/user/index.vue b/msh_single_uniapp/pages/user/index.vue index ec2a5a6..6f3a5c7 100644 --- a/msh_single_uniapp/pages/user/index.vue +++ b/msh_single_uniapp/pages/user/index.vue @@ -220,7 +220,8 @@ that.$set(that, 'pageHeight', app.globalData.windowHeight); // #endif that.$set(that, 'MyMenus', app.globalData.MyMenus); - that.$set(that,'chatConfig',Cache.getItem('chatConfig')); + // test-0415 反馈6-2:chatConfig 缓存可能为 null(用户未访问商城首页),保留空对象兜底避免 v-if 报错 + that.$set(that,'chatConfig', Cache.getItem('chatConfig') || { consumer_hotline:'', telephone_service_switch:'close', wx_chant_independent:'close' }); // #ifdef H5 that.shareApi(); // #endif @@ -372,9 +373,14 @@ } }, wxChatService(){ + // test-0415 反馈6-2:chatUrl 未配置时给出明确提示,避免跳到空白 web 页 + if (!this.chatUrl) { + uni.showToast({ title: '客服暂未配置,请稍后再试', icon: 'none' }) + return + } let chatUrlArr = this.chatUrl.split('?') uni.navigateTo({ - url:`/pages/users/web_page/index?webUel=${chatUrlArr[0]}&title=客服&${chatUrlArr[1]}` + url:`/pages/users/web_page/index?webUel=${chatUrlArr[0]}&title=客服&${chatUrlArr[1] || ''}` }) }, getOrderData() {