Commit d1f73fbbba098216479cce824940a8819d729a22

Authored by 后端研发-苏泰源
2 parents 08d3358a 54919013

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

pages/cart/cart2/cart2.js
@@ -5,10 +5,8 @@ var regeneratorRuntime = require('../../../utils/runtime.js'); @@ -5,10 +5,8 @@ var regeneratorRuntime = require('../../../utils/runtime.js');
5 var util_pay = require("../../../utils/pay.js"); 5 var util_pay = require("../../../utils/pay.js");
6 var zh_calc = require("zh_calculate.js"); 6 var zh_calc = require("zh_calculate.js");
7 var ladder_calc = require("ladder_calculate.js"); 7 var ladder_calc = require("ladder_calculate.js");
8 -  
9 // 防抖函数用定时器 8 // 防抖函数用定时器
10 let timer; 9 let timer;
11 -  
12 Page({ 10 Page({
13 data: { 11 data: {
14 url: t.globalData.setting.url, 12 url: t.globalData.setting.url,
@@ -93,13 +91,11 @@ Page({ @@ -93,13 +91,11 @@ Page({
93 is_coupon: 1, //选择券的控制属性 91 is_coupon: 1, //选择券的控制属性
94 is_shipping_code: "",//插入用户默认地址 92 is_shipping_code: "",//插入用户默认地址
95 wu_arr_txt: "", //要更新的物流的字段 93 wu_arr_txt: "", //要更新的物流的字段
96 -  
97 sales_rules: 1, //默认是显示线上库存 94 sales_rules: 1, //默认是显示线上库存
98 isget_by_quan: {}, //是否调用了接口获取包邮券 95 isget_by_quan: {}, //是否调用了接口获取包邮券
99 get_by_quan_list: null, //立即购买的 96 get_by_quan_list: null, //立即购买的
100 get_by_quan_list_cart: {}, //购物车的 97 get_by_quan_list_cart: {}, //购物车的
101 by_quan_list_cart: null, //点击选择的包邮列表 98 by_quan_list_cart: null, //点击选择的包邮列表
102 -  
103 //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券 99 //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
104 is_no_by: {}, 100 is_no_by: {},
105 is_by: {}, 101 is_by: {},
@@ -2347,15 +2343,15 @@ Page({ @@ -2347,15 +2343,15 @@ Page({
2347 } 2343 }
2348 } 2344 }
2349 }) 2345 })
  2346 + this.setData({
  2347 + submit:1,
  2348 + })
2350 }, 2349 },
2351 2350
2352 //--------------------提交订单----------------------- 2351 //--------------------提交订单-----------------------
2353 async submit_func() { 2352 async submit_func() {
2354 - if (this.data.is_summit_ing == 1) return false; //--提交中退出--  
2355 - this.data.is_summit_ing = 1;  
2356 var th = this, pdata = new Array(); 2353 var th = this, pdata = new Array();
2357 var ff = true; 2354 var ff = true;
2358 -  
2359 //------------立即购买------------- 2355 //------------立即购买-------------
2360 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) { 2356 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
2361 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) { 2357 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
@@ -2981,6 +2977,9 @@ Page({ @@ -2981,6 +2977,9 @@ Page({
2981 console.log("index.js wx.request CheckCallUser fail"); 2977 console.log("index.js wx.request CheckCallUser fail");
2982 }, 2978 },
2983 complete: function () { 2979 complete: function () {
  2980 + this.setData({
  2981 + submit:0,
  2982 + })
2984 } 2983 }
2985 }) 2984 })
2986 2985
@@ -4370,15 +4369,22 @@ Page({ @@ -4370,15 +4369,22 @@ Page({
4370 }, 4369 },
4371 //订阅消息提醒 4370 //订阅消息提醒
4372 sendsm: function (func) { 4371 sendsm: function (func) {
  4372 + let th =this;
4373 var template_id = this.data.template_id; 4373 var template_id = this.data.template_id;
4374 // //授权订阅 4374 // //授权订阅
4375 wx.requestSubscribeMessage({ 4375 wx.requestSubscribeMessage({
4376 tmplIds: [template_id], 4376 tmplIds: [template_id],
4377 success(res) { 4377 success(res) {
4378 func(); 4378 func();
  4379 + th.setData({
  4380 + submit:0,
  4381 + })
4379 }, 4382 },
4380 fail(res) { 4383 fail(res) {
4381 func(); 4384 func();
  4385 + th.setData({
  4386 + submit:0,
  4387 + })
4382 } 4388 }
4383 }) 4389 })
4384 4390
pages/cart/cart2/cart2.wxml
@@ -455,7 +455,7 @@ @@ -455,7 +455,7 @@
455 <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view> 455 <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
456 <!-- <view class="co-red big"></view> --> 456 <!-- <view class="co-red big"></view> -->
457 </view> 457 </view>
458 - <button class="tips-btn" formType="submit" id="submitOrder" bindtap="requestSubscribe">提交订单</button> 458 + <button class="tips-btn" formType="submit" id="submitOrder" disabled="{{submit}}" bindtap="requestSubscribe">提交订单</button>
459 </view> 459 </view>
460 </form> 460 </form>
461 461
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -29,14 +29,20 @@ Page({ @@ -29,14 +29,20 @@ Page({
29 first_leader: e.globalData.first_leader || 0, // 推荐人ID 29 first_leader: e.globalData.first_leader || 0, // 推荐人ID
30 }, 30 },
31 onLoad: function (options) { 31 onLoad: function (options) {
32 - 32 + this.setData({
  33 + params: options,
  34 + })
  35 +
  36 + },
  37 + init() {
33 var th = this; 38 var th = this;
34 - var my_confirm = th.selectComponent("#my_confirm"); //组件的id  
35 - my_confirm.open_cancel(0);  
36 - th.setData({ 39 + let options = this.data?.params;
  40 + this.setData({
37 getStorageID: a.stoid, 41 getStorageID: a.stoid,
38 getUserID: d.user_id 42 getUserID: d.user_id
39 }); 43 });
  44 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  45 + my_confirm.open_cancel(0);
40 //-- 获取分享人的ID -- 46 //-- 获取分享人的ID --
41 var first_leader = options.first_leader || getApp().globalData.first_leader; 47 var first_leader = options.first_leader || getApp().globalData.first_leader;
42 if (first_leader) { 48 if (first_leader) {
@@ -52,8 +58,6 @@ Page({ @@ -52,8 +58,6 @@ Page({
52 } 58 }
53 }) 59 })
54 } 60 }
55 -  
56 -  
57 getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { 61 getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {
58 data: { 62 data: {
59 enabled: 1 63 enabled: 1
@@ -72,19 +76,18 @@ Page({ @@ -72,19 +76,18 @@ Page({
72 }); 76 });
73 } 77 }
74 }) 78 })
75 -  
76 - 79 + this.getList();
77 }, 80 },
78 onShow: function () { 81 onShow: function () {
79 //--先判断会员状态-- 82 //--先判断会员状态--
80 - getApp().is_Single_page(this,function(){ 83 + getApp().is_Single_page(this, function () {
81 var user_info = getApp().globalData.userInfo; 84 var user_info = getApp().globalData.userInfo;
82 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 85 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
83 - getApp().goto('/pages/togoin/togoin');  
84 - return false; 86 + getApp().goto('/pages/togoin/togoin');
  87 + return false;
85 } 88 }
86 - this.getList();  
87 }) 89 })
  90 + this.init();
88 }, 91 },
89 92
90 //购买礼包 93 //购买礼包
@@ -190,7 +193,7 @@ Page({ @@ -190,7 +193,7 @@ Page({
190 if (getApp().globalData.guide_id) { 193 if (getApp().globalData.guide_id) {
191 json.guide_id = getApp().globalData.guide_id; 194 json.guide_id = getApp().globalData.guide_id;
192 } 195 }
193 - console.log(json,'json'); 196 + console.log(json, 'json');
194 var data = JSON.stringify(json); 197 var data = JSON.stringify(json);
195 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; 198 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
196 getApp().request.json_post(url, json, 199 getApp().request.json_post(url, json,
@@ -201,7 +204,7 @@ Page({ @@ -201,7 +204,7 @@ Page({
201 getApp().my_warnning(res.data.msg, 0, th); 204 getApp().my_warnning(res.data.msg, 0, th);
202 } 205 }
203 }, 206 },
204 - function (res) {}) 207 + function (res) { })
205 208
206 }) 209 })
207 210
@@ -245,7 +248,7 @@ Page({ @@ -245,7 +248,7 @@ Page({
245 getApp().my_warnning(res.data.msg, 0, th); 248 getApp().my_warnning(res.data.msg, 0, th);
246 } 249 }
247 }, 250 },
248 - function (res) {}) 251 + function (res) { })
249 }) 252 })
250 }, 253 },
251 254
@@ -271,12 +274,14 @@ Page({ @@ -271,12 +274,14 @@ Page({
271 wareCard: arr3, 274 wareCard: arr3,
272 total: res.data.data.total, 275 total: res.data.data.total,
273 ismore: ismore, 276 ismore: ismore,
274 - is_read: 1 277 + is_read: 1,
  278 + is_get:1
275 }), wx.stopPullDownRefresh(); //停止下拉刷新 279 }), wx.stopPullDownRefresh(); //停止下拉刷新
276 } else { 280 } else {
277 th.setData({ 281 th.setData({
278 is_read: 1, 282 is_read: 1,
279 - ismore: 1 283 + ismore: 1,
  284 + is_get:1
280 }) 285 })
281 } 286 }
282 } 287 }
@@ -326,7 +331,7 @@ Page({ @@ -326,7 +331,7 @@ Page({
326 if (pagePath.indexOf('/') != 0) { 331 if (pagePath.indexOf('/') != 0) {
327 pagePath = '/' + pagePath; 332 pagePath = '/' + pagePath;
328 } 333 }
329 - pagePath += "?first_leader="+this.data.getUserID; 334 + pagePath += "?first_leader=" + this.data.getUserID;
330 return { 335 return {
331 title: "专享礼包", 336 title: "专享礼包",
332 path: pagePath, 337 path: pagePath,
@@ -340,7 +345,7 @@ Page({ @@ -340,7 +345,7 @@ Page({
340 if (pagePath.indexOf('/') != 0) { 345 if (pagePath.indexOf('/') != 0) {
341 pagePath = '/' + pagePath; 346 pagePath = '/' + pagePath;
342 } 347 }
343 - pagePath += "?first_leader="+this.data.getUserID; 348 + pagePath += "?first_leader=" + this.data.getUserID;
344 return { 349 return {
345 title: '专享礼包', 350 title: '专享礼包',
346 imageUrl: this.data.ad_data.ad_code, 351 imageUrl: this.data.ad_data.ad_code,
pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
94 </view> 94 </view>
95 </view> 95 </view>
96 </block> 96 </block>
97 - <block wx:if="{{is_read && wareCard.length<1}}"> 97 + <block wx:if="{{is_read && wareCard.length<1 && is_get}}">
98 <view class="foot_empty"> 98 <view class="foot_empty">
99 <view> 99 <view>
100 <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> 100 <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
pages/giftpack/giftpacklist/giftpacklist.js
@@ -32,14 +32,22 @@ Page({ @@ -32,14 +32,22 @@ Page({
32 first_leader: e.globalData.first_leader || 0, // 推荐人ID 32 first_leader: e.globalData.first_leader || 0, // 推荐人ID
33 }, 33 },
34 onLoad: function (options) { 34 onLoad: function (options) {
  35 + this.setData({
  36 + params:options,
  37 + })
  38 + },
  39 + init(){
  40 + let options = this.data?.params;
35 var th = this; 41 var th = this;
36 - th.setData({ 42 + this.setData({
  43 + getUserID: d.user_id,
  44 + getStorageID: a.stoid,
  45 + })
  46 + this.setData({
37 isBuy: options.isBuy, 47 isBuy: options.isBuy,
38 getGiftID: options.lbId, 48 getGiftID: options.lbId,
39 orderSn: options.orderSn, 49 orderSn: options.orderSn,
40 - getUserID: d.user_id,  
41 }) 50 })
42 -  
43 if (options.lbId) th.data.lbId = options.lbId; 51 if (options.lbId) th.data.lbId = options.lbId;
44 //-- 获取分享人的ID -- 52 //-- 获取分享人的ID --
45 var first_leader = options.first_leader || getApp().globalData.first_leader; 53 var first_leader = options.first_leader || getApp().globalData.first_leader;
@@ -57,6 +65,11 @@ Page({ @@ -57,6 +65,11 @@ Page({
57 }) 65 })
58 } 66 }
59 th.close(); 67 th.close();
  68 + if (this.data.isBuy == 0) {
  69 + this.GetMyGiftList();
  70 + } else {
  71 + this.GetBuyGiftList();
  72 + }
60 }, 73 },
61 74
62 onShow: function () { 75 onShow: function () {
@@ -67,11 +80,7 @@ Page({ @@ -67,11 +80,7 @@ Page({
67 getApp().goto('/pages/togoin/togoin'); 80 getApp().goto('/pages/togoin/togoin');
68 return false; 81 return false;
69 } 82 }
70 - if (this.data.isBuy == 0) {  
71 - this.GetMyGiftList();  
72 - } else {  
73 - this.GetBuyGiftList();  
74 - } 83 + this.init();
75 }) 84 })
76 }, 85 },
77 GetBuyPrice: function (e) { 86 GetBuyPrice: function (e) {
pages/giftpack/mygiftpack/mygiftpack.js
@@ -25,19 +25,24 @@ Page({ @@ -25,19 +25,24 @@ Page({
25 curpage: 1, //当前分页数 25 curpage: 1, //当前分页数
26 pageSize: 10, //页大小 26 pageSize: 10, //页大小
27 total: 0, //总数量 27 total: 0, //总数量
28 - ad_data:null, 28 + ad_data: null,
29 first_leader: e.globalData.first_leader || 0, // 推荐人ID 29 first_leader: e.globalData.first_leader || 0, // 推荐人ID
30 }, 30 },
  31 + onLoad: function (options) {
  32 + this.setData({
  33 + params: options,
  34 + })
  35 + },
31 36
32 - onLoad: function(options) { 37 + init() {
  38 + let options = this.data?.params;
33 var th = this; 39 var th = this;
34 - th.setData({ 40 + this.setData({
35 getStorageID: a.stoid, 41 getStorageID: a.stoid,
36 getUserID: d.user_id, 42 getUserID: d.user_id,
37 loadingType: 0, 43 loadingType: 0,
38 getDate: i.formatTime(new Date().getTime()) 44 getDate: i.formatTime(new Date().getTime())
39 }); 45 });
40 -  
41 //-- 获取分享人的ID -- 46 //-- 获取分享人的ID --
42 var first_leader = options.first_leader || getApp().globalData.first_leader; 47 var first_leader = options.first_leader || getApp().globalData.first_leader;
43 if (first_leader) { 48 if (first_leader) {
@@ -53,39 +58,39 @@ Page({ @@ -53,39 +58,39 @@ Page({
53 } 58 }
54 }) 59 })
55 } 60 }
56 -  
57 - getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {  
58 - data: {  
59 - enabled: 1  
60 - }  
61 - }).then(res => {  
62 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
63 - var a = res.data.data.pageData;  
64 - var tt = {  
65 - 'ad_code': os.imghost + a[0].ad_code,  
66 - 'media_link': '',  
67 - 'ad_weapplink':a[0].ad_weapplink,  
68 - 'bgcolor':a[0].bgcolor,  
69 - };  
70 - th.setData({ad_data:tt});  
71 - }  
72 - })  
73 61
  62 + getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {
  63 + data: {
  64 + enabled: 1
  65 + }
  66 + }).then(res => {
  67 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
  68 + var a = res.data.data.pageData;
  69 + var tt = {
  70 + 'ad_code': os.imghost + a[0].ad_code,
  71 + 'media_link': '',
  72 + 'ad_weapplink': a[0].ad_weapplink,
  73 + 'bgcolor': a[0].bgcolor,
  74 + };
  75 + th.setData({ ad_data: tt });
  76 + }
  77 + })
  78 + this.getList();
74 }, 79 },
75 - onShow: function() { 80 + onShow: function () {
76 //--先判断会员状态-- 81 //--先判断会员状态--
77 - getApp().is_Single_page(this,function () { 82 + getApp().is_Single_page(this, function () {
78 var user_info = getApp().globalData.userInfo; 83 var user_info = getApp().globalData.userInfo;
79 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 84 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
80 - getApp().goto('/pages/togoin/togoin');  
81 - return false; 85 + getApp().goto('/pages/togoin/togoin');
  86 + return false;
82 } 87 }
83 - this.getList(); 88 + this.init()
84 }) 89 })
85 - 90 +
86 91
87 }, 92 },
88 - getList: function() { 93 + getList: function () {
89 var th = this; 94 var th = this;
90 95
91 getApp().request.get('/api/weshop/marketing/my/giftbag/page', { 96 getApp().request.get('/api/weshop/marketing/my/giftbag/page', {
@@ -96,7 +101,7 @@ Page({ @@ -96,7 +101,7 @@ Page({
96 page: th.data.curpage, 101 page: th.data.curpage,
97 pageSize: th.data.pageSize 102 pageSize: th.data.pageSize
98 }, 103 },
99 - success: function(res) { 104 + success: function (res) {
100 if (res.data.code == 0) { 105 if (res.data.code == 0) {
101 th.data.curpage++; 106 th.data.curpage++;
102 var arr1 = th.data.wareCard; 107 var arr1 = th.data.wareCard;
@@ -108,12 +113,14 @@ Page({ @@ -108,12 +113,14 @@ Page({
108 wareCard: arr3, 113 wareCard: arr3,
109 total: res.data.data.total, 114 total: res.data.data.total,
110 ismore: ismore, 115 ismore: ismore,
111 - is_read: 1 116 + is_read: 1,
  117 + is_get:1,
112 }), wx.stopPullDownRefresh(); //停止下拉刷新 118 }), wx.stopPullDownRefresh(); //停止下拉刷新
113 } else { 119 } else {
114 th.setData({ 120 th.setData({
115 is_read: 1, 121 is_read: 1,
116 - ismore:1 122 + ismore: 1,
  123 + is_get:1,
117 }) 124 })
118 } 125 }
119 126
@@ -123,7 +130,7 @@ Page({ @@ -123,7 +130,7 @@ Page({
123 130
124 }, 131 },
125 //销毁界面跳转 132 //销毁界面跳转
126 - redirectTo: function(e) { 133 + redirectTo: function (e) {
127 var th = this; 134 var th = this;
128 var url = e.currentTarget.dataset.url; 135 var url = e.currentTarget.dataset.url;
129 //销毁跳转 136 //销毁跳转
@@ -132,13 +139,13 @@ Page({ @@ -132,13 +139,13 @@ Page({
132 }); 139 });
133 }, 140 },
134 //不销毁界面跳转 141 //不销毁界面跳转
135 - navigateTo: function(e) { 142 + navigateTo: function (e) {
136 var th = this; 143 var th = this;
137 var url = e.currentTarget.dataset.url; 144 var url = e.currentTarget.dataset.url;
138 getApp().goto(url); 145 getApp().goto(url);
139 }, 146 },
140 //下拉事件 147 //下拉事件
141 - onReachBottom: function() { 148 + onReachBottom: function () {
142 var th = this; 149 var th = this;
143 if (th.data.total <= th.data.pageSize) return; 150 if (th.data.total <= th.data.pageSize) return;
144 if (th.data.ismore) return; 151 if (th.data.ismore) return;
@@ -146,7 +153,7 @@ Page({ @@ -146,7 +153,7 @@ Page({
146 }, 153 },
147 154
148 //图片失败,默认图片 155 //图片失败,默认图片
149 - bind_bnerr2: function(e) { 156 + bind_bnerr2: function (e) {
150 var _errImg = e.target.dataset.errorimg; 157 var _errImg = e.target.dataset.errorimg;
151 var _errObj = {}; 158 var _errObj = {};
152 _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; 159 _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
@@ -154,33 +161,33 @@ Page({ @@ -154,33 +161,33 @@ Page({
154 }, 161 },
155 162
156 163
157 -//--- 分享设置 --  
158 -onShareAppMessage: function (e) {  
159 - var curPage=this;  
160 - var pagePath = curPage.route; //当前页面url  
161 - if (pagePath.indexOf('/') != 0) {  
162 - pagePath = '/' + pagePath;  
163 - }  
164 - pagePath += "?first_leader="+ this.data.getUserID;  
165 - return {  
166 - title: "专享礼包",  
167 - path:pagePath,  
168 - }  
169 -}, 164 + //--- 分享设置 --
  165 + onShareAppMessage: function (e) {
  166 + var curPage = this;
  167 + var pagePath = curPage.route; //当前页面url
  168 + if (pagePath.indexOf('/') != 0) {
  169 + pagePath = '/' + pagePath;
  170 + }
  171 + pagePath += "?first_leader=" + this.data.getUserID;
  172 + return {
  173 + title: "专享礼包",
  174 + path: pagePath,
  175 + }
  176 + },
170 177
171 - onShareTimeline() {  
172 - var curPage=this;  
173 - var pagePath = curPage.route; //当前页面url  
174 - if (pagePath.indexOf('/') != 0) {  
175 - pagePath = '/' + pagePath; 178 + onShareTimeline() {
  179 + var curPage = this;
  180 + var pagePath = curPage.route; //当前页面url
  181 + if (pagePath.indexOf('/') != 0) {
  182 + pagePath = '/' + pagePath;
  183 + }
  184 + pagePath += "?first_leader=" + this.data.getUserID;
  185 + return {
  186 + title: '专享礼包',
  187 + imageUrl: this.data.ad_data.ad_code,
  188 + path: pagePath,
176 } 189 }
177 - pagePath += "?first_leader="+ this.data.getUserID;  
178 - return {  
179 - title: '专享礼包',  
180 - imageUrl: this.data.ad_data.ad_code,  
181 - path: pagePath,  
182 - }  
183 - }, 190 + },
184 191
185 192
186 }); 193 });
187 \ No newline at end of file 194 \ No newline at end of file
pages/giftpack/mygiftpack/mygiftpack.wxml
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
96 </view> 96 </view>
97 </view> 97 </view>
98 </block> 98 </block>
99 - <block wx:if="{{is_read && wareCard.length<1}}"> 99 + <block wx:if="{{is_read && wareCard.length<1 && is_get}}">
100 <view class="foot_empty"> 100 <view class="foot_empty">
101 <view> 101 <view>
102 <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> 102 <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
pages/goods/goodsInfo/goodsInfo.js
@@ -3664,7 +3664,6 @@ Page({ @@ -3664,7 +3664,6 @@ Page({
3664 pageSize: 1000 3664 pageSize: 1000
3665 } 3665 }
3666 }).then(res => { 3666 }).then(res => {
3667 -  
3668 let pd_list = res.data.data.pageData; 3667 let pd_list = res.data.data.pageData;
3669 if (res.data.code == 0 && pd_list.length > 0) { 3668 if (res.data.code == 0 && pd_list.length > 0) {
3670 flag = pd_list.some(pd => { 3669 flag = pd_list.some(pd => {
@@ -4394,6 +4393,7 @@ Page({ @@ -4394,6 +4393,7 @@ Page({
4394 go_cj_team: function (e) { 4393 go_cj_team: function (e) {
4395 var ind = e.currentTarget.dataset.ind; 4394 var ind = e.currentTarget.dataset.ind;
4396 var item = this.data.teamgroup[ind]; 4395 var item = this.data.teamgroup[ind];
  4396 + var goods_id = e.currentTarget.dataset.goodsid;
4397 var id = item.id; 4397 var id = item.id;
4398 var th = this; 4398 var th = this;
4399 4399
@@ -4438,15 +4438,17 @@ Page({ @@ -4438,15 +4438,17 @@ Page({
4438 getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); 4438 getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
4439 4439
4440 } else { 4440 } else {
  4441 + console.log(222,goods_id)
4441 wx.navigateTo({ 4442 wx.navigateTo({
4442 - url: "/pages/team/team_show/team_show?tg_id=" + id, 4443 + url: "/pages/team/team_show/team_show?tg_id=" + id +"&goods_id="+goods_id,
4443 }); 4444 });
4444 } 4445 }
4445 } 4446 }
4446 //--跳转到参团-- 4447 //--跳转到参团--
4447 else { 4448 else {
  4449 + console.log(1111,th.data.goods_id)
4448 wx.navigateTo({ 4450 wx.navigateTo({
4449 - url: "/pages/team/team_show/team_show?tg_id=" + id, 4451 + url: "/pages/team/team_show/team_show?tg_id=" + id+"&goods_id="+goods_id,
4450 }); 4452 });
4451 } 4453 }
4452 } 4454 }
pages/goods/goodsInfo/goodsInfo.wxml
@@ -216,7 +216,7 @@ @@ -216,7 +216,7 @@
216 </view> 216 </view>
217 </view> 217 </view>
218 <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup"> 218 <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup">
219 - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}"> 219 + <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}" data-goodsid="{{data.goods_id}}">
220 <!-- <view class="flex ai_c"> --> 220 <!-- <view class="flex ai_c"> -->
221 <!-- //选项框头像 --> 221 <!-- //选项框头像 -->
222 <view class='gtou'> 222 <view class='gtou'>
utils/pay.js
1 -var t = getApp(), n = t.request; 1 +var t = getApp(), n = t.request,wx_paying=0;
2 2
3 module.exports = { 3 module.exports = {
4 url: "/api/weshop/order/pay/createOrder", 4 url: "/api/weshop/order/pay/createOrder",
@@ -20,6 +20,10 @@ module.exports = { @@ -20,6 +20,10 @@ module.exports = {
20 }); 20 });
21 }, 21 },
22 pay: function(t, e, a,sto,type) { 22 pay: function(t, e, a,sto,type) {
  23 +
  24 + if(wx_paying) return false;
  25 + wx_paying=1;
  26 +
23 var i = this; 27 var i = this;
24 var dd = { 28 var dd = {
25 parent_sn: t, 29 parent_sn: t,
@@ -28,9 +32,11 @@ module.exports = { @@ -28,9 +32,11 @@ module.exports = {
28 }; 32 };
29 if (type == 1) dd.type = 1; 33 if (type == 1) dd.type = 1;
30 34
  35 + wx.showLoading();
31 n.post(this.url, { 36 n.post(this.url, {
32 data: dd, 37 data: dd,
33 success: function(t) { 38 success: function(t) {
  39 + wx.hideLoading();
34 if(t.data.code==0){ 40 if(t.data.code==0){
35 i.weixinPay(t.data.data, e, a); 41 i.weixinPay(t.data.data, e, a);
36 }else{ 42 }else{
@@ -39,14 +45,19 @@ module.exports = { @@ -39,14 +45,19 @@ module.exports = {
39 wx.redirectTo({ 45 wx.redirectTo({
40 url: "/pages/user/order_list/order_list", 46 url: "/pages/user/order_list/order_list",
41 }); 47 });
42 - },1000) 48 + },1000)
  49 + wx_paying=0;
43 } 50 }
44 return false; 51 return false;
45 }, 52 },
46 fail: function() { 53 fail: function() {
  54 + wx.hideLoading();
  55 + wx_paying=0;
47 "function" == typeof a && a(); 56 "function" == typeof a && a();
48 }, 57 },
49 failStatus: function() { 58 failStatus: function() {
  59 + wx.hideLoading();
  60 + wx_paying=0;
50 "function" == typeof a && a(); 61 "function" == typeof a && a();
51 } 62 }
52 }); 63 });
@@ -64,9 +75,11 @@ module.exports = { @@ -64,9 +75,11 @@ module.exports = {
64 paySign: n.paySign, 75 paySign: n.paySign,
65 orderInfo: n.orderInfo, // 需要新增的 订单 信息 76 orderInfo: n.orderInfo, // 需要新增的 订单 信息
66 success (n) { 77 success (n) {
  78 + wx_paying=0;
67 t.showSuccess("支付成功!", e); 79 t.showSuccess("支付成功!", e);
68 }, 80 },
69 fail (n) { 81 fail (n) {
  82 + wx_paying=0;
70 if(!n.errMsg ) { 83 if(!n.errMsg ) {
71 getApp().showWarning("支付失败"); 84 getApp().showWarning("支付失败");
72 "function" == typeof fail && fail(); 85 "function" == typeof fail && fail();
@@ -87,9 +100,11 @@ module.exports = { @@ -87,9 +100,11 @@ module.exports = {
87 signType: n.signType, 100 signType: n.signType,
88 paySign: n.paySign, 101 paySign: n.paySign,
89 success: function (n) { 102 success: function (n) {
  103 + wx_paying=0;
90 console.log(n), t.showSuccess("支付成功!", e); 104 console.log(n), t.showSuccess("支付成功!", e);
91 }, 105 },
92 fail: function (n) { 106 fail: function (n) {
  107 + wx_paying=0;
93 console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : 108 console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") :
94 t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), 109 t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
95 "function" == typeof a && a(); 110 "function" == typeof a && a();
utils/pay2.js
1 -var t = getApp(), n = t.request; 1 +var t = getApp(), n = t.request,wx_paying=0;
2 2
3 module.exports = { 3 module.exports = {
4 url: "/api/weshop/plus/create/plus/order", 4 url: "/api/weshop/plus/create/plus/order",
5 pay: function(dd, succ,fail) { 5 pay: function(dd, succ,fail) {
  6 +
  7 + if(wx_paying) return false;
  8 + wx_paying=1;
  9 +
  10 + wx.showLoading();
6 var i = this; 11 var i = this;
7 n.post(this.url, { 12 n.post(this.url, {
8 data: dd, 13 data: dd,
9 success: function(t) { 14 success: function(t) {
  15 + wx.hideLoading();
10 if(t.data.code==0){ 16 if(t.data.code==0){
11 if(t.data.data=="升级成功"){ 17 if(t.data.data=="升级成功"){
12 "function" == typeof succ && succ(1); 18 "function" == typeof succ && succ(1);
@@ -19,9 +25,13 @@ module.exports = { @@ -19,9 +25,13 @@ module.exports = {
19 return false; 25 return false;
20 }, 26 },
21 fail: function() { 27 fail: function() {
  28 + wx.hideLoading();
  29 + wx_paying=0;
22 "function" == typeof fail && fail(); 30 "function" == typeof fail && fail();
23 }, 31 },
24 failStatus: function() { 32 failStatus: function() {
  33 + wx.hideLoading();
  34 + wx_paying=0;
25 "function" == typeof fail && fail(); 35 "function" == typeof fail && fail();
26 } 36 }
27 }); 37 });
@@ -35,9 +45,11 @@ module.exports = { @@ -35,9 +45,11 @@ module.exports = {
35 signType: n.signType, 45 signType: n.signType,
36 paySign: n.paySign, 46 paySign: n.paySign,
37 success: function(n) { 47 success: function(n) {
  48 + wx_paying=0;
38 "function" == typeof succ && succ(); 49 "function" == typeof succ && succ();
39 }, 50 },
40 fail: function(n) { 51 fail: function(n) {
  52 + wx_paying=0;
41 "function" == typeof fail && fail(); 53 "function" == typeof fail && fail();
42 } 54 }
43 }); 55 });