You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

352 lines
9.3 KiB

3 years ago
<template>
<view>
<view class="icon">
3 years ago
<u-image mode="widthFix" width="114rpx" :src="require('@/static/activity-rule.png')" @click="popoverType = 1,$refs['popover'].show()"></u-image>
3 years ago
<u-image style="margin-top: 28rpx;" mode="widthFix" width="114rpx" :src="require('@/static/me-center.png')" @click="toMe"></u-image>
</view>
<view class="bkg">
<u-image width="100%" height="100vh" :src="require('@/static/home-bkg.jpg')"></u-image>
</view>
<view class="content">
<view class="logo">
<u-image mode="heightFix" height="54rpx" :src="require('@/static/guangdian-logo.png')"></u-image>
</view>
<view class="title">
<u-image style="display: flex;justify-content: center;" mode="heightFix" width="auto" height="220rpx" :src="require('@/static/title.png')"></u-image>
</view>
<view class="notice">
3 years ago
<u-notice-bar :speed="80" color="#fff" bg-color="transparent" :volume-icon="false" :more-icon="false" :list="notices"></u-notice-bar>
3 years ago
</view>
<view class="present">
3 years ago
<u-image style="display: flex;justify-content: center;" mode="heightFix" width="auto" height="700rpx" :src="require('@/static/present.png')"></u-image>
3 years ago
</view>
<view class="login">
<view class="login-bkg">
<u-image style="display: flex;justify-content: center;" mode="scaleToFill" width="100%" height="448rpx" :src="require('@/static/yellow-phone-bkg.png')"></u-image>
</view>
<view class="login-text">
短信验证
</view>
<view class="login-phone">
<u-icon width="30rpx" height="46rpx" name="/static/phone.png" ></u-icon>
<span>192</span>
3 years ago
<u-input v-model="inputMobile" placeholder-style="color:#969696" :custom-style="{ 'margin-left': '8rpx','color': '#333333' }" placeholder="请填写手机后8位"></u-input>
3 years ago
</view>
<view class="login-validate">
3 years ago
<u-input v-model="code" placeholder-style="color:#969696" :custom-style="{ 'color': '#333333' }" @input="$u.debounce(bindMobile, 1000)"></u-input>
<u-verification-code :keep-running="true" :seconds="60" ref="uCode" start-text=""
@change="t => tips = t"></u-verification-code>
<u-button :ripple="true" :hair-line="false" :custom-style="{ 'height': '100%','background': '#969696','color': '#fff' }" shape="circle" @click="sendCode">{{ tips }}</u-button>
3 years ago
</view>
<view class="login-tip">
仅限中国广电苏州地区用户手机号参与活动
</view>
</view>
<view class="footer">
江苏省广电有线信息网络股份有限公司苏州分公司
</view>
<popover :icon="getIcon" height="1128rpx" ref="popover">
<view slot="box-content">
<view v-if="popoverType === 1">
<view class="box-text__title">活动规则</view>
<view class="box-text__top">
参与方式及参与对象
</view>
<view class="box-text__content">
本次活动奖品数量有限仅限中国广电苏州地区用户手机号参与活动输入其他手机号均无效
</view>
<view class="box-text__top">
活动规则
</view>
<view class="box-text__content">
1. 活动期间每个号码每日可有三次抽奖机会 2. 分享活动页面可增加一次机会关注江苏有线苏州分公司公众号或视频号可增加一次机会下载视界观App可增加一次机会 3. 每个手机号每天最多6次抽奖机会 4. 实物奖品会在活动结束后3个工作日内根据您参与活动的中奖号码与您联系并安排派奖联系未果视为主动放弃奖品
</view>
</view>
<view v-if="popoverType === 2">
<view class="box-text__title">验证失败</view>
3 years ago
<u-button shape="circle" :ripple="true" :hair-line="false" :custom-style="{ 'background': '#FED45F','color': '#fff','width': '374rpx','height': '84rpx' }" @click="code = '',$refs['popover'].hidden()">重新验证</u-button>
</view>
<view v-if="popoverType === 3">
<view class="box-text__title">验证成功</view>
<u-button shape="circle" :ripple="true" :hair-line="false" :custom-style="{ 'background': '#FED45F','color': '#fff','width': '374rpx','height': '84rpx' }" @click="toRaffle"></u-button>
3 years ago
</view>
</view>
</popover>
</view>
</view>
</template>
<script>
import popover from "@/component/popover/index.vue";
export default {
components: {
popover
},
data() {
return {
3 years ago
tips: '',
popoverType: 1,//1为规则2为验证失败3验证通过
inputMobile: '',
code: '',
notices: []
3 years ago
}
},
onLoad() {
},
methods: {
3 years ago
toRaffle() {
uni.navigateTo({
url: '/pages/raffle/raffle'
})
},
3 years ago
toMe() {
uni.navigateTo({
url: '/pages/me/index'
})
3 years ago
},
async getNotices() {
const res = await this.$u.api.getPrize()
3 years ago
this.notices = res.draw_log_day?.filter(i => i.draw_prize?.name !== '谢谢参与')?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
3 years ago
},
sendCode() {
3 years ago
// if(!/^1[3-9]\d{9}$/.test(`192${this.inputMobile}`)) {
// uni.showToast({
// icon: 'none',
// title: '手机号不正确'
// })
// return
// }
if(this.$refs.uCode.canGetCode) {
this.$refs.uCode.start()
this.$u.api.sendSms({
tempate_key: 'sms_code_template',
mobile: this.inputMobile
//`192${this.inputMobile}`
}).then(res => {
uni.showToast({
icon: 'none',
title: res.msg
})
3 years ago
})
} else {
3 years ago
this.$u.toast('倒计时结束后再发送');
3 years ago
}
},
bindMobile() {
if(this.code) {
this.$u.api.bindMobile({
3 years ago
mobile: this.inputMobile,
//`192${this.inputMobile}`,
3 years ago
code: this.code
}).then(res => {
this.popoverType = 3;
this.$refs['popover'].show();
}).catch(err => {
this.popoverType = 2;
this.$refs['popover'].show();
})
}
3 years ago
}
},
computed: {
getIcon() {
switch (this.popoverType) {
case 1:
return 'smile';
case 2:
return 'frown';
3 years ago
case 3:
return 'laugh';
3 years ago
}
}
3 years ago
},
watch: {
vuex_token: {
handler(newVal){
if(newVal) {
this.getNotices()
}
},
immediate: true
}
3 years ago
}
}
</script>
<style lang="scss">
.bkg {
z-index: -1;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.icon {
display: flex;
flex-direction: column;
z-index: 3;
position: fixed;
top: 30vh;
right: 24rpx;
}
.content {
min-height: 100vh;
position: relative;
& .logo {
3 years ago
margin-top: 3vh;
3 years ago
margin-left: 40rpx;
}
& .title {
3 years ago
margin-top: 3vh;
3 years ago
}
& .notice {
background: rgba(254, 210, 141, 0.6);
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(3,46,63,0.45);
border-radius: 28rpx;
color: #fff;
text-align: center;
3 years ago
margin: .1vh 140rpx 0 140rpx;
3 years ago
}
.present {
3 years ago
margin-top: 0.5vh;
3 years ago
}
.login {
height: 448rpx;
position: relative;
3 years ago
margin: -12vh 60rpx 0 60rpx;
3 years ago
padding: 0 52rpx 3.5vh 40rpx;
&-bkg {
filter: drop-shadow(14rpx 14rpx 4rpx rgba(0,0,0,0.3));
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&-text {
font-size: 34rpx;
font-weight: 500;
color: #C82F34;
text-align: center;
padding-top: 90rpx;
position: relative;
z-index: 2;
}
&-phone {
height: 70rpx;
background: #E2DFD6;
opacity: 0.3;
border-radius: 34rpx;
display: flex;
align-items: center;
padding: 0 0 0 38rpx;
margin-top: 34rpx;
& > span {
font-size: 28rpx;
line-height: 22rpx;
font-weight: 500;
color: #333333;
border-right: 2rpx solid #333;
padding-left: 30rpx;
padding-right: 8rpx;
}
}
&-validate {
height: 70rpx;
background: #E2DFD6;
opacity: 0.3;
border-radius: 34rpx;
display: flex;
align-items: center;
margin-top: 28rpx;
padding-left: 38rpx;
}
&-tip {
text-align: center;
font-size: 22rpx;
zoom: 0.85;
font-weight: 400;
color: #333333;
padding-top: 1.5vh;
position: relative;
}
}
.footer {
font-size: 22rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 32rpx;
text-align: center;
3 years ago
padding-top: 4vh;
3 years ago
padding-bottom: 2.28vh;
}
}
.box-text {
&__title {
font-size: 36rpx;
font-weight: 500;
color: #333333;
text-align: center;
padding-bottom: 56rpx;
}
&__top {
color: rgba(51, 51, 51, 1);
font-size: 36rpx;
text-align: left;
padding: 20rpx 0;
}
&__content {
color: rgba(51, 51, 51, 1);
font-size: 26rpx;
text-align: left;
}
}
</style>