Commit 5b25a21b by 陆志强

feat: 新增强制填写逻辑

parent 60a922d7
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.21.0", "@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@easy-messenger/client-connection": "^1.0.3", "@easy-messenger/client-connection": "^1.0.3",
"@gdyfe/config": "^2.1.5", "@gdyfe/config": "^2.1.5",
"@gdyfe/gdy-component-lib": "^0.4.1", "@gdyfe/gdy-component-lib": "^1.0.4",
"@gdyfe/rop-client": "1.1.10", "@gdyfe/rop-client": "1.1.10",
"axios": "^0.18.0", "axios": "^0.18.0",
"@vant/area-data": "^1.5.1", "@vant/area-data": "^1.5.1",
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
// Add favicon and iconfont stylesheets // Add favicon and iconfont stylesheets
_addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/img/gdy_favicon.png', 'icon') _addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/img/gdy_favicon.png', 'icon')
_addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/icon/iconfont.css', 'stylesheet') _addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/icon/iconfont.css', 'stylesheet')
_addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/web-component/complaintsDeal/complaintsDeal.min.css', 'stylesheet') _addLink('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/web-component/complaintsDeal/complaintsDeal.min.css', 'stylesheet')
_addLink('//apiliveroom.dev.guangdianyun.tv/v1', 'dns-prefetch') _addLink('//apiliveroom.dev.guangdianyun.tv/v1', 'dns-prefetch')
_addLink('//activity.guangdianyun.tv', 'dns-prefetch') _addLink('//activity.guangdianyun.tv', 'dns-prefetch')
_addLink('//static-pro.guangdianyun.tv', 'dns-prefetch') _addLink('//static-pro.guangdianyun.tv', 'dns-prefetch')
......
/*! /*!
* Global Config for Guangdianyun v1.6.0 * Global Config for Guangdianyun v1.6.4
* https://guangdianyun.tv/ * https://guangdianyun.tv/
* *
* Copyright belongs to Guangdianyun Corporation and other contributors * Copyright belongs to Guangdianyun Corporation and other contributors
* Released under the Proprietary License * Released under the Proprietary License
* *
* Date: 2024-05-16 15:01:07 * Date: 2024-07-26 15:51:44
*/ */
(function () { (function () {
if (!!window.__GDY_ENV_CONFIG__) return; if (!!window.__GDY_ENV_CONFIG__) return;
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
"ROP_DOMAIN": "aodianyun.com", "ROP_DOMAIN": "aodianyun.com",
"CNAME_DOMAIN": "guangdianyun.tv", "CNAME_DOMAIN": "guangdianyun.tv",
"HELPER_DOMAIN": "help-dev.guangdianyun.tv", "HELPER_DOMAIN": "help-dev.guangdianyun.tv",
"BACKUP_DOMAIN": "",
"AODIAN_OSS_DOMAIN": "cdn.aodianyun.com", "AODIAN_OSS_DOMAIN": "cdn.aodianyun.com",
"CONSOLES_DOMAIN": "consoles.dev.guangdianyun.tv", "CONSOLES_DOMAIN": "consoles.dev.guangdianyun.tv",
"CHANNEL_DOMAIN": "pindao.dev.guangdianyun.tv", "CHANNEL_DOMAIN": "pindao.dev.guangdianyun.tv",
......
<template>
<van-popup
v-model="visible"
position="bottom"
round
transfer
>
<div class="main">
<div class="top">
<div style="width: 28px;height: 14px;"></div>
<div class="top-title">{{ editItem.id ? '编辑地址' : '新增地址' }}</div>
<div class="top-btn" @click="confirm">确定</div>
</div>
<div class="form" :class="{error: isError}">
<van-field v-model="form.name" label-width="60" label="姓名" placeholder="请输入姓名" @focus="isError = false"/>
<van-field v-model="form.mobile" label-width="60" label="手机号" placeholder="请输入联系电话" @focus="isError = false"/>
<van-field :value="address" label-width="60" label="收货地址" readonly placeholder="请选择省市区" @focus="isError = false" @click="select" >
<template #button>
<van-icon name="location" />
</template>
</van-field>
<van-field
v-model="form.detail"
label="门牌号"
label-width="60"
placeholder="详细地址(精确到门牌号)"
maxlength="50"
show-word-limit
@focus="isError = false"
/>
</div>
<van-popup
v-model="isShowAdd"
position="bottom"
round
>
<van-area title="区域选择" :area-list="areaList" @confirm="chooseAdd" @cancel="isShowAdd = false"/>
</van-popup>
</div>
</van-popup>
</template>
<script>
import { areaList } from '@vant/area-data';
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'AddAddressPopup',
props: {
value: {
type: Boolean,
default: true,
},
editItem: {
type: Object,
default: () => {
return { id: '' }
},
},
createApi: {
type: Function,
default: null
},
updateApi: {
type: Function,
default: null
},
},
data() {
return {
form: {
id: '',
name: '',
mobile: '',
detail: '',
province: '',
city: '',
area: '',
isDefault: 0,
provinceCode: 0,
cityCode: 0,
},
areaList,
isShowAdd: false,
isError: false,
}
},
computed: {
...mapGetters({
uin: 'users/uin',
lotteryInfo: 'lottery/lotteryInfo'
}),
visible: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
},
},
address() {
if (this.form.province && this.form.city && this.form.area) {
return `${this.form.province} ${this.form.city} ${this.form.area}`
} else {
return ''
}
},
},
watch: {
visible(val) {
if (val) {
this.resetForm()
}
}
},
methods: {
...mapActions({
getLotteryDetail: 'lottery/getLotteryDetail',
updateInfo: 'lottery/updateInfo',
postInfo: 'users/postInfo',
checkPremise: 'lottery/check_premise'
}),
resetForm() {
this.form = {...this.form, ...this.editItem}
},
select() {
this.isShowAdd = true
},
chooseAdd(val) {
this.form.province = val[0].name
this.form.city = val[1].name
this.form.area = val[2].name
this.form.provinceCode = val[0].code
this.form.cityCode = val[1].code
this.isShowAdd = false
},
confirm() {
const { name, mobile, province, detail } = this.form
if (!name || !mobile || !province || !detail) {
this.isError = true
return 0
}
if (!this.form.mobile.match(/^s*$|(?:(?:\+|00)86)?1\d{10}$/)) {
this.$toast('手机号格式不正确')
return 0
}
this.$emit('onConfirm', this.form)
this.visible = false
}
}
}
</script>
<style lang="less" scoped>
.main {
min-height: 42vh;
}
.top {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px;
font-size: 14px;
&-title {
font-size: 16px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
color: #333333;
}
&-btn {
font-size: 14px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #357BF0;
}
}
.form {
.address {
display: flex;
align-items: center;
// justify-content: space-between;
padding: 9.5px 13px;
&-icon {
width: 24px;
height: 24px;
margin-right: 48px;
}
&-text {
flex: 1;
// width: 225px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 24px;
text-align: left;
padding-right: 35px;
}
&-right {
width: 5px;
height: 9px;
}
}
.code {
font-size: 13px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #357BF0;
}
/deep/ .van-field__control {
padding-right: 40px;
}
/deep/ .van-field__word-limit {
position: absolute;
top: 0;
right: 0;
}
/deep/ .van-cell {
padding: 18px 13px;
}
/deep/ .van-field__label{
height: 20px;
font-size: 14px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #333333;
span {
white-space: nowrap;
}
}
/deep/ .van-field__word-limit{
color: #999;
}
/deep/ .van-cell::after {
border-bottom: none;
}
}
.error {
/deep/ .van-field__control::placeholder {
color: red;
}
}
</style>
<template>
<van-popup
v-model="visible"
position="bottom"
round
transfer
>
<div class="main">
<div class="top">
<div class="top-title">地址选择</div>
</div>
<div class="operate">
<div class="operate-left">常用地址</div>
<div class="operate-right">
<div v-if="mode === 'normal'" class="item" @click.stop="mode = 'edit'">
<img src="./img/edit.png" alt="">
<div class="name">管理</div>
</div>
<div v-if="mode === 'edit'" class="item" @click.stop="mode = 'normal'">
<img src="./img/edit.png" alt="">
<div class="name">完成</div>
</div>
<div class="item">
<img src="./img/add.png" alt="" @click.stop="editItem = {id: ''}; isShowAddPopup = true">
<div class="name">新增</div>
</div>
</div>
</div>
<div class="content">
<div class="list">
<div v-for="item in addressList" :key="item.id" class="item" @click="chooseItem = item">
<div class="item-status">
<img v-if="item.id !== chooseItem.id" src="./img/unchoose.png" alt="">
<img v-else src="./img/choosed.png" alt="">
</div>
<div class="item-content">
<div class="item-content__info">
<span class="item-content__info-name">{{ item.name }}</span>
<span class="item-content__info-mobile">{{ item.mobile }}</span>
</div>
<div class="item-content__address">
{{ item.province }} {{ item.city }} {{ item.area }} {{ item.detail }}
</div>
</div>
<div v-if="mode === 'edit'" class="item-operate">
<img src="./img/edit-gray.png" alt="" @click.stop="editItem = item; isShowAddPopup = true">
<img src="./img/delete.png" alt="" @click.stop="delAddress(item)">
</div>
</div>
</div>
</div>
<div class="btn" @click="confirmAddress">
确认地址
</div>
</div>
<AddAddressPopup
v-model="isShowAddPopup"
:edit-item="editItem"
:create-api="createApi"
:update-api="updateApi"
@onConfirm="updtaAddress"
></AddAddressPopup>
</van-popup>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
import AddAddressPopup from './AddAddressPopup.vue'
export default {
name: 'AddressPopup',
components: {
AddAddressPopup
},
props: {
value: {
type: Boolean,
default: true,
},
addressList: {
type: Array,
default: () => []
},
addressItem: {
type: Object,
default: () => {}
},
createApi: {
type: Function,
default: null
},
updateApi: {
type: Function,
default: null
},
deleteApi: {
type: Function,
default: null
}
},
data() {
return {
chooseItem: {id: ''},
mode: 'normal',
isShowAddPopup: false,
editItem: {id: ''}
}
},
computed: {
...mapGetters({
uin: 'users/uin',
lotteryInfo: 'lottery/lotteryInfo'
}),
visible: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
},
},
},
watch: {
visible(val) {
if (val) {
this.chooseItem = this.addressItem
}
}
},
methods: {
...mapActions({
getLotteryDetail: 'lottery/getLotteryDetail',
updateInfo: 'lottery/updateInfo',
postInfo: 'users/postInfo',
checkPremise: 'lottery/check_premise'
}),
confirmAddress() {
this.$emit('confirm', this.addressList.find(item => item.id === this.chooseItem.id))
this.visible = false
},
delAddress(item) {
const { uin, deleteApi } = this
this.$dialog.confirm({
message: '确定删除吗?'
}).then(() => {
deleteApi({ uin, id: item.id }).then(res => {
const { code, errorCode, errorMessage } = res
if (code === 200 && errorCode === 0) {
this.$toast('地址删除成功!')
this.$emit('reload')
} else {
this.$toast(errorMessage)
}
})
})
},
updtaAddress(value) {
const { uin, createApi, updateApi } = this
if (value?.id) {
updateApi({ uin, ...value }).then(res => {
const { code, errorCode, errorMessage } = res
if (code === 200 && errorCode === 0) {
this.$toast('修改成功')
this.$emit('reload')
this.isShowAddressEdit = false
} else {
this.$toast(errorMessage)
}
})
return
}
createApi({ uin, ...value }).then(res => {
const { code, errorCode, errorMessage } = res
if (code === 200 && errorCode === 0) {
this.$toast('添加成功')
this.$emit('reload')
this.isShowAddressEdit = false
} else {
this.$toast(errorMessage)
}
})
}
}
}
</script>
<style lang="less" scoped>
.main {
min-height: 42vh;
max-height: 60vh;
padding-left: 12px;
display: flex;
flex-direction: column;
}
.top {
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
font-size: 14px;
&-title {
font-size: 16px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
color: #333333;
}
&-btn {
font-size: 14px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #357BF0;
}
}
.operate {
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 12px;
&-left {
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 13px;
color: #333333;
line-height: 18.5px;
}
&-right {
display: flex;
align-items: center;
justify-content: center;
.item {
display: flex;
align-items: center;
margin-left: 15px;
img {
width: 16px;
height: 16px;
margin-right: 4px;
}
.name {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 13px;
color: #FF5000;
line-height: 18px;
text-align: left;
}
}
}
}
.content {
flex: 1;
overflow-y: auto;
padding-right: 12px;
.list {
height: 100%;
.item {
display: flex;
align-items: center;
justify-content: space-between;
margin: 16px 0;
&-status {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
}
}
&-content {
flex: 1;
display: flex;
// align-items: center;
flex-direction: column;
padding: 0 6px 0 12px;
text-align: left;
.item-content__info {
display: flex;
align-items: center;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 14px;
color: #333333;
line-height: 24px;
text-align: justify;
&-name {
color: #333333;
font-weight: 600;
font-size: 14px;
}
&-mobile {
color: #666666;
margin-left: 5px;
font-size: 13px;
}
}
.item-content__address {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 24px;
text-align: justify;
}
}
&-operate {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
margin-left: 10px;
}
}
}
}
}
.btn {
width: 330px;
height: 36px;
background: linear-gradient( 270deg, #FF5000 0%, #FF9000 100%);
border-radius: 22px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 36px;
cursor: pointer;
text-align: center;
margin: 15px auto 12px;
padding-right: 12px;
}
</style>
...@@ -57,14 +57,15 @@ export default { ...@@ -57,14 +57,15 @@ export default {
.bind-phone-dialog { .bind-phone-dialog {
&__title { &__title {
position: relative; position: relative;
padding: 10px;
} }
&__close { &__close {
position: absolute; position: absolute;
right: 14px; right: 14px;
top: -12px; top: 10px;
color: #646566; color: #646566;
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 16px;
} }
&__content { &__content {
padding: 24px; padding: 24px;
......
<template>
<van-popup
v-model="visible"
position="bottom"
round
transfer
class="force-popup"
>
<div class="main">
<div class="box">
<img class="box-img" src="~@/assets/images/lottery/force.png" alt="">
<img class="box-close" src="~@/assets/images/lottery/force-close.png" alt="" @click="visible = false">
<div class="box-warp">
<div class="box-warp__title">抽奖信息填写,快人一步!</div>
<div class="box-warp__content">该直播间有抽奖活动现在填写信息,参与抽奖更快哦!</div>
<div class="box-warp__btn" @click="goConfig">立即填写</div>
</div>
</div>
</div>
</van-popup>
</template>
<script>
import Bus from '@/utils/Bus'
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'ForcePopup',
props: {
value: {
type: Boolean,
default: true,
},
},
data() {
return {
}
},
computed: {
...mapGetters({
uin: 'users/uin',
lotteryInfo: 'lottery/lotteryInfo'
}),
visible: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
},
},
},
methods: {
...mapActions({
getLotteryDetail: 'lottery/getLotteryDetail',
updateInfo: 'lottery/updateInfo',
postInfo: 'users/postInfo',
checkPremise: 'lottery/check_premise'
}),
goConfig() {
Bus.$emit('showConfig')
this.visible = false
}
}
}
</script>
<style lang="less" scoped>
.force-popup {
background-color: transparent;
.main {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
.box {
width: 70%;
position: relative;
&-img {
width: 100%;
position: relative;
}
&-close {
width: 20px;
height: 20px;
position: absolute;
top: 10%;
right: -20px;
}
&-warp {
position: absolute;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
padding-bottom: 20%;
top: 0;
left: 0;
right: 0;
bottom: 0;
&__title {
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 18px;
color: #333333;
text-align: center;
}
&__content {
max-width: 80%;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 13px;
color: #666666;
text-align: center;
margin: 14px 0 37px;
}
&__btn {
width: 120px;
height: 33px;
background: linear-gradient( 201deg, #FD8192 0%, #FF4F31 100%);
border-radius: 37px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 13px;
color: #FFFFFF;
line-height: 33px;
text-align: center;
}
}
}
}
}
</style>
...@@ -573,6 +573,7 @@ export default { ...@@ -573,6 +573,7 @@ export default {
overflow: hidden; overflow: hidden;
padding: 0 10px; padding: 0 10px;
font-size: 12px; font-size: 12px;
text-align: center;
} }
&__button-wrap { &__button-wrap {
width: 100%; width: 100%;
......
...@@ -577,6 +577,7 @@ export default { ...@@ -577,6 +577,7 @@ export default {
overflow: hidden; overflow: hidden;
padding: 0 10px; padding: 0 10px;
font-size: 12px; font-size: 12px;
text-align: center;
} }
&__button-wrap { &__button-wrap {
width: 100%; width: 100%;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
v-if="lotteryInfo.showType === 6 || lotteryInfo.showType === 1" v-if="lotteryInfo.showType === 6 || lotteryInfo.showType === 1"
:is-btn-loading="isBtnLoading" :is-btn-loading="isBtnLoading"
:is-show-win="isShowWin" :is-show-win="isShowWin"
:is-show-online-tip="isShowOnlineTip"
:is-show-bind-phone="isShowBindPhone" :is-show-bind-phone="isShowBindPhone"
:win-info="winInfo" :win-info="winInfo"
@lotteryCallback="lotteryCallback" @lotteryCallback="lotteryCallback"
...@@ -12,6 +13,7 @@ ...@@ -12,6 +13,7 @@
v-if="lotteryInfo.showType === 7" v-if="lotteryInfo.showType === 7"
:is-btn-loading="isBtnLoading" :is-btn-loading="isBtnLoading"
:is-show-win="isShowWin" :is-show-win="isShowWin"
:is-show-online-tip="isShowOnlineTip"
:is-show-bind-phone="isShowBindPhone" :is-show-bind-phone="isShowBindPhone"
:win-info="winInfo" :win-info="winInfo"
@lotteryCallback="lotteryCallback" @lotteryCallback="lotteryCallback"
...@@ -36,6 +38,7 @@ export default { ...@@ -36,6 +38,7 @@ export default {
stype: this.$route.query.stype || null, // 引用类型 stype: this.$route.query.stype || null, // 引用类型
playId: this.$route.query.sessionId, playId: this.$route.query.sessionId,
isShowWin: false, isShowWin: false,
isShowOnlineTip: false,
isShowBindPhone: false, // 是否显示绑定手机号提示 isShowBindPhone: false, // 是否显示绑定手机号提示
winInfo: this.winInfoTranslator(), winInfo: this.winInfoTranslator(),
isShowIntro: false isShowIntro: false
...@@ -46,7 +49,9 @@ export default { ...@@ -46,7 +49,9 @@ export default {
uin: 'users/uin', uin: 'users/uin',
isLogin: 'users/isLogin', isLogin: 'users/isLogin',
lotteryInfo: 'lottery/lotteryInfo', lotteryInfo: 'lottery/lotteryInfo',
isBindPhone: 'users/isBindPhone' isBindPhone: 'users/isBindPhone',
userInfo: 'users/userInfo',
premise: 'lottery/premise'
}), }),
backUrl() { backUrl() {
return this.$route.query.backUrl || '' return this.$route.query.backUrl || ''
...@@ -71,6 +76,17 @@ export default { ...@@ -71,6 +76,17 @@ export default {
}, },
mounted() { mounted() {
this.eventHubInit() this.eventHubInit()
Bus.$on('LotteryResult', data => {
if (data.winUserIdArr.includes(this.userInfo.id)) {
this.updateInfo({
isWin: 1
})
}else {
if (this.lotteryInfo.isDraw === 1) {
this.isShowWin = true
}
}
})
}, },
methods: { methods: {
...mapActions({ updateInfo: 'lottery/updateInfo' }), ...mapActions({ updateInfo: 'lottery/updateInfo' }),
...@@ -116,6 +132,15 @@ export default { ...@@ -116,6 +132,15 @@ export default {
Bus.$emit('showLogin') Bus.$emit('showLogin')
} }
}) })
} else if(!this.premise) {
this.$toast({
message: '请先填写信息',
duration: 1500,
onClose: () => {
Bus.$emit('showConfig')
}
})
return
} else if (this.lotteryInfo.status !== 1) { } else if (this.lotteryInfo.status !== 1) {
// 抽奖不在活动日期内 // 抽奖不在活动日期内
} else if (this.isBtnLoading) { } else if (this.isBtnLoading) {
...@@ -145,6 +170,9 @@ export default { ...@@ -145,6 +170,9 @@ export default {
}) })
this.$toast.success('参与成功') this.$toast.success('参与成功')
this.isBtnLoading = false this.isBtnLoading = false
if (this.lotteryInfo.needOnline === 1) {
this.isShowOnlineTip = true
}
} else { } else {
this.$toast.fail(errorMessage) this.$toast.fail(errorMessage)
this.isBtnLoading = false this.isBtnLoading = false
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:is-mini="true" :is-mini="true"
:is-btn-loading="isBtnLoading" :is-btn-loading="isBtnLoading"
:is-show-win="isShowWin" :is-show-win="isShowWin"
:is-show-online-tip="isShowOnlineTip"
:is-show-bind-phone="isShowBindPhone" :is-show-bind-phone="isShowBindPhone"
:win-info="winInfo" :win-info="winInfo"
:is-show-intro="isShowIntro" :is-show-intro="isShowIntro"
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
:is-mini="true" :is-mini="true"
:is-btn-loading="isBtnLoading" :is-btn-loading="isBtnLoading"
:is-show-win="isShowWin" :is-show-win="isShowWin"
:is-show-online-tip="isShowOnlineTip"
:is-show-bind-phone="isShowBindPhone" :is-show-bind-phone="isShowBindPhone"
:win-info="winInfo" :win-info="winInfo"
:is-show-intro="isShowIntro" :is-show-intro="isShowIntro"
...@@ -43,6 +45,7 @@ export default { ...@@ -43,6 +45,7 @@ export default {
stype: this.$route.query.stype || null, // 引用类型 stype: this.$route.query.stype || null, // 引用类型
playId: this.$route.query.sessionId, playId: this.$route.query.sessionId,
isShowWin: false, isShowWin: false,
isShowOnlineTip: false,
isShowBindPhone: false, // 是否显示绑定手机号提示 isShowBindPhone: false, // 是否显示绑定手机号提示
winInfo: this.winInfoTranslator(), winInfo: this.winInfoTranslator(),
isShowIntro: false isShowIntro: false
...@@ -55,6 +58,7 @@ export default { ...@@ -55,6 +58,7 @@ export default {
lotteryInfo: 'lottery/lotteryInfo', lotteryInfo: 'lottery/lotteryInfo',
isBindPhone: 'users/isBindPhone', isBindPhone: 'users/isBindPhone',
userInfo: 'users/userInfo', userInfo: 'users/userInfo',
premise: 'lottery/premise'
}), }),
backUrl() { backUrl() {
return this.$route.query.backUrl || '' return this.$route.query.backUrl || ''
...@@ -137,6 +141,15 @@ export default { ...@@ -137,6 +141,15 @@ export default {
Bus.$emit('showLogin') Bus.$emit('showLogin')
} }
}) })
} else if(!this.premise) {
this.$toast({
message: '请先填写信息',
duration: 1500,
onClose: () => {
Bus.$emit('showConfig')
}
})
return
} else if (this.lotteryInfo.status !== 1) { } else if (this.lotteryInfo.status !== 1) {
// 抽奖不在活动日期内 // 抽奖不在活动日期内
} else if (this.isBtnLoading) { } else if (this.isBtnLoading) {
...@@ -165,6 +178,9 @@ export default { ...@@ -165,6 +178,9 @@ export default {
activeNum: num activeNum: num
}) })
this.$toast.success('参与成功') this.$toast.success('参与成功')
if (this.lotteryInfo.needOnline === 1) {
this.isShowOnlineTip = true
}
this.isBtnLoading = false this.isBtnLoading = false
} else { } else {
this.$toast.fail(errorMessage) this.$toast.fail(errorMessage)
......
<template>
<van-popup
v-model="visible"
class="online-tip-popup"
closeable
close-icon="close"
:style="{ background: 'transparent' }"
@click-close-icon="onClose"
>
<div class="main">
<div class="box">
<img class="box-img" src="~@/assets/images/lottery/needOnline.png" alt="">
<img class="box-close" src="~@/assets/images/lottery/force-close.png" alt="" @click="visible = false">
<div class="box-warp">
<div class="box-warp__title">成功参与抽奖!</div>
<div class="box-warp__content">注:开奖前请不要离开页面,只有在线的用户中进行抽奖!</div>
</div>
</div>
</div>
</van-popup>
</template>
<script>
import Bus from '@/utils/Bus'
export default {
name: 'OnlineTipPopup',
components: {},
props: {
value: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
},
type: {
type: String,
default: ''
}
},
computed: {
visible: {
get() {
return this.value
},
set(val) {
Bus.$emit('updateMain', { isShowOnlineTip: val })
}
},
isWin() {
return !!Number(this.info.id)
}
},
methods: {
know() {
Bus.$emit('updateMain', { func: 'winCallback' })
},
onClose() {
Bus.$emit('updateMain', { func: 'winCloseCallback' })
}
}
}
</script>
<style lang="less" scoped>
.online-tip-popup {
// overflow: visible;
width: 100%;
/deep/ .van-popup__close-icon {
right: 10px;
top: -16px;
font-size: 22px;
color: #fff;
}
background-color: transparent;
.main {
// width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
.box {
width: 70%;
position: relative;
&-img {
width: 100%;
position: relative;
}
&-close {
width: 20px;
height: 20px;
position: absolute;
top: 10%;
right: -20px;
}
&-warp {
position: absolute;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
padding-bottom: 10%;
top: 0;
left: 0;
right: 0;
bottom: 0;
&__title {
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 18px;
color: #333333;
text-align: center;
}
&__content {
max-width: 80%;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 13px;
color: #666666;
text-align: center;
margin: 14px 0 37px;
}
&__btn {
width: 120px;
height: 33px;
background: linear-gradient( 201deg, #FD8192 0%, #FF4F31 100%);
border-radius: 37px;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 13px;
color: #FFFFFF;
line-height: 33px;
text-align: center;
}
}
}
}
}
</style>
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 13px; padding: 0 13px;
overflow-x: scroll; // overflow-x: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.intro { .intro {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<Records v-if="isMini"></Records> <Records v-if="isMini"></Records>
<RulePopup :value="isShowIntro"></RulePopup> <RulePopup :value="isShowIntro"></RulePopup>
<WinPopup :value="isShowWin" :info="winInfo" type="luckybag"></WinPopup> <WinPopup :value="isShowWin" :info="winInfo" type="luckybag"></WinPopup>
<OnlineTipPopup :value="isShowOnlineTip"></OnlineTipPopup>
<BindPhoneDialog :value="isShowBindPhone"></BindPhoneDialog> <BindPhoneDialog :value="isShowBindPhone"></BindPhoneDialog>
</section> </section>
</template> </template>
...@@ -33,6 +34,8 @@ import BackButton from '@/components/Lottery/Timing/BackButton' ...@@ -33,6 +34,8 @@ import BackButton from '@/components/Lottery/Timing/BackButton'
import WinPopup from '@/components/Lottery/Timing/WinPopup' import WinPopup from '@/components/Lottery/Timing/WinPopup'
// banner // banner
import Banner from '../Banner.vue' import Banner from '../Banner.vue'
// 在线提示弹窗
import OnlineTipPopup from '@/components/Lottery/Timing/OnlineTipPopup'
export default { export default {
...@@ -43,6 +46,7 @@ export default { ...@@ -43,6 +46,7 @@ export default {
Rewards, Rewards,
BackButton, BackButton,
WinPopup, WinPopup,
OnlineTipPopup,
Banner, Banner,
BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'), BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'),
RulePopup: () => import('@/components/Lottery/Timing/RulePopup'), RulePopup: () => import('@/components/Lottery/Timing/RulePopup'),
...@@ -61,6 +65,10 @@ export default { ...@@ -61,6 +65,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowOnlineTip: {
type: Boolean,
default: false
},
isShowBindPhone: { isShowBindPhone: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -163,7 +171,7 @@ export default { ...@@ -163,7 +171,7 @@ export default {
border-radius: 22px; border-radius: 22px;
} }
.reward-box { .reward-box {
width: 100%; width: calc(100% - 48px);
position: absolute; position: absolute;
bottom: 3%; bottom: 3%;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<Records v-if="isMini"></Records> <Records v-if="isMini"></Records>
<RulePopup :value="isShowIntro"></RulePopup> <RulePopup :value="isShowIntro"></RulePopup>
<WinPopup :value="isShowWin" :info="winInfo" type="treasure"></WinPopup> <WinPopup :value="isShowWin" :info="winInfo" type="treasure"></WinPopup>
<OnlineTipPopup :value="isShowOnlineTip"></OnlineTipPopup>
<BindPhoneDialog :value="isShowBindPhone"></BindPhoneDialog> <BindPhoneDialog :value="isShowBindPhone"></BindPhoneDialog>
</section> </section>
</template> </template>
...@@ -33,6 +34,8 @@ import BackButton from '@/components/Lottery/Timing/BackButton' ...@@ -33,6 +34,8 @@ import BackButton from '@/components/Lottery/Timing/BackButton'
import WinPopup from '@/components/Lottery/Timing/WinPopup' import WinPopup from '@/components/Lottery/Timing/WinPopup'
// banner // banner
import Banner from '../Banner.vue' import Banner from '../Banner.vue'
// 在线提示弹窗
import OnlineTipPopup from '@/components/Lottery/Timing/OnlineTipPopup'
export default { export default {
components: { components: {
...@@ -42,6 +45,7 @@ export default { ...@@ -42,6 +45,7 @@ export default {
Rewards, Rewards,
BackButton, BackButton,
WinPopup, WinPopup,
OnlineTipPopup,
Banner, Banner,
BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'), BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'),
RulePopup: () => import('@/components/Lottery/Timing/RulePopup'), RulePopup: () => import('@/components/Lottery/Timing/RulePopup'),
...@@ -60,6 +64,10 @@ export default { ...@@ -60,6 +64,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowOnlineTip: {
type: Boolean,
default: false
},
isShowBindPhone: { isShowBindPhone: {
type: Boolean, type: Boolean,
default: false default: false
......
<template> <template>
<div class="container"> <div class="container">
<ConfigPopup v-model="isShowConfig"></ConfigPopup> <ConfigPopup v-model="isShowConfig"></ConfigPopup>
<ForcePopup v-model="isShowForce"></ForcePopup>
<slot> <slot>
<router-view></router-view> <router-view></router-view>
</slot> </slot>
...@@ -12,16 +13,19 @@ import { mapActions } from 'vuex' ...@@ -12,16 +13,19 @@ import { mapActions } from 'vuex'
import loginAction from '@/plugins/UserAction/login' import loginAction from '@/plugins/UserAction/login'
import { ENV_CONFIG } from "@/config"; import { ENV_CONFIG } from "@/config";
import ConfigPopup from '../components/Common/ConfigPopup' import ConfigPopup from '../components/Common/ConfigPopup'
import ForcePopup from '../components/Common/ForcePopup'
import action from '@/plugins/pvStatisticalService' import action from '@/plugins/pvStatisticalService'
import dmsService from '@/plugins/dmsService' import dmsService from '@/plugins/dmsService'
export default { export default {
components: { components: {
ConfigPopup, ConfigPopup,
ForcePopup
}, },
data() { data() {
return { return {
loginInstance: null, loginInstance: null,
isShowConfig: false isShowConfig: false,
isShowForce: false
} }
}, },
mounted() { mounted() {
...@@ -31,16 +35,25 @@ export default { ...@@ -31,16 +35,25 @@ export default {
Bus.$on('showConfig', () => { Bus.$on('showConfig', () => {
this.isShowConfig = true this.isShowConfig = true
}) })
Bus.$on('showForce', () => {
this.isShowForce = true
})
const route = this.$route const route = this.$route
const store = this.$store const store = this.$store
action({ route, store }) action({ route, store })
dmsService({ route }) dmsService({ route })
const { id, uin } = this.$route.query
// 抽奖前置条件
this.checkPremise({ id, uin })
}, },
destroyed() { destroyed() {
Bus.$off('showLogin') Bus.$off('showLogin')
}, },
methods: { methods: {
...mapActions({ jumpToLogin: 'users/jumpToLogin' }), ...mapActions({
jumpToLogin: 'users/jumpToLogin',
checkPremise: 'lottery/check_premise'
}),
handleVisibilityChange() { handleVisibilityChange() {
const { uin = 0 } = this.$route.query const { uin = 0 } = this.$route.query
if (document.hidden) { if (document.hidden) {
...@@ -54,7 +67,6 @@ export default { ...@@ -54,7 +67,6 @@ export default {
initLoginCenter() { initLoginCenter() {
if (!window.LoginCenter) return if (!window.LoginCenter) return
const that = this const that = this
console.log(4444);
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
this.loginInstance = LoginCenter({ this.loginInstance = LoginCenter({
target: document.body, target: document.body,
......
...@@ -34,9 +34,33 @@ export default { ...@@ -34,9 +34,33 @@ export default {
...mapGetters({ ...mapGetters({
isLogin: 'users/isLogin', isLogin: 'users/isLogin',
uin: 'users/uin', uin: 'users/uin',
lotteryInfo: 'lottery/lotteryInfo' lotteryInfo: 'lottery/lotteryInfo',
premise: 'lottery/premise'
}) })
}, },
watch: {
premise(nVal, oVal) {
if (this.lotteryInfo.forceWrite && nVal === 0) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
'lotteryInfo.forceWrite': {
handler(val) {
if (val && this.premise === 0) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
deep: true
}
},
created() { created() {
this.dataInit() this.dataInit()
}, },
...@@ -78,8 +102,6 @@ export default { ...@@ -78,8 +102,6 @@ export default {
}) })
// 初始化事件中心 // 初始化事件中心
this.eventHubInit() this.eventHubInit()
// 抽奖前置条件
this.checkPremise({ id, uin })
}, },
// 事件中心 // 事件中心
eventHubInit() { eventHubInit() {
......
...@@ -37,9 +37,33 @@ export default { ...@@ -37,9 +37,33 @@ export default {
...mapGetters({ ...mapGetters({
isLogin: 'users/isLogin', isLogin: 'users/isLogin',
uin: 'users/uin', uin: 'users/uin',
lotteryInfo: 'lottery/lotteryInfo' lotteryInfo: 'lottery/lotteryInfo',
premise: 'lottery/premise'
}) })
}, },
watch: {
premise(nVal, oVal) {
if (this.lotteryInfo.forceWrite && nVal === 0 && this.lotteryInfo.newPremise.length) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
'lotteryInfo.forceWrite': {
handler(val) {
if (val && this.premise === 0) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
deep: true
}
},
created() { created() {
this.connectionInit() this.connectionInit()
this.dataInit() this.dataInit()
...@@ -54,7 +78,8 @@ export default { ...@@ -54,7 +78,8 @@ export default {
...mapActions({ ...mapActions({
getLotteryDetail: 'lottery/getLotteryDetail', getLotteryDetail: 'lottery/getLotteryDetail',
updateInfo: 'lottery/updateInfo', updateInfo: 'lottery/updateInfo',
postInfo: 'users/postInfo' postInfo: 'users/postInfo',
checkPremise: 'lottery/check_premise'
}), }),
connectionInit() { connectionInit() {
const { ClientConnection } = require('@easy-messenger/client-connection/dist/clientConnection.cjs.js') const { ClientConnection } = require('@easy-messenger/client-connection/dist/clientConnection.cjs.js')
...@@ -97,6 +122,8 @@ export default { ...@@ -97,6 +122,8 @@ export default {
}) })
// 初始化事件中心 // 初始化事件中心
this.eventHubInit() this.eventHubInit()
// 抽奖前置条件
this.checkPremise({ id, uin })
}, },
// 事件中心 // 事件中心
eventHubInit() { eventHubInit() {
......
...@@ -35,7 +35,34 @@ export default { ...@@ -35,7 +35,34 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters({ sessionList: 'lottery/sessionList' }) ...mapGetters({
sessionList: 'lottery/sessionList',
lotteryInfo: 'lottery/lotteryInfo',
premise: 'lottery/premise'
})
},
watch: {
premise(nVal, oVal) {
if (this.lotteryInfo.forceWrite && nVal === 0 && this.lotteryInfo.newPremise.length) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
'lotteryInfo.forceWrite': {
handler(val) {
if (val && this.premise === 0) {
if (window.self === window.top) {
Bus.$emit('showForce')
} else {
Bus.$emit('showConfig')
}
}
},
deep: true
}
}, },
mounted() { mounted() {
// 初始化事件中心 // 初始化事件中心
......
...@@ -16,10 +16,12 @@ const state = { ...@@ -16,10 +16,12 @@ const state = {
type: null, // 抽奖类型 1 即时抽奖 2 定时抽奖 type: null, // 抽奖类型 1 即时抽奖 2 定时抽奖
record: [], // 抽奖记录列表 record: [], // 抽奖记录列表
prizeConfigs: [], // 奖品 prizeConfigs: [], // 奖品
showType: null // 定时抽奖条件 1 倒计时 2 参与人数 showType: null, // 定时抽奖条件 1 倒计时 2 参与人数
newPremise: [], // 新的抽奖前置条件
premise: [] // 旧的抽奖前置条件
}, // 抽奖信息 }, // 抽奖信息
isShowBind: false, // 是否显示绑定手机 isShowBind: false, // 是否显示绑定手机
premise: 0 premise: null // 抽奖前置条件检测
} }
const mutations = { const mutations = {
...@@ -50,6 +52,9 @@ const actions = { ...@@ -50,6 +52,9 @@ const actions = {
document.title = title || '抽奖' document.title = title || '抽奖'
// 停止加载效果 // 停止加载效果
commit('common/SET_ISPAGELOADING', false, { root: true }) commit('common/SET_ISPAGELOADING', false, { root: true })
// 主要是为了设置premise信息
commit('SET_LOTTERYINFO', {...state.lotteryInfo, newPremise: data.premise, forceWrite: data.forceWrite })
console.log(state.lotteryInfo, data.premise);
} else { } else {
Toast.fail(errorMessage) Toast.fail(errorMessage)
if (errorCode === 9) { if (errorCode === 9) {
......
class PostMessage {
sendMsg(data) {
window.parent.postMessage(data, "*");
}
// 直播间显示登录弹窗
showLogin() {
const data = {
cmd: 'showLogin'
}
this.sendMsg(data)
}
// 通知直播间信息填写完毕
premiseFilled() {
const data = {
cmd: 'premiseFilled'
}
this.sendMsg(data)
}
}
export default new PostMessage()
...@@ -1349,11 +1349,12 @@ ...@@ -1349,11 +1349,12 @@
node-rsa "^1.1.1" node-rsa "^1.1.1"
vm2 "^3.9.19" vm2 "^3.9.19"
"@gdyfe/gdy-component-lib@^0.4.1": "@gdyfe/gdy-component-lib@^1.0.4":
version "0.4.1" version "1.0.4"
resolved "https://registry.yarnpkg.com/@gdyfe/gdy-component-lib/-/gdy-component-lib-0.4.1.tgz#05f60cb3a2542064730b104875633eae597630ca" resolved "https://registry.npmmirror.com/@gdyfe/gdy-component-lib/-/gdy-component-lib-1.0.4.tgz#4425021a3d5363179192958ea0518b4b7a1f2c1a"
integrity sha512-78RpBbexqiCaDLvWZVB9g7bYo+AiqSYw2BDqmxirG1cl1NVgfnLjpy0eQHBEO2z/w0UFEptK+Ag9BPIhHHU2EA== integrity sha512-XcF0JHz47w6EVgGRIZXtReYuqYvK+eNibtA6ljuc9me+VjcMfOOfxz3Izps0DF80tFzQYBI4PF2coCtcDvBbkA==
dependencies: dependencies:
"@vant/area-data" "^1.3.1"
core-js "^3.6.5" core-js "^3.6.5"
vant "^2.12.21" vant "^2.12.21"
vue "^2.6.11" vue "^2.6.11"
...@@ -1729,6 +1730,11 @@ ...@@ -1729,6 +1730,11 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@vant/area-data@^1.3.1":
version "1.5.2"
resolved "https://registry.npmmirror.com/@vant/area-data/-/area-data-1.5.2.tgz#d2bed822a86ee92f7e28f07f16834929b38a5fba"
integrity sha512-Gtxgt6Rjgopt6234ANpO0bBsSwtjZ23lBlVDHIy8Mi2NJqyoj1vgVWY0dri8/2LCZAWzQ6EnwRrUVViUZ0cvMA==
"@vant/area-data@^1.5.1": "@vant/area-data@^1.5.1":
version "1.5.1" version "1.5.1"
resolved "https://mirrors.cloud.tencent.com/npm/@vant/area-data/-/area-data-1.5.1.tgz#bdd943b9b569476cb04133a8323bd04aa35be2c2" resolved "https://mirrors.cloud.tencent.com/npm/@vant/area-data/-/area-data-1.5.1.tgz#bdd943b9b569476cb04133a8323bd04aa35be2c2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment