xiaoe_mp_npm 0.5.44-test5 → 0.5.44-test7

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.
@@ -487,6 +487,7 @@ Component({
487
487
  * @param {Boolean} data.triggerPrePay 本次修改是否触发批价
488
488
  */
489
489
  payInfoChange(val) {
490
+ console.log('子组件传参父组件',val)
490
491
  let data = {};
491
492
  val.detail ? data = val.detail : data = val
492
493
  this.setData({
@@ -541,6 +542,8 @@ Component({
541
542
  })
542
543
  }
543
544
  }
545
+ console.log('prePayParams',this.data.prePayParams);
546
+ console.log('payParams',this.data.payParams);
544
547
  },
545
548
  // 返回箭头点击事件
546
549
  backClick() {
@@ -49,6 +49,7 @@
49
49
  ></ChoosePicker>
50
50
  <!-- 商品信息 -->
51
51
  <GoodsInfo
52
+ prePayInfo="{{prePayInfo}}"
52
53
  marketingData="{{ marketingData.marketing_info }}"
53
54
  goodsInfo="{{ goodsInfo }}"
54
55
  confirmOrderInfo="{{ confirmOrderInfo }}"
@@ -83,7 +83,11 @@ Component({
83
83
  isFullScreen: {
84
84
  type: Boolean,
85
85
  value: false
86
- }
86
+ },
87
+ prePayInfo: {
88
+ type: Object,
89
+ value: () => {},
90
+ },
87
91
  },
88
92
 
89
93
  /**
@@ -91,7 +95,10 @@ Component({
91
95
  */
92
96
  data: {
93
97
  goodsCount: 1,
94
- first: true
98
+ first: true,
99
+ usedPromoCode: '',
100
+ couponList: []
101
+
95
102
  },
96
103
  computed: {
97
104
  historyBuy(data) {
@@ -306,6 +313,15 @@ Component({
306
313
  this.changeVal(event)
307
314
  }
308
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
+ },
309
325
  },
310
326
  lifetimes: {
311
327
  attached: function () {
@@ -323,6 +339,13 @@ Component({
323
339
  })
324
340
  this.countBlur(true);
325
341
  },
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
+ },
326
349
  overlimit(limitType) {
327
350
  if (limitType.detail === 'plus') {
328
351
  if (this.data.goodsInfo?.stock === this.data.count || this.data.count > this.data.goodsInfo?.stock) {
@@ -24,17 +24,14 @@ Component({
24
24
  originalPrice: data?.original_price,
25
25
  goodsPrice: data?.goods_price
26
26
  })
27
- // if(!this.data.setCoupon) {
28
- // console.log('this.data.chooseCouponList',this.data.chooseCouponList)
29
- // let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
30
- // this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
31
- // this.setData({
32
- // setCoupon: true
33
- // })
34
- // }
35
- console.log('this.data.chooseCouponList',this.data.chooseCouponList)
36
- let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
37
- this.setPricingInfo(chooseCouponList, this.data.usedPromoCode);
27
+ if(!this.data.setCoupon) {
28
+ console.log('this.data.chooseCouponList',this.data.chooseCouponList)
29
+ let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
30
+ this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
31
+ this.setData({
32
+ setCoupon: true
33
+ })
34
+ }
38
35
  }
39
36
  },
40
37
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.5.44-test5",
3
+ "version": "0.5.44-test7",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -487,6 +487,7 @@ Component({
487
487
  * @param {Boolean} data.triggerPrePay 本次修改是否触发批价
488
488
  */
489
489
  payInfoChange(val) {
490
+ console.log('子组件传参父组件',val)
490
491
  let data = {};
491
492
  val.detail ? data = val.detail : data = val
492
493
  this.setData({
@@ -541,6 +542,8 @@ Component({
541
542
  })
542
543
  }
543
544
  }
545
+ console.log('prePayParams',this.data.prePayParams);
546
+ console.log('payParams',this.data.payParams);
544
547
  },
545
548
  // 返回箭头点击事件
546
549
  backClick() {
@@ -49,6 +49,7 @@
49
49
  ></ChoosePicker>
50
50
  <!-- 商品信息 -->
51
51
  <GoodsInfo
52
+ prePayInfo="{{prePayInfo}}"
52
53
  marketingData="{{ marketingData.marketing_info }}"
53
54
  goodsInfo="{{ goodsInfo }}"
54
55
  confirmOrderInfo="{{ confirmOrderInfo }}"
@@ -83,7 +83,11 @@ Component({
83
83
  isFullScreen: {
84
84
  type: Boolean,
85
85
  value: false
86
- }
86
+ },
87
+ prePayInfo: {
88
+ type: Object,
89
+ value: () => {},
90
+ },
87
91
  },
88
92
 
89
93
  /**
@@ -91,7 +95,10 @@ Component({
91
95
  */
92
96
  data: {
93
97
  goodsCount: 1,
94
- first: true
98
+ first: true,
99
+ usedPromoCode: '',
100
+ couponList: []
101
+
95
102
  },
96
103
  computed: {
97
104
  historyBuy(data) {
@@ -306,6 +313,15 @@ Component({
306
313
  this.changeVal(event)
307
314
  }
308
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
+ },
309
325
  },
310
326
  lifetimes: {
311
327
  attached: function () {
@@ -323,6 +339,13 @@ Component({
323
339
  })
324
340
  this.countBlur(true);
325
341
  },
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
+ },
326
349
  overlimit(limitType) {
327
350
  if (limitType.detail === 'plus') {
328
351
  if (this.data.goodsInfo?.stock === this.data.count || this.data.count > this.data.goodsInfo?.stock) {
@@ -24,17 +24,14 @@ Component({
24
24
  originalPrice: data?.original_price,
25
25
  goodsPrice: data?.goods_price
26
26
  })
27
- // if(!this.data.setCoupon) {
28
- // console.log('this.data.chooseCouponList',this.data.chooseCouponList)
29
- // let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
30
- // this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
31
- // this.setData({
32
- // setCoupon: true
33
- // })
34
- // }
35
- console.log('this.data.chooseCouponList',this.data.chooseCouponList)
36
- let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
37
- this.setPricingInfo(chooseCouponList, this.data.usedPromoCode);
27
+ if(!this.data.setCoupon) {
28
+ console.log('this.data.chooseCouponList',this.data.chooseCouponList)
29
+ let chooseCouponList = this.changeCouponId(this.data.chooseCouponList)
30
+ this.setPricingInfoFirst(chooseCouponList, this.data.usedPromoCode)
31
+ this.setData({
32
+ setCoupon: true
33
+ })
34
+ }
38
35
  }
39
36
  },
40
37
  },