Feat:抽奖2.0(部分接口未调通)

This commit is contained in:
LinCyJang
2026-04-27 08:47:33 +08:00
parent 0202f14073
commit d3602c010e
11 changed files with 2718 additions and 29 deletions
+67 -2
View File
@@ -346,10 +346,34 @@
<!-- v9 老用户弹窗 -->
<u-popup
v-if="isOldUserPopupShow"
v-if="drawEntranceConfig.homePosterEnable"
mode="center"
bgColor="transparent"
:show="isOldUser && oldUserPopup.image && lotteryCanDraw"
:show="isDrawPosterVisible"
>
<view class="popup-old-user flex flex-col ai-center">
<image
:src="drawEntranceConfig.homePosterImage"
class="main"
mode="scaleToFill"
@click="tapDrawPoster()"
/>
<view
class="icon-box flex jc-center ai-center"
@click="closeDrawPoster()"
>
<image
:src="webUrl+'/20230608112219219303.png'"
mode="scaleToFill"
/>
</view>
</view>
</u-popup>
<u-popup
v-if="canShowOldPoster"
mode="center"
bgColor="transparent"
:show="isOldUser"
>
<view class="popup-old-user flex flex-col ai-center">
<image
@@ -431,6 +455,8 @@ export default {
return {
isFirstLoad: true,
isOldUserPopupShow: 0,
isDrawPosterVisible: false,
canShowOldPoster: false,
webUrl: this.$VUE_APP_RESOURCES_URL,
// 状态栏高度
statusBarHeight: 20,
@@ -458,6 +484,8 @@ export default {
// 老用户弹窗
isOldUser: true,
oldUserPopup: {},
// 首页抽奖弹窗入口
drawEntranceConfig: {},
// 民宿专题轮播
contentHomestay: [],
// 新品推荐
@@ -1492,6 +1520,7 @@ export default {
_this.bastLeftList = []
_this.bastRightList = []
_this.lotteryCanDraw = data.lotteryCanDraw || false
_this.initPosterPopupState(data)
if (data.bastList) {
for (let i = 0; i < data.bastList.length; i++) {
if (i % 2 === 0) {
@@ -1544,6 +1573,7 @@ export default {
this.$set(this, 'isOldUserPopupShow', data.isOldUserPopupShow || 0)
this.indexVideo = data.indexVideo ? data.indexVideo.videoUrl : ''
this.lotteryCanDraw = data.lotteryCanDraw || false
this.initPosterPopupState(data)
if (data.bastList) {
const newBastLeftList = []
const newBastRightList = []
@@ -1606,6 +1636,41 @@ export default {
changeOldPopup(state) {
this.isOldUser = state
},
initPosterPopupState(data = {}) {
const drawEntranceConfig = data.drawEntranceConfig || {}
this.$set(this, 'drawEntranceConfig', drawEntranceConfig)
const hasDrawPoster = Number(drawEntranceConfig.homePosterEnable) === 1
this.canShowOldPoster = Boolean(
(data.isOldUserPopupShow || 0) &&
data.oldUserPopup &&
data.oldUserPopup.image &&
(data.lotteryCanDraw || false)
)
this.isDrawPosterVisible = hasDrawPoster
this.isOldUser = !hasDrawPoster && this.canShowOldPoster
},
showNextPoster() {
if (!this.isDrawPosterVisible && this.canShowOldPoster) {
this.isOldUser = true
}
},
closeDrawPoster() {
this.isDrawPosterVisible = false
this.showNextPoster()
},
goDrawLotteryPage() {
const config = this.drawEntranceConfig || {}
const linkType = Number(config.homePosterLinkType) || 1
const activityId = Number(config.homePosterAreaId) || 0
uni.navigateTo({
url: `/pkg-video/views/county-lottery?linkType=${linkType}&activityId=${4}`
})
},
tapDrawPoster() {
this.isDrawPosterVisible = false
this.goDrawLotteryPage()
this.showNextPoster()
},
// 民宿专题
goHomeStay(item) {
if (item.type === 1) {