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.
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.scss +37 -0
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.wxss +25 -1
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.scss +215 -0
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.wxss +360 -36
- package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.scss +83 -0
- package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.wxss +118 -14
- package/miniprogram_dist/ConfirmOrder/components/Invoice/index.scss +51 -0
- package/miniprogram_dist/ConfirmOrder/components/Invoice/index.wxss +46 -2
- package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.scss +32 -0
- package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.wxss +18 -2
- package/miniprogram_dist/ConfirmOrder/components/PayBar/index.scss +54 -0
- package/miniprogram_dist/ConfirmOrder/components/PayBar/index.wxss +55 -3
- package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.scss +41 -0
- package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.wxss +35 -3
- package/miniprogram_dist/CouponList/components/CouponItem/index.js +83 -91
- package/miniprogram_dist/CouponList/components/CouponItem/index.scss +130 -132
- package/miniprogram_dist/CouponList/components/CouponItem/index.wxss +624 -78
- package/miniprogram_dist/CouponList/couponColumn/index.scss +106 -0
- package/miniprogram_dist/CouponList/couponColumn/index.wxss +159 -33
- package/miniprogram_dist/GoodsItem/index.js +21 -3
- package/miniprogram_dist/GoodsItem/index.scss +323 -0
- package/miniprogram_dist/GoodsItem/index.wxml +1 -1
- package/miniprogram_dist/GoodsItem/index.wxss +630 -85
- package/miniprogram_dist/GoodsRecommend/index.scss +154 -0
- package/miniprogram_dist/GoodsRecommend/index.wxss +289 -33
- package/miniprogram_dist/LiveGoodsList/Header/index.scss +71 -0
- package/miniprogram_dist/LiveGoodsList/Header/index.wxss +102 -10
- package/miniprogram_dist/LiveGoodsList/index.js +8 -1
- package/miniprogram_dist/LiveGoodsList/index.scss +80 -0
- package/miniprogram_dist/LiveGoodsList/index.wxml +56 -33
- package/miniprogram_dist/LiveGoodsList/index.wxss +123 -19
- package/miniprogram_dist/PayModule/button/index.scss +37 -0
- package/miniprogram_dist/PayModule/button/index.wxss +32 -4
- package/miniprogram_dist/common/utils/index.js +9 -0
- package/miniprogram_dist/coupon/components/CouponItem/index.less +1 -0
- package/miniprogram_dist/coupon/components/CouponItem/index.scss +239 -0
- package/miniprogram_dist/coupon/components/CouponSelect/index.scss +319 -0
- package/miniprogram_dist/coupon/components/CouponSelect/index.wxss +594 -59
- package/miniprogram_dist/coupon/index.scss +75 -0
- package/miniprogram_dist/coupon/index.wxss +119 -15
- package/package.json +1 -1
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.scss +37 -0
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxss +29 -1
- package/src/ConfirmOrder/components/GoodsInfo/index.scss +215 -0
- package/src/ConfirmOrder/components/GoodsInfo/index.wxss +390 -39
- package/src/ConfirmOrder/components/IntegralSelect/index.scss +83 -0
- package/src/ConfirmOrder/components/IntegralSelect/index.wxss +129 -14
- package/src/ConfirmOrder/components/Invoice/index.scss +51 -0
- package/src/ConfirmOrder/components/Invoice/index.wxss +52 -2
- package/src/ConfirmOrder/components/LeaveWord/index.scss +32 -0
- package/src/ConfirmOrder/components/LeaveWord/index.wxss +21 -2
- package/src/ConfirmOrder/components/PayBar/index.scss +54 -0
- package/src/ConfirmOrder/components/PayBar/index.wxss +60 -3
- package/src/ConfirmOrder/components/PayDetail/index.scss +41 -0
- package/src/ConfirmOrder/components/PayDetail/index.wxss +39 -3
- package/src/CouponList/components/CouponItem/index.js +83 -91
- package/src/CouponList/components/CouponItem/index.scss +130 -132
- package/src/CouponList/components/CouponItem/index.wxss +625 -84
- package/src/CouponList/couponColumn/index.scss +106 -0
- package/src/CouponList/couponColumn/index.wxss +173 -33
- package/src/GoodsItem/index.js +21 -3
- package/src/GoodsItem/index.scss +323 -0
- package/src/GoodsItem/index.wxml +1 -1
- package/src/GoodsItem/index.wxss +673 -85
- package/src/GoodsRecommend/index.scss +154 -0
- package/src/GoodsRecommend/index.wxss +311 -33
- package/src/LiveGoodsList/Header/index.scss +71 -0
- package/src/LiveGoodsList/Header/index.wxss +109 -10
- package/src/LiveGoodsList/index.js +8 -1
- package/src/LiveGoodsList/index.scss +80 -0
- package/src/LiveGoodsList/index.wxml +56 -33
- package/src/LiveGoodsList/index.wxss +133 -19
- package/src/PayModule/button/index.scss +37 -0
- package/src/PayModule/button/index.wxss +35 -4
- package/src/common/utils/index.js +9 -0
- package/src/coupon/components/CouponItem/index.less +1 -0
- package/src/coupon/components/CouponItem/index.scss +239 -0
- package/src/coupon/components/CouponSelect/index.scss +319 -0
- package/src/coupon/components/CouponSelect/index.wxss +642 -59
- package/src/coupon/index.scss +75 -0
- 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
|
|
73
|
+
return rpxToVmin(32)
|
|
84
74
|
} else if (tempPrice.toString().length >= 5) {
|
|
85
|
-
return
|
|
75
|
+
return rpxToVmin(36)
|
|
86
76
|
} else {
|
|
87
|
-
return
|
|
77
|
+
return rpxToVmin(48)
|
|
88
78
|
}
|
|
89
79
|
} else {
|
|
90
|
-
return
|
|
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
|
|
88
|
+
return rpxToVmin(32)
|
|
99
89
|
} else if (tempPrice.toString().length >= 5) {
|
|
100
|
-
return
|
|
90
|
+
return rpxToVmin(36)
|
|
101
91
|
} else if (tempPrice.toString().length >= 4) {
|
|
102
|
-
return
|
|
92
|
+
return rpxToVmin(48)
|
|
103
93
|
} else {
|
|
104
|
-
return
|
|
94
|
+
return rpxToVmin(56)
|
|
105
95
|
}
|
|
106
96
|
} else {
|
|
107
|
-
return
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
224
|
-
|
|
210
|
+
return
|
|
211
|
+
} else { // 普通优惠券
|
|
225
212
|
this.setData({
|
|
226
|
-
coupon_type:
|
|
213
|
+
coupon_type: 2,
|
|
214
|
+
has_received: true
|
|
227
215
|
})
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
234
|
-
|
|
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:
|
|
235
|
+
coupon_type: 3
|
|
237
236
|
})
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
})
|