xiaoe_mp_npm 0.5.39 → 0.5.40-alpha2

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 (81) hide show
  1. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.scss +37 -0
  2. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.wxss +25 -1
  3. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.scss +215 -0
  4. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.wxss +360 -36
  5. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.scss +83 -0
  6. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.wxss +118 -14
  7. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.scss +51 -0
  8. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.wxss +46 -2
  9. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.scss +32 -0
  10. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.wxss +18 -2
  11. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.scss +54 -0
  12. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.wxss +55 -3
  13. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.scss +41 -0
  14. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.wxss +35 -3
  15. package/miniprogram_dist/CouponList/components/CouponItem/index.js +83 -91
  16. package/miniprogram_dist/CouponList/components/CouponItem/index.scss +130 -132
  17. package/miniprogram_dist/CouponList/components/CouponItem/index.wxss +624 -78
  18. package/miniprogram_dist/CouponList/couponColumn/index.scss +106 -0
  19. package/miniprogram_dist/CouponList/couponColumn/index.wxss +159 -33
  20. package/miniprogram_dist/GoodsItem/index.js +21 -3
  21. package/miniprogram_dist/GoodsItem/index.scss +323 -0
  22. package/miniprogram_dist/GoodsItem/index.wxml +1 -1
  23. package/miniprogram_dist/GoodsItem/index.wxss +630 -85
  24. package/miniprogram_dist/GoodsRecommend/index.scss +154 -0
  25. package/miniprogram_dist/GoodsRecommend/index.wxss +289 -33
  26. package/miniprogram_dist/LiveGoodsList/Header/index.scss +71 -0
  27. package/miniprogram_dist/LiveGoodsList/Header/index.wxss +102 -10
  28. package/miniprogram_dist/LiveGoodsList/index.js +8 -1
  29. package/miniprogram_dist/LiveGoodsList/index.scss +80 -0
  30. package/miniprogram_dist/LiveGoodsList/index.wxml +56 -33
  31. package/miniprogram_dist/LiveGoodsList/index.wxss +123 -19
  32. package/miniprogram_dist/PayModule/button/index.scss +37 -0
  33. package/miniprogram_dist/PayModule/button/index.wxss +32 -4
  34. package/miniprogram_dist/common/utils/index.js +9 -0
  35. package/miniprogram_dist/coupon/components/CouponItem/index.less +1 -0
  36. package/miniprogram_dist/coupon/components/CouponItem/index.scss +239 -0
  37. package/miniprogram_dist/coupon/components/CouponSelect/index.scss +319 -0
  38. package/miniprogram_dist/coupon/components/CouponSelect/index.wxss +594 -59
  39. package/miniprogram_dist/coupon/index.scss +75 -0
  40. package/miniprogram_dist/coupon/index.wxss +119 -15
  41. package/package.json +1 -1
  42. package/src/ConfirmOrder/components/ConfirmOrderContent/index.scss +37 -0
  43. package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxss +29 -1
  44. package/src/ConfirmOrder/components/GoodsInfo/index.scss +215 -0
  45. package/src/ConfirmOrder/components/GoodsInfo/index.wxss +390 -39
  46. package/src/ConfirmOrder/components/IntegralSelect/index.scss +83 -0
  47. package/src/ConfirmOrder/components/IntegralSelect/index.wxss +129 -14
  48. package/src/ConfirmOrder/components/Invoice/index.scss +51 -0
  49. package/src/ConfirmOrder/components/Invoice/index.wxss +52 -2
  50. package/src/ConfirmOrder/components/LeaveWord/index.scss +32 -0
  51. package/src/ConfirmOrder/components/LeaveWord/index.wxss +21 -2
  52. package/src/ConfirmOrder/components/PayBar/index.scss +54 -0
  53. package/src/ConfirmOrder/components/PayBar/index.wxss +60 -3
  54. package/src/ConfirmOrder/components/PayDetail/index.scss +41 -0
  55. package/src/ConfirmOrder/components/PayDetail/index.wxss +39 -3
  56. package/src/CouponList/components/CouponItem/index.js +83 -91
  57. package/src/CouponList/components/CouponItem/index.scss +130 -132
  58. package/src/CouponList/components/CouponItem/index.wxss +625 -84
  59. package/src/CouponList/couponColumn/index.scss +106 -0
  60. package/src/CouponList/couponColumn/index.wxss +173 -33
  61. package/src/GoodsItem/index.js +21 -3
  62. package/src/GoodsItem/index.scss +323 -0
  63. package/src/GoodsItem/index.wxml +1 -1
  64. package/src/GoodsItem/index.wxss +673 -85
  65. package/src/GoodsRecommend/index.scss +154 -0
  66. package/src/GoodsRecommend/index.wxss +311 -33
  67. package/src/LiveGoodsList/Header/index.scss +71 -0
  68. package/src/LiveGoodsList/Header/index.wxss +109 -10
  69. package/src/LiveGoodsList/index.js +8 -1
  70. package/src/LiveGoodsList/index.scss +80 -0
  71. package/src/LiveGoodsList/index.wxml +56 -33
  72. package/src/LiveGoodsList/index.wxss +133 -19
  73. package/src/PayModule/button/index.scss +37 -0
  74. package/src/PayModule/button/index.wxss +35 -4
  75. package/src/common/utils/index.js +9 -0
  76. package/src/coupon/components/CouponItem/index.less +1 -0
  77. package/src/coupon/components/CouponItem/index.scss +239 -0
  78. package/src/coupon/components/CouponSelect/index.scss +319 -0
  79. package/src/coupon/components/CouponSelect/index.wxss +642 -59
  80. package/src/coupon/index.scss +75 -0
  81. package/src/coupon/index.wxss +128 -15
@@ -4,17 +4,7 @@ import { receiveCoupon } from "../../../common/api/couponlist"
4
4
  import { debounce } from '../../../common/utils/tool.js'
5
5
  import {getInfoCollectionData} from "../../../common/utils/getInfoCollectionData"
6
6
  import { sensorLog } from "live-mp-tools";
7
-
8
- const TOAST_TYPE = {
9
- 4: "优惠券链接已失效,请联系商家重新获取",
10
- 6: "优惠券链接已失效,请联系商家重新获取",
11
- 7: "操作频繁,稍后再试",
12
- 101: "优惠券已经被领完啦",
13
- 102: "该优惠券领取次数已达上限",
14
- 103: "领取已结束",
15
- 104: "优惠券已过期",
16
- 105: "优惠券绑定的商品权益变更,无法领取"
17
- }
7
+ import { rpxToVmin } from '../../../common/utils/index.js'
18
8
 
19
9
  Component({
20
10
 
@@ -80,14 +70,14 @@ Component({
80
70
  if (data.item && data.item.price) {
81
71
  let tempPrice = data.item.price / 100;
82
72
  if (tempPrice.toString().length >=6 ) {
83
- return "4.27vmin"
73
+ return rpxToVmin(32)
84
74
  } else if (tempPrice.toString().length >= 5) {
85
- return "4.8vmin"
75
+ return rpxToVmin(36)
86
76
  } else {
87
- return "6.4vmin"
77
+ return rpxToVmin(48)
88
78
  }
89
79
  } else {
90
- return "6.4vmin";
80
+ return rpxToVmin(48);
91
81
  }
92
82
  },
93
83
  // 判断金额长度,不同金额区间端显示不同样式(互动页优惠券样式)
@@ -95,16 +85,16 @@ Component({
95
85
  if (data.item && data.item.price) {
96
86
  let tempPrice = data.item.price / 100;
97
87
  if (tempPrice.toString().length >=6 ) {
98
- return "4.27vmin"
88
+ return rpxToVmin(32)
99
89
  } else if (tempPrice.toString().length >= 5) {
100
- return "4.8vmin"
90
+ return rpxToVmin(36)
101
91
  } else if (tempPrice.toString().length >= 4) {
102
- return "6.4vmin"
92
+ return rpxToVmin(48)
103
93
  } else {
104
- return "7.47vmin"
94
+ return rpxToVmin(56)
105
95
  }
106
96
  } else {
107
- return "7.47vmin";
97
+ return rpxToVmin(56)
108
98
  }
109
99
  },
110
100
  // 判断金额长度,不同金额区间端显示不同样式(竖屏互动页优惠券样式)
@@ -117,14 +107,13 @@ Component({
117
107
  }
118
108
  return false
119
109
  },
120
- // 格式化使用说明
121
- getDesInfo (data) {
122
- if (!data.item.instructions) {
123
- return '';
110
+ // 格式化使用说明
111
+ getDesInfo (data) {
112
+ if (!data.item.instructions) {
113
+ return '';
114
+ }
115
+ return data.item.instructions.replace(/\r\n/g, '<br/>');
124
116
  }
125
- return data.item.instructions.replace(/\r\n/g, '<br/>');
126
- }
127
-
128
117
  },
129
118
  observers: {
130
119
  item(val) {
@@ -212,46 +201,81 @@ Component({
212
201
  console.log("领取单个优惠券信息", data);
213
202
  const code = data.code
214
203
  let dataInfo = data.data
215
- switch (code) {
216
- case 0:
217
- this.handleLimitCoupon(dataInfo);
218
- break;
219
- case 101:
220
- this.setData({
221
- coupon_type: 3
204
+ if (code == 0) { //code为0包含普通优惠券和专属优惠券,通过dataInfo.is_limit区别
205
+ if (dataInfo.is_limit == 1) { // 专属优惠券
206
+ wx.showToast({
207
+ title: dataInfo.limit_tips,
208
+ icon: 'none'
222
209
  })
223
- break;
224
- case 102:
210
+ return
211
+ } else { // 普通优惠券
225
212
  this.setData({
226
- coupon_type: 6
213
+ coupon_type: 2,
214
+ has_received: true
227
215
  })
228
- break;
229
- case 103://103;已手动结束--B端操作停止使优惠券失效
230
- this.setData({
231
- coupon_type: 5
216
+ // 达到领取上限,隐藏按钮
217
+ if (dataInfo.receive_rule && dataInfo.receive_rule === dataInfo.current_user_received_count) {
218
+ this.setData({
219
+ coupon_type: 6
220
+ })
221
+ }
222
+ this.triggerEvent('receivedSuccess') //优惠券领取成功抛出方法用于直播间热度上报
223
+ wx.showToast({
224
+ title: '领取成功',
225
+ icon: 'none'
232
226
  })
233
- break;
234
- case 104:// 已过期
227
+ // 全屏端领取成功关闭优惠券弹窗
228
+ if (this.properties.isFullScreen) {
229
+ this.triggerEvent('closeCounpon')
230
+ }
231
+ return
232
+ }
233
+ } else if(code == 101) {
235
234
  this.setData({
236
- coupon_type: 4
235
+ coupon_type: 3
237
236
  })
238
- break;
239
- case 105:// 105:领取失败,券已失效
240
- case 4:// 4:数据库错误,该优惠券领取次数已达上限
241
- case 6://6:获取不到指定记录,无效的优惠券信息
242
- this.setData({
243
- coupon_type: 7
237
+ wx.showToast({
238
+ title: '优惠券已经被领完啦',
239
+ icon: 'none'
240
+ })
241
+ } else if (code == 102) {
242
+ this.setData({
243
+ coupon_type: 6
244
+ })
245
+ wx.showToast({
246
+ title: '该优惠券领取次数已达上限',
247
+ icon: 'none'
248
+ })
249
+ } else if (code == 103) { //103;已手动结束--B端操作停止使优惠券失效
250
+ this.setData({
251
+ coupon_type: 5
252
+ })
253
+ wx.showToast({
254
+ title: '该优惠券已失效',
255
+ icon: 'none'
256
+ })
257
+ } else if (code == 104) { // 已过期
258
+ this.setData({
259
+ coupon_type: 4
260
+ })
261
+ wx.showToast({
262
+ title: '该优惠券已过期',
263
+ icon: 'none'
264
+ })
265
+ } else if (code == 105 || code == 6) { // 105:已失效,6:删除
266
+ this.setData({
267
+ coupon_type: 7
268
+ })
269
+ wx.showToast({
270
+ title: '该优惠券已失效',
271
+ icon: 'none'
272
+ })
273
+ } else {
274
+ wx.showToast({
275
+ title: data.msg,
276
+ icon: 'none'
244
277
  })
245
- break;
246
- default:
247
- break;
248
278
  }
249
- // code 为0的时候有自己的toast
250
- if(code === 0) return;
251
- wx.showToast({
252
- title: TOAST_TYPE[code] || data.msg,
253
- icon: 'none'
254
- })
255
279
  // 竖屏领取上限后需要消失
256
280
  if (code !== 0 && this.data.aliveMode === 1) this.triggerEvent("closeCounpon");
257
281
  })
@@ -274,37 +298,5 @@ Component({
274
298
  is_viewUsingInfo: !this.data.is_viewUsingInfo
275
299
  })
276
300
  },
277
- // 处理领取优惠券接口code为0的情况
278
- handleLimitCoupon(dataInfo) {
279
- if (dataInfo.is_limit == 1) { // 专属优惠券
280
- wx.showToast({
281
- title: dataInfo.limit_tips,
282
- icon: 'none'
283
- })
284
- } else { // 普通优惠券
285
- this.setData({
286
- coupon_type: 2,
287
- has_received: true
288
- })
289
- // 达到领取上限,隐藏按钮
290
- if (dataInfo.receive_rule && dataInfo.receive_rule === dataInfo.current_user_received_count) {
291
- this.setData({
292
- coupon_type: 6
293
- })
294
- }
295
- this.triggerEvent('receivedSuccess') //优惠券领取成功抛出方法用于直播间热度上报
296
- wx.showToast({
297
- title: '领取成功',
298
- icon: 'none'
299
- })
300
- // 全屏端领取成功关闭优惠券弹窗
301
- if (this.properties.isFullScreen) {
302
- this.triggerEvent('closeCounpon')
303
- }
304
- }
305
- }
306
-
307
301
  }
308
-
309
-
310
302
  })