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.
- package/miniprogram_dist/GoodsItem/index.wxml +1 -1
- package/miniprogram_dist/LiveGoodsList/index.js +24 -21
- package/miniprogram_dist/LiveGoodsList/index.wxml +2 -1
- package/miniprogram_dist/TeacherGoodsList/index.wxml +1 -1
- package/package.json +1 -1
- package/src/GoodsItem/index.wxml +1 -1
- package/src/LiveGoodsList/index.js +24 -21
- package/src/LiveGoodsList/index.wxml +2 -1
- package/src/TeacherGoodsList/index.wxml +1 -1
|
@@ -270,8 +270,7 @@ Component({
|
|
|
270
270
|
default:
|
|
271
271
|
break
|
|
272
272
|
}
|
|
273
|
-
|
|
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
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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"
|
|
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
package/src/GoodsItem/index.wxml
CHANGED
|
@@ -270,8 +270,7 @@ Component({
|
|
|
270
270
|
default:
|
|
271
271
|
break
|
|
272
272
|
}
|
|
273
|
-
|
|
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
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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"
|
|
49
|
+
<view wx:for="{{goodsInfo}}" wx:for-item="goodsItem" wx:key="index">
|
|
50
50
|
<goods-item
|
|
51
51
|
goodsInfo="{{goodsItem}}"
|
|
52
52
|
aliveInfo="{{aliveInfo}}"
|