xiaoe_mp_npm 0.2.1-t220110 → 0.2.1
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/.gitlab-ci.yml +2 -2
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.js +1 -1
- package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.js +11 -0
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/ImageData/index.js +2 -20
- package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.js +2 -1
- package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.less +18 -3
- package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.wxml +4 -2
- package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.wxss +17 -2
- package/miniprogram_dist/CouponList/components/CouponItem/index.js +4 -2
- package/miniprogram_dist/CouponList/couponColumn/index.js +3 -0
- package/miniprogram_dist/CouponList/couponColumn/index.wxml +1 -0
- package/miniprogram_dist/GoodsItem/index.js +9 -24
- package/miniprogram_dist/GoodsItem/index.wxml +2 -2
- package/miniprogram_dist/LiveGoodsList/index.js +26 -17
- package/miniprogram_dist/LiveGoodsList/index.wxml +2 -2
- package/miniprogram_dist/Lottery/components/AddressCollection/index.js +11 -8
- package/miniprogram_dist/Lottery/components/CommonPopup/index.less +4 -4
- package/miniprogram_dist/Lottery/components/CommonPopup/index.wxss +4 -4
- package/miniprogram_dist/Lottery/components/LotteryInfo/index.js +17 -11
- package/miniprogram_dist/Lottery/components/LotteryInfo/index.wxml +2 -2
- package/miniprogram_dist/Lottery/components/LotteryPopups/index.js +19 -0
- package/miniprogram_dist/Lottery/components/LotteryResult/LosingLottery/index.js +4 -1
- package/miniprogram_dist/Lottery/components/LotteryResult/LosingLottery/index.less +4 -0
- package/miniprogram_dist/Lottery/components/LotteryResult/LosingLottery/index.wxml +3 -4
- package/miniprogram_dist/Lottery/components/LotteryResult/LosingLottery/index.wxss +4 -0
- package/miniprogram_dist/Lottery/components/LotteryResult/WinLottery/index.js +2 -1
- package/miniprogram_dist/Lottery/components/LotteryResult/WinLottery/index.wxml +2 -2
- package/miniprogram_dist/Lottery/components/LotteryResult/index.js +22 -22
- package/miniprogram_dist/Lottery/components/NobodyAttend/index.wxml +1 -1
- package/miniprogram_dist/Lottery/components/Winners/index.js +3 -1
- package/miniprogram_dist/Lottery/components/Winners/index.wxml +2 -1
- package/miniprogram_dist/Lottery/constants.js +2 -1
- package/miniprogram_dist/Lottery/store/reducer.js +6 -0
- package/miniprogram_dist/Lottery/utils.js +4 -0
- package/miniprogram_dist/PayModule/index/index.js +1 -0
- package/miniprogram_dist/SharePoster/PosterDom/index.js +37 -2
- package/miniprogram_dist/SharePoster/PosterDom/index.wxml +2 -2
- package/miniprogram_dist/SharePoster/PosterDom/index.wxss +3 -3
- package/miniprogram_dist/SharePoster/components/saveTip/index.js +40 -0
- package/miniprogram_dist/SharePoster/components/saveTip/index.json +5 -0
- package/miniprogram_dist/SharePoster/components/saveTip/index.less +0 -0
- package/miniprogram_dist/SharePoster/components/saveTip/index.wxml +6 -0
- package/miniprogram_dist/SharePoster/components/saveTip/index.wxss +21 -0
- package/miniprogram_dist/SharePoster/components/settingModal/index.js +38 -0
- package/miniprogram_dist/SharePoster/components/settingModal/index.json +5 -0
- package/miniprogram_dist/SharePoster/components/settingModal/index.less +0 -0
- package/miniprogram_dist/SharePoster/components/settingModal/index.wxml +9 -0
- package/miniprogram_dist/SharePoster/components/settingModal/index.wxss +45 -0
- package/miniprogram_dist/SharePoster/components/shareCircleTip/index.js +35 -0
- package/miniprogram_dist/SharePoster/components/shareCircleTip/index.json +5 -0
- package/miniprogram_dist/SharePoster/components/shareCircleTip/index.wxml +5 -0
- package/miniprogram_dist/SharePoster/components/shareCircleTip/index.wxss +35 -0
- package/miniprogram_dist/SharePoster/components/unauthorizedModal/index.js +35 -0
- package/miniprogram_dist/SharePoster/components/unauthorizedModal/index.json +5 -0
- package/miniprogram_dist/SharePoster/components/unauthorizedModal/index.wxml +11 -0
- package/miniprogram_dist/SharePoster/components/unauthorizedModal/index.wxss +51 -0
- package/miniprogram_dist/SharePoster/sharePopup/index.js +327 -5
- package/miniprogram_dist/SharePoster/sharePopup/index.json +5 -1
- package/miniprogram_dist/SharePoster/sharePopup/index.wxml +37 -28
- package/miniprogram_dist/SharePoster/sharePopup/index.wxss +27 -13
- package/miniprogram_dist/Sku/commSelect/index.js +2 -1
- package/miniprogram_dist/Sku/index/index.js +2 -1
- package/miniprogram_dist/TeacherGoodsList/index.js +3 -3
- package/miniprogram_dist/common/api/confirmOrder.js +3 -3
- package/miniprogram_dist/common/api/pay.js +2 -2
- package/miniprogram_dist/common/api/payComplete.js +1 -1
- package/miniprogram_dist/common/api/sku.js +4 -4
- package/miniprogram_dist/common/utils/constants.js +2 -0
- package/miniprogram_dist/common/utils/helper.js +2 -1
- package/miniprogram_dist/coupon/components/CouponItem/index.less +2 -2
- package/miniprogram_dist/coupon/components/CouponItem/index.wxss +2 -2
- package/miniprogram_dist/coupon/components/CouponSelect/index.less +3 -3
- package/miniprogram_dist/coupon/components/CouponSelect/index.wxss +3 -3
- package/miniprogram_dist/coupon/index.js +10 -1
- package/package.json +2 -2
- package/src/AliveInvite/LiveRoomVertical/index.js +1 -1
- package/src/ConfirmOrder/components/ConfirmOrderContent/index.js +11 -0
- package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.js +2 -20
- package/src/ConfirmOrder/components/GoodsInfo/index.js +2 -1
- package/src/ConfirmOrder/components/PickupSelect/index.less +18 -3
- package/src/ConfirmOrder/components/PickupSelect/index.wxml +4 -2
- package/src/ConfirmOrder/components/PickupSelect/index.wxss +17 -2
- package/src/CouponList/components/CouponItem/index.js +4 -2
- package/src/CouponList/couponColumn/index.js +3 -0
- package/src/CouponList/couponColumn/index.wxml +1 -0
- package/src/GoodsItem/index.js +9 -24
- package/src/GoodsItem/index.wxml +2 -2
- package/src/LiveGoodsList/index.js +26 -17
- package/src/LiveGoodsList/index.wxml +2 -2
- package/src/Lottery/components/AddressCollection/index.js +11 -8
- package/src/Lottery/components/CommonPopup/index.less +4 -4
- package/src/Lottery/components/CommonPopup/index.wxss +4 -4
- package/src/Lottery/components/LotteryInfo/index.js +17 -11
- package/src/Lottery/components/LotteryInfo/index.wxml +2 -2
- package/src/Lottery/components/LotteryPopups/index.js +19 -0
- package/src/Lottery/components/LotteryResult/LosingLottery/index.js +4 -1
- package/src/Lottery/components/LotteryResult/LosingLottery/index.less +4 -0
- package/src/Lottery/components/LotteryResult/LosingLottery/index.wxml +3 -4
- package/src/Lottery/components/LotteryResult/LosingLottery/index.wxss +4 -0
- package/src/Lottery/components/LotteryResult/WinLottery/index.js +2 -1
- package/src/Lottery/components/LotteryResult/WinLottery/index.wxml +2 -2
- package/src/Lottery/components/LotteryResult/index.js +22 -22
- package/src/Lottery/components/NobodyAttend/index.wxml +1 -1
- package/src/Lottery/components/Winners/index.js +3 -1
- package/src/Lottery/components/Winners/index.wxml +2 -1
- package/src/Lottery/constants.js +2 -1
- package/src/Lottery/store/reducer.js +6 -0
- package/src/Lottery/utils.js +4 -0
- package/src/PayModule/index/index.js +1 -0
- package/src/SharePoster/PosterDom/index.js +37 -2
- package/src/SharePoster/PosterDom/index.wxml +2 -2
- package/src/SharePoster/PosterDom/index.wxss +3 -3
- package/src/SharePoster/components/saveTip/index.js +40 -0
- package/src/SharePoster/components/saveTip/index.json +5 -0
- package/src/SharePoster/components/saveTip/index.less +0 -0
- package/src/SharePoster/components/saveTip/index.wxml +6 -0
- package/src/SharePoster/components/saveTip/index.wxss +21 -0
- package/src/SharePoster/components/settingModal/index.js +38 -0
- package/src/SharePoster/components/settingModal/index.json +5 -0
- package/src/SharePoster/components/settingModal/index.less +0 -0
- package/src/SharePoster/components/settingModal/index.wxml +9 -0
- package/src/SharePoster/components/settingModal/index.wxss +46 -0
- package/src/SharePoster/components/shareCircleTip/index.js +35 -0
- package/src/SharePoster/components/shareCircleTip/index.json +5 -0
- package/src/SharePoster/components/shareCircleTip/index.wxml +5 -0
- package/src/SharePoster/components/shareCircleTip/index.wxss +35 -0
- package/src/SharePoster/components/unauthorizedModal/index.js +35 -0
- package/src/SharePoster/components/unauthorizedModal/index.json +5 -0
- package/src/SharePoster/components/unauthorizedModal/index.wxml +11 -0
- package/src/SharePoster/components/unauthorizedModal/index.wxss +52 -0
- package/src/SharePoster/sharePopup/index.js +327 -5
- package/src/SharePoster/sharePopup/index.json +5 -1
- package/src/SharePoster/sharePopup/index.wxml +37 -28
- package/src/SharePoster/sharePopup/index.wxss +27 -13
- package/src/Sku/commSelect/index.js +2 -1
- package/src/Sku/index/index.js +2 -1
- package/src/TeacherGoodsList/index.js +3 -3
- package/src/common/api/confirmOrder.js +3 -3
- package/src/common/api/pay.js +2 -2
- package/src/common/api/payComplete.js +1 -1
- package/src/common/api/sku.js +4 -4
- package/src/common/utils/constants.js +2 -0
- package/src/common/utils/helper.js +2 -1
- package/src/coupon/components/CouponItem/index.less +2 -2
- package/src/coupon/components/CouponItem/index.wxss +2 -2
- package/src/coupon/components/CouponSelect/index.less +3 -3
- package/src/coupon/components/CouponSelect/index.wxss +3 -3
- package/src/coupon/index.js +10 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -3,7 +3,8 @@ build_test:
|
|
|
3
3
|
stage: build
|
|
4
4
|
only:
|
|
5
5
|
- dev
|
|
6
|
-
-
|
|
6
|
+
- feature/live_marketing_iteration
|
|
7
|
+
- fix/record-lottery
|
|
7
8
|
tags:
|
|
8
9
|
- fe-group-prod-runner-2
|
|
9
10
|
script:
|
|
@@ -13,7 +14,6 @@ build_test:
|
|
|
13
14
|
- export version=${version:2:$[${#version}-4]}
|
|
14
15
|
- export message=$(git log --pretty=format:%s -1)
|
|
15
16
|
- export author=$(git log --pretty=format:%an -1)
|
|
16
|
-
- if [ $CI_COMMIT_REF_NAME != "master" ] && [ $(echo $version | grep -E "r|t" ) != "" ]; then echo "正常发包"; else exit 0; fi
|
|
17
17
|
- cnpm i
|
|
18
18
|
- npm run build
|
|
19
19
|
- cnpm publish
|
|
@@ -219,6 +219,17 @@ Component({
|
|
|
219
219
|
},
|
|
220
220
|
},
|
|
221
221
|
observers: {
|
|
222
|
+
distributionMode(val) {
|
|
223
|
+
if (val === 1) {
|
|
224
|
+
this.setData({
|
|
225
|
+
express_type: val
|
|
226
|
+
})
|
|
227
|
+
} else if (val === 2) {
|
|
228
|
+
this.setData({
|
|
229
|
+
express_type: val
|
|
230
|
+
})
|
|
231
|
+
}
|
|
232
|
+
},
|
|
222
233
|
marketingData(marketingData) {
|
|
223
234
|
// 这里的逻辑应该是存在拼团的时候那么payment_type就要赋值为13,如果是限时折扣或者是单买的话,payment_type不做赋值默认为2
|
|
224
235
|
if (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.js
|
|
2
2
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
3
|
+
const {utils} = require("live-mp-tools");
|
|
3
4
|
|
|
4
5
|
Component({
|
|
5
6
|
behaviors: [computedBehavior],
|
|
@@ -51,28 +52,9 @@ Component({
|
|
|
51
52
|
},
|
|
52
53
|
computed: {
|
|
53
54
|
realSrc(data) {
|
|
54
|
-
|
|
55
55
|
// 腾讯云图片才会支持去压缩裁剪
|
|
56
56
|
if (data.src.indexOf("myqcloud") > 0 && data.showCompress) {
|
|
57
|
-
|
|
58
|
-
const curSrc = `${formatSrc.replace("file", "picsh")}?imageView2`;
|
|
59
|
-
const compressType = data.compressType ? `/${data.compressType}` : "";
|
|
60
|
-
const compressWidth = data.compressWidth
|
|
61
|
-
? `/w/${data.compressWidth}`
|
|
62
|
-
: "";
|
|
63
|
-
const compressHeight = data.compressHeight
|
|
64
|
-
? `/h/${data.compressHeight}`
|
|
65
|
-
: "";
|
|
66
|
-
const compress = data.compress ? `/q/${data.compress}` : "";
|
|
67
|
-
const format = data.format ? `/format/${data.format}` : "";
|
|
68
|
-
return (
|
|
69
|
-
curSrc +
|
|
70
|
-
compressType +
|
|
71
|
-
compressWidth +
|
|
72
|
-
compressHeight +
|
|
73
|
-
compress +
|
|
74
|
-
format
|
|
75
|
-
);
|
|
57
|
+
return utils.replaceCDN(data.src, `?imageView2/2/w/${data.compressWidth || 400}/h/${data.compressHeight || 400}/q/${data.compress || 100}`)
|
|
76
58
|
} else {
|
|
77
59
|
return data.src;
|
|
78
60
|
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
SPECIAL_COLUMN,
|
|
16
16
|
E_BOOK,
|
|
17
17
|
TRAINING_CAMP,
|
|
18
|
+
SERVICE_GOODS,
|
|
18
19
|
SVIP_SPU_TYPE,
|
|
19
20
|
} from "../../../common/utils/constants";
|
|
20
21
|
import {
|
|
@@ -140,7 +141,7 @@ Component({
|
|
|
140
141
|
}
|
|
141
142
|
},
|
|
142
143
|
showStepper(data) {
|
|
143
|
-
let spuTypes = [ENTITY_GOODS, VALUE_COUPON];
|
|
144
|
+
let spuTypes = [ENTITY_GOODS, VALUE_COUPON, SERVICE_GOODS];
|
|
144
145
|
return (
|
|
145
146
|
(spuTypes.includes(data.baseInfo?.spu_type) || data.sendFriend) &&
|
|
146
147
|
!data.goodsInfo.is_goods_package
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
.pickup-select-content {
|
|
2
2
|
.van-cell__value {
|
|
3
3
|
flex: 3;
|
|
4
|
-
text-align: right;
|
|
5
4
|
}
|
|
6
|
-
.
|
|
7
|
-
|
|
5
|
+
.right {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: flex-end;
|
|
9
|
+
.custom-title {
|
|
10
|
+
max-width: 450rpx;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
margin-left: 16rpx;
|
|
15
|
+
}
|
|
16
|
+
.custom-site {
|
|
17
|
+
max-width: 450rpx;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
margin-left: 16rpx;
|
|
22
|
+
}
|
|
8
23
|
}
|
|
9
24
|
}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
<view slot="title">
|
|
6
6
|
<van-tag color="#EBF1FF" text-color="#105CFB">自提</van-tag>
|
|
7
7
|
</view>
|
|
8
|
-
<view class="
|
|
9
|
-
|
|
8
|
+
<view class="right">
|
|
9
|
+
<view class="custom-title">{{ setPlace_name }}</view>
|
|
10
|
+
<view class="custom-site">{{ setPlace_area }}</view>
|
|
11
|
+
</view>
|
|
10
12
|
</van-cell>
|
|
11
13
|
</van-cell-group>
|
|
12
14
|
</view>
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
.pickup-select-content .van-cell__value {
|
|
2
2
|
flex: 3;
|
|
3
|
-
text-align: right;
|
|
4
3
|
}
|
|
5
|
-
.pickup-select-content .
|
|
4
|
+
.pickup-select-content .right {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: flex-end;
|
|
8
|
+
}
|
|
9
|
+
.pickup-select-content .right .custom-title {
|
|
10
|
+
max-width: 450rpx;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
margin-left: 16rpx;
|
|
15
|
+
}
|
|
16
|
+
.pickup-select-content .right .custom-site {
|
|
17
|
+
max-width: 450rpx;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
text-overflow: ellipsis;
|
|
6
21
|
margin-left: 16rpx;
|
|
7
22
|
}
|
|
@@ -19,7 +19,8 @@ Component({
|
|
|
19
19
|
},
|
|
20
20
|
couponType: {
|
|
21
21
|
// 优惠券 couponType: 1-领取 2-继续领 3-已领完 4-已过期(领取失败) 5-已结束 6-已达上限 7、已失效
|
|
22
|
-
type:
|
|
22
|
+
type: Number,
|
|
23
|
+
optionalTypes: [String],
|
|
23
24
|
value: 1
|
|
24
25
|
},
|
|
25
26
|
aliveInfo: { // 直播间信息
|
|
@@ -162,11 +163,12 @@ Component({
|
|
|
162
163
|
has_received: true
|
|
163
164
|
})
|
|
164
165
|
// 达到领取上限,隐藏按钮
|
|
165
|
-
if (dataInfo && dataInfo.receive_rule === dataInfo.current_user_received_count) {
|
|
166
|
+
if (dataInfo.receive_rule && dataInfo.receive_rule === dataInfo.current_user_received_count) {
|
|
166
167
|
this.setData({
|
|
167
168
|
coupon_type: 6
|
|
168
169
|
})
|
|
169
170
|
}
|
|
171
|
+
this.triggerEvent('receivedSuccess') //优惠券领取成功抛出方法用于直播间热度上报
|
|
170
172
|
wx.showToast({
|
|
171
173
|
title: '领取成功',
|
|
172
174
|
icon: 'none'
|
|
@@ -8,27 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import {debounce} from "../common/utils/index"
|
|
10
10
|
import { getUserPermission, snapCheck } from "../common/api/liveGoodsList"
|
|
11
|
-
|
|
11
|
+
const {utils, sensorLog } = require("live-mp-tools");
|
|
12
12
|
|
|
13
13
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
14
|
-
const SPU_TYPE = {
|
|
15
|
-
1:"ITX",
|
|
16
|
-
2:"ADO",
|
|
17
|
-
3:"VDO",
|
|
18
|
-
4:"LVE",
|
|
19
|
-
5:"MMB",
|
|
20
|
-
6:"SPC",
|
|
21
|
-
8:"BSC",
|
|
22
|
-
20:"EBK",
|
|
23
|
-
25:"TCP",
|
|
24
|
-
29:"OLC",
|
|
25
|
-
21:"ENT",
|
|
26
|
-
35:"BTK",
|
|
27
|
-
41:"VCP",
|
|
28
|
-
42:"OLP",
|
|
29
|
-
45:"ALC"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
14
|
|
|
33
15
|
Component({
|
|
34
16
|
behaviors: [computedBehavior],
|
|
@@ -183,12 +165,12 @@ Component({
|
|
|
183
165
|
},
|
|
184
166
|
//销量/订阅。只有 实物商品 21 、专栏 6、大专栏 8、会员 5 展示,受B端店铺设置(hide_sub_count):隐藏商品销量控制 0-显示 1-隐藏
|
|
185
167
|
hasSaleNum(data){
|
|
186
|
-
return [21,6,8,5,41].indexOf(data.goodsItem.resource_type) > -1 && !data.goodsItem.hide_sub_count && data.goodsItem.order_num > 0
|
|
168
|
+
return [21,6,8,5,41,68].indexOf(data.goodsItem.resource_type) > -1 && !data.goodsItem.hide_sub_count && data.goodsItem.order_num > 0
|
|
187
169
|
},
|
|
188
170
|
//销量/订阅。只有 实物商品 21 、专栏 6、大专栏 8、会员 5 展示
|
|
189
171
|
saleNum(data){
|
|
190
172
|
//实物商品
|
|
191
|
-
if(data.goodsItem.resource_type === 21 || data.goodsItem.resource_type === 41){
|
|
173
|
+
if(data.goodsItem.resource_type === 21 || data.goodsItem.resource_type === 41 || data.goodsItem.resource_type === 68){
|
|
192
174
|
return ' 已售 ' + (data.goodsItem.order_num || 0)
|
|
193
175
|
} else if(data.goodsItem.resource_type === 6 || data.goodsItem.resource_type === 8 || data.goodsItem.resource_type === 5){
|
|
194
176
|
return ' 订阅 ' + (data.goodsItem.order_num || 0)
|
|
@@ -250,6 +232,9 @@ Component({
|
|
|
250
232
|
}else {
|
|
251
233
|
return ''
|
|
252
234
|
}
|
|
235
|
+
},
|
|
236
|
+
filterSrc(data){
|
|
237
|
+
return utils.replaceCDN(data.goodsItem.img_url, '?imageMogr2/thumbnail/400x400>/ignore-error/1')
|
|
253
238
|
}
|
|
254
239
|
},
|
|
255
240
|
/**
|
|
@@ -339,8 +324,8 @@ Component({
|
|
|
339
324
|
},
|
|
340
325
|
// 判断权益
|
|
341
326
|
judgePermission: debounce(async function (permission){
|
|
342
|
-
// 实物21 可多次购买,去详情页;
|
|
343
|
-
if(
|
|
327
|
+
// 实物21 有价优惠券41 可多次购买,去详情页; 直播商品4不管有没有权益都去详情页啦。
|
|
328
|
+
if([41, 4, 21].indexOf(Number(this.data.goodsItem.resource_type)) > -1){
|
|
344
329
|
this.toDetails()
|
|
345
330
|
return
|
|
346
331
|
}
|
|
@@ -382,7 +367,7 @@ getUserPermission(){
|
|
|
382
367
|
spu_id: this.data.goodsItem.resource_id,
|
|
383
368
|
resource_type: this.data.goodsItem.resource_type,
|
|
384
369
|
resource_id: this.data.goodsItem.id,
|
|
385
|
-
spu_type:
|
|
370
|
+
spu_type: this.data.goodsItem.spu_type,
|
|
386
371
|
sku,
|
|
387
372
|
count: 1,
|
|
388
373
|
isAlive:1,
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
<image alt=""
|
|
16
16
|
class="goods-img"
|
|
17
17
|
mode="aspectFit"
|
|
18
|
-
src="{{
|
|
18
|
+
src="{{filterSrc}}" />
|
|
19
19
|
<text class="index">{{index + 1}}</text>
|
|
20
|
-
<text class="goods-type">{{goodsItem.
|
|
20
|
+
<text class="goods-type">{{goodsItem.resource_type_name}}</text>
|
|
21
21
|
<image wx:if="{{ isShowExamplaining }}" class="goods-explaining" src="../../common/assets/images/liveGoodsList/explaining.png" />
|
|
22
22
|
</view>
|
|
23
23
|
<view class="right">
|
|
@@ -104,7 +104,8 @@ Component({
|
|
|
104
104
|
formExplainingGoods: {}, //小卡片拿不到一些字段,从props接受到讲解中的商品resourceID 再从接口返回里面取
|
|
105
105
|
explainingGoodsIndex: 1,
|
|
106
106
|
coupon_switch: true,
|
|
107
|
-
currentGoodsItem: {}
|
|
107
|
+
currentGoodsItem: {},
|
|
108
|
+
componentsState: 1
|
|
108
109
|
},
|
|
109
110
|
lifetimes: {
|
|
110
111
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
@@ -169,7 +170,8 @@ Component({
|
|
|
169
170
|
if(this.data.finished || this._freshing){
|
|
170
171
|
return
|
|
171
172
|
}
|
|
172
|
-
|
|
173
|
+
let onScrolltolower = true
|
|
174
|
+
this.getGoodsList(onScrolltolower)
|
|
173
175
|
},
|
|
174
176
|
getExplainingGoodsInfo() {
|
|
175
177
|
// 打散获取讲解中商品的请求,缓解后台压力
|
|
@@ -199,7 +201,8 @@ Component({
|
|
|
199
201
|
})
|
|
200
202
|
}, this.getRandomInt(0, 1000));
|
|
201
203
|
},
|
|
202
|
-
getGoodsList(){
|
|
204
|
+
getGoodsList(onScrolltolower = false){
|
|
205
|
+
let state = this.data.componentsState
|
|
203
206
|
let params = {
|
|
204
207
|
alive_id: this.data.aliveInfo.alive_id,
|
|
205
208
|
type: 1,
|
|
@@ -210,16 +213,14 @@ Component({
|
|
|
210
213
|
getGoodsList(params).then(res=>{
|
|
211
214
|
let { data, code } = res.data
|
|
212
215
|
if (code === 0) {
|
|
216
|
+
// 关闭弹窗的时候返回的数据丢弃 // 上拉加载与下拉刷新一起触发时丢弃上拉加载数据
|
|
217
|
+
if(state !==this.data.componentsState || (this._freshing === true && onScrolltolower) ) {
|
|
218
|
+
return
|
|
219
|
+
}
|
|
213
220
|
var total = data[0] ? data[0].total : this.data.total
|
|
214
221
|
var finishedTxt = "加载中"
|
|
215
222
|
var finished = false
|
|
216
|
-
|
|
217
|
-
if(this._freshing){
|
|
218
|
-
//下拉加载直接赋值
|
|
219
|
-
this.formatData(data, true)
|
|
220
|
-
}else {
|
|
221
|
-
this.formatData(data)
|
|
222
|
-
}
|
|
223
|
+
this.formatData(data,onScrolltolower)
|
|
223
224
|
// 下拉加载,且数据返回空
|
|
224
225
|
if(this._freshing && data.length === 0){
|
|
225
226
|
finishedTxt = "no-data"
|
|
@@ -243,22 +244,23 @@ Component({
|
|
|
243
244
|
}
|
|
244
245
|
})
|
|
245
246
|
},
|
|
246
|
-
formatData(data,
|
|
247
|
+
formatData(data,onScrolltolower){
|
|
248
|
+
//onScrolltolower代表是上拉加载的标识,网卡的时候有上拉加载与下拉刷新同时请求,上拉加载的数据也push进去的情况。
|
|
247
249
|
let goodsInfo = this.data.goodsInfo
|
|
248
250
|
data.forEach((item,index) => {
|
|
249
251
|
this.formatItem(item)
|
|
250
|
-
if (!
|
|
252
|
+
if (!this._freshing && onScrolltolower) {
|
|
251
253
|
goodsInfo.push(item)
|
|
252
254
|
}
|
|
253
255
|
})
|
|
254
|
-
if (
|
|
256
|
+
if (this._freshing && !onScrolltolower) {
|
|
255
257
|
//下拉刷新的时候直接赋值
|
|
256
258
|
goodsInfo = JSON.parse(JSON.stringify(data))
|
|
257
259
|
}
|
|
258
260
|
this.setData({goodsInfo})
|
|
259
261
|
},
|
|
260
262
|
formatItem(e) {
|
|
261
|
-
e.resourceTypeName =
|
|
263
|
+
e.resourceTypeName = e.resource_type_name // 商品类型
|
|
262
264
|
e.leftStock = e.is_activity && e.now_stock ? e.now_stock : e.stock // 商品库存,活动中且有活动库存就用活动库存
|
|
263
265
|
// 处理未到活动时间的限时折扣
|
|
264
266
|
if (e.activity_type === 3) {
|
|
@@ -286,7 +288,7 @@ Component({
|
|
|
286
288
|
arr.push({
|
|
287
289
|
active: "",
|
|
288
290
|
price: e.price,
|
|
289
|
-
weight: e.price + 0.
|
|
291
|
+
weight: e.price + 0.0003,
|
|
290
292
|
})
|
|
291
293
|
// 活动管理、实物商品、有价优惠券、线下课和课时包不能设置活动库存,其他可以设置活动库存得需要判断是否还剩余活动库存;拼团也不能设置活动库存。
|
|
292
294
|
let notExistNowStock = [9, 21, 41, 29, 42].indexOf(e.resource_type) > -1
|
|
@@ -305,7 +307,7 @@ Component({
|
|
|
305
307
|
//判断超级会员价
|
|
306
308
|
active: "超级会员",
|
|
307
309
|
price: e.svip_price,
|
|
308
|
-
weight: e.svip_price + 0.
|
|
310
|
+
weight: e.svip_price + 0.0002,
|
|
309
311
|
})
|
|
310
312
|
arr.sort((a, b) => a.weight - b.weight)
|
|
311
313
|
let svipAllFree = e.resource_rights_type === 1
|
|
@@ -323,7 +325,7 @@ Component({
|
|
|
323
325
|
}
|
|
324
326
|
e.priceLineShowInt = this.priceInt(e.priceLine) // 展示划线价的整数部分
|
|
325
327
|
e.priceLineShowFlow = this.priceFlow(e.priceLine) // 展示划线的小数部分
|
|
326
|
-
e.entityShowStock = (e.resource_type === 21 || e.resource_type === 41) && e.show_stock // 实物商品库存依赖 B端店铺设置(show_stock):详情页展示不展示剩余件数
|
|
328
|
+
e.entityShowStock = (e.resource_type === 21 || e.resource_type === 41 || e.resource_type === 68) && e.show_stock // 实物商品库存依赖 B端店铺设置(show_stock):详情页展示不展示剩余件数
|
|
327
329
|
e.hasStock = [29,35].indexOf(e.resource_type) > -1 || e.entityShowStock || e.now_stock // 班课、线下课、实物商品、体验课、有活动库存,满足其一即展示库存
|
|
328
330
|
},
|
|
329
331
|
priceInt(val){
|
|
@@ -351,7 +353,14 @@ Component({
|
|
|
351
353
|
showInfoCollection(){
|
|
352
354
|
this.triggerEvent("showInfoCollection")
|
|
353
355
|
},
|
|
356
|
+
// 领取成功优惠券上报热度
|
|
357
|
+
receivedSuccess() {
|
|
358
|
+
this.triggerEvent("receivedSuccess")
|
|
359
|
+
},
|
|
354
360
|
closePop(){
|
|
361
|
+
this.setData({
|
|
362
|
+
componentsState: this.data.componentsState + 1
|
|
363
|
+
})
|
|
355
364
|
this.triggerEvent("closePop")
|
|
356
365
|
},
|
|
357
366
|
gotoPayRecords(){
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<view>
|
|
12
12
|
<custom-popup
|
|
13
13
|
showPopup="{{ show }}"
|
|
14
|
-
customStyle="height: calc(100% -
|
|
14
|
+
customStyle="height: calc(100% - 422rpx);"
|
|
15
15
|
bind:close="closePop"
|
|
16
16
|
overlay="{{false}}">
|
|
17
17
|
<view slot="header">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<!-- 商品列表 start-->
|
|
24
24
|
<scroll-view class="goods-list" scroll-y="true" bindscrolltolower="onScrolltolower" refresher-triggered="{{refreshing}}" bindrefresherrefresh="onLoad" refresher-enabled="{{true}}">
|
|
25
25
|
<!-- 优惠券列表 start -->
|
|
26
|
-
<coupon-list aliveInfo="{{ aliveInfo }}" bind:showPopup="showInfoCollection" sensorReportParams="{{sensorReportParams}}"></coupon-list>
|
|
26
|
+
<coupon-list aliveInfo="{{ aliveInfo }}" bind:showPopup="showInfoCollection" bind:receivedSuccess="receivedSuccess" sensorReportParams="{{sensorReportParams}}"></coupon-list>
|
|
27
27
|
<!-- 优惠券列表 end -->
|
|
28
28
|
<!-- 讲解中的商品 start -->
|
|
29
29
|
<block wx:if="{{showExplainingGoods}}">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {connect} from '../../store/index'
|
|
2
|
-
import {toast} from '../../utils'
|
|
2
|
+
import {toast, hasKey} from '../../utils'
|
|
3
3
|
|
|
4
4
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
5
5
|
|
|
@@ -8,6 +8,8 @@ const mapState = state => ({
|
|
|
8
8
|
addressInfo: state.addressInfo,
|
|
9
9
|
addressSubmitCallback: state.addressSubmitCallback
|
|
10
10
|
})
|
|
11
|
+
|
|
12
|
+
|
|
11
13
|
Component(
|
|
12
14
|
connect(mapState)({
|
|
13
15
|
behaviors: [computedBehavior],
|
|
@@ -20,7 +22,11 @@ Component(
|
|
|
20
22
|
return Object.keys(data.addressQuery).length > 0
|
|
21
23
|
},
|
|
22
24
|
isAddressInfoReady(data) {
|
|
23
|
-
|
|
25
|
+
const { addressInfo } = data
|
|
26
|
+
if(addressInfo.express_type === 2) {
|
|
27
|
+
return hasKey(addressInfo.pickerUserInfo) && hasKey(addressInfo.picksiteInfo)
|
|
28
|
+
}
|
|
29
|
+
return hasKey(addressInfo.addressInfo)
|
|
24
30
|
}
|
|
25
31
|
},
|
|
26
32
|
observers: {},
|
|
@@ -45,16 +51,13 @@ Component(
|
|
|
45
51
|
onStateChange({detail: isEntry}) {
|
|
46
52
|
this.setData({isEntry})
|
|
47
53
|
},
|
|
48
|
-
hasKey(obj) {
|
|
49
|
-
return obj && Object.keys(obj).length > 0
|
|
50
|
-
},
|
|
51
54
|
validateSubmitInfo() {
|
|
52
55
|
const info = this.data.addressInfo
|
|
53
|
-
if (info.express_type === 1 && !
|
|
56
|
+
if (info.express_type === 1 && !hasKey(info.addressInfo)) {
|
|
54
57
|
toast('请先添加收货地址')
|
|
55
58
|
return false
|
|
56
59
|
}
|
|
57
|
-
if (info.express_type === 2 && !(
|
|
60
|
+
if (info.express_type === 2 && !(hasKey(info.pickerUserInfo) && hasKey(info.picksiteInfo))) {
|
|
58
61
|
toast('请完善提货信息')
|
|
59
62
|
return false
|
|
60
63
|
}
|
|
@@ -67,4 +70,4 @@ Component(
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
})
|
|
70
|
-
)
|
|
73
|
+
)
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
&.red {
|
|
18
18
|
// 红色背景的抽奖弹窗顶部超出一部分,高度特殊计算
|
|
19
19
|
overflow: hidden;
|
|
20
|
-
height: calc(100% -
|
|
20
|
+
height: calc(100% - 320rpx);
|
|
21
21
|
background: transparent !important;
|
|
22
22
|
.close-icon {
|
|
23
23
|
top: 136rpx;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
&.orange {
|
|
40
|
-
height: calc(100% -
|
|
40
|
+
height: calc(100% - 422rpx);
|
|
41
41
|
background: transparent !important;
|
|
42
42
|
.close-icon {
|
|
43
43
|
top: 24rpx;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
&.white {
|
|
51
|
-
height: calc(100% -
|
|
51
|
+
height: calc(100% - 422rpx);
|
|
52
52
|
background: #fff;
|
|
53
53
|
.close-icon {
|
|
54
54
|
top: 24rpx;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
// custom-classes
|
|
62
62
|
&.address-collection-popup {
|
|
63
|
-
height: calc(100% -
|
|
63
|
+
height: calc(100% - 422rpx);
|
|
64
64
|
background: #f5f5f5;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
.common-popup.red {
|
|
17
17
|
overflow: hidden;
|
|
18
|
-
height: calc(100% -
|
|
18
|
+
height: calc(100% - 320rpx);
|
|
19
19
|
background: transparent !important;
|
|
20
20
|
}
|
|
21
21
|
.common-popup.red .close-icon {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
background: linear-gradient(to right, #FE8758, #FE9656);
|
|
35
35
|
}
|
|
36
36
|
.common-popup.orange {
|
|
37
|
-
height: calc(100% -
|
|
37
|
+
height: calc(100% - 422rpx);
|
|
38
38
|
background: transparent !important;
|
|
39
39
|
}
|
|
40
40
|
.common-popup.orange .close-icon {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
left: 0;
|
|
46
46
|
}
|
|
47
47
|
.common-popup.white {
|
|
48
|
-
height: calc(100% -
|
|
48
|
+
height: calc(100% - 422rpx);
|
|
49
49
|
background: #fff;
|
|
50
50
|
}
|
|
51
51
|
.common-popup.white .close-icon {
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
height: 240rpx;
|
|
57
57
|
}
|
|
58
58
|
.common-popup.address-collection-popup {
|
|
59
|
-
height: calc(100% -
|
|
59
|
+
height: calc(100% - 422rpx);
|
|
60
60
|
background: #f5f5f5;
|
|
61
61
|
}
|
|
@@ -20,13 +20,14 @@ Component(
|
|
|
20
20
|
data: {
|
|
21
21
|
remotePic,
|
|
22
22
|
prizeInfo: {},
|
|
23
|
-
selectedIndex: 0
|
|
23
|
+
selectedIndex: 0,
|
|
24
|
+
isShowParticipant: 0 //0 不展示,1 展示
|
|
24
25
|
},
|
|
25
26
|
computed: {
|
|
26
27
|
countdownLabel(data) {
|
|
27
28
|
return `${
|
|
28
29
|
data.prizeInfo.prize_activity_num ? `${data.prizeInfo.prize_activity_num}人已参与` : '暂无人参与'
|
|
29
|
-
}
|
|
30
|
+
}`
|
|
30
31
|
},
|
|
31
32
|
joinPrompt(data) {
|
|
32
33
|
const joinBtnMap = {
|
|
@@ -108,7 +109,9 @@ Component(
|
|
|
108
109
|
if (data.code === 0) {
|
|
109
110
|
const prizeInfo = data.data || {}
|
|
110
111
|
this.setData({prizeInfo})
|
|
112
|
+
this.setData({isShowParticipant: prizeInfo.is_show_participant})
|
|
111
113
|
this.store.dispatch({type: 'set_participation_condition', payload: prizeInfo.prize_condition})
|
|
114
|
+
this.store.dispatch({type: 'is_show_participant', payload: prizeInfo.is_show_participant})
|
|
112
115
|
}
|
|
113
116
|
})
|
|
114
117
|
.catch(err => {
|
|
@@ -124,22 +127,25 @@ Component(
|
|
|
124
127
|
app_id: this.data.baseInfo.app_id, // 店铺id
|
|
125
128
|
alive_id: this.data.baseInfo.alive_id,
|
|
126
129
|
user_id: this.data.baseInfo.user_id,
|
|
127
|
-
prize_id: this.data.prizeInfo.prize_id
|
|
130
|
+
prize_id: this.data.prizeInfo.prize_id,
|
|
131
|
+
type: 1
|
|
128
132
|
}
|
|
129
133
|
joinCommentLottery(params)
|
|
130
134
|
.then(({data}) => {
|
|
131
|
-
if (data.code
|
|
132
|
-
|
|
133
|
-
this.store.dispatch({type: 'hide_lottery_info'})
|
|
134
|
-
if (prizeCondition === PARTICIPATION_CONDITION.SPECIFY_COMMENT) {
|
|
135
|
-
eventBus.emit('input_change', this.data.lotteryInfo.prize_param.ext.content)
|
|
136
|
-
}
|
|
137
|
-
eventBus.emit('input_focus')
|
|
135
|
+
if (data.code !== 0) {
|
|
136
|
+
return Promise.reject(data);
|
|
138
137
|
}
|
|
139
138
|
})
|
|
140
139
|
.catch(err => {
|
|
141
140
|
console.error(err)
|
|
142
|
-
})
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
this.store.dispatch({type: 'set_is_ready_to_comment', payload: true})
|
|
144
|
+
this.store.dispatch({type: 'hide_lottery_info'})
|
|
145
|
+
if (prizeCondition === PARTICIPATION_CONDITION.SPECIFY_COMMENT) {
|
|
146
|
+
eventBus.emit('input_change', this.data.lotteryInfo.prize_param.ext.content)
|
|
147
|
+
}
|
|
148
|
+
eventBus.emit('input_focus')
|
|
143
149
|
return
|
|
144
150
|
}
|
|
145
151
|
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
<image class="right-arrow-icon" src="../../../common/assets/images/lottery/white_right_arrow.png" />
|
|
10
10
|
</view>
|
|
11
11
|
</block>
|
|
12
|
-
<text wx:else
|
|
12
|
+
<text wx:else>本次抽奖无人中奖</text>
|
|
13
13
|
</view>
|
|
14
14
|
<view wx:else class="countdown-box">
|
|
15
|
-
<text class="label">{{countdownLabel}}
|
|
15
|
+
<text class="label" wx:if="{{isShowParticipant}}">{{countdownLabel}},</text><text class="label">开奖倒计时</text>
|
|
16
16
|
<lottery-countdown></lottery-countdown>
|
|
17
17
|
</view>
|
|
18
18
|
<view class="prize-box">
|