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 @@
-
-
- 联系客服
-
-
-
-
- 客服热线:
- {{store_tel}}
-
-
-
-
-
-
-
-
- 在线客服
-
-
-
+
-
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 @@
-
-
-
- 联系客服
-
-
-
-
- 客服热线:
- {{store_tel}}
-
-
-
-
-
-
-
-
- 在线客服
-
-
-
-
-
+
+
diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js
index 78ada49..184d4e1 100644
--- a/packageB/pages/zuhegou/index/index.js
+++ b/packageB/pages/zuhegou/index/index.js
@@ -869,7 +869,7 @@ Page({
//开始调用接口
getApp().request.get(url, {
data: req_data,
- success: function (res) {
+ success: async function (res) {
th.data.loading = 0;
th.setData({
is_get: 1
@@ -879,6 +879,16 @@ Page({
var list = th.data.list;
if (!list) list = [];
+ for (let it = 0; it < res.data.data.pageData.length; it++) {
+ var g_ite=res.data.data.pageData[it];
+ //获取单品的现在的活动状态
+ var rs_gd=await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + g_ite.goods_id, {});
+ if(rs_gd && rs_gd.data.code==0 && rs_gd.data.data){
+ g_ite.viplimited_timetype= rs_gd.data.data.viplimited_timetype;
+ }
+
+ }
+
//当是下拉刷新的时候
if (th.data.page > 1 && th.data.cart_list) {
//下拉之后也要重新计算一下金额
@@ -2392,7 +2402,8 @@ Page({
goods_id: gd.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:gd.viplimited_timetype
},
}).then(res2 => {
var g_buy_num = 0;
@@ -2887,7 +2898,8 @@ Page({
goods_id: item_j.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:item_j.viplimited_timetype
},
}).then(res2 => {
if (res2.data.code == 0) {
@@ -2964,7 +2976,8 @@ Page({
goods_id: item_j.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:item_j.viplimited_timetype
},
}).then(res2 => {
if (res2.data.code == 0) {
diff --git a/packageB/pages/zuhegou/preindex/index.js b/packageB/pages/zuhegou/preindex/index.js
index 02b4707..72679d5 100644
--- a/packageB/pages/zuhegou/preindex/index.js
+++ b/packageB/pages/zuhegou/preindex/index.js
@@ -1745,7 +1745,8 @@ Page({
goods_id: gd.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:gd.viplimited_timetype
},
}).then(res2 => {
var g_buy_num = 0;
@@ -2122,7 +2123,8 @@ Page({
goods_id: item_j.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:item_j.viplimited_timetype
},
}).then(res2 => {
if (res2.data.code == 0) {
@@ -2199,7 +2201,8 @@ Page({
goods_id: item_j.goods_id,
prom_type: 7,
prom_id: th.data.act.id,
- isnew:1
+ isnew:1,
+ timetype:item_j.viplimited_timetype
},
}).then(res2 => {
if (res2.data.code == 0) {
diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
index c9efe7d..6a2761a 100644
--- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
+++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -479,7 +479,8 @@ Page({
goods_id: item1.goods_id,
prom_type: item1.prom_type,
prom_id: item1.prom_id,
- isnew:1
+ isnew:1,
+ timetype:item1.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
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/luckyGo/luckyGo_order/luckyGo_order.js b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
index 510a2fa..3bd29f4 100644
--- a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
+++ b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
@@ -768,6 +768,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;
@@ -839,6 +841,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/packageC/pages/payForAnother/payForAnother.js b/packageC/pages/payForAnother/payForAnother.js
index cad3426..fc2cd17 100644
--- a/packageC/pages/payForAnother/payForAnother.js
+++ b/packageC/pages/payForAnother/payForAnother.js
@@ -447,7 +447,8 @@ Page({
goods_id: item1.goods_id,
prom_type: item1.prom_type,
prom_id: item1.prom_id,
- isnew:1
+ isnew:1,
+ timetype:item1.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
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/cart/cart.js b/packageC/pages/presell/cart/cart.js
index c3a4c4e..21530c7 100644
--- a/packageC/pages/presell/cart/cart.js
+++ b/packageC/pages/presell/cart/cart.js
@@ -3333,7 +3333,8 @@ Page({
goods_id: good.goods_id,
prom_type: good.prom_type,
prom_id: good.prom_id,
- isnew: 1
+ isnew: 1,
+ timetype:good.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
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/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js
index 7e2f6ca..7fba225 100644
--- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -2570,7 +2570,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/packageD/pages/shop/order_detail/order_detail.js b/packageD/pages/shop/order_detail/order_detail.js
index a166134..1509f2f 100644
--- a/packageD/pages/shop/order_detail/order_detail.js
+++ b/packageD/pages/shop/order_detail/order_detail.js
@@ -341,7 +341,8 @@ Page({
user_id: getApp().globalData.user_id,
goods_id: good.goods_id,
prom_type: good.prom_type,
- prom_id: good.prom_id
+ prom_id: good.prom_id,
+ timetype:good.viplimited_timetype
},
}).then(res => {
var buy_num_data = res.data.data;
@@ -1283,6 +1284,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;
@@ -1354,6 +1356,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/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js
index f60dc29..d9b1d17 100644
--- a/packageE/pages/cart/cart2/cart2.js
+++ b/packageE/pages/cart/cart2/cart2.js
@@ -2526,16 +2526,20 @@ Page({
},
//寻找活动在列表中的最后一个
- is_has_gift(ord_goods, prom_id) {
+ is_has_gift(ord_goods, prom_id,get_data) {
if (!ord_goods || ord_goods.length == 0) return false;
var len = ord_goods.length;
+ var is_ck=false;
for (var i = 0; i < len; i++) {
var e = ord_goods[i];
if (e.prom_type == 3 && e.prom_id == prom_id && e.is_gift == 1) {
- return true;
+ if(get_data.zp_by>0){
+ ord_goods[i].is_past=1;
+ }
+ is_ck=true;
}
}
- return false;
+ return is_ck;
},
@@ -2550,7 +2554,7 @@ Page({
cart_add_gift(item_map, pickid, i, ord_goods, get_data) {
var th = this;
- var is_has_gift = this.is_has_gift(ord_goods, item_map.prom_id)
+ var is_has_gift = this.is_has_gift(ord_goods, item_map.prom_id,get_data)
//-- 没有赠品的时候才添加,避免购物车重复出现 --
if (!is_has_gift) {
diff --git a/packageE/pages/cart/cart2_pt/cart2_pt.js b/packageE/pages/cart/cart2_pt/cart2_pt.js
index 303aae4..35e3360 100644
--- a/packageE/pages/cart/cart2_pt/cart2_pt.js
+++ b/packageE/pages/cart/cart2_pt/cart2_pt.js
@@ -813,6 +813,7 @@ Page({
//to.getwuliuprice(async function (rs) {
console.log('calculatePrice2222');
//console.log(rs);
+ let all_gd_price=allpice;
var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
var out_of_weight = null; //超出多少重量
@@ -1201,9 +1202,12 @@ Page({
var total_m = parseFloat(allpice) + parseFloat(th.data.formData.shipping_price);
total_m = parseFloat(total_m).toFixed(2);
+ all_gd_price = parseFloat(all_gd_price) + parseFloat(th.data.formData.shipping_price);
+ all_gd_price = parseFloat(all_gd_price).toFixed(2);
var atxt = "formData.total_amount";
- th.setData({ [atxt]: total_m, })
+ th.setData({ [atxt]: all_gd_price,}) ; //因为allprice有减了券的钱,不能在用allprice了
+
var order_m = total_m;
@@ -1516,7 +1520,6 @@ Page({
}
-
var gg = to.get_b_now();
var goods = {
'goods_id': gg.goods_id,
@@ -1589,6 +1592,12 @@ Page({
goods.is_whsle_goods = 1;
}
+ //组装优惠券的钱
+ if (parseFloat(th.data.formData.coupon_price) > 0) {
+ goods.quan_num = th.data.formData.coupon_price;
+ goods.quan_no = item.coupon_no;
+ }
+
//--导购分享过来的id--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
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/team/team_show/team_show.js b/packageG/pages/team/team_show/team_show.js
index 5100894..af27f9b 100644
--- a/packageG/pages/team/team_show/team_show.js
+++ b/packageG/pages/team/team_show/team_show.js
@@ -331,13 +331,14 @@ Page({
var user_id=getApp().globalData.user_id;
var promgoodsbuynum=0;
var goodsbuynum=0;
- getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
+ await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
data: {
store_id: os.stoid,
user_id: user_id,
goods_id: gd.goods_id,
- prom_type: gd.prom_type,
- prom_id: gd.prom_id, isnew:1
+ prom_type: 6,
+ prom_id: th.data.teamlist.id, isnew:1,
+ timetype:gd.viplimited_timetype
},
}).then(res=>{
@@ -349,15 +350,18 @@ Page({
//先判断限购
if (num+goodsbuynum>gd.viplimited && gd.viplimited>0) {
getApp().confirmBox("超出商品限购");
+ th.inp_val(gd.viplimited-goodsbuynum);
return false;
}
if (num+promgoodsbuynum>th.data.teamlist.buy_limit && th.data.teamlist.buy_limit>0) {
getApp().confirmBox("超出活动限购");
+ th.inp_val(th.data.teamlist.buy_limit-promgoodsbuynum);
return false;
}
//判断库存
if ( num>gd.store_count) {
getApp().confirmBox("超出商品库存");
+ th.inp_val(gd.store_count);
return false;
}
var r_num=0;
@@ -372,6 +376,7 @@ Page({
//--判断库存---
if ( num>r_num) {
getApp().confirmBox("超出商品库存");
+ th.inp_val(r_num);
return false;
}
@@ -380,11 +385,12 @@ Page({
minusStatus: minusStatus,
})
+ return true;
+
},
- /*输入框事件*/
- bindManual: function(e) {
- var num = e.detail.value;
+ inp_val(num){
+ if(!num || num<1) num=1;
var minusStatus = num > 1 ? 'normal' : 'disable';
this.setData({
num: num,
@@ -392,6 +398,17 @@ Page({
})
},
+ /*输入框事件*/
+ bindManual: async function(e) {
+ var num = e.detail.value;
+ var minusStatus = num > 1 ? 'normal' : 'disable';
+ // this.setData({
+ // num: num,
+ // minusStatus: minusStatus
+ // })
+ this.check_num(num,minusStatus);
+ },
+
//---------------初始化代码----------------
async init(tg_id) {
var goods_id = 0, //商品ID,
@@ -898,6 +915,10 @@ Page({
//购买前的判断redis
async buy_check_redis(func){
+
+ var ck= await this.check_num(this.data.num,1);
+ if(!ck) return false;
+
//获取redis中的数量
var r_num=0,prom_type=6,prom_id=this.data.teamlist.id;
await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
diff --git a/packageG/pages/user/order_detail/order_detail.js b/packageG/pages/user/order_detail/order_detail.js
index 58837ce..08ba1af 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;
@@ -1768,11 +1769,8 @@ Page({
})
if (arr2.length == 1) {
- good.prom_type = 1;
- good.prom_id = item.act_id;
-
-
-
+ good.prom_type = arr2[0].prom_type;
+ good.prom_id = arr2[0].act_id;
}
else if (arr2.length > 1) {
good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id;
@@ -1978,6 +1976,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 +2000,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 +2048,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 3b848e5..1607263 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,
@@ -2480,11 +2498,11 @@ Page({
// s.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;
+ if (l_num <= 0) l_num = 1;
+ th.setData({
+ goodsInputNum: l_num
+ })
+ return false;
}
}
@@ -2631,7 +2649,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) {
@@ -2644,7 +2661,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
})
@@ -3485,7 +3502,7 @@ Page({
jieti_prom: null,
order_prom: null,
zh_act: null,
- more_flash: null,
+ more_flash: null
})
}
@@ -3530,7 +3547,7 @@ Page({
sele_g: item,
data: item,
//gid: gid, //只去掉gid的更新
-
+ goodsInputNum:1
});
@@ -5436,7 +5453,8 @@ Page({
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) {
@@ -5753,7 +5771,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
})
@@ -9034,6 +9052,11 @@ Page({
getApp().customer_chat(goods_id);
},
+ 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..8d3b471 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;
@@ -2092,8 +2093,8 @@ Page({
})
if (arr2.length == 1) {
- good.prom_type = item.prom_type;
- good.prom_id = item.act_id;
+ good.prom_type = arr2[0].prom_type;
+ good.prom_id = arr2[0].act_id;
}
else if (arr2.length > 1) {
good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id;
@@ -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;
}