Commit dfa080e4 authored by spc's avatar spc

fixed

parent 5f3c87c2
<template> <template>
<view class="act915page" v-if="!loading"> <view class="act915page" v-if="!loading">
<span class="act915pagebg" :style="getBackgroundStyle()"></span> <span class="act915pagebg" :style="getBackgroundStyle()"></span>
<span class="act915pagegoods1" :style="{ backgroundImage: `url(${$baseUrl}${getImageUrl('goods1')})` }"></span> <span class="act915pagegoods1" :style="{ backgroundImage: `url(${$baseUrl}${getImageUrl('goods1')})` }"
@click="handleGoods1Click"></span>
<!-- 商品3区域 - 分成3个点击区域 --> <!-- 商品3区域 - 分成3个点击区域 -->
<view class="act915pagegoods3-container"> <view class="act915pagegoods3-container">
<span class="act915pagegoods3bg" <span class="act915pagegoods3bg"
...@@ -167,17 +168,7 @@ const getShareData = (type) => { ...@@ -167,17 +168,7 @@ const getShareData = (type) => {
} }
} }
// 分享配置 - uni-app方式
const onShareAppMessage = () => {
console.log('onShareAppMessage 被调用')
return getShareData()
}
// 分享到朋友圈
const onShareTimeline = () => {
console.log('onShareTimeline 被调用')
return getShareData()
}
// 响应式数据 // 响应式数据
const currentState = ref('normal') // 页面状态 const currentState = ref('normal') // 页面状态
...@@ -222,6 +213,13 @@ const getBackgroundStyle = () => { ...@@ -222,6 +213,13 @@ const getBackgroundStyle = () => {
} }
} }
// 商品1区域点击处理
const handleGoods1Click = () => {
console.log('点击商品1区域')
jump(config.value?.goods?.goods1?.link)
}
// 获取图片URL的辅助函数 // 获取图片URL的辅助函数
const getImageUrl = (imageKey) => { const getImageUrl = (imageKey) => {
// 根据不同的图片类型从对应的结构中获取 // 根据不同的图片类型从对应的结构中获取
...@@ -322,9 +320,9 @@ const fetchAct915HomeData = async () => { ...@@ -322,9 +320,9 @@ const fetchAct915HomeData = async () => {
const data = response.data const data = response.data
// 更新邀请相关数据 // 更新邀请相关数据
invitationCode.value = data.invitationCode || '' invitationCode.value = data.invitationCode
invitationText.value = data.invitationText || '飞鹤915活动' invitationText.value = data.invitationText
invitationImageUrl.value = data.invitationImageUrl || '' invitationImageUrl.value = data.invitationImageUrl
invitedCount.value = data.invitedCount || 0 invitedCount.value = data.invitedCount || 0
nextRewardNeedCount.value = data.nextRewardNeedCount || 2 nextRewardNeedCount.value = data.nextRewardNeedCount || 2
unclaimedPrizes.value = data.unclaimedPrizes || [] unclaimedPrizes.value = data.unclaimedPrizes || []
...@@ -509,7 +507,7 @@ const handleInvitationAssist = async (incomingCode) => { ...@@ -509,7 +507,7 @@ const handleInvitationAssist = async (incomingCode) => {
return Promise.resolve(); return Promise.resolve();
} else { } else {
uni.showToast({ uni.showToast({
title: '助力失败', title: res.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
...@@ -518,7 +516,7 @@ const handleInvitationAssist = async (incomingCode) => { ...@@ -518,7 +516,7 @@ const handleInvitationAssist = async (incomingCode) => {
} catch (error) { } catch (error) {
console.error('助力请求失败:', error) console.error('助力请求失败:', error)
uni.showToast({ uni.showToast({
title: '助力失败', title: error.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
...@@ -536,21 +534,6 @@ const handleInviteClick = () => { ...@@ -536,21 +534,6 @@ const handleInviteClick = () => {
showMask.value = true showMask.value = true
return return
} }
// 已登录用户直接分享,不需要助力
console.log('用户已登录,直接分享')
console.log('当前分享配置:', getShareData())
// 先隐藏朋友圈分享
uni.hideShareMenu({
menus: ['shareTimeline']
})
// 显示分享菜单
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
} }
// 页面初始化逻辑 // 页面初始化逻辑
...@@ -580,6 +563,17 @@ onMounted(async () => { ...@@ -580,6 +563,17 @@ onMounted(async () => {
// 即使登录失败也执行页面初始化 // 即使登录失败也执行页面初始化
await initPage() await initPage()
} }
// 先隐藏朋友圈分享
uni.hideShareMenu({
menus: ['shareTimeline']
})
// 显示分享菜单
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage']
});
}); });
// Phone authorization // Phone authorization
......
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
<div class="lotterypagenoticecontext-container" :class="{ 'no-transition': isResetting }" <div class="lotterypagenoticecontext-container" :class="{ 'no-transition': isResetting }"
:style="{ transform: `translateY(-${currentNoticeIndex * 40}rpx)` }"> :style="{ transform: `translateY(-${currentNoticeIndex * 40}rpx)` }">
<span class="lotterypagenoticecontext" v-for="(notice, index) in displayNotices" <span class="lotterypagenoticecontext" v-for="(notice, index) in displayNotices"
:key="`${notice.userNickname}-${index}`">{{ formatNotice(notice.userNickname, notice.prizeName) :key="`${notice.userNickname}-${index}`"
:style="{ top: `${index * 40}rpx` }">{{ formatNotice(notice.userNickname, notice.prizeName)
}}</span> }}</span>
</div> </div>
</div> </div>
...@@ -181,7 +182,12 @@ const recentNotices = computed(() => { ...@@ -181,7 +182,12 @@ const recentNotices = computed(() => {
if (winningCarousel.value.length > 0) { if (winningCarousel.value.length > 0) {
notices = winningCarousel.value.slice(0, 20); notices = winningCarousel.value.slice(0, 20);
} else { } else {
// 提供默认数据确保轮播能正常工作
notices = [
{ userNickname: '用户1', prizeName: '奖品A' },
{ userNickname: '用户2', prizeName: '奖品B' },
{ userNickname: '用户3', prizeName: '奖品C' }
];
} }
// 如果只有1条数据,复制成3条以确保轮播效果 // 如果只有1条数据,复制成3条以确保轮播效果
...@@ -233,7 +239,7 @@ const handleAwardClick = () => { ...@@ -233,7 +239,7 @@ const handleAwardClick = () => {
// 这里可以根据实际需求调整环境判断逻辑 // 这里可以根据实际需求调整环境判断逻辑
// 例如:根据域名、配置等判断当前环境 // 例如:根据域名、配置等判断当前环境
const currentEnv = 'uat2' // 可以动态获取 const currentEnv = 'prod' // 可以动态获取
const appIdMap = { const appIdMap = {
'uat2': 'wxabebc35e71e66795', 'uat2': 'wxabebc35e71e66795',
...@@ -339,7 +345,7 @@ const startNoticeCarousel = () => { ...@@ -339,7 +345,7 @@ const startNoticeCarousel = () => {
// 下一帧恢复过渡动效 // 下一帧恢复过渡动效
setTimeout(() => { setTimeout(() => {
isResetting.value = false isResetting.value = false
}, 0) }, 100) // 确保重置完成
} }
}, 3000) // 每3秒切换一次 }, 3000) // 每3秒切换一次
} }
......
...@@ -403,12 +403,15 @@ ...@@ -403,12 +403,15 @@
.lotterypagenoticecontext { .lotterypagenoticecontext {
width: 482rpx; width: 482rpx;
height: 40rpx; height: 40rpx;
position: relative; position: absolute;
top: 0;
left: 0;
font-size: 24rpx; font-size: 24rpx;
line-height: 40rpx; line-height: 40rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
display: block; display: block;
margin-bottom: 0; margin: 0;
padding: 0;
} }
.lotterypagenoticeconsoundicon { .lotterypagenoticeconsoundicon {
......
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 to comment