增加新模块

This commit is contained in:
何江明
2025-05-10 18:17:24 +08:00
parent 7e7a096151
commit 8217069b9a
427 changed files with 2069 additions and 1941 deletions
+37 -8
View File
@@ -8,18 +8,39 @@ const _sfc_main = {
lightImages: ["/static/turntable/bg_bs.png", "/static/turntable/bg_hs.png"],
prizesObj: {},
prizes: [],
lotteryList: []
lotteryList: [],
// 中奖的列表ID
styleOpt: {
prizeBgColors: ["#fff0a3", "#fffce6", "#fdba64"]
},
isRun: false,
// 是否正在抽奖
backPath: null
};
},
onLoad() {
onLoad(option) {
const backPath = option.backPath;
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:76", "option backPath", backPath);
if (backPath && backPath !== "null") {
this.backPath = backPath;
}
},
mounted() {
this.getActivityList();
},
methods: {
jumpMine() {
common_vendor.index.switchTab({
url: "/pages/mine/mine"
});
const backPath = this.backPath;
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:87", "backPath", backPath);
if (backPath) {
common_vendor.index.switchTab({
url: "/pages/home/home"
});
} else {
common_vendor.index.switchTab({
url: "/pages/mine/mine"
});
}
},
// 查询活动详情
async getActivityList() {
@@ -27,6 +48,9 @@ const _sfc_main = {
if (resp && resp.bizcode === 100) {
this.prizesObj = resp.data;
this.prizes = resp.data.prizes || [];
if (this.prizes.length % 2 === 0) {
this.styleOpt.prizeBgColors = ["#fff0a3", "#fdba64"];
}
}
},
/**
@@ -39,6 +63,9 @@ const _sfc_main = {
},
// 用户点击开始,需要请求后台,去算出抽奖的选中的哪个
async startClick(num) {
if (this.isRun) {
return;
}
const count = this.prizesObj.times;
if (!count || count === 0) {
common_vendor.index.showToast({
@@ -50,6 +77,7 @@ const _sfc_main = {
if (count < num) {
return;
}
this.isRun = true;
const params = {
id: this.prizesObj.id,
times: num
@@ -64,7 +92,6 @@ const _sfc_main = {
const prizes = this.prizes;
const lastData = data[data.length - 1];
for (let i = 0; i < prizes.length; i++) {
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:123", "prizes[i]", prizes[i]);
if (prizes[i].id === lastData.prizeId) {
runCount = i;
break;
@@ -97,6 +124,7 @@ const _sfc_main = {
icon: "none"
});
}
this.isRun = false;
}
}
};
@@ -123,7 +151,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
d: common_assets._imports_0,
e: common_assets._imports_1,
f: common_vendor.o(($event) => $options.startClick(1)),
g: common_vendor.sr("luckyWheel", "573c7e2f-1"),
g: common_vendor.sr("luckyWheel", "42dcd262-1"),
h: common_vendor.o(($event) => $options.startClick(1)),
i: common_vendor.o($options.Done),
j: common_vendor.p({
@@ -131,7 +159,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
size: 626,
duration: 5e3,
lightImgs: $data.lightImages,
customStyle: "borderRadius: 50%;"
customStyle: "borderRadius: 50%;",
styleOpt: $data.styleOpt
}),
k: common_vendor.t($data.prizesObj.times || 0),
l: common_vendor.n($data.prizesObj.times < 1 ? "draws_item_warp draws_item_warp_no" : "draws_item_warp"),
@@ -1 +1 @@
<view class="turntable_warp"><view class="turntable_header_warp"><view class="header_title_warp"><view style="width:100rpx;height:100rpx;display:flex;align-items:center" bindtap="{{b}}"><up-image wx:if="{{a}}" u-i="573c7e2f-0" bind:__l="__l" u-p="{{a}}"></up-image></view><view class="title_">{{c}}</view></view><view class="turntable_content_warp"><view class="frequency_warp"><view class="content"><view class="lottery"><dengbo-lottery-wheel wx:if="{{j}}" class="r" u-s="{{['bg','pointer']}}" bindrun="{{h}}" binddone="{{i}}" u-r="luckyWheel" u-i="573c7e2f-1" bind:__l="__l" u-p="{{j}}"><image src="{{d}}" style="width:100%;height:100%" slot="bg"/><image src="{{e}}" style="width:50px;height:50px" mode="widthFix" bindtap="{{f}}" slot="pointer"/></dengbo-lottery-wheel></view><view class="draws_number"> 还剩 {{k}} 次抽奖 </view></view><view class="draws_warp"><view class="{{l}}" bindtap="{{m}}">抽1次</view><view class="{{n}}" bindtap="{{o}}">抽10次</view><view class="{{p}}" bindtap="{{q}}">抽20次</view><view class="{{r}}" bindtap="{{s}}">抽50次</view></view></view></view><view class="rule"><view class="rule_title"><view class="title">活动规则</view></view><view class="rule_content"><rich-text nodes="{{t}}"/></view></view></view><view class="winning_record" bindtap="{{w}}"><view style="margin-top:10rpx"><up-image wx:if="{{v}}" u-i="573c7e2f-2" bind:__l="__l" u-p="{{v}}"></up-image></view><view style="margin-left:10rpx">中奖记录</view></view></view>
<view class="turntable_warp"><view class="turntable_header_warp"><view class="header_title_warp"><view style="width:100rpx;height:100rpx;display:flex;align-items:center" bindtap="{{b}}"><up-image wx:if="{{a}}" u-i="42dcd262-0" bind:__l="__l" u-p="{{a}}"></up-image></view><view class="title_">{{c}}</view></view><view class="turntable_content_warp"><view class="frequency_warp"><view class="content"><view class="lottery"><dengbo-lottery-wheel wx:if="{{j}}" class="r" u-s="{{['bg','pointer']}}" bindrun="{{h}}" binddone="{{i}}" u-r="luckyWheel" u-i="42dcd262-1" bind:__l="__l" u-p="{{j}}"><image src="{{d}}" style="width:100%;height:100%" slot="bg"/><image src="{{e}}" style="width:50px;height:50px" mode="widthFix" bindtap="{{f}}" slot="pointer"/></dengbo-lottery-wheel></view><view class="draws_number"> 还剩 {{k}} 次抽奖 </view></view><view class="draws_warp"><view class="{{l}}" bindtap="{{m}}">抽1次</view><view class="{{n}}" bindtap="{{o}}">抽10次</view><view class="{{p}}" bindtap="{{q}}">抽20次</view><view class="{{r}}" bindtap="{{s}}">抽50次</view></view></view></view><view class="rule"><view class="rule_title"><view class="title">活动规则</view></view><view class="rule_content"><rich-text nodes="{{t}}"/></view></view></view><view class="winning_record" bindtap="{{w}}"><view style="margin-top:10rpx"><up-image wx:if="{{v}}" u-i="42dcd262-2" bind:__l="__l" u-p="{{v}}"></up-image></view><view style="margin-left:10rpx">中奖记录</view></view></view>