增加新功能
This commit is contained in:
+31
-14
@@ -45,13 +45,13 @@ const _sfc_main = {
|
||||
// 点击开始抽奖
|
||||
start() {
|
||||
let { areaNumber } = this;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:73", "areaNumber", areaNumber);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:92", "areaNumber", areaNumber);
|
||||
const singleAngle = 360 / areaNumber;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:75", "singleAngle", singleAngle);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:94", "singleAngle", singleAngle);
|
||||
this.singleAngle = singleAngle;
|
||||
let index = Math.floor(Math.random() * 6 + 1);
|
||||
this.award = index;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:79", "index", index);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:98", "index", index);
|
||||
this.begin(index);
|
||||
},
|
||||
begin(awardNumer) {
|
||||
@@ -63,11 +63,11 @@ const _sfc_main = {
|
||||
return;
|
||||
this.isStart = true;
|
||||
let endAddAngle = 0;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:91", "awardNumer", awardNumer);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:92", "singleAngle", singleAngle);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:110", "awardNumer", awardNumer);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:111", "singleAngle", singleAngle);
|
||||
endAddAngle = 360 - ((awardNumer - 1) * singleAngle + singleAngle / 2);
|
||||
const rangeAngle = (Math.floor(Math.random() * 4) + 4) * 360;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:97", endAddAngle);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:116", endAddAngle);
|
||||
let cAngle;
|
||||
deg = 0;
|
||||
this.timer = setInterval(() => {
|
||||
@@ -87,20 +87,26 @@ const _sfc_main = {
|
||||
this.deg = deg;
|
||||
}, 1e3 / 60);
|
||||
},
|
||||
// 用户点击开始抽奖
|
||||
// turntableStart() {
|
||||
// let index = Math.floor(Math.random() * 6 + 1) //前端随机数,这里应该后台返回中奖结果
|
||||
// this.award = index
|
||||
// this.$refs.turntable.begin(this.award);
|
||||
// },
|
||||
// 抽奖完成后操作
|
||||
turntableSuccess() {
|
||||
const index = this.award - 1;
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:131", "bind:success", this.awardList[index]);
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:144", "bind:success", this.awardList[index]);
|
||||
common_vendor.index.showToast({
|
||||
title: `恭喜你获得${this.awardList[index].title}`,
|
||||
icon: "none"
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 开始多次抽奖
|
||||
*/
|
||||
drawsFun(count) {
|
||||
common_vendor.index.__f__("log", "at pages/turntable/turntable.vue:154", "开始多次抽奖。。count", count);
|
||||
this.start();
|
||||
},
|
||||
/**
|
||||
* 跳转到中奖记录
|
||||
*/
|
||||
jumpWinningRecord() {
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -124,7 +130,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
c: common_assets._imports_0,
|
||||
d: common_vendor.s("-webkit-transform:rotate(" + $data.deg + "deg) translateZ(0);transform:rotate(" + $data.deg + "deg) translateZ(0)"),
|
||||
e: common_assets._imports_1,
|
||||
f: common_vendor.o((...args) => $options.start && $options.start(...args))
|
||||
f: common_vendor.o((...args) => $options.start && $options.start(...args)),
|
||||
g: common_vendor.o(($event) => $options.drawsFun(1)),
|
||||
h: common_vendor.o(($event) => $options.drawsFun(10)),
|
||||
i: common_vendor.o(($event) => $options.drawsFun(100)),
|
||||
j: common_vendor.o(($event) => $options.drawsFun(365)),
|
||||
k: common_vendor.o($options.jumpWinningRecord),
|
||||
l: common_vendor.p({
|
||||
src: "/static/turntable/record.png",
|
||||
width: "14",
|
||||
height: "14",
|
||||
bgColor: "#f1f6ff00"
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="turntable_warp"><view class="turntable_header_warp"><view class="header_title_warp"><up-image wx:if="{{b}}" bindclick="{{a}}" u-i="42dcd262-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="title_">幸运转盘百亿补贴</view></view><view class="turntable_content_warp"><view class="frequency_warp"><view class="turntable_wp sol-class"><image src="{{c}}" style="{{d}}"></image><view class="turntable_pointer" bindtap="{{f}}"><image src="{{e}}"></image></view></view></view></view></view></view>
|
||||
<view class="turntable_warp"><view class="turntable_header_warp"><view class="header_title_warp"><up-image wx:if="{{b}}" bindclick="{{a}}" u-i="573c7e2f-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="title_">幸运转盘百亿补贴</view></view><view class="turntable_content_warp"><view class="frequency_warp"><view class="turntable_wp sol-class"><image src="{{c}}" style="{{d}}"></image><view class="turntable_pointer" bindtap="{{f}}"><image src="{{e}}"></image></view></view><view class="draws_warp"><view class="draws_item_warp" bindtap="{{g}}">抽1次</view><view class="draws_item_warp" bindtap="{{h}}">抽10次</view><view class="draws_item_warp" bindtap="{{i}}">抽100次</view><view class="draws_item_warp" bindtap="{{j}}">抽356次</view></view></view></view><view class="rule"><view class="rule_title"><view class="title">活动规则</view></view><view class="rule_content">内容XXXXXXXXXXXXXXXXXXXXXXXX</view></view></view><view class="winning_record"><view style="margin-top:10rpx"><up-image wx:if="{{l}}" bindclick="{{k}}" u-i="573c7e2f-1" bind:__l="__l" u-p="{{l}}"></up-image></view><view style="margin-left:10rpx">中奖记录</view></view></view>
|
||||
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
.turntable_warp {
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
}
|
||||
.turntable_header_warp {
|
||||
height: 1200rpx;
|
||||
@@ -57,12 +58,59 @@
|
||||
/* 将图片居中显示 */
|
||||
width: 100%;
|
||||
height: 820rpx;
|
||||
position: relative;
|
||||
}
|
||||
.turntable_header_warp .turntable_content_warp .draws_warp {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding: 0 84rpx;
|
||||
position: absolute;
|
||||
top: 576rpx;
|
||||
width: calc(100% - 168rpx);
|
||||
}
|
||||
.turntable_header_warp .turntable_content_warp .draws_warp .draws_item_warp {
|
||||
width: 40%;
|
||||
text-align: center;
|
||||
background: #FE2F32;
|
||||
border-radius: 16rpx;
|
||||
border: 2px solid #FFC8C8;
|
||||
margin-bottom: 20rpx;
|
||||
color: #ffffff;
|
||||
padding: 20rpx 0rpx;
|
||||
}
|
||||
.turntable_header_warp .rule {
|
||||
background: #FFFFFF;
|
||||
border-radius: 50rpx 50rpx 0rpx 0rpx;
|
||||
min-height: 500rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.turntable_header_warp .rule .rule_title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.turntable_header_warp .rule .rule_title .title {
|
||||
background: #FF2524;
|
||||
border-radius: 30rpx 0rpx 40rpx 0rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 10rpx 0;
|
||||
width: 280rpx;
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.turntable_header_warp .rule .rule_content {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.turntable_wp {
|
||||
width: 610rpx;
|
||||
height: 610rpx;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
top: -176rpx;
|
||||
}
|
||||
.turntable_wp image {
|
||||
display: block;
|
||||
@@ -76,4 +124,18 @@
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: -125rpx 0 0 -112rpx;
|
||||
}
|
||||
.winning_record {
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
top: 200rpx;
|
||||
background: rgba(92, 0, 1, 0.5);
|
||||
border-radius: 30rpx 0rpx 0rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #FFFFFF;
|
||||
padding: 10rpx 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 25rpx;
|
||||
color: #FBFAFA;
|
||||
}
|
||||
Reference in New Issue
Block a user