diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index fcf119b..e388ee1 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -5,10 +5,8 @@ var regeneratorRuntime = require('../../../utils/runtime.js');
var util_pay = require("../../../utils/pay.js");
var zh_calc = require("zh_calculate.js");
var ladder_calc = require("ladder_calculate.js");
-
// 防抖函数用定时器
let timer;
-
Page({
data: {
url: t.globalData.setting.url,
@@ -93,13 +91,11 @@ Page({
is_coupon: 1, //选择券的控制属性
is_shipping_code: "",//插入用户默认地址
wu_arr_txt: "", //要更新的物流的字段
-
sales_rules: 1, //默认是显示线上库存
isget_by_quan: {}, //是否调用了接口获取包邮券
get_by_quan_list: null, //立即购买的
get_by_quan_list_cart: {}, //购物车的
by_quan_list_cart: null, //点击选择的包邮列表
-
//如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
is_no_by: {},
is_by: {},
@@ -2347,15 +2343,15 @@ Page({
}
}
})
+ this.setData({
+ submit:1,
+ })
},
//--------------------提交订单-----------------------
async submit_func() {
- if (this.data.is_summit_ing == 1) return false; //--提交中退出--
- this.data.is_summit_ing = 1;
var th = this, pdata = new Array();
var ff = true;
-
//------------立即购买-------------
if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
@@ -2981,6 +2977,9 @@ Page({
console.log("index.js wx.request CheckCallUser fail");
},
complete: function () {
+ this.setData({
+ submit:0,
+ })
}
})
@@ -4370,15 +4369,22 @@ Page({
},
//订阅消息提醒
sendsm: function (func) {
+ let th =this;
var template_id = this.data.template_id;
// //授权订阅
wx.requestSubscribeMessage({
tmplIds: [template_id],
success(res) {
func();
+ th.setData({
+ submit:0,
+ })
},
fail(res) {
func();
+ th.setData({
+ submit:0,
+ })
}
})
diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml
index 0fdda33..a6a3aee 100644
--- a/pages/cart/cart2/cart2.wxml
+++ b/pages/cart/cart2/cart2.wxml
@@ -455,7 +455,7 @@
应付金额:¥{{formData.order_amount}}
-
+
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js
index 93f7af1..dccbaa0 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.js
+++ b/pages/giftpack/buygiftpack/giftpackbuy.js
@@ -29,14 +29,20 @@ Page({
first_leader: e.globalData.first_leader || 0, // 推荐人ID
},
onLoad: function (options) {
-
+ this.setData({
+ params: options,
+ })
+
+ },
+ init() {
var th = this;
- var my_confirm = th.selectComponent("#my_confirm"); //组件的id
- my_confirm.open_cancel(0);
- th.setData({
+ let options = this.data?.params;
+ this.setData({
getStorageID: a.stoid,
getUserID: d.user_id
});
+ var my_confirm = th.selectComponent("#my_confirm"); //组件的id
+ my_confirm.open_cancel(0);
//-- 获取分享人的ID --
var first_leader = options.first_leader || getApp().globalData.first_leader;
if (first_leader) {
@@ -52,8 +58,6 @@ Page({
}
})
}
-
-
getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {
data: {
enabled: 1
@@ -72,19 +76,18 @@ Page({
});
}
})
-
-
+ this.getList();
},
onShow: function () {
//--先判断会员状态--
- getApp().is_Single_page(this,function(){
+ getApp().is_Single_page(this, function () {
var user_info = getApp().globalData.userInfo;
if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- getApp().goto('/pages/togoin/togoin');
- return false;
+ getApp().goto('/pages/togoin/togoin');
+ return false;
}
- this.getList();
})
+ this.init();
},
//购买礼包
@@ -190,7 +193,7 @@ Page({
if (getApp().globalData.guide_id) {
json.guide_id = getApp().globalData.guide_id;
}
- console.log(json,'json');
+ console.log(json, 'json');
var data = JSON.stringify(json);
var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
getApp().request.json_post(url, json,
@@ -201,7 +204,7 @@ Page({
getApp().my_warnning(res.data.msg, 0, th);
}
},
- function (res) {})
+ function (res) { })
})
@@ -245,7 +248,7 @@ Page({
getApp().my_warnning(res.data.msg, 0, th);
}
},
- function (res) {})
+ function (res) { })
})
},
@@ -271,12 +274,14 @@ Page({
wareCard: arr3,
total: res.data.data.total,
ismore: ismore,
- is_read: 1
+ is_read: 1,
+ is_get:1
}), wx.stopPullDownRefresh(); //停止下拉刷新
} else {
th.setData({
is_read: 1,
- ismore: 1
+ ismore: 1,
+ is_get:1
})
}
}
@@ -326,7 +331,7 @@ Page({
if (pagePath.indexOf('/') != 0) {
pagePath = '/' + pagePath;
}
- pagePath += "?first_leader="+this.data.getUserID;
+ pagePath += "?first_leader=" + this.data.getUserID;
return {
title: "专享礼包",
path: pagePath,
@@ -340,7 +345,7 @@ Page({
if (pagePath.indexOf('/') != 0) {
pagePath = '/' + pagePath;
}
- pagePath += "?first_leader="+this.data.getUserID;
+ pagePath += "?first_leader=" + this.data.getUserID;
return {
title: '专享礼包',
imageUrl: this.data.ad_data.ad_code,
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml
index e711329..ab4a751 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.wxml
+++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -94,7 +94,7 @@
-
+
-
+
-
+
diff --git a/utils/pay.js b/utils/pay.js
index cd76b8b..ddd33e6 100644
--- a/utils/pay.js
+++ b/utils/pay.js
@@ -1,4 +1,4 @@
-var t = getApp(), n = t.request;
+var t = getApp(), n = t.request,wx_paying=0;
module.exports = {
url: "/api/weshop/order/pay/createOrder",
@@ -20,6 +20,10 @@ module.exports = {
});
},
pay: function(t, e, a,sto,type) {
+
+ if(wx_paying) return false;
+ wx_paying=1;
+
var i = this;
var dd = {
parent_sn: t,
@@ -28,9 +32,11 @@ module.exports = {
};
if (type == 1) dd.type = 1;
+ wx.showLoading();
n.post(this.url, {
data: dd,
success: function(t) {
+ wx.hideLoading();
if(t.data.code==0){
i.weixinPay(t.data.data, e, a);
}else{
@@ -39,14 +45,19 @@ module.exports = {
wx.redirectTo({
url: "/pages/user/order_list/order_list",
});
- },1000)
+ },1000)
+ wx_paying=0;
}
return false;
},
fail: function() {
+ wx.hideLoading();
+ wx_paying=0;
"function" == typeof a && a();
},
failStatus: function() {
+ wx.hideLoading();
+ wx_paying=0;
"function" == typeof a && a();
}
});
@@ -64,9 +75,11 @@ module.exports = {
paySign: n.paySign,
orderInfo: n.orderInfo, // 需要新增的 订单 信息
success (n) {
+ wx_paying=0;
t.showSuccess("支付成功!", e);
},
fail (n) {
+ wx_paying=0;
if(!n.errMsg ) {
getApp().showWarning("支付失败");
"function" == typeof fail && fail();
@@ -87,9 +100,11 @@ module.exports = {
signType: n.signType,
paySign: n.paySign,
success: function (n) {
+ wx_paying=0;
console.log(n), t.showSuccess("支付成功!", e);
},
fail: function (n) {
+ wx_paying=0;
console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") :
t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
"function" == typeof a && a();
diff --git a/utils/pay2.js b/utils/pay2.js
index 3e46819..11562b3 100644
--- a/utils/pay2.js
+++ b/utils/pay2.js
@@ -1,12 +1,18 @@
-var t = getApp(), n = t.request;
+var t = getApp(), n = t.request,wx_paying=0;
module.exports = {
url: "/api/weshop/plus/create/plus/order",
pay: function(dd, succ,fail) {
+
+ if(wx_paying) return false;
+ wx_paying=1;
+
+ wx.showLoading();
var i = this;
n.post(this.url, {
data: dd,
success: function(t) {
+ wx.hideLoading();
if(t.data.code==0){
if(t.data.data=="升级成功"){
"function" == typeof succ && succ(1);
@@ -19,9 +25,13 @@ module.exports = {
return false;
},
fail: function() {
+ wx.hideLoading();
+ wx_paying=0;
"function" == typeof fail && fail();
},
failStatus: function() {
+ wx.hideLoading();
+ wx_paying=0;
"function" == typeof fail && fail();
}
});
@@ -35,9 +45,11 @@ module.exports = {
signType: n.signType,
paySign: n.paySign,
success: function(n) {
+ wx_paying=0;
"function" == typeof succ && succ();
},
fail: function(n) {
+ wx_paying=0;
"function" == typeof fail && fail();
}
});