xiaoe_mp_npm 1.0.19 → 1.0.20-alpha.2

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.
Files changed (60) hide show
  1. package/miniprogram_dist/GoodsItem/index.js +63 -14
  2. package/miniprogram_dist/GoodsItem/index.scss +13 -3
  3. package/miniprogram_dist/GoodsItem/index.wxml +9 -2
  4. package/miniprogram_dist/GoodsItem/index.wxss +64 -41
  5. package/miniprogram_dist/LiveGoodsList/index.js +15 -1
  6. package/miniprogram_dist/LiveGoodsList/index.wxml +13 -11
  7. package/miniprogram_dist/Task/taskReceivePopup/coupon/index.js +13 -8
  8. package/miniprogram_dist/Task/taskReceivePopup/coupon/index.scss +32 -0
  9. package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxml +34 -22
  10. package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxss +141 -54
  11. package/package.json +1 -1
  12. package/src/AliveInvite/LiveRoomVertical/index.wxss +252 -252
  13. package/src/CollectionAddress/index.wxss +5 -5
  14. package/src/ConfirmOrder/components/AddressEdit/index.wxss +120 -120
  15. package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
  16. package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
  17. package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
  18. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxss +45 -45
  19. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxss +100 -100
  20. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxss +55 -55
  21. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxss +13 -13
  22. package/src/ConfirmOrder/components/Header/index.wxss +26 -26
  23. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxss +85 -85
  24. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxss +155 -155
  25. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxss +51 -51
  26. package/src/ConfirmOrder/components/ModeSelect/index.wxss +44 -44
  27. package/src/ConfirmOrder/components/PickupSelect/index.wxss +22 -22
  28. package/src/ConfirmOrder/components/SelectSite/index.wxss +82 -82
  29. package/src/ConfirmOrder/components/Shipper/index.wxss +76 -76
  30. package/src/ConfirmOrder/components/ShipperEdit/index.wxss +78 -78
  31. package/src/ConfirmOrder/components/WechatAddress/index.wxss +22 -22
  32. package/src/ConfirmOrder/index.wxss +5 -5
  33. package/src/CouponList/couponMsg/index.wxss +3 -3
  34. package/src/CustomPopup/index.wxss +22 -22
  35. package/src/GoodsItem/index.js +63 -14
  36. package/src/GoodsItem/index.scss +13 -3
  37. package/src/GoodsItem/index.wxml +9 -2
  38. package/src/GoodsItem/index.wxss +1 -2026
  39. package/src/LiveGoodsList/index.js +15 -1
  40. package/src/LiveGoodsList/index.wxml +13 -11
  41. package/src/PayComplete/Components/CouponItem/index.wxss +122 -122
  42. package/src/PayComplete/Components/Header/index.wxss +27 -27
  43. package/src/PayComplete/Components/LeadGroup/index.wxss +33 -33
  44. package/src/PayComplete/Components/PayGifts/index.wxss +157 -157
  45. package/src/PayComplete/Components/PayState/earnIntegral/index.wxss +23 -23
  46. package/src/PayComplete/Components/PayState/index.wxss +20 -20
  47. package/src/PayComplete/index.wxss +27 -27
  48. package/src/PayModule/wechatLoading/index.wxss +57 -57
  49. package/src/Recommend/index.wxss +110 -110
  50. package/src/Sku/Header/index.wxss +27 -27
  51. package/src/Sku/goods-info/index.wxss +52 -52
  52. package/src/Sku/index/index.wxss +52 -52
  53. package/src/Sku/row-item/index.wxss +50 -50
  54. package/src/Sku/step/index.wxss +11 -11
  55. package/src/Task/taskReceivePopup/coupon/index.js +13 -8
  56. package/src/Task/taskReceivePopup/coupon/index.scss +32 -0
  57. package/src/Task/taskReceivePopup/coupon/index.wxml +34 -22
  58. package/src/Task/taskReceivePopup/coupon/index.wxss +145 -54
  59. package/src/common/css/theme.wxss +16 -16
  60. package/src/miniprogram_npm/miniprogram-computed/index.js +0 -1
@@ -26,6 +26,30 @@ const { utils, sensorLog } = require("live-mp-tools");
26
26
 
27
27
  const computedBehavior = require('miniprogram-computed').behavior
28
28
 
29
+ const formatNum = (num) => {
30
+ if (!num || isNaN(num)) return num
31
+
32
+ num = Number(num)
33
+ const isDecimals = (num) => {
34
+ num = num.toString()
35
+ if(num.split('.')[1] != '00'){
36
+ return true
37
+ }else{
38
+ return false
39
+ }
40
+ }
41
+
42
+ if (Math.abs(num) >= 100000000) {
43
+ num = num / 100000000
44
+ return isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '亿' : num + '亿'
45
+ } else if (Math.abs(num) >= 10000) {
46
+ num = num / 10000
47
+ return isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '万' : num + '万'
48
+ } else {
49
+ return num
50
+ }
51
+ }
52
+
29
53
  Component({
30
54
  behaviors: [computedBehavior],
31
55
  options: {
@@ -165,6 +189,11 @@ Component({
165
189
  type: String,
166
190
  value: '',
167
191
  },
192
+ // 是否展示库存
193
+ stockSwitch: {
194
+ type: Number,
195
+ value: 0
196
+ }
168
197
  },
169
198
 
170
199
  lifetimes: {
@@ -195,8 +224,39 @@ Component({
195
224
  isSoldOut: false, //商品是否设置已售罄
196
225
  isRealOver: false, //商品是否为非手动售罄下的,真实抢光
197
226
  changeStateLoading: false, // 修改状态 loading(如售罄状态、显示状态)
227
+ skillNowTime: 0 // 秒杀活动对比的当前时间
198
228
  },
199
229
  computed: {
230
+ // 是否显示库存
231
+ showStock(data) {
232
+ const { current_role, goodsInfo, stockSwitch, skillNowTime } = data
233
+ // 只涉及实物商品,线下课,班课,有价优惠券,课时包,服务类商品
234
+ if (![21, 29, 35, 41, 42, 68].includes(goodsInfo.resource_type)) return false
235
+ // 讲师必定展示
236
+ if (current_role === 'teacher') return true
237
+ // 学员的话,参与营销活动有活动库存,并且开始了,就不展示了
238
+ const activityTime = new Date(goodsInfo.start_at?.replace(/-/g, "/")).getTime() || 0
239
+ const nowTime = skillNowTime || new Date().getTime()
240
+ if (+goodsInfo.is_activity === 1 && (nowTime > activityTime) && goodsInfo.activity_stock) return false
241
+ // 学员其余情况下,根据b端显示库存开关
242
+ return stockSwitch === 1
243
+ },
244
+ goodsStock(data) {
245
+ const { current_role, goodsInfo, skillNowTime } = data
246
+ // 讲师显示原库存
247
+ if (current_role === 'teacher') return formatNum(goodsInfo.stock)
248
+ // 售罄了
249
+ if (+goodsInfo.is_sell_out === 1) return 0
250
+ // 原库存为0
251
+ if (+goodsInfo.stock === 0) return 0
252
+ // 如果参与了营销活动开始后且有活动呢库存, 展示活动库存
253
+ const activityTime = new Date(goodsInfo.start_at?.replace(/-/g, "/")).getTime() || 0
254
+ const nowTime = skillNowTime || new Date().getTime()
255
+ if (+goodsInfo.is_activity === 1 && (nowTime > activityTime)) {
256
+ return goodsInfo.activity_stock ? formatNum(goodsInfo.activity_stock - goodsInfo.activity_order_num) : formatNum(goodsInfo.stock)
257
+ }
258
+ return formatNum(goodsInfo.stock)
259
+ },
200
260
  showPreferentialPrice(properties) {
201
261
  // 券后价小于展示价格的时候展示券后价; coupon_switch B端店铺设置 是否展示券后价,err_code === 0 是正常,非0表示券后价相关接口报错了,去抢购按钮展示为查看详情
202
262
  //超级会员全免权益
@@ -336,20 +396,6 @@ Component({
336
396
  },
337
397
  // 商品剩余数量
338
398
  residueQuantity(data) {
339
- let formatNum = (num) => {
340
- if (!num || isNaN(num)) return num
341
- num = Number(num)
342
- if (Math.abs(num) >= 100000000) {
343
- num = num / 100000000
344
- return this.isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '亿' : num + '亿'
345
- } else if (Math.abs(num) >= 10000) {
346
- num = num / 10000
347
- return this.isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '万' : num + '万'
348
- } else {
349
- return num
350
- }
351
- }
352
-
353
399
  // "已抢光"
354
400
  if (data.isSellOut) return '已抢光'
355
401
 
@@ -675,6 +721,7 @@ Component({
675
721
  let end = deadline.getTime();
676
722
  //剩余时间
677
723
  let time = end - now;
724
+ this.setData({ skillNowTime: now })
678
725
  //定义变量 d,h,m,s保存倒计时的时间
679
726
  let d = 0, h = 0, m = 0, s = 0;
680
727
  if (time >= 0) {
@@ -694,6 +741,8 @@ Component({
694
741
  let that = this
695
742
  if (!(d === 0 && h === 0 && m === 0 && s === 0)) { //秒杀活动还未到时间
696
743
  setTimeout(() => that.countTime(), 1000)
744
+ } else {
745
+ this.setData({ skillNowTime: 0 })
697
746
  }
698
747
  },
699
748
  handleContact(e) {
@@ -1,4 +1,4 @@
1
- @import "../common/css/theme.wxss";
1
+ @import "..\\common/css/index.wxss";
2
2
 
3
3
  $deviceWidth: 750;
4
4
  @function vmin($rpx) {
@@ -250,8 +250,18 @@ $deviceWidth: 750;
250
250
  border-radius: vmin(4);
251
251
  }
252
252
  }
253
- .order-stock{
254
- color: #999999;
253
+ .stock-and-order {
254
+ display: flex;
255
+ align-items: center;
256
+ .stock-line {
257
+ background-color: #E5E5E5;
258
+ width: 1px;
259
+ height: 10px;
260
+ margin: 0 4px;
261
+ }
262
+ .order-stock{
263
+ color: #999999;
264
+ }
255
265
  }
256
266
  }
257
267
 
@@ -62,8 +62,15 @@
62
62
  <view wx:if="{{showPreferentialPrice}}" class="preferential-price">{{ '券后¥' + goodsItem.preferentialShowInt }}</view>
63
63
  </view>
64
64
 
65
- <!-- 商品销量 -->
66
- <view class="order-stock" wx:if="{{hasSaleNum}}">{{ '已售' + goodsItem.order_num }}</view>
65
+ <view class="stock-and-order">
66
+ <block wx:if="{{ showStock }}">
67
+ <!-- 商品库存 -->
68
+ <view class="order-stock">{{ current_role === 'teacher' ? '库存' : '剩余' }} {{ goodsStock }}</view>
69
+ <view wx:if="{{ hasSaleNum }}" class="stock-line"></view>
70
+ </block>
71
+ <!-- 商品销量 -->
72
+ <view class="order-stock" wx:if="{{hasSaleNum}}">{{ '已售' + goodsItem.order_num }}</view>
73
+ </view>
67
74
  </view>
68
75
 
69
76
  <!-- 活动进度条 -->
@@ -1,20 +1,3 @@
1
- @charset "UTF-8";
2
- /* 主题色 */
3
- .theme-customize-bg {
4
- background: linear-gradient(180.25deg, #fe6500 0%, #ff4102 100%) !important;
5
- }
6
- .theme-customize-font {
7
- color: #1472FF !important;
8
- }
9
- .theme-customize-light-new {
10
- background-color: #9db8f1 !important;
11
- }
12
- .theme-customize-bg-light {
13
- background-color: #fff3eb !important;
14
- }
15
- .theme-customize-border {
16
- border-color: #FF781F !important;
17
- }
18
1
  @keyframes turn {
19
2
  0% {
20
3
  transform: rotate(0deg);
@@ -211,7 +194,7 @@
211
194
  width: 59.46667vmin;
212
195
  }
213
196
  .goods-item .main-card .right .line-one .super-activity-type {
214
- background: linear-gradient(180.25deg, #333333 0%, #525252 68%, #333333 100%);
197
+ background: linear-gradient(180.25deg, #333 0%, #525252 68%, #333 100%);
215
198
  color: #ff781f;
216
199
  padding: 0.53333vmin 1.06667vmin;
217
200
  font-size: 2.66667vmin;
@@ -280,7 +263,17 @@
280
263
  padding: 0.53333vmin 1.06667vmin;
281
264
  border-radius: 0.53333vmin;
282
265
  }
283
- .goods-item .main-card .right .order .order-stock {
266
+ .goods-item .main-card .right .order .stock-and-order {
267
+ display: flex;
268
+ align-items: center;
269
+ }
270
+ .goods-item .main-card .right .order .stock-and-order .stock-line {
271
+ background-color: #E5E5E5;
272
+ width: 1px;
273
+ height: 10px;
274
+ margin: 0 4px;
275
+ }
276
+ .goods-item .main-card .right .order .stock-and-order .order-stock {
284
277
  color: #999999;
285
278
  }
286
279
  .goods-item .main-card .right .progress {
@@ -450,12 +443,12 @@
450
443
  font-weight: 500;
451
444
  }
452
445
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-flow {
453
- color: white;
446
+ color: #fff;
454
447
  font-size: 2.66667vmin;
455
448
  }
456
449
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-show {
457
450
  font-size: 3.73333vmin;
458
- color: white;
451
+ color: #fff;
459
452
  }
460
453
  .goods-item .main-card .manage-right {
461
454
  width: 49.86667vmin;
@@ -468,7 +461,7 @@
468
461
  }
469
462
  .goods-item .main-card .teacher-switch .switch-txt {
470
463
  opacity: 1;
471
- color: #333333;
464
+ color: #333;
472
465
  font-size: 3.2vmin;
473
466
  font-weight: 400;
474
467
  font-family: "PingFang SC";
@@ -507,7 +500,7 @@
507
500
  align-items: center;
508
501
  font-weight: bold;
509
502
  color: #333;
510
- border: 0.13333vmin solid #cccccc;
503
+ border: 0.13333vmin solid #ccc;
511
504
  }
512
505
  .goods-item .option-btn-wrap .option-btn:last-of-type {
513
506
  margin-right: 0;
@@ -689,7 +682,7 @@
689
682
  width: 29.03646vmin;
690
683
  }
691
684
  .goods-item .main-card .right .line-one .super-activity-type {
692
- background: linear-gradient(180.25deg, #333333 0%, #525252 68%, #333333 100%);
685
+ background: linear-gradient(180.25deg, #333 0%, #525252 68%, #333 100%);
693
686
  color: #ff781f;
694
687
  padding: 0.26042vmin 0.52083vmin;
695
688
  font-size: 1.30208vmin;
@@ -758,7 +751,17 @@
758
751
  padding: 0.26042vmin 0.52083vmin;
759
752
  border-radius: 0.26042vmin;
760
753
  }
761
- .goods-item .main-card .right .order .order-stock {
754
+ .goods-item .main-card .right .order .stock-and-order {
755
+ display: flex;
756
+ align-items: center;
757
+ }
758
+ .goods-item .main-card .right .order .stock-and-order .stock-line {
759
+ background-color: #E5E5E5;
760
+ width: 1px;
761
+ height: 10px;
762
+ margin: 0 4px;
763
+ }
764
+ .goods-item .main-card .right .order .stock-and-order .order-stock {
762
765
  color: #999999;
763
766
  }
764
767
  .goods-item .main-card .right .progress {
@@ -928,12 +931,12 @@
928
931
  font-weight: 500;
929
932
  }
930
933
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-flow {
931
- color: white;
934
+ color: #fff;
932
935
  font-size: 1.30208vmin;
933
936
  }
934
937
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-show {
935
938
  font-size: 1.82292vmin;
936
- color: white;
939
+ color: #fff;
937
940
  }
938
941
  .goods-item .main-card .manage-right {
939
942
  width: 24.34896vmin;
@@ -946,7 +949,7 @@
946
949
  }
947
950
  .goods-item .main-card .teacher-switch .switch-txt {
948
951
  opacity: 1;
949
- color: #333333;
952
+ color: #333;
950
953
  font-size: 1.5625vmin;
951
954
  font-weight: 400;
952
955
  font-family: "PingFang SC";
@@ -985,7 +988,7 @@
985
988
  align-items: center;
986
989
  font-weight: bold;
987
990
  color: #333;
988
- border: 0.0651vmin solid #cccccc;
991
+ border: 0.0651vmin solid #ccc;
989
992
  }
990
993
  .goods-item .option-btn-wrap .option-btn:last-of-type {
991
994
  margin-right: 0;
@@ -1168,7 +1171,7 @@
1168
1171
  width: 35.39683vmin;
1169
1172
  }
1170
1173
  .goods-item .main-card .right .line-one .super-activity-type {
1171
- background: linear-gradient(180.25deg, #333333 0%, #525252 68%, #333333 100%);
1174
+ background: linear-gradient(180.25deg, #333 0%, #525252 68%, #333 100%);
1172
1175
  color: #ff781f;
1173
1176
  padding: 0.31746vmin 0.63492vmin;
1174
1177
  font-size: 1.5873vmin;
@@ -1237,7 +1240,17 @@
1237
1240
  padding: 0.31746vmin 0.63492vmin;
1238
1241
  border-radius: 0.31746vmin;
1239
1242
  }
1240
- .goods-item .main-card .right .order .order-stock {
1243
+ .goods-item .main-card .right .order .stock-and-order {
1244
+ display: flex;
1245
+ align-items: center;
1246
+ }
1247
+ .goods-item .main-card .right .order .stock-and-order .stock-line {
1248
+ background-color: #E5E5E5;
1249
+ width: 1px;
1250
+ height: 10px;
1251
+ margin: 0 4px;
1252
+ }
1253
+ .goods-item .main-card .right .order .stock-and-order .order-stock {
1241
1254
  color: #999999;
1242
1255
  }
1243
1256
  .goods-item .main-card .right .progress {
@@ -1407,12 +1420,12 @@
1407
1420
  font-weight: 500;
1408
1421
  }
1409
1422
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-flow {
1410
- color: white;
1423
+ color: #fff;
1411
1424
  font-size: 1.5873vmin;
1412
1425
  }
1413
1426
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-show {
1414
1427
  font-size: 2.22222vmin;
1415
- color: white;
1428
+ color: #fff;
1416
1429
  }
1417
1430
  .goods-item .main-card .manage-right {
1418
1431
  width: 29.68254vmin;
@@ -1425,7 +1438,7 @@
1425
1438
  }
1426
1439
  .goods-item .main-card .teacher-switch .switch-txt {
1427
1440
  opacity: 1;
1428
- color: #333333;
1441
+ color: #333;
1429
1442
  font-size: 1.90476vmin;
1430
1443
  font-weight: 400;
1431
1444
  font-family: "PingFang SC";
@@ -1464,7 +1477,7 @@
1464
1477
  align-items: center;
1465
1478
  font-weight: bold;
1466
1479
  color: #333;
1467
- border: 0.07937vmin solid #cccccc;
1480
+ border: 0.07937vmin solid #ccc;
1468
1481
  }
1469
1482
  .goods-item .option-btn-wrap .option-btn:last-of-type {
1470
1483
  margin-right: 0;
@@ -1647,7 +1660,7 @@
1647
1660
  width: 29.03646vmin;
1648
1661
  }
1649
1662
  .goods-item .main-card .right .line-one .super-activity-type {
1650
- background: linear-gradient(180.25deg, #333333 0%, #525252 68%, #333333 100%);
1663
+ background: linear-gradient(180.25deg, #333 0%, #525252 68%, #333 100%);
1651
1664
  color: #ff781f;
1652
1665
  padding: 0.26042vmin 0.52083vmin;
1653
1666
  font-size: 1.30208vmin;
@@ -1716,7 +1729,17 @@
1716
1729
  padding: 0.26042vmin 0.52083vmin;
1717
1730
  border-radius: 0.26042vmin;
1718
1731
  }
1719
- .goods-item .main-card .right .order .order-stock {
1732
+ .goods-item .main-card .right .order .stock-and-order {
1733
+ display: flex;
1734
+ align-items: center;
1735
+ }
1736
+ .goods-item .main-card .right .order .stock-and-order .stock-line {
1737
+ background-color: #E5E5E5;
1738
+ width: 1px;
1739
+ height: 10px;
1740
+ margin: 0 4px;
1741
+ }
1742
+ .goods-item .main-card .right .order .stock-and-order .order-stock {
1720
1743
  color: #999999;
1721
1744
  }
1722
1745
  .goods-item .main-card .right .progress {
@@ -1886,12 +1909,12 @@
1886
1909
  font-weight: 500;
1887
1910
  }
1888
1911
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-flow {
1889
- color: white;
1912
+ color: #fff;
1890
1913
  font-size: 1.30208vmin;
1891
1914
  }
1892
1915
  .goods-item .main-card .right .line-three .buy-btn-preferential .preferential-show {
1893
1916
  font-size: 1.82292vmin;
1894
- color: white;
1917
+ color: #fff;
1895
1918
  }
1896
1919
  .goods-item .main-card .manage-right {
1897
1920
  width: 24.34896vmin;
@@ -1904,7 +1927,7 @@
1904
1927
  }
1905
1928
  .goods-item .main-card .teacher-switch .switch-txt {
1906
1929
  opacity: 1;
1907
- color: #333333;
1930
+ color: #333;
1908
1931
  font-size: 1.5625vmin;
1909
1932
  font-weight: 400;
1910
1933
  font-family: "PingFang SC";
@@ -1943,7 +1966,7 @@
1943
1966
  align-items: center;
1944
1967
  font-weight: bold;
1945
1968
  color: #333;
1946
- border: 0.0651vmin solid #cccccc;
1969
+ border: 0.0651vmin solid #ccc;
1947
1970
  }
1948
1971
  .goods-item .option-btn-wrap .option-btn:last-of-type {
1949
1972
  margin-right: 0;
@@ -157,6 +157,11 @@ Component({
157
157
  useCouponInfo: {
158
158
  type: Object,
159
159
  value: {}
160
+ },
161
+ // 是否展示库存
162
+ stockSwitch: {
163
+ type: Number,
164
+ value: 0
160
165
  }
161
166
  },
162
167
  data: {
@@ -277,6 +282,11 @@ Component({
277
282
  type = 'goodsSwitch';
278
283
  marketInfo = Number(msgData[key]);
279
284
  break;
285
+ // 直播带货库存显示开关
286
+ case "stock_switch":
287
+ type = "stockSwitch";
288
+ marketInfo = Number(msgData[key]);
289
+ break;
280
290
  // 新增操作
281
291
  case 'conf_list':
282
292
  type = 'goodsConfList';
@@ -305,7 +315,7 @@ Component({
305
315
  default:
306
316
  break;
307
317
  }
308
- if (marketInfo?.length > 0 || ['goodsSwitch', 'couponSwitch', 'goodsIsSellOut'].includes(type)) {
318
+ if (marketInfo?.length > 0 || ['goodsSwitch', 'couponSwitch', 'goodsIsSellOut', 'stockSwitch'].includes(type)) {
309
319
  this.changGoodsList({ type, marketInfo });
310
320
  type = '';
311
321
  marketInfo = [];
@@ -335,6 +345,10 @@ Component({
335
345
  case 'goodsSwitch':
336
346
  if ([0, 1].includes(marketInfo)) this.setData({ goodsSwitch: marketInfo });
337
347
  break;
348
+ // 带货库存显示开关操作
349
+ case 'stockSwitch':
350
+ if ([0, 1].includes(marketInfo)) this.setData({ stockSwitch: marketInfo });
351
+ break;
338
352
  case 'goodsConfList':
339
353
  // 如果已经加载完了,可以拼接数据
340
354
  if (this.data.finished || this.data.finishedTxt === 'no-data') {
@@ -47,21 +47,22 @@
47
47
  <view class="full-item">
48
48
  <block wx:if="{{showExplainingGoods}}">
49
49
  <goods-item
50
+ class="goods-item"
50
51
  style="display:{{!formExplainingGoods.is_display_package ? 'none' : ''}}"
51
52
  aliveInfo="{{aliveInfo}}"
52
53
  allContactPay="{{allContactPay}}"
53
54
  goodsInfo="{{formExplainingGoods}}"
54
55
  coupon_switch="{{coupon_switch}}"
55
- bind:sendNewMsg="sendNewMsg"
56
- bind:showConfirmOrder="showConfirmOrder"
57
- bind:showSku="showSku"
58
56
  explainingGoods="{{explainingGoods}}"
59
- bind:showDialog="showDialog"
60
- class="goods-item"
61
57
  envName="{{ENV_NAME}}"
62
58
  sensorReportParams="{{sensorReportParams}}"
63
59
  isFullScreen="{{ popPosition === 'right'}}"
64
60
  isGrayMarketing="{{ isGrayMarketing}}"
61
+ stockSwitch="{{ stockSwitch }}"
62
+ bind:showDialog="showDialog"
63
+ bind:sendNewMsg="sendNewMsg"
64
+ bind:showConfirmOrder="showConfirmOrder"
65
+ bind:showSku="showSku"
65
66
  ></goods-item>
66
67
  </block>
67
68
  <goods-item
@@ -69,23 +70,24 @@
69
70
  wx:for-item="goodsItem"
70
71
  wx:key="index"
71
72
  wx:for-index="index"
73
+ class="goods-item"
72
74
  index="{{index}}"
73
75
  style="display:{{!goodsItem.is_display_package ? 'none' : ''}}"
74
76
  goodsInfo="{{goodsItem}}"
75
77
  aliveInfo="{{aliveInfo}}"
76
78
  allContactPay="{{allContactPay}}"
77
79
  coupon_switch="{{coupon_switch}}"
78
- bind:sendNewMsg="sendNewMsg"
79
- bind:showConfirmOrder="showConfirmOrder"
80
- bind:showSku="showSku"
81
80
  explainingGoods="{{explainingGoods}}"
82
- bind:showDialog="showDialog"
83
- bind:changeGoodsState="changeGoodsState"
84
- class="goods-item"
85
81
  envName="{{ENV_NAME}}"
86
82
  sensorReportParams="{{sensorReportParams}}"
87
83
  isFullScreen="{{ popPosition === 'right'}}"
88
84
  isGrayMarketing="{{ isGrayMarketing}}"
85
+ stockSwitch="{{ stockSwitch }}"
86
+ bind:showDialog="showDialog"
87
+ bind:sendNewMsg="sendNewMsg"
88
+ bind:showConfirmOrder="showConfirmOrder"
89
+ bind:showSku="showSku"
90
+ bind:changeGoodsState="changeGoodsState"
89
91
  ></goods-item>
90
92
  </view>
91
93
  <view class="finished-text" wx:if="{{!refreshing && finishedTxt !== 'no-data'}}">{{finishedTxt}}</view>
@@ -26,17 +26,22 @@ Component({
26
26
  data: {},
27
27
  computed: {
28
28
  receiveCouponNowMsg(data){
29
- return data.rewardData.coupon_list[0]
29
+ return data.rewardData.coupon_list[0]
30
30
  },
31
31
  isShowPoint(data) {
32
- let tempPrice = data.receiveCouponNowMsg.price;
33
- if (tempPrice % 100 == 0) {
34
- return false;
35
- } else {
36
- return true;
37
- }
32
+ let tempPrice = data.receiveCouponNowMsg.price;
33
+ if (tempPrice % 100 == 0) {
34
+ return false;
35
+ } else {
36
+ return true;
37
+ }
38
38
  },
39
- },
39
+ // 是否为礼品券
40
+ isGiftCoupon(data) {
41
+ const item = data.receiveCouponNowMsg;
42
+ return item && item.coupon_type && +item.coupon_type === 6; // 优惠券类型 1=通用优惠券,2=专属优惠券,3=员工优惠券 6=礼品劵
43
+ },
44
+ },
40
45
 
41
46
  /**
42
47
  * 组件的方法列表
@@ -11,6 +11,9 @@ $deviceWidth: 750;
11
11
  background-size: 100% 100%;
12
12
  background-image: url('https://commonresource-1252524126.cdn.xiaoeknow.com/image/loqj5jrx0grc.png');
13
13
  overflow: hidden;
14
+ .receive-container-gift {
15
+ margin-top: vmin(300);
16
+ }
14
17
  &__content {
15
18
  display: flex;
16
19
  flex-direction: column;
@@ -43,6 +46,35 @@ $deviceWidth: 750;
43
46
  font-weight: 600;
44
47
  }
45
48
  }
49
+ &__content-gift {
50
+ .label {
51
+ color: #fd2b54;
52
+ font-size: vmin(36);
53
+ height: vmin(48);
54
+ line-height: vmin(48);
55
+ margin-right: vmin(4);
56
+ }
57
+ .title {
58
+ display: flex;
59
+ justify-content: center;
60
+ align-items: center;
61
+ height: vmin(64);
62
+ margin-top: vmin(4);
63
+ .title-txt {
64
+ width: vmin(400);
65
+ line-height: vmin(64);
66
+ color: #fd2b54;
67
+ font-size: vmin(48);
68
+ font-weight: 600;
69
+ display: -webkit-box;
70
+ -webkit-box-orient: vertical;
71
+ -webkit-line-clamp: 1;
72
+ font-family: "PingFang SC";
73
+ font-weight: 600;
74
+ overflow: hidden;
75
+ }
76
+ }
77
+ }
46
78
  &__content-describe {
47
79
  color: #333333;
48
80
  font-size: vmin(28);
@@ -8,30 +8,42 @@
8
8
  >
9
9
  <view class="receive-container-wrapper">
10
10
  <view class="receive-container">
11
- <view class="receive-container__content">
12
- <view class="receive-container__content-price">
13
- <view wx:if="{{receiveCouponNowMsg.discount_way === 1}}">
14
- <text class="smallIcon">¥</text>
15
- <text class="boldIcon">{{ couponReceivePopup.filterPrice(receiveCouponNowMsg.price) }}</text>
16
- <text
17
- class="smallIcon"
18
- wx:if="{{isShowPoint}}"
19
- >.{{ couponReceivePopup.fixedFont(receiveCouponNowMsg.price) }}</text>
11
+ <view class="receive-container__content {{ isGiftCoupon ? 'receive-container-gift' : '' }}">
12
+ <block wx:if="{{!isGiftCoupon}}">
13
+ <view class="receive-container__content-price">
14
+ <view wx:if="{{receiveCouponNowMsg.discount_way === 1}}">
15
+ <text class="smallIcon">¥</text>
16
+ <text class="boldIcon">{{ couponReceivePopup.filterPrice(receiveCouponNowMsg.price) }}</text>
17
+ <text
18
+ class="smallIcon"
19
+ wx:if="{{isShowPoint}}"
20
+ >.{{ couponReceivePopup.fixedFont(receiveCouponNowMsg.price) }}</text>
21
+ </view>
22
+ <text wx:if="{{receiveCouponNowMsg.discount_way === 2}}">
23
+ <text class="boldIcon">{{ couponReceivePopup.filterPrice(receiveCouponNowMsg.discount_percent, false) }}</text>
24
+ <text
25
+ class="boldIcon"
26
+ wx:if="{{receiveCouponNowMsg.discount_percent % 10 !== 0}}"
27
+ >.{{ couponReceivePopup.fixedFont(receiveCouponNowMsg.discount_percent, false) }}</text>
28
+ <text class="discountFont">折</text>
29
+ </text>
20
30
  </view>
21
- <text wx:if="{{receiveCouponNowMsg.discount_way === 2}}">
22
- <text class="boldIcon">{{ couponReceivePopup.filterPrice(receiveCouponNowMsg.discount_percent, false) }}</text>
23
- <text
24
- class="boldIcon"
25
- wx:if="{{receiveCouponNowMsg.discount_percent % 10 !== 0}}"
26
- >.{{ couponReceivePopup.fixedFont(receiveCouponNowMsg.discount_percent, false) }}</text>
27
- <text class="discountFont">折</text>
28
- </text>
29
- </view>
31
+ </block>
32
+ <block wx:else>
33
+ <view class="receive-container__content-gift">
34
+ <view class="label">礼品券</view>
35
+ <view class="title">
36
+ <view class="title-txt">{{ receiveCouponNowMsg.title }}</view>
37
+ </view>
38
+ </view>
39
+ </block>
30
40
  <view class="receive-container__content-describe">
31
- <!-- 无门槛 -->
32
- <view wx:if="{{receiveCouponNowMsg.require_price == 0}}">无门槛</view>
33
- <!-- 满xx元可用 -->
34
- <view wx:else>满{{ receiveCouponNowMsg.require_price / 100 }}元可用</view>
41
+ <block wx:if="{{!isGiftCoupon}}">
42
+ <!-- 无门槛 -->
43
+ <view wx:if="{{receiveCouponNowMsg.require_price == 0}}">无门槛</view>
44
+ <!-- 满xx元可用 -->
45
+ <view wx:else>满{{ receiveCouponNowMsg.require_price / 100 }}元可用</view>
46
+ </block>
35
47
  <!-- 全部商品可用 -->
36
48
  <view wx:if="{{receiveCouponNowMsg.type == 1}}">全部商品可用</view>
37
49
  <!-- 部分商品可用 -->