vhall-mini-sdk 0.1.0 → 0.1.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/lib/components/player/components/online-hot/index.js +2 -2
- package/lib/sdk/main/index.js +1 -0
- package/package.json +2 -4
- package/postinstall.js +21 -51
- package/dist/components/chat/chat-edit/chat-edit.js +0 -127
- package/dist/components/chat/chat-edit/chat-edit.json +0 -4
- package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
- package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
- package/dist/components/chat/chat-item/chat-item.js +0 -253
- package/dist/components/chat/chat-item/chat-item.json +0 -3
- package/dist/components/chat/chat-item/chat-item.wxml +0 -96
- package/dist/components/chat/chat-item/chat-item.wxss +0 -1
- package/dist/components/chat/chat-list/chat-list.js +0 -216
- package/dist/components/chat/chat-list/chat-list.json +0 -6
- package/dist/components/chat/chat-list/chat-list.wxml +0 -9
- package/dist/components/chat/chat-list/chat-list.wxss +0 -1
- package/dist/components/chat/chat.js +0 -98
- package/dist/components/chat/chat.json +0 -7
- package/dist/components/chat/chat.wxml +0 -7
- package/dist/components/chat/chat.wxss +0 -1
- package/dist/components/gift/gift-display/gift-display.js +0 -118
- package/dist/components/gift/gift-display/gift-display.json +0 -3
- package/dist/components/gift/gift-display/gift-display.wxml +0 -16
- package/dist/components/gift/gift-display/gift-display.wxss +0 -1
- package/dist/components/gift/gift-sender/gift-sender.js +0 -63
- package/dist/components/gift/gift-sender/gift-sender.json +0 -6
- package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
- package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
- package/dist/components/introduction/introduction.js +0 -43
- package/dist/components/introduction/introduction.json +0 -3
- package/dist/components/introduction/introduction.wxml +0 -8
- package/dist/components/introduction/introduction.wxss +0 -1
- package/dist/components/invite-rank/img/bronze.png +0 -0
- package/dist/components/invite-rank/img/gold.png +0 -0
- package/dist/components/invite-rank/img/silver.png +0 -0
- package/dist/components/invite-rank/index.js +0 -135
- package/dist/components/invite-rank/index.json +0 -8
- package/dist/components/invite-rank/index.wxml +0 -42
- package/dist/components/invite-rank/index.wxss +0 -1
- package/dist/components/invite-rank/invite-rank-item.js +0 -12
- package/dist/components/invite-rank/invite-rank-item.json +0 -4
- package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
- package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
- package/dist/components/invite-rank/my-invite-detail.js +0 -82
- package/dist/components/invite-rank/my-invite-detail.json +0 -7
- package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
- package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
- package/dist/components/invite-rank/util.wxs +0 -21
- package/dist/components/live-landscape/live-landscape.js +0 -216
- package/dist/components/live-landscape/live-landscape.json +0 -39
- package/dist/components/live-landscape/live-landscape.wxml +0 -73
- package/dist/components/live-landscape/live-landscape.wxss +0 -1
- package/dist/components/live-portrait/live-portrait.js +0 -274
- package/dist/components/live-portrait/live-portrait.json +0 -38
- package/dist/components/live-portrait/live-portrait.wxml +0 -106
- package/dist/components/live-portrait/live-portrait.wxss +0 -1
- package/dist/components/lottery/lottery-accept/index.js +0 -249
- package/dist/components/lottery/lottery-accept/index.json +0 -4
- package/dist/components/lottery/lottery-accept/index.wxml +0 -49
- package/dist/components/lottery/lottery-accept/index.wxss +0 -1
- package/dist/components/lottery/lottery-history/index.js +0 -36
- package/dist/components/lottery/lottery-history/index.json +0 -3
- package/dist/components/lottery/lottery-history/index.wxml +0 -28
- package/dist/components/lottery/lottery-history/index.wxss +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
- package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
- package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
- package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
- package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
- package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
- package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
- package/dist/components/lottery/lottery-winners/index.js +0 -101
- package/dist/components/lottery/lottery-winners/index.json +0 -4
- package/dist/components/lottery/lottery-winners/index.wxml +0 -39
- package/dist/components/lottery/lottery-winners/index.wxss +0 -1
- package/dist/components/lottery/lottery.js +0 -388
- package/dist/components/lottery/lottery.json +0 -11
- package/dist/components/lottery/lottery.wxml +0 -78
- package/dist/components/lottery/lottery.wxss +0 -1
- package/dist/components/lottery/wheel.json +0 -49
- package/dist/components/mall-reward/common/reward-card.wxss +0 -0
- package/dist/components/mall-reward/duration-icon/index.js +0 -101
- package/dist/components/mall-reward/duration-icon/index.json +0 -3
- package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
- package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
- package/dist/components/mall-reward/f-count-down/index.js +0 -61
- package/dist/components/mall-reward/f-count-down/index.json +0 -3
- package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
- package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
- package/dist/components/mall-reward/f-empty/index.js +0 -11
- package/dist/components/mall-reward/f-empty/index.json +0 -3
- package/dist/components/mall-reward/f-empty/index.wxml +0 -8
- package/dist/components/mall-reward/f-empty/index.wxss +0 -1
- package/dist/components/mall-reward/f-history/index.js +0 -84
- package/dist/components/mall-reward/f-history/index.json +0 -4
- package/dist/components/mall-reward/f-history/index.wxml +0 -38
- package/dist/components/mall-reward/f-history/index.wxss +0 -1
- package/dist/components/mall-reward/f-open/index.js +0 -36
- package/dist/components/mall-reward/f-open/index.json +0 -3
- package/dist/components/mall-reward/f-open/index.wxml +0 -10
- package/dist/components/mall-reward/f-open/index.wxss +0 -1
- package/dist/components/mall-reward/f-receive/index.js +0 -36
- package/dist/components/mall-reward/f-receive/index.json +0 -3
- package/dist/components/mall-reward/f-receive/index.wxml +0 -9
- package/dist/components/mall-reward/f-receive/index.wxss +0 -1
- package/dist/components/mall-reward/index.js +0 -374
- package/dist/components/mall-reward/index.json +0 -8
- package/dist/components/mall-reward/index.wxml +0 -4
- package/dist/components/mall-reward/index.wxss +0 -0
- package/dist/components/mall-reward/main-popup/index.js +0 -46
- package/dist/components/mall-reward/main-popup/index.json +0 -12
- package/dist/components/mall-reward/main-popup/index.wxml +0 -16
- package/dist/components/mall-reward/main-popup/index.wxss +0 -1
- package/dist/components/player/assets/image/arrow-left.png +0 -0
- package/dist/components/player/assets/image/arrow-right.png +0 -0
- package/dist/components/player/assets/image/enterFullScreen.png +0 -0
- package/dist/components/player/assets/image/exitFullScreen.png +0 -0
- package/dist/components/player/assets/image/fullscreen_1.png +0 -0
- package/dist/components/player/assets/image/fullscreen_2.png +0 -0
- package/dist/components/player/assets/image/pause.png +0 -0
- package/dist/components/player/assets/image/pause_1.png +0 -0
- package/dist/components/player/assets/image/play.png +0 -0
- package/dist/components/player/assets/image/play_1.png +0 -0
- package/dist/components/player/assets/image/refresh.png +0 -0
- package/dist/components/player/assets/image/refresh_1.png +0 -0
- package/dist/components/player/assets/image/subtitle_close.png +0 -0
- package/dist/components/player/assets/image/subtitle_default.png +0 -0
- package/dist/components/player/assets/image/volume-off.png +0 -0
- package/dist/components/player/assets/image/volume-on.png +0 -0
- package/dist/components/player/common/config.js +0 -7
- package/dist/components/player/common/veComponent.js +0 -4
- package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
- package/dist/components/player/components/barrage/barrage-dom.js +0 -471
- package/dist/components/player/components/barrage/index.js +0 -62
- package/dist/components/player/components/barrage/index.json +0 -4
- package/dist/components/player/components/barrage/index.wxml +0 -39
- package/dist/components/player/components/barrage/index.wxss +0 -1
- package/dist/components/player/components/barrage/utils.js +0 -71
- package/dist/components/player/components/controls/controls.js +0 -93
- package/dist/components/player/components/controls/controls.json +0 -6
- package/dist/components/player/components/controls/controls.wxml +0 -60
- package/dist/components/player/components/controls/controls.wxss +0 -1
- package/dist/components/player/components/danmaku/danmaku.js +0 -23
- package/dist/components/player/components/danmaku/danmaku.json +0 -4
- package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
- package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
- package/dist/components/player/components/error/error.js +0 -15
- package/dist/components/player/components/error/error.json +0 -3
- package/dist/components/player/components/error/error.wxml +0 -6
- package/dist/components/player/components/error/error.wxss +0 -1
- package/dist/components/player/components/loading/loading.js +0 -9
- package/dist/components/player/components/loading/loading.json +0 -3
- package/dist/components/player/components/loading/loading.wxml +0 -4
- package/dist/components/player/components/loading/loading.wxss +0 -1
- package/dist/components/player/components/main/extensions/data.js +0 -8
- package/dist/components/player/components/main/extensions/export.js +0 -83
- package/dist/components/player/components/main/extensions/methods.js +0 -110
- package/dist/components/player/components/main/extensions/observers.js +0 -41
- package/dist/components/player/components/main/extensions/props.js +0 -177
- package/dist/components/player/components/main/index.js +0 -44
- package/dist/components/player/components/main/index.json +0 -4
- package/dist/components/player/components/main/index.wxml +0 -7
- package/dist/components/player/components/main/index.wxss +0 -1
- package/dist/components/player/components/marquee/marquee.js +0 -304
- package/dist/components/player/components/marquee/marquee.json +0 -4
- package/dist/components/player/components/marquee/marquee.wxml +0 -14
- package/dist/components/player/components/marquee/marquee.wxss +0 -1
- package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
- package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
- package/dist/components/player/components/online-hot/index.js +0 -66
- package/dist/components/player/components/online-hot/index.json +0 -3
- package/dist/components/player/components/online-hot/index.wxml +0 -15
- package/dist/components/player/components/online-hot/index.wxss +0 -1
- package/dist/components/player/components/poster/poster.js +0 -12
- package/dist/components/player/components/poster/poster.json +0 -3
- package/dist/components/player/components/poster/poster.wxml +0 -5
- package/dist/components/player/components/poster/poster.wxss +0 -1
- package/dist/components/player/components/watermark/watermark.js +0 -52
- package/dist/components/player/components/watermark/watermark.json +0 -4
- package/dist/components/player/components/watermark/watermark.wxml +0 -8
- package/dist/components/player/components/watermark/watermark.wxss +0 -1
- package/dist/components/player/extensions/data.js +0 -63
- package/dist/components/player/extensions/export.js +0 -325
- package/dist/components/player/extensions/methods.js +0 -406
- package/dist/components/player/extensions/observers.js +0 -114
- package/dist/components/player/extensions/props.js +0 -162
- package/dist/components/player/player.js +0 -83
- package/dist/components/player/player.json +0 -33
- package/dist/components/player/player.wxml +0 -48
- package/dist/components/player/player.wxss +0 -1
- package/dist/components/praise/praise.js +0 -150
- package/dist/components/praise/praise.json +0 -5
- package/dist/components/praise/praise.wxml +0 -17
- package/dist/components/praise/praise.wxss +0 -1
- package/dist/components/product/product-card/product-card.js +0 -109
- package/dist/components/product/product-card/product-card.json +0 -3
- package/dist/components/product/product-card/product-card.wxml +0 -47
- package/dist/components/product/product-card/product-card.wxss +0 -1
- package/dist/components/product/product-detail/product-detail.js +0 -127
- package/dist/components/product/product-detail/product-detail.json +0 -3
- package/dist/components/product/product-detail/product-detail.wxml +0 -57
- package/dist/components/product/product-detail/product-detail.wxss +0 -1
- package/dist/components/product/product-item/product-item.js +0 -56
- package/dist/components/product/product-item/product-item.json +0 -3
- package/dist/components/product/product-item/product-item.wxml +0 -35
- package/dist/components/product/product-item/product-item.wxss +0 -1
- package/dist/components/product/product-list/product-list.js +0 -67
- package/dist/components/product/product-list/product-list.json +0 -6
- package/dist/components/product/product-list/product-list.wxml +0 -16
- package/dist/components/product/product-list/product-list.wxss +0 -1
- package/dist/components/product/product-order/product-order.js +0 -394
- package/dist/components/product/product-order/product-order.json +0 -3
- package/dist/components/product/product-order/product-order.wxml +0 -75
- package/dist/components/product/product-order/product-order.wxss +0 -1
- package/dist/components/signin/signin-dialog.js +0 -305
- package/dist/components/signin/signin-dialog.json +0 -7
- package/dist/components/signin/signin-dialog.wxml +0 -19
- package/dist/components/signin/signin-dialog.wxss +0 -1
- package/dist/components/top-notify/index.js +0 -14
- package/dist/components/top-notify/index.json +0 -3
- package/dist/components/top-notify/index.wxml +0 -2
- package/dist/components/top-notify/index.wxss +0 -1
- package/dist/pubComponents/countdown/countdown.js +0 -97
- package/dist/pubComponents/countdown/countdown.json +0 -5
- package/dist/pubComponents/countdown/countdown.wxml +0 -19
- package/dist/pubComponents/countdown/countdown.wxss +0 -1
- package/dist/pubComponents/error-page/index.js +0 -146
- package/dist/pubComponents/error-page/index.json +0 -5
- package/dist/pubComponents/error-page/index.wxml +0 -37
- package/dist/pubComponents/error-page/index.wxss +0 -1
- package/dist/pubComponents/popup/popup.js +0 -161
- package/dist/pubComponents/popup/popup.json +0 -5
- package/dist/pubComponents/popup/popup.wxml +0 -17
- package/dist/pubComponents/popup/popup.wxss +0 -1
- package/dist/pubComponents/tabs/index.js +0 -95
- package/dist/pubComponents/tabs/index.json +0 -4
- package/dist/pubComponents/tabs/index.wxml +0 -22
- package/dist/pubComponents/tabs/index.wxss +0 -1
- package/dist/sdk/config/index.js +0 -1
- package/dist/sdk/main/index.js +0 -1
- package/dist/sdk/player/index.js +0 -1
- package/dist/sdk/plugins/ChatServer.js +0 -1
- package/dist/sdk/plugins/CustomMenuServer.js +0 -1
- package/dist/sdk/plugins/InteractServer.js +0 -1
- package/dist/sdk/plugins/InviteCardServer.js +0 -1
- package/dist/sdk/plugins/LotteryServer.js +0 -1
- package/dist/sdk/plugins/MallRewardServer.js +0 -1
- package/dist/sdk/plugins/ProductServer.js +0 -1
- package/dist/shared/RequestUtil.js +0 -1
- package/dist/shared/SerializableMap.js +0 -1
- package/dist/shared/base.server.js +0 -1
- package/dist/shared/cacheUtil.js +0 -1
- package/dist/shared/dateUtil.js +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/mpUtils.js +0 -1
- package/dist/shared/utils.js +0 -1
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
Component({
|
|
2
|
-
properties: {
|
|
3
|
-
visible: {
|
|
4
|
-
type: Boolean,
|
|
5
|
-
value: false,
|
|
6
|
-
},
|
|
7
|
-
lotteryId: {
|
|
8
|
-
type: String,
|
|
9
|
-
value: '',
|
|
10
|
-
},
|
|
11
|
-
sdkInstance: {
|
|
12
|
-
type: Object,
|
|
13
|
-
value: null,
|
|
14
|
-
},
|
|
15
|
-
publishWinner: {
|
|
16
|
-
type: Number,
|
|
17
|
-
value: 0,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
data: {
|
|
22
|
-
acceptType: 1, // 1表单,2客服,3无需领奖
|
|
23
|
-
winForm: [], // 中奖信息表单
|
|
24
|
-
customerServiceInfo: {}, // 客服信息
|
|
25
|
-
verified: false, // 表单是否验证通过
|
|
26
|
-
showSuccess: false, // 是否显示提交成功弹框
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
observers: {
|
|
30
|
-
visible: function (visible) {
|
|
31
|
-
if (visible && this.properties.lotteryId && this.properties.sdkInstance) {
|
|
32
|
-
this.initAcceptConfig();
|
|
33
|
-
} else {
|
|
34
|
-
this.setData({ showSuccess: false });
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
methods: {
|
|
40
|
-
// 获取领奖配置
|
|
41
|
-
async initAcceptConfig() {
|
|
42
|
-
try {
|
|
43
|
-
const lotteryServer = this.properties.sdkInstance.get('lotteryServer');
|
|
44
|
-
const webinarId = this.properties.sdkInstance.store.get('webinarId');
|
|
45
|
-
const res = await lotteryServer.getReceiveAwardSetting({
|
|
46
|
-
lottery_id: this.properties.lotteryId || '',
|
|
47
|
-
webinar_id: webinarId || '',
|
|
48
|
-
});
|
|
49
|
-
if (res.code === 200) {
|
|
50
|
-
const data = res.data;
|
|
51
|
-
if (data.receive_award_way === 1) {
|
|
52
|
-
// 表单领奖
|
|
53
|
-
this.setData({
|
|
54
|
-
acceptType: 1,
|
|
55
|
-
winForm: this.paseFormInfo(data.json_data),
|
|
56
|
-
});
|
|
57
|
-
this.fillUserInfo();
|
|
58
|
-
} else if (data.receive_award_way === 2) {
|
|
59
|
-
// 客服领奖
|
|
60
|
-
this.setData({
|
|
61
|
-
acceptType: 2,
|
|
62
|
-
customerServiceInfo: this.paseCustomerServiceInfo(data.json_data),
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.error('获取领奖配置失败:', err);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
// 解析表单信息
|
|
72
|
-
paseFormInfo(jsonString) {
|
|
73
|
-
let info = [];
|
|
74
|
-
try {
|
|
75
|
-
const jsonObj = JSON.parse(jsonString);
|
|
76
|
-
if (Array.isArray(jsonObj)) {
|
|
77
|
-
jsonObj.map((item) => {
|
|
78
|
-
if (item.field_key == 'phone') {
|
|
79
|
-
item.maxLength = 20;
|
|
80
|
-
} else if (item.field_key == 'name') {
|
|
81
|
-
item.maxLength = 20;
|
|
82
|
-
} else if (item.field_key == 'address') {
|
|
83
|
-
item.maxLength = 50;
|
|
84
|
-
} else {
|
|
85
|
-
item.maxLength = 100;
|
|
86
|
-
}
|
|
87
|
-
item.field_value = '';
|
|
88
|
-
item.error = false;
|
|
89
|
-
info.push(item);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
} catch (e) {
|
|
93
|
-
info = [];
|
|
94
|
-
}
|
|
95
|
-
return info;
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
// 解析客服信息
|
|
99
|
-
paseCustomerServiceInfo(jsonString) {
|
|
100
|
-
let info = {};
|
|
101
|
-
try {
|
|
102
|
-
const jsonObj = JSON.parse(jsonString);
|
|
103
|
-
if (Array.isArray(jsonObj)) {
|
|
104
|
-
jsonObj.forEach((filedItem) => {
|
|
105
|
-
info[filedItem.field_key] = filedItem.placeholder;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
} catch (e) {
|
|
109
|
-
info = {};
|
|
110
|
-
}
|
|
111
|
-
return info;
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
// 验证表单是否可提交
|
|
115
|
-
validateForm() {
|
|
116
|
-
const winForm = this.data.winForm;
|
|
117
|
-
const verified = winForm.every((form) => {
|
|
118
|
-
return !form.is_required || (form.field_value && form.field_value.trim() !== '');
|
|
119
|
-
});
|
|
120
|
-
this.setData({ verified });
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
// 表单输入监听
|
|
124
|
-
onFormInput(e) {
|
|
125
|
-
const { index } = e.currentTarget.dataset;
|
|
126
|
-
const value = e.detail.value;
|
|
127
|
-
const winForm = this.data.winForm;
|
|
128
|
-
winForm[index].field_value = value;
|
|
129
|
-
winForm[index].error = false;
|
|
130
|
-
this.setData({ winForm });
|
|
131
|
-
this.validateForm();
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
// 验证表单
|
|
135
|
-
verify() {
|
|
136
|
-
const winForm = this.data.winForm;
|
|
137
|
-
const errorItem = winForm.find((item) => {
|
|
138
|
-
if (
|
|
139
|
-
item.field_key == 'phone' &&
|
|
140
|
-
((item.field_value != '' && item.field_value != null) || !!item.is_required)
|
|
141
|
-
) {
|
|
142
|
-
const phone = item.field_value.replace(/\s+/g, '');
|
|
143
|
-
// 简单的手机号校验
|
|
144
|
-
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
} else if (!!item.is_required && item.field_value == '') {
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (errorItem) {
|
|
154
|
-
errorItem.error = true;
|
|
155
|
-
this.setData({ winForm });
|
|
156
|
-
wx.showToast({
|
|
157
|
-
title: `请输入正确的信息${errorItem.field}`,
|
|
158
|
-
icon: 'none',
|
|
159
|
-
});
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
return true;
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
// 提交领奖信息
|
|
166
|
-
async submit() {
|
|
167
|
-
if (!this.verify()) return;
|
|
168
|
-
|
|
169
|
-
const winForm = this.data.winForm;
|
|
170
|
-
const remark = winForm.map((item) => ({
|
|
171
|
-
field_value: item.field_value,
|
|
172
|
-
field: item.field,
|
|
173
|
-
field_key: item.field_key,
|
|
174
|
-
is_required: item.is_required,
|
|
175
|
-
is_system: item.is_system,
|
|
176
|
-
placeholder: item.placeholder,
|
|
177
|
-
rank: item.rank,
|
|
178
|
-
}));
|
|
179
|
-
|
|
180
|
-
try {
|
|
181
|
-
const lotteryServer = this.properties.sdkInstance.get('lotteryServer');
|
|
182
|
-
if (!lotteryServer) return;
|
|
183
|
-
const watchInitData = this.properties.sdkInstance.store.get('watchInitData');
|
|
184
|
-
const roomId = watchInitData?.interact?.room_id || '';
|
|
185
|
-
const res = await lotteryServer.submitLotteryAward({
|
|
186
|
-
lottery_user_name: winForm[0]?.field_value || '',
|
|
187
|
-
lottery_user_phone: winForm[1]?.field_value || '',
|
|
188
|
-
lottery_user_remark: JSON.stringify(remark),
|
|
189
|
-
lottery_id: this.properties.lotteryId || '',
|
|
190
|
-
room_id: roomId,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
if (res.code === 200) {
|
|
194
|
-
this.setData({ showSuccess: true });
|
|
195
|
-
this.triggerEvent('success');
|
|
196
|
-
} else {
|
|
197
|
-
wx.showToast({
|
|
198
|
-
title: res.msg || '提交失败',
|
|
199
|
-
icon: 'none',
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
} catch (err) {
|
|
203
|
-
wx.showToast({
|
|
204
|
-
title: '提交失败',
|
|
205
|
-
icon: 'none',
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
// 预填用户信息
|
|
211
|
-
async fillUserInfo() {
|
|
212
|
-
try {
|
|
213
|
-
const lotteryServer = this.properties.sdkInstance.get('lotteryServer');
|
|
214
|
-
if (!lotteryServer) return;
|
|
215
|
-
const res = await lotteryServer.getLotteryUserInfo();
|
|
216
|
-
if (res.code === 200 && res.data) {
|
|
217
|
-
const data = res.data;
|
|
218
|
-
const winForm = this.data.winForm;
|
|
219
|
-
winForm.map((item) => {
|
|
220
|
-
if (item.field_key == 'name') {
|
|
221
|
-
item.field_value = data.lottery_user_name || '';
|
|
222
|
-
item.error = false;
|
|
223
|
-
} else if (item.field_key == 'phone') {
|
|
224
|
-
item.field_value = data.lottery_user_phone || '';
|
|
225
|
-
} else if (item.field_key == 'address') {
|
|
226
|
-
item.field_value = data.lottery_user_address || '';
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
this.setData({ winForm });
|
|
230
|
-
this.validateForm();
|
|
231
|
-
}
|
|
232
|
-
} catch (err) {
|
|
233
|
-
console.error('获取用户信息失败:', err);
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
// 关闭弹框
|
|
238
|
-
close() {
|
|
239
|
-
this.setData({ showSuccess: false });
|
|
240
|
-
this.triggerEvent('close');
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
// 查看中奖名单
|
|
244
|
-
viewWinnersList() {
|
|
245
|
-
this.setData({ showSuccess: false });
|
|
246
|
-
this.triggerEvent('viewWinners');
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<view wx:if="{{visible}}" class="lottery-accept-modal">
|
|
2
|
-
<view class="lottery-accept-mask" bindtap="close"></view>
|
|
3
|
-
<view class="lottery-accept-content">
|
|
4
|
-
<view class="lottery-accept-title">领奖信息</view>
|
|
5
|
-
<!-- 表单领奖 -->
|
|
6
|
-
<view wx:if="{{acceptType === 1}}" class="form-wrap">
|
|
7
|
-
<view class="form">
|
|
8
|
-
<view wx:for="{{winForm}}" wx:key="index" class="form-item">
|
|
9
|
-
<view class="form-item__input {{item.is_required ? 'required' : ''}}">
|
|
10
|
-
<input class="form-input" value="{{item.field_value}}" type="text" maxlength="{{item.maxLength}}" placeholder="{{item.placeholder}}" data-index="{{index}}" bindinput="onFormInput" />
|
|
11
|
-
</view>
|
|
12
|
-
</view>
|
|
13
|
-
</view>
|
|
14
|
-
<button class="vmp-lottery-btn {{verified ? '' : 'disabled'}}" bindtap="submit">
|
|
15
|
-
提交
|
|
16
|
-
</button>
|
|
17
|
-
</view>
|
|
18
|
-
<!-- 客服领奖 -->
|
|
19
|
-
<view wx:if="{{acceptType === 2}}" class="customer-service-container">
|
|
20
|
-
<view wx:if="{{customerServiceInfo.private_number}}" class="wechat">
|
|
21
|
-
{{customerServiceInfo.private_number}}
|
|
22
|
-
</view>
|
|
23
|
-
<image wx:if="{{customerServiceInfo.private_qrcode}}" src="{{customerServiceInfo.private_qrcode}}" class="qrcode" mode="aspectFit" />
|
|
24
|
-
<view wx:if="{{customerServiceInfo.tip_note}}" class="tip">
|
|
25
|
-
{{customerServiceInfo.tip_note}}
|
|
26
|
-
</view>
|
|
27
|
-
<button wx:if="{{publishWinner == 1}}" class="lottery-success-btn" bindtap="viewWinnersList">
|
|
28
|
-
查看中奖名单
|
|
29
|
-
</button>
|
|
30
|
-
</view>
|
|
31
|
-
</view>
|
|
32
|
-
|
|
33
|
-
<!-- 提交成功弹框 -->
|
|
34
|
-
<view wx:if="{{showSuccess}}" class="lottery-success-modal">
|
|
35
|
-
<view class="lottery-success-mask" bindtap="close"></view>
|
|
36
|
-
<view class="lottery-success-content">
|
|
37
|
-
<view class="lottery-success-close" bindtap="close">
|
|
38
|
-
<icon type="cancel" size="24" color="#999" />
|
|
39
|
-
</view>
|
|
40
|
-
<view class="lottery-success-icon">
|
|
41
|
-
<view class="success-check"></view>
|
|
42
|
-
</view>
|
|
43
|
-
<text class="lottery-success-title">信息提交成功</text>
|
|
44
|
-
<button wx:if="{{publishWinner == 1}}" class="lottery-success-btn" bindtap="viewWinnersList">
|
|
45
|
-
查看中奖名单
|
|
46
|
-
</button>
|
|
47
|
-
</view>
|
|
48
|
-
</view>
|
|
49
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.lottery-accept-modal{bottom:0;display:flex;flex-direction:column;justify-content:flex-end;left:0;position:fixed;right:0;top:0;z-index:1000}.lottery-accept-mask{background:rgba(0,0,0,.5);bottom:0;left:0;position:absolute;right:0;top:0}.lottery-accept-content{background:linear-gradient(37.94deg,#fffbe8 3.86%,#fbf0e6 84.36%);border-radius:32rpx 32rpx 0 0;max-height:85vh;overflow-y:auto;padding:0 40rpx 80rpx;position:relative}.lottery-accept-title{color:#333;font-size:1.36rem;font-weight:600;line-height:4.29rem;text-align:center}.customer-service-container{align-items:center;display:flex;flex-direction:column}.customer-service-container .wechat{color:#333;font-size:1.14rem;line-height:1.71rem;text-align:center;word-break:break-all}.customer-service-container .qrcode{height:400rpx;margin-top:40rpx;width:400rpx}.customer-service-container .tip{color:#999;font-size:1rem;line-height:1.43rem;margin-top:30rpx;text-align:center}.form-item{align-items:center;background:#f8f8f8;border-radius:16rpx;display:flex;height:100rpx;margin-bottom:24rpx;overflow:hidden;position:relative}.form-item__input{flex:1;padding-left:80rpx;position:relative}.form-item__input.required:before{color:#ff4d4f;content:"*";display:inline-block;font-size:1.14rem;height:20rpx;left:30rpx;position:absolute;top:50%;transform:translateY(-50%);width:20rpx}.form-input{background:transparent;color:#333;font-size:1.14rem;height:100%;line-height:3.57rem;outline:0;vertical-align:middle}.form-input,.vmp-lottery-btn{box-sizing:border-box;width:100%}.vmp-lottery-btn{align-items:center;background:#fb2626;border:none;border-radius:60rpx;color:#fff;display:flex;font-size:1.29rem;font-weight:700;height:96rpx;justify-content:center;margin:60rpx auto 0}.vmp-lottery-btn.disabled{opacity:.4;pointer-events:none}.lottery-success-modal{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:2000}.lottery-success-mask{background:rgba(0,0,0,.5);bottom:0;left:0;position:absolute;right:0;top:0}.lottery-success-content{align-items:center;background:linear-gradient(37.94deg,#fffbe8 3.86%,#fbf0e6 84.36%);border-radius:32rpx;display:flex;flex-direction:column;padding:80rpx 40rpx;position:relative;width:600rpx}.lottery-success-close{height:48rpx;position:absolute;right:30rpx;top:30rpx;width:48rpx}.lottery-success-close,.lottery-success-icon{align-items:center;display:flex;justify-content:center}.lottery-success-icon{background:linear-gradient(135deg,gold,#ffb700);border-radius:50%;box-shadow:0 8rpx 32rpx rgba(255,183,0,.4);height:160rpx;margin-bottom:40rpx;width:160rpx}.lottery-success-icon .success-check{border-bottom:6rpx solid #fff;border-left:6rpx solid #fff;height:40rpx;margin-top:-20rpx;transform:rotate(-45deg);width:80rpx}.lottery-success-title{color:#333;font-size:1.29rem;font-weight:600;margin-bottom:60rpx}.lottery-success-btn{align-items:center;background:#fb2626;border:none;border-radius:60rpx;color:#fff;display:flex;font-size:1.14rem;font-weight:700;height:88rpx;justify-content:center;width:400rpx}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
Component({
|
|
2
|
-
properties: {
|
|
3
|
-
visible: {
|
|
4
|
-
type: Boolean,
|
|
5
|
-
value: false,
|
|
6
|
-
},
|
|
7
|
-
winLotteryHistory: {
|
|
8
|
-
type: Array,
|
|
9
|
-
value: [],
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
data: {
|
|
14
|
-
defaultLotteryImg: 'https://cnstatic01.e.vhall.com/upload/webinars/spread-imgs/default-lottery.png',
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
methods: {
|
|
18
|
-
takeAward(e) {
|
|
19
|
-
const { index } = e.currentTarget.dataset;
|
|
20
|
-
const lottery = this.properties.winLotteryHistory[index];
|
|
21
|
-
lottery.lottery_id=lottery.id;
|
|
22
|
-
this.triggerEvent('takeAward', lottery);
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
onItemClick(e) {
|
|
26
|
-
const { index } = e.currentTarget.dataset;
|
|
27
|
-
const lottery = this.properties.winLotteryHistory[index];
|
|
28
|
-
lottery.lottery_id = lottery.id;
|
|
29
|
-
this.triggerEvent('itemClick', lottery);
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
close() {
|
|
33
|
-
this.triggerEvent('close');
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<view wx:if="{{visible}}" class="lottery-history-modal">
|
|
2
|
-
<view class="lottery-history-mask" bindtap="close"></view>
|
|
3
|
-
<view class="lottery-history-content">
|
|
4
|
-
<view class="lottery-history-title">中奖记录</view>
|
|
5
|
-
<view class="lottery-wrap-container">
|
|
6
|
-
<scroll-view class="lottery-wrap" scroll-y>
|
|
7
|
-
<view wx:for="{{winLotteryHistory}}" wx:key="index" class="win-lottery" bindtap="onItemClick" data-index="{{index}}">
|
|
8
|
-
<view class="lottery-item">
|
|
9
|
-
<image class="lottery-item__img" src="{{(item.award_snapshoot && item.award_snapshoot.image_url) || defaultLotteryImg}}" mode="aspectFill" />
|
|
10
|
-
<view class="lottery-item__content">
|
|
11
|
-
<p class="award-name">{{item.award_snapshoot.award_name}}</p>
|
|
12
|
-
<p class="award-time">{{item.created_at}}</p>
|
|
13
|
-
</view>
|
|
14
|
-
<view class="lottery-item__status">
|
|
15
|
-
<text wx:if="{{item.take_award == 1}}" class="status-text">已领取</text>
|
|
16
|
-
<text wx:elif="{{item.need_take_award == 0}}" class="status-text">
|
|
17
|
-
已中奖
|
|
18
|
-
</text>
|
|
19
|
-
<button wx:else class="take-award-btn" bindtap="takeAward" data-index="{{index}}">
|
|
20
|
-
领取
|
|
21
|
-
</button>
|
|
22
|
-
</view>
|
|
23
|
-
</view>
|
|
24
|
-
</view>
|
|
25
|
-
</scroll-view>
|
|
26
|
-
</view>
|
|
27
|
-
</view>
|
|
28
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.lottery-history-modal{bottom:0;display:flex;flex-direction:column;justify-content:flex-end;left:0;position:fixed;right:0;top:0;z-index:1000}.lottery-history-mask{background:rgba(0,0,0,.5);bottom:0;left:0;position:absolute;right:0;top:0}.lottery-history-content{background:linear-gradient(37.94deg,#fffbe8 3.86%,#fbf0e6 84.36%);border-radius:32rpx 32rpx 0 0;max-height:70vh;overflow:hidden;padding:0 40rpx 80rpx;position:relative}.lottery-history-title{border-bottom:2rpx solid #f0f0f0;color:#333;font-size:1.36rem;font-weight:600;height:100rpx;line-height:3.57rem;text-align:center}.lottery-wrap-container{padding-right:4rpx}.lottery-wrap{max-height:432rpx;min-height:128rpx}.win-lottery{margin-bottom:24rpx}.lottery-item{align-items:center;background:#fff;border-radius:24rpx;display:flex;flex-direction:row;height:144rpx;padding:28rpx 32rpx}.lottery-item__img{border:2rpx solid #d9d9d9;border-radius:24rpx;flex-shrink:0;height:160rpx;width:160rpx}.lottery-item__content{display:flex;flex:1;flex-direction:column;height:100%;justify-content:center;margin-left:30rpx}.award-name{color:#262626;font-size:1.14rem;font-weight:500;height:48rpx;line-height:1.71rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.award-time{color:#8c8c8c;font-size:.86rem;height:36rpx;line-height:1.29rem;margin-top:8rpx}.take-award-btn{align-items:center;background:linear-gradient(135deg,#ff4d4f,#ff7875);border:none;border-radius:32rpx;color:#fff;display:flex;font-size:1rem;font-weight:500;height:64rpx;justify-content:center;padding:0 40rpx;width:auto!important}.status-text{color:#bfbfbf;font-size:1rem}
|