xiaoe_mp_npm 0.5.44-test8 → 0.5.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.js +0 -3
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.wxml +0 -1
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.js +1 -39
- package/miniprogram_dist/ConfirmOrder/index.js +2 -0
- package/miniprogram_dist/coupon/index.js +33 -9
- package/package.json +1 -1
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.js +0 -3
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxml +0 -1
- package/src/ConfirmOrder/components/GoodsInfo/index.js +1 -39
- package/src/ConfirmOrder/index.js +2 -0
- package/src/coupon/index.js +33 -9
|
@@ -487,7 +487,6 @@ Component({
|
|
|
487
487
|
* @param {Boolean} data.triggerPrePay 本次修改是否触发批价
|
|
488
488
|
*/
|
|
489
489
|
payInfoChange(val) {
|
|
490
|
-
console.log('子组件传参父组件',val)
|
|
491
490
|
let data = {};
|
|
492
491
|
val.detail ? data = val.detail : data = val
|
|
493
492
|
this.setData({
|
|
@@ -542,8 +541,6 @@ Component({
|
|
|
542
541
|
})
|
|
543
542
|
}
|
|
544
543
|
}
|
|
545
|
-
console.log('prePayParams',this.data.prePayParams);
|
|
546
|
-
console.log('payParams',this.data.payParams);
|
|
547
544
|
},
|
|
548
545
|
// 返回箭头点击事件
|
|
549
546
|
backClick() {
|
|
@@ -84,10 +84,6 @@ Component({
|
|
|
84
84
|
type: Boolean,
|
|
85
85
|
value: false
|
|
86
86
|
},
|
|
87
|
-
prePayInfo: {
|
|
88
|
-
type: Object,
|
|
89
|
-
value: () => {},
|
|
90
|
-
},
|
|
91
87
|
},
|
|
92
88
|
|
|
93
89
|
/**
|
|
@@ -96,9 +92,6 @@ Component({
|
|
|
96
92
|
data: {
|
|
97
93
|
goodsCount: 1,
|
|
98
94
|
first: true,
|
|
99
|
-
usedPromoCode: '',
|
|
100
|
-
couponList: []
|
|
101
|
-
|
|
102
95
|
},
|
|
103
96
|
computed: {
|
|
104
97
|
historyBuy(data) {
|
|
@@ -312,16 +305,7 @@ Component({
|
|
|
312
305
|
if (count != 1 && this.data.goodsInfo.sku_min_purchase <= 1) {
|
|
313
306
|
this.changeVal(event)
|
|
314
307
|
}
|
|
315
|
-
}
|
|
316
|
-
'prePayInfo': function(data) {
|
|
317
|
-
console.log('data',data)
|
|
318
|
-
if(data) {
|
|
319
|
-
this.setData({
|
|
320
|
-
usedPromoCode: data?.promo_code || '',
|
|
321
|
-
couponList: this.changeCouponId(data?.coupon?.valid || []),
|
|
322
|
-
})
|
|
323
|
-
}
|
|
324
|
-
},
|
|
308
|
+
}
|
|
325
309
|
},
|
|
326
310
|
lifetimes: {
|
|
327
311
|
attached: function () {
|
|
@@ -339,13 +323,6 @@ Component({
|
|
|
339
323
|
})
|
|
340
324
|
this.countBlur(true);
|
|
341
325
|
},
|
|
342
|
-
changeCouponId(list) {
|
|
343
|
-
const arr = [];
|
|
344
|
-
for (let i = 0; i < list.length; i++) {
|
|
345
|
-
arr[i] = list[i].cu_id;
|
|
346
|
-
}
|
|
347
|
-
return arr
|
|
348
|
-
},
|
|
349
326
|
overlimit(limitType) {
|
|
350
327
|
if (limitType.detail === 'plus') {
|
|
351
328
|
if (this.data.goodsInfo?.stock === this.data.count || this.data.count > this.data.goodsInfo?.stock) {
|
|
@@ -411,25 +388,10 @@ Component({
|
|
|
411
388
|
first: false
|
|
412
389
|
})
|
|
413
390
|
this.countBlur();
|
|
414
|
-
this.couponCheck();
|
|
415
391
|
})
|
|
416
392
|
},
|
|
417
|
-
couponCheck(){
|
|
418
|
-
this.triggerEvent("dataChange", {
|
|
419
|
-
name: "goodsInfo",
|
|
420
|
-
prePayParams: {
|
|
421
|
-
cu_id: this.data.couponList,
|
|
422
|
-
promo_code: this.data.usedPromoCode
|
|
423
|
-
},
|
|
424
|
-
payParams: {
|
|
425
|
-
cu_id: this.data.couponList,
|
|
426
|
-
promo_code: this.data.usedPromoCode
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
},
|
|
430
393
|
// init 是否初次触发
|
|
431
394
|
countBlur(init) {
|
|
432
|
-
console.log('init',init)
|
|
433
395
|
if (this.data.count === this.data.goodsCount && init !== true) {
|
|
434
396
|
return false;
|
|
435
397
|
}
|
|
@@ -11,7 +11,6 @@ Component({
|
|
|
11
11
|
})
|
|
12
12
|
},
|
|
13
13
|
'prePayInfo': function(data) {
|
|
14
|
-
console.log('data',data)
|
|
15
14
|
if(data) {
|
|
16
15
|
this.setData({
|
|
17
16
|
couponDiscount: data?.coupon_discount || 0,
|
|
@@ -24,14 +23,39 @@ Component({
|
|
|
24
23
|
originalPrice: data?.original_price,
|
|
25
24
|
goodsPrice: data?.goods_price
|
|
26
25
|
})
|
|
27
|
-
if(!this.data.setCoupon) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
// if(!this.data.setCoupon) {
|
|
27
|
+
// let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
|
|
28
|
+
// this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
|
|
29
|
+
// this.setData({
|
|
30
|
+
// setCoupon: true
|
|
31
|
+
// })
|
|
32
|
+
// }
|
|
33
|
+
wx.getStorage({
|
|
34
|
+
key: 'oldChooseCouponList',
|
|
35
|
+
success : (res)=> {
|
|
36
|
+
console.log('this.changeCouponId(this.data.chooseCouponList)',this.changeCouponId(this.data.chooseCouponList))
|
|
37
|
+
console.log('oldChooseCouponList',res)
|
|
38
|
+
if(JSON.stringify(this.changeCouponId(this.data.chooseCouponList)) != res.data ){
|
|
39
|
+
this.setPricingInfoFirst(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
wx.getStorage({
|
|
44
|
+
key: 'oldUsedPromoCode',
|
|
45
|
+
success : (res)=> {
|
|
46
|
+
if(this.data.usedPromoCode != res.data ){
|
|
47
|
+
this.setPricingInfoFirst(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
wx.setStorage({
|
|
52
|
+
key:"oldChooseCouponList",
|
|
53
|
+
data: JSON.stringify(this.changeCouponId(this.data.chooseCouponList))
|
|
54
|
+
})
|
|
55
|
+
wx.setStorage({
|
|
56
|
+
key:"oldUsedPromoCode",
|
|
57
|
+
data: this.data.usedPromoCode
|
|
58
|
+
})
|
|
35
59
|
}
|
|
36
60
|
},
|
|
37
61
|
},
|
package/package.json
CHANGED
|
@@ -487,7 +487,6 @@ Component({
|
|
|
487
487
|
* @param {Boolean} data.triggerPrePay 本次修改是否触发批价
|
|
488
488
|
*/
|
|
489
489
|
payInfoChange(val) {
|
|
490
|
-
console.log('子组件传参父组件',val)
|
|
491
490
|
let data = {};
|
|
492
491
|
val.detail ? data = val.detail : data = val
|
|
493
492
|
this.setData({
|
|
@@ -542,8 +541,6 @@ Component({
|
|
|
542
541
|
})
|
|
543
542
|
}
|
|
544
543
|
}
|
|
545
|
-
console.log('prePayParams',this.data.prePayParams);
|
|
546
|
-
console.log('payParams',this.data.payParams);
|
|
547
544
|
},
|
|
548
545
|
// 返回箭头点击事件
|
|
549
546
|
backClick() {
|
|
@@ -84,10 +84,6 @@ Component({
|
|
|
84
84
|
type: Boolean,
|
|
85
85
|
value: false
|
|
86
86
|
},
|
|
87
|
-
prePayInfo: {
|
|
88
|
-
type: Object,
|
|
89
|
-
value: () => {},
|
|
90
|
-
},
|
|
91
87
|
},
|
|
92
88
|
|
|
93
89
|
/**
|
|
@@ -96,9 +92,6 @@ Component({
|
|
|
96
92
|
data: {
|
|
97
93
|
goodsCount: 1,
|
|
98
94
|
first: true,
|
|
99
|
-
usedPromoCode: '',
|
|
100
|
-
couponList: []
|
|
101
|
-
|
|
102
95
|
},
|
|
103
96
|
computed: {
|
|
104
97
|
historyBuy(data) {
|
|
@@ -312,16 +305,7 @@ Component({
|
|
|
312
305
|
if (count != 1 && this.data.goodsInfo.sku_min_purchase <= 1) {
|
|
313
306
|
this.changeVal(event)
|
|
314
307
|
}
|
|
315
|
-
}
|
|
316
|
-
'prePayInfo': function(data) {
|
|
317
|
-
console.log('data',data)
|
|
318
|
-
if(data) {
|
|
319
|
-
this.setData({
|
|
320
|
-
usedPromoCode: data?.promo_code || '',
|
|
321
|
-
couponList: this.changeCouponId(data?.coupon?.valid || []),
|
|
322
|
-
})
|
|
323
|
-
}
|
|
324
|
-
},
|
|
308
|
+
}
|
|
325
309
|
},
|
|
326
310
|
lifetimes: {
|
|
327
311
|
attached: function () {
|
|
@@ -339,13 +323,6 @@ Component({
|
|
|
339
323
|
})
|
|
340
324
|
this.countBlur(true);
|
|
341
325
|
},
|
|
342
|
-
changeCouponId(list) {
|
|
343
|
-
const arr = [];
|
|
344
|
-
for (let i = 0; i < list.length; i++) {
|
|
345
|
-
arr[i] = list[i].cu_id;
|
|
346
|
-
}
|
|
347
|
-
return arr
|
|
348
|
-
},
|
|
349
326
|
overlimit(limitType) {
|
|
350
327
|
if (limitType.detail === 'plus') {
|
|
351
328
|
if (this.data.goodsInfo?.stock === this.data.count || this.data.count > this.data.goodsInfo?.stock) {
|
|
@@ -411,25 +388,10 @@ Component({
|
|
|
411
388
|
first: false
|
|
412
389
|
})
|
|
413
390
|
this.countBlur();
|
|
414
|
-
this.couponCheck();
|
|
415
391
|
})
|
|
416
392
|
},
|
|
417
|
-
couponCheck(){
|
|
418
|
-
this.triggerEvent("dataChange", {
|
|
419
|
-
name: "goodsInfo",
|
|
420
|
-
prePayParams: {
|
|
421
|
-
cu_id: this.data.couponList,
|
|
422
|
-
promo_code: this.data.usedPromoCode
|
|
423
|
-
},
|
|
424
|
-
payParams: {
|
|
425
|
-
cu_id: this.data.couponList,
|
|
426
|
-
promo_code: this.data.usedPromoCode
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
},
|
|
430
393
|
// init 是否初次触发
|
|
431
394
|
countBlur(init) {
|
|
432
|
-
console.log('init',init)
|
|
433
395
|
if (this.data.count === this.data.goodsCount && init !== true) {
|
|
434
396
|
return false;
|
|
435
397
|
}
|
package/src/coupon/index.js
CHANGED
|
@@ -11,7 +11,6 @@ Component({
|
|
|
11
11
|
})
|
|
12
12
|
},
|
|
13
13
|
'prePayInfo': function(data) {
|
|
14
|
-
console.log('data',data)
|
|
15
14
|
if(data) {
|
|
16
15
|
this.setData({
|
|
17
16
|
couponDiscount: data?.coupon_discount || 0,
|
|
@@ -24,14 +23,39 @@ Component({
|
|
|
24
23
|
originalPrice: data?.original_price,
|
|
25
24
|
goodsPrice: data?.goods_price
|
|
26
25
|
})
|
|
27
|
-
if(!this.data.setCoupon) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
// if(!this.data.setCoupon) {
|
|
27
|
+
// let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
|
|
28
|
+
// this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
|
|
29
|
+
// this.setData({
|
|
30
|
+
// setCoupon: true
|
|
31
|
+
// })
|
|
32
|
+
// }
|
|
33
|
+
wx.getStorage({
|
|
34
|
+
key: 'oldChooseCouponList',
|
|
35
|
+
success : (res)=> {
|
|
36
|
+
console.log('this.changeCouponId(this.data.chooseCouponList)',this.changeCouponId(this.data.chooseCouponList))
|
|
37
|
+
console.log('oldChooseCouponList',res)
|
|
38
|
+
if(JSON.stringify(this.changeCouponId(this.data.chooseCouponList)) != res.data ){
|
|
39
|
+
this.setPricingInfoFirst(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
wx.getStorage({
|
|
44
|
+
key: 'oldUsedPromoCode',
|
|
45
|
+
success : (res)=> {
|
|
46
|
+
if(this.data.usedPromoCode != res.data ){
|
|
47
|
+
this.setPricingInfoFirst(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
wx.setStorage({
|
|
52
|
+
key:"oldChooseCouponList",
|
|
53
|
+
data: JSON.stringify(this.changeCouponId(this.data.chooseCouponList))
|
|
54
|
+
})
|
|
55
|
+
wx.setStorage({
|
|
56
|
+
key:"oldUsedPromoCode",
|
|
57
|
+
data: this.data.usedPromoCode
|
|
58
|
+
})
|
|
35
59
|
}
|
|
36
60
|
},
|
|
37
61
|
},
|