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 @@
-
-
- 联系客服
-
-
-
-
- 客服热线:
- {{store_tel}}
-
-
-
-
-
-
-
-
- 在线客服
-
-
-
+
-
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 @@
-
-
-
- 联系客服
-
-
-
-
- 客服热线:
- {{store_tel}}
-
-
-
-
-
-
-
-
- 在线客服
-
-
-
-
-
+
+
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
index 861a66e..23bd2bf 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -306,7 +306,7 @@ Page({
},
//------初始化加载----------
- onLoad: function (t) {
+ onLoad: async function (t) {
self = this;
// console.log('onload');
if (t && t.group_id) {
@@ -459,6 +459,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({
@@ -483,6 +492,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,
@@ -2141,11 +2156,11 @@ Page({
// });
getApp().my_warnning('超出商品限购', 0, th);
l_num = th.data.sele_g.viplimited - gd_buy_num;
- if (l_num < 0) l_num = 0;
- //th.setData({ goodsInputNum: num })
- //return false;
- is_show_bs=1;
+ if (l_num <= 0) l_num = 1;
+ th.setData({ goodsInputNum: l_num })
+ return false;
}
+ is_show_bs=1;
}
//--判断商品是否超出活动限购--
@@ -4446,7 +4461,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) {
@@ -4725,7 +4741,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;
}
@@ -7146,6 +7162,10 @@ Page({
getApp().con_wx(this);
},
+ customer_chat:function(){
+ var gid=this.data.front_g.goods_id;
+ getApp().customer_chat(gid);
+ },
// 显示幸运购规则
showRules: function () {
diff --git a/packageC/pages/presell/cardInfo/goodsInfo.js b/packageC/pages/presell/cardInfo/goodsInfo.js
index 4b83be1..16fbad5 100644
--- a/packageC/pages/presell/cardInfo/goodsInfo.js
+++ b/packageC/pages/presell/cardInfo/goodsInfo.js
@@ -229,7 +229,7 @@ Page({
},
//------初始化加载----------
- onLoad:function(t) {
+ onLoad:async function(t) {
self = this;
this.setData({
@@ -338,6 +338,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({
@@ -362,6 +371,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,
@@ -2596,15 +2611,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) {}
- })
+ con_weixin: function () {
+ getApp().con_wx(this);
+ },
+
+ customer_chat:function(){
+ getApp().customer_chat(this.data.data.id,1);
},
//评论的调用
diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js
index 96282c5..e3c8424 100644
--- a/packageC/pages/presell/goodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -274,7 +274,7 @@ Page({
},
//------初始化加载----------
- onLoad: function (t) {
+ onLoad: async function (t) {
self = this;
var ee = this, that = ee, th = ee,
pre_id = t.pre_id,
@@ -389,6 +389,17 @@ 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({
@@ -413,6 +424,12 @@ 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,
@@ -1383,7 +1400,7 @@ Page({
});
var num = th.data.sele_g.viplimited - gd_buy_num;
- if (num < 0) num = 0;
+ if (num <=0) num = 1;
th.setData({ goodsInputNum: num })
return false;
}
@@ -2931,7 +2948,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) {
@@ -4884,6 +4902,11 @@ Page({
getApp().con_wx(this);
},
+ customer_chat:function(){
+ var gid=this.data.sele_g.goods_id;
+ getApp().customer_chat(gid);
+},
+
// 预览海报
previewPoster() {
getApp().globalData.no_clear = 1;
diff --git a/packageG/pages/customer_chat/customer_chat.js b/packageG/pages/customer_chat/customer_chat.js
new file mode 100644
index 0000000..d7333d6
--- /dev/null
+++ b/packageG/pages/customer_chat/customer_chat.js
@@ -0,0 +1,54 @@
+// packageG/pages/customer_chat/customer_chat.js
+var os = getApp().globalData.setting;
+var ut = require("../../../utils/util.js");
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ chatUrl:'', // 聊天页面地址
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ let goods_id=options.goods_id;
+ let type=options.type;
+ let user_id=getApp().globalData.user_id;
+ if(!user_id){
+ ut.m_toast("请先登录")
+ setTimeout(()=> {
+ getApp().goto("/packageE/pages/togoin/togoin")
+ },2000)
+ return false;
+ }
+
+ let url= os.h5_host+"/mchat/mbchat/index?goods_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
+ if(type)
+ url= os.h5_host+"/mchat/mbchat/index?card_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
+
+ console.log("chat"+url);
+ this.setData({
+ chatUrl:url
+ })
+
+ },
+
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ }
+
+})
\ No newline at end of file
diff --git a/packageG/pages/customer_chat/customer_chat.json b/packageG/pages/customer_chat/customer_chat.json
new file mode 100644
index 0000000..447eee0
--- /dev/null
+++ b/packageG/pages/customer_chat/customer_chat.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "在线客服",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/packageG/pages/customer_chat/customer_chat.wxml b/packageG/pages/customer_chat/customer_chat.wxml
new file mode 100644
index 0000000..a014bd3
--- /dev/null
+++ b/packageG/pages/customer_chat/customer_chat.wxml
@@ -0,0 +1 @@
+
diff --git a/packageG/pages/customer_chat/customer_chat.wxss b/packageG/pages/customer_chat/customer_chat.wxss
new file mode 100644
index 0000000..020df15
--- /dev/null
+++ b/packageG/pages/customer_chat/customer_chat.wxss
@@ -0,0 +1 @@
+/* packageG/pages/customer_chat/customer_chat.wxss */
\ No newline at end of file
diff --git a/packageG/pages/group_buy/goodsInfo/goodsInfo.js b/packageG/pages/group_buy/goodsInfo/goodsInfo.js
index 97e2e11..34024f3 100644
--- a/packageG/pages/group_buy/goodsInfo/goodsInfo.js
+++ b/packageG/pages/group_buy/goodsInfo/goodsInfo.js
@@ -226,7 +226,7 @@ Page({
},
//------初始化加载----------
- onLoad: function (t) {
+ onLoad:async function (t) {
self = this;
@@ -308,6 +308,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({
@@ -332,6 +341,10 @@ 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,
@@ -2568,18 +2581,14 @@ 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);
+ },
+
//评论的调用
requestComments_new: async function () {
var e = this, th = e, ee = e;
diff --git a/packageG/pages/group_buy/goodsInfo/goodsInfo.wxml b/packageG/pages/group_buy/goodsInfo/goodsInfo.wxml
index dcfd078..a6ea9e8 100644
--- a/packageG/pages/group_buy/goodsInfo/goodsInfo.wxml
+++ b/packageG/pages/group_buy/goodsInfo/goodsInfo.wxml
@@ -897,30 +897,7 @@
-
-
- 联系客服
-
-
-
-
- 客服热线:
- {{store_tel}}
-
-
-
-
-
-
-
-
- 在线客服
-
-
-
+
-
diff --git a/packageG/pages/user/order_detail/order_detail.js b/packageG/pages/user/order_detail/order_detail.js
index 58837ce..cbb88f0 100644
--- a/packageG/pages/user/order_detail/order_detail.js
+++ b/packageG/pages/user/order_detail/order_detail.js
@@ -495,7 +495,8 @@ Page({
user_id: user_id,
goods_id: good.goods_id,
prom_type: good.prom_type,
- prom_id: good.prom_id
+ prom_id: good.prom_id,
+ timetype:gg.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
@@ -1978,6 +1979,7 @@ Page({
store_id: os.stoid,
user_id: getApp().globalData.user_id,
goods_id: good.goods_id,
+ timetype:good.viplimited_timetype
};
if(b_item.prom_type==7){
req_data.prom_type=7;
@@ -2001,7 +2003,7 @@ Page({
//---- 要计算商品的限购 -----
if(good['viplimited']>0){
- if(cart_num+buynum>good['viplimited']){
+ if(cart_num+buynum>=good['viplimited']){
err_text+= good['goods_name']+"超出限购\n";
continue;
}
@@ -2049,6 +2051,7 @@ Page({
store_id: os.stoid,
user_id: getApp().globalData.user_id,
goods_id: good.goods_id,
+ timetype:good.viplimited_timetype
};
if(prom){
diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js
index 5b486fb..5f81db5 100644
--- a/pages/cart/cart/cart.js
+++ b/pages/cart/cart/cart.js
@@ -2829,7 +2829,8 @@ Page({
goods_id: goodsinfo.goods_id,
prom_type: goodsinfo.prom_type,
prom_id: goodsinfo.prom_id,
- isnew:1
+ isnew:1,
+ timetype:goodsinfo.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 66d8223..17260a4 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -438,6 +438,18 @@ Page({
}
+
+ 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().waitfor_login(()=>{
if (!getApp().globalData.user_id) {
@@ -469,6 +481,12 @@ Page({
console.log('获取系统参数');
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,
@@ -2477,7 +2495,7 @@ Page({
// s.my_warnning('超出商品限购', 0, th);
l_num = th.data.sele_g.viplimited - gd_buy_num;
- if (l_num < 0) l_num = 0;
+ if (l_num <= 0) l_num = 1;
th.setData({
goodsInputNum: l_num
})
@@ -2628,7 +2646,6 @@ Page({
checkCartNum_inte: function (t) {
var th = this;
this.get_buy_num(this.data.data, async function () {
- ;
//--判断商品是否超出限购--
if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
@@ -2641,7 +2658,7 @@ Page({
});
// s.my_warnning('超出商品限购', 0, th);
var num = th.data.sele_g.viplimited - gd_buy_num;
- if (num < 0) num = 0;
+ if (num <= 0) num = 1;
th.setData({
goodsInputNum: num
})
@@ -3482,7 +3499,7 @@ Page({
jieti_prom: null,
order_prom: null,
zh_act: null,
- more_flash: null,
+ more_flash: null
})
}
@@ -3527,7 +3544,7 @@ Page({
sele_g: item,
data: item,
//gid: gid, //只去掉gid的更新
-
+ goodsInputNum:1
});
@@ -5751,7 +5768,7 @@ Page({
// s.my_warnning('超出商品限购', 0, th);
var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num;
- if (num < 0) num = 0;
+ if (num <= 0) num = 1;
th.setData({
goodsInputNum: num
})
@@ -9027,6 +9044,11 @@ Page({
getApp().con_wx(this);
},
+ customer_chat:function(){
+ var gid=this.data.front_g.goods_id;
+ getApp().customer_chat(gid);
+ },
+
get_normal(gid) {
var set_ob={};
diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js
index ea575e4..d383ed4 100644
--- a/pages/user/order_list/order_list.js
+++ b/pages/user/order_list/order_list.js
@@ -806,7 +806,8 @@ Page({
user_id: user_id,
goods_id: good.goods_id,
prom_type: good.prom_type,
- prom_id: good.prom_id
+ prom_id: good.prom_id,
+ timetype:gg.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
@@ -2130,7 +2131,7 @@ Page({
case 2:
var group = null;
- await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => {
+ await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id+"/"+ getApp().globalData.user_id, {}).then(res => {
if (res.data.code == 0) {
group = res.data.data;
}
@@ -2293,6 +2294,8 @@ Page({
store_id: os.stoid,
user_id: getApp().globalData.user_id,
goods_id: good.goods_id,
+ timetype:good.viplimited_timetype
+
};
if (b_item.prom_type == 7) {
req_data.prom_type = 7;
@@ -2366,6 +2369,7 @@ Page({
store_id: os.stoid,
user_id: getApp().globalData.user_id,
goods_id: good.goods_id,
+ timetype:good.viplimited_timetype
};
if (prom) {
@@ -2404,7 +2408,7 @@ Page({
//---- 要计算商品的限购 -----
if (good['viplimited'] > 0) {
- if (cart_num + buynum > good['viplimited']) {
+ if (cart_num + buynum >= good['viplimited']) {
err_text += good['goods_name'] + "超出限购\n";
continue;
}