xiaoe_mp_npm 0.5.42-test16 → 0.5.42-test18

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.
@@ -54,7 +54,7 @@
54
54
  </view>
55
55
 
56
56
  <!-- 商品销量 -->
57
- <view class="order-stock" wx:if="{{hasSaleNum}}">{{ saleNum }}</view>
57
+ <view class="order-stock" wx:if="{{hasSaleNum}}">{{ '已售' + goodsItem.order_num }}</view>
58
58
  </view>
59
59
 
60
60
  <!-- 活动进度条 -->
@@ -270,8 +270,7 @@ Component({
270
270
  default:
271
271
  break
272
272
  }
273
- console.log('jer=========', type, marketInfo)
274
- if (marketInfo?.length > 0) {
273
+ if (marketInfo?.length > 0 || ['goodsSwitch', 'couponSwitch'].includes(type)) {
275
274
  this.changGoodsList({type, marketInfo})
276
275
  type = ''
277
276
  marketInfo = []
@@ -328,15 +327,19 @@ Component({
328
327
  }
329
328
  }
330
329
  break;
331
- } else if (type === "goodsBatchSwitchList" && item.is_display_package === 1 && item.order_weight < goodsInfo[index].order_weight) {
330
+ } else if (type === "goodsBatchSwitchList" && item.is_display_package === 1 && ((item.order_weight < goodsInfo[index].order_weight) || (this.data.finished && index === (goodsInfo.length - 1) && item.order_weight > goodsInfo[index].order_weight))) {
332
331
  // 由于兼容显示商品时,接口并没有此商品的话,需要做一个插入商品到对应位置的操作,获取需要插入状态值(只有学员才需要操作)
333
332
  this.formatItem(item)
334
- goodsInfo.splice(index, 0, item);
333
+ if (item.order_weight < goodsInfo[index].order_weight) {
334
+ goodsInfo.splice(index, 0, item);
335
+ } else if (this.data.finished && index === (goodsInfo.length - 1) && item.order_weight > goodsInfo[index].order_weight) {
336
+ goodsInfo.splice(index+1, 0, item);
337
+ }
335
338
  break;
336
339
  }
337
340
  };
338
341
  });
339
- this.formatData(goodsInfo, false)
342
+ this.formatData(goodsInfo, false, true)
340
343
  break;
341
344
  case "goodsDelList":
342
345
  let delIndex = -1; // 删除数据的当前下标
@@ -356,7 +359,7 @@ Component({
356
359
  // 重置删除下标
357
360
  delIndex = -1;
358
361
  });
359
- this.formatData(goodsInfo, false)
362
+ this.formatData(goodsInfo, false, true)
360
363
  break;
361
364
  default:
362
365
  break;
@@ -496,22 +499,22 @@ Component({
496
499
  }
497
500
  })
498
501
  },
499
- formatData(data,onScrolltolower){
502
+ formatData(data,onScrolltolower,isReplace = false){
500
503
  //onScrolltolower代表是上拉加载的标识,网卡的时候有上拉加载与下拉刷新同时请求,上拉加载的数据也push进去的情况。
501
- let goodsInfo = this.data.goodsInfo
502
- data.forEach((item,index) => {
503
- this.formatItem(item)
504
- if (!this._freshing && onScrolltolower) {
505
- goodsInfo.push(item)
506
- }
507
- })
508
- if (this._freshing && !onScrolltolower) {
509
- //下拉刷新的时候直接赋值
510
- goodsInfo = JSON.parse(JSON.stringify(data))
511
- }
512
- this.setData({goodsInfo},()=>{
513
- this.getActivityStatus(this.data.goodsInfo)
514
- })
504
+ let goodsInfo = this.data.goodsInfo
505
+ data.forEach((item,index) => {
506
+ this.formatItem(item)
507
+ if (!this._freshing && onScrolltolower) {
508
+ goodsInfo.push(item)
509
+ }
510
+ })
511
+ if (this._freshing && !onScrolltolower || isReplace) {
512
+ //下拉刷新的时候直接赋值
513
+ goodsInfo = JSON.parse(JSON.stringify(data))
514
+ }
515
+ this.setData({goodsInfo},()=>{
516
+ this.getActivityStatus(this.data.goodsInfo)
517
+ })
515
518
  },
516
519
  getActivityStatus(data){
517
520
  activityList = []
@@ -54,6 +54,7 @@
54
54
  <view class="full-item">
55
55
  <block wx:if="{{showExplainingGoods}}">
56
56
  <goods-item
57
+ style="display:{{!formExplainingGoods.is_display_package ? 'none' : ''}}"
57
58
  aliveInfo="{{aliveInfo}}"
58
59
  allContactPay="{{allContactPay}}"
59
60
  goodsInfo="{{formExplainingGoods}}"
@@ -70,11 +71,11 @@
70
71
  isGrayMarketing="{{ isGrayMarketing}}"
71
72
  ></goods-item>
72
73
  </block>
73
- <!-- 讲解中的商品 end -->
74
74
  <goods-item
75
75
  wx:for="{{goodsInfo}}"
76
76
  wx:for-item="goodsItem"
77
77
  wx:key="index"
78
+ style="display:{{!goodsItem.is_display_package ? 'none' : ''}}"
78
79
  goodsInfo="{{goodsItem}}"
79
80
  allContactPay="{{allContactPay}}"
80
81
  coupon_switch="{{coupon_switch}}"
@@ -46,7 +46,7 @@
46
46
  </van-checkbox-group>
47
47
  </block>
48
48
  <block wx:else>
49
- <view wx:for="{{goodsInfo}}" wx:for-item="goodsItem" wx:key="index" class="full-item">
49
+ <view wx:for="{{goodsInfo}}" wx:for-item="goodsItem" wx:key="index">
50
50
  <goods-item
51
51
  goodsInfo="{{goodsItem}}"
52
52
  aliveInfo="{{aliveInfo}}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.5.42-test16",
3
+ "version": "0.5.42-test18",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -54,7 +54,7 @@
54
54
  </view>
55
55
 
56
56
  <!-- 商品销量 -->
57
- <view class="order-stock" wx:if="{{hasSaleNum}}">{{ saleNum }}</view>
57
+ <view class="order-stock" wx:if="{{hasSaleNum}}">{{ '已售' + goodsItem.order_num }}</view>
58
58
  </view>
59
59
 
60
60
  <!-- 活动进度条 -->
@@ -270,8 +270,7 @@ Component({
270
270
  default:
271
271
  break
272
272
  }
273
- console.log('jer=========', type, marketInfo)
274
- if (marketInfo?.length > 0) {
273
+ if (marketInfo?.length > 0 || ['goodsSwitch', 'couponSwitch'].includes(type)) {
275
274
  this.changGoodsList({type, marketInfo})
276
275
  type = ''
277
276
  marketInfo = []
@@ -328,15 +327,19 @@ Component({
328
327
  }
329
328
  }
330
329
  break;
331
- } else if (type === "goodsBatchSwitchList" && item.is_display_package === 1 && item.order_weight < goodsInfo[index].order_weight) {
330
+ } else if (type === "goodsBatchSwitchList" && item.is_display_package === 1 && ((item.order_weight < goodsInfo[index].order_weight) || (this.data.finished && index === (goodsInfo.length - 1) && item.order_weight > goodsInfo[index].order_weight))) {
332
331
  // 由于兼容显示商品时,接口并没有此商品的话,需要做一个插入商品到对应位置的操作,获取需要插入状态值(只有学员才需要操作)
333
332
  this.formatItem(item)
334
- goodsInfo.splice(index, 0, item);
333
+ if (item.order_weight < goodsInfo[index].order_weight) {
334
+ goodsInfo.splice(index, 0, item);
335
+ } else if (this.data.finished && index === (goodsInfo.length - 1) && item.order_weight > goodsInfo[index].order_weight) {
336
+ goodsInfo.splice(index+1, 0, item);
337
+ }
335
338
  break;
336
339
  }
337
340
  };
338
341
  });
339
- this.formatData(goodsInfo, false)
342
+ this.formatData(goodsInfo, false, true)
340
343
  break;
341
344
  case "goodsDelList":
342
345
  let delIndex = -1; // 删除数据的当前下标
@@ -356,7 +359,7 @@ Component({
356
359
  // 重置删除下标
357
360
  delIndex = -1;
358
361
  });
359
- this.formatData(goodsInfo, false)
362
+ this.formatData(goodsInfo, false, true)
360
363
  break;
361
364
  default:
362
365
  break;
@@ -496,22 +499,22 @@ Component({
496
499
  }
497
500
  })
498
501
  },
499
- formatData(data,onScrolltolower){
502
+ formatData(data,onScrolltolower,isReplace = false){
500
503
  //onScrolltolower代表是上拉加载的标识,网卡的时候有上拉加载与下拉刷新同时请求,上拉加载的数据也push进去的情况。
501
- let goodsInfo = this.data.goodsInfo
502
- data.forEach((item,index) => {
503
- this.formatItem(item)
504
- if (!this._freshing && onScrolltolower) {
505
- goodsInfo.push(item)
506
- }
507
- })
508
- if (this._freshing && !onScrolltolower) {
509
- //下拉刷新的时候直接赋值
510
- goodsInfo = JSON.parse(JSON.stringify(data))
511
- }
512
- this.setData({goodsInfo},()=>{
513
- this.getActivityStatus(this.data.goodsInfo)
514
- })
504
+ let goodsInfo = this.data.goodsInfo
505
+ data.forEach((item,index) => {
506
+ this.formatItem(item)
507
+ if (!this._freshing && onScrolltolower) {
508
+ goodsInfo.push(item)
509
+ }
510
+ })
511
+ if (this._freshing && !onScrolltolower || isReplace) {
512
+ //下拉刷新的时候直接赋值
513
+ goodsInfo = JSON.parse(JSON.stringify(data))
514
+ }
515
+ this.setData({goodsInfo},()=>{
516
+ this.getActivityStatus(this.data.goodsInfo)
517
+ })
515
518
  },
516
519
  getActivityStatus(data){
517
520
  activityList = []
@@ -54,6 +54,7 @@
54
54
  <view class="full-item">
55
55
  <block wx:if="{{showExplainingGoods}}">
56
56
  <goods-item
57
+ style="display:{{!formExplainingGoods.is_display_package ? 'none' : ''}}"
57
58
  aliveInfo="{{aliveInfo}}"
58
59
  allContactPay="{{allContactPay}}"
59
60
  goodsInfo="{{formExplainingGoods}}"
@@ -70,11 +71,11 @@
70
71
  isGrayMarketing="{{ isGrayMarketing}}"
71
72
  ></goods-item>
72
73
  </block>
73
- <!-- 讲解中的商品 end -->
74
74
  <goods-item
75
75
  wx:for="{{goodsInfo}}"
76
76
  wx:for-item="goodsItem"
77
77
  wx:key="index"
78
+ style="display:{{!goodsItem.is_display_package ? 'none' : ''}}"
78
79
  goodsInfo="{{goodsItem}}"
79
80
  allContactPay="{{allContactPay}}"
80
81
  coupon_switch="{{coupon_switch}}"
@@ -46,7 +46,7 @@
46
46
  </van-checkbox-group>
47
47
  </block>
48
48
  <block wx:else>
49
- <view wx:for="{{goodsInfo}}" wx:for-item="goodsItem" wx:key="index" class="full-item">
49
+ <view wx:for="{{goodsInfo}}" wx:for-item="goodsItem" wx:key="index">
50
50
  <goods-item
51
51
  goodsInfo="{{goodsItem}}"
52
52
  aliveInfo="{{aliveInfo}}"