diff --git a/components/add_purchase/add_purchase.js b/components/add_purchase/add_purchase.js index 66b440f..2e05b59 100644 --- a/components/add_purchase/add_purchase.js +++ b/components/add_purchase/add_purchase.js @@ -3131,7 +3131,8 @@ Component({ data: { store_id: os.stoid, user_id: user_id, - goods_id: gd.goods_id, isnew: 1 + goods_id: gd.goods_id, isnew: 1, + timetype:gd.viplimited_timetype }, success: function (t) { if (t.data.code == 0) { 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/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index 7e16ca3..dd809a5 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -783,7 +783,7 @@ Page({ }); var num= th.data.data.viplimited-gd_buy_num; - if(num<0) num=0; + if(num<=0) num=1 th.setData({goodsInputNum:num}) return false; } @@ -797,7 +797,7 @@ Page({ }); var num=th.data.prom_buy_limit- th.data.prom_buy_num ; - if(num<0) num=0; + if(num<=0) num=1; th.setData({goodsInputNum:num}) return false; } @@ -1472,7 +1472,8 @@ Page({ store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, - isnew:1 + isnew:1, + timetype:gd.viplimited_timetype }, success: function(t) { if (t.data.code == 0) { 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 @@ - - - - + +