xiaoe_mp_npm 0.5.44-test8 → 0.5.44-test9
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.
|
@@ -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,
|
|
@@ -25,13 +24,17 @@ Component({
|
|
|
25
24
|
goodsPrice: data?.goods_price
|
|
26
25
|
})
|
|
27
26
|
if(!this.data.setCoupon) {
|
|
28
|
-
console.log('this.data.chooseCouponList',this.data.chooseCouponList)
|
|
29
27
|
let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
|
|
30
28
|
this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
|
|
31
29
|
this.setData({
|
|
32
30
|
setCoupon: true
|
|
33
31
|
})
|
|
34
32
|
}
|
|
33
|
+
let oldChooseCouponList = JSON.parse(sessionStorage.getItem('oldChooseCouponList'))
|
|
34
|
+
let oldUsedPromoCode = sessionStorage.getItem('oldUsedPromoCode')
|
|
35
|
+
if(this.changeCouponId(this.data.chooseCouponList) != oldChooseCouponList || this.data.usedPromoCode != oldUsedPromoCode){
|
|
36
|
+
this.setPricingInfo(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
},
|
|
@@ -198,6 +201,9 @@ Component({
|
|
|
198
201
|
// 判断当前显示文案
|
|
199
202
|
choosedType () {
|
|
200
203
|
console.log('properties', this.properties)
|
|
204
|
+
sessionStorage.setItem('oldChooseCouponList', JSON.stringify(this.changeCouponId(this.data.chooseCouponList)))
|
|
205
|
+
sessionStorage.setItem('oldUsedPromoCode',this.data.usedPromoCode)
|
|
206
|
+
console.log('oldChooseCouponList',JSON.parse(sessionStorage.getItem('oldChooseCouponList')));
|
|
201
207
|
if (this.properties.usedPromoCode) {
|
|
202
208
|
return `已选优惠码`;
|
|
203
209
|
}
|
package/package.json
CHANGED
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,
|
|
@@ -25,13 +24,17 @@ Component({
|
|
|
25
24
|
goodsPrice: data?.goods_price
|
|
26
25
|
})
|
|
27
26
|
if(!this.data.setCoupon) {
|
|
28
|
-
console.log('this.data.chooseCouponList',this.data.chooseCouponList)
|
|
29
27
|
let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
|
|
30
28
|
this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
|
|
31
29
|
this.setData({
|
|
32
30
|
setCoupon: true
|
|
33
31
|
})
|
|
34
32
|
}
|
|
33
|
+
let oldChooseCouponList = JSON.parse(sessionStorage.getItem('oldChooseCouponList'))
|
|
34
|
+
let oldUsedPromoCode = sessionStorage.getItem('oldUsedPromoCode')
|
|
35
|
+
if(this.changeCouponId(this.data.chooseCouponList) != oldChooseCouponList || this.data.usedPromoCode != oldUsedPromoCode){
|
|
36
|
+
this.setPricingInfo(this.changeCouponId(this.data.chooseCouponList), this.data.usedPromoCode)
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
},
|
|
@@ -198,6 +201,9 @@ Component({
|
|
|
198
201
|
// 判断当前显示文案
|
|
199
202
|
choosedType () {
|
|
200
203
|
console.log('properties', this.properties)
|
|
204
|
+
sessionStorage.setItem('oldChooseCouponList', JSON.stringify(this.changeCouponId(this.data.chooseCouponList)))
|
|
205
|
+
sessionStorage.setItem('oldUsedPromoCode',this.data.usedPromoCode)
|
|
206
|
+
console.log('oldChooseCouponList',JSON.parse(sessionStorage.getItem('oldChooseCouponList')));
|
|
201
207
|
if (this.properties.usedPromoCode) {
|
|
202
208
|
return `已选优惠码`;
|
|
203
209
|
}
|