diff --git a/components/com_servicer/com_servicer.wxml b/components/com_servicer/com_servicer.wxml index 56c9844..124ba9a 100644 --- a/components/com_servicer/com_servicer.wxml +++ b/components/com_servicer/com_servicer.wxml @@ -21,6 +21,13 @@ 在线客服 + + + + 在线客服 + + + \ No newline at end of file diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index 3b81b91..bb79cf9 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -227,7 +227,7 @@ Page({ }, //------初始化加载---------- - onLoad:function(t) { + onLoad:async function(t) { self = this; this.setData({ @@ -317,7 +317,16 @@ Page({ getApp().getConfig(function(e) { ee.setData({sto_sele_name_1:e.store_name}) - }) + }) + + var is_chat=0; + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { + + }).then(res => { + if(res && res.data.code==0 && res.data.data){ + is_chat=1; + } + }) //----获取系统参数----- getApp().getConfig2(function (e) { @@ -343,6 +352,12 @@ Page({ } // console.log(e); var json_d = JSON.parse(e.switch_list); + + //如果商家未开通在线客服的话 + if(json_d && json_d.weapp_customertype==3 && !is_chat){ + json_d.weapp_customertype=0 + } + ee.setData({ store_config: e, sys_switch: json_d, @@ -2838,16 +2853,13 @@ Page({ }) }, - //---------联系微信客服------------ - con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) - }, + con_weixin: function () { + getApp().con_wx(this); + }, + + customer_chat:function(){ + getApp().customer_chat(this.data.data.id,1); + }, //评论的调用 requestComments_new: async function () { diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index b9d1139..d10e4eb 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -1017,30 +1017,7 @@ - + - diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js index 9e6b3cf..d1729be 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js @@ -310,6 +310,15 @@ Page({ ee.setData({sto_sele_name_1: e.store_name}) }) + var is_chat=0; + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { + + }).then(res => { + if(res && res.data.code==0 && res.data.data){ + is_chat=1; + } + }) + //----获取系统参数----- getApp().getConfig2(function (e) { ee.setData({ @@ -334,6 +343,11 @@ Page({ } var json_d = JSON.parse(e.switch_list); + + //如果商家未开通在线客服的话 + if(json_d && json_d.weapp_customertype==3 && !is_chat){ + json_d.weapp_customertype=0 + } ee.setData({ store_config: e, sys_switch: json_d, @@ -2620,16 +2634,12 @@ Page({ }) }, - //---------联系微信客服------------ con_weixin: function () { - var url = this.data.sys_switch.weapp_customertype_url; - var id = this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) { - } - }) + getApp().con_wx(this); + }, + + customer_chat:function(){ + getApp().customer_chat(this.data.data.id,1); }, //评论的调用 diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml index 196a2b7..c71c175 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml @@ -826,32 +826,8 @@ - - - - + +