Commit 8c180c42 authored by chenkai@duiba.com.cn's avatar chenkai@duiba.com.cn

Merge branch 'dev' of gitlab2.dui88.com:fh/20250528_FHQ1 into dev

parents 720c4f87 397a52dc
...@@ -4,25 +4,14 @@ ...@@ -4,25 +4,14 @@
<Brand v-if="globalStore.curTabIndex == 1 && !globalStore.isWxFriendCircle" :scroll-top="scrollTop" /> <Brand v-if="globalStore.curTabIndex == 1 && !globalStore.isWxFriendCircle" :scroll-top="scrollTop" />
<Integral v-if="globalStore.curTabIndex == 2 && !globalStore.isWxFriendCircle" :scrollTop="scrollTop" /> <Integral v-if="globalStore.curTabIndex == 2 && !globalStore.isWxFriendCircle" :scrollTop="scrollTop" />
<My v-if="globalStore.curTabIndex == 3 && !globalStore.isWxFriendCircle" /> <My v-if="globalStore.curTabIndex == 3 && !globalStore.isWxFriendCircle" />
<TabBar <TabBar v-if="!globalStore.isWxFriendCircle" :curTabIndex="globalStore.curTabIndex" @tabClick="handleTabClick" />
v-if="!globalStore.isWxFriendCircle"
:curTabIndex="globalStore.curTabIndex"
@tabClick="handleTabClick"
/>
<WxFriendCircleSimplePage v-if="globalStore.isWxFriendCircle" /> <WxFriendCircleSimplePage v-if="globalStore.isWxFriendCircle" />
<!-- 邀请奖品弹窗 --> <!-- 邀请奖品弹窗 -->
<InvitePrizePanel <InvitePrizePanel :visible="globalStore.isShowInvitePrizePanel" :inviteCount="globalStore.inviteCount"
:visible="globalStore.isShowInvitePrizePanel" :prizeName="globalStore.prizeName" :prizeImage="globalStore.prizeImage" :prizeType="globalStore.prizeType"
:inviteCount="globalStore.inviteCount" :memberId="globalStore.memberId" @close="handleCloseInvitePrizePanel" @record="handleInvitePrizePanelRecord"
:prizeName="globalStore.prizeName" @prize="handleInvitePrizePanelPrize" />
:prizeImage="globalStore.prizeImage"
:prizeType="globalStore.prizeType"
:memberId="globalStore.memberId"
@close="handleCloseInvitePrizePanel"
@record="handleInvitePrizePanelRecord"
@prize="handleInvitePrizePanelPrize"
/>
<!-- 任务完成弹窗 --> <!-- 任务完成弹窗 -->
<!-- <TaskComplete <!-- <TaskComplete
...@@ -34,61 +23,32 @@ ...@@ -34,61 +23,32 @@
/> --> /> -->
<!-- 任务弹窗 --> <!-- 任务弹窗 -->
<TaskPop <TaskPop :visible="globalStore.isShowTaskPop" :taskTodo="globalStore.taskTodo" @close="handleCloseTaskPop"
:visible="globalStore.isShowTaskPop" @taskClick="handleTaskClick" />
:taskTodo="globalStore.taskTodo"
@close="handleCloseTaskPop"
@taskClick="handleTaskClick"
/>
<!-- 任务完成提示弹窗 --> <!-- 任务完成提示弹窗 -->
<TaskCompleteTips <TaskCompleteTips :visible="globalStore.isShowTaskComplete" :points="globalStore.taskCompletePoints"
:visible="globalStore.isShowTaskComplete" :taskTitle="globalStore.taskCompleteTitle" @close="handleCloseTaskCompleteTips" />
:points="globalStore.taskCompletePoints"
:taskTitle="globalStore.taskCompleteTitle"
@close="handleCloseTaskCompleteTips"
/>
<!-- 任务信息弹窗 --> <!-- 任务信息弹窗 -->
<TaskPerson <TaskPerson :visible="globalStore.isShowTaskPerson" @close="handleCloseTaskPerson"
:visible="globalStore.isShowTaskPerson" @submit="handleTaskPersonSubmit" />
@close="handleCloseTaskPerson"
@submit="handleTaskPersonSubmit"
/>
<!-- 公众号弹窗 --> <!-- 公众号弹窗 -->
<GongzhonghaoPop <GongzhonghaoPop :visible="showGongzhonghaoPop" :title="gongzhonghaoTitle" :description="gongzhonghaoDescription"
:visible="showGongzhonghaoPop" :qrCodeUrl="gongzhonghaoQrCodeUrl" @close="handleCloseGongzhonghaoPop" @download="handleDownloadQrCode" />
:title="gongzhonghaoTitle"
:description="gongzhonghaoDescription"
:qrCodeUrl="gongzhonghaoQrCodeUrl"
@close="handleCloseGongzhonghaoPop"
@download="handleDownloadQrCode"
/>
<!-- 视频弹窗 --> <!-- 视频弹窗 -->
<view v-if="showVideo" class="video-popup1"> <view v-if="showVideo" class="video-popup1">
<video <video :src="currentVideoUrl" controls autoplay :style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
:src="currentVideoUrl" @loadedmetadata="onVideoLoadedMeta" @play="onVideoPlay"></video>
controls
autoplay
:style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
@loadedmetadata="onVideoLoadedMeta"
@play="onVideoPlay"
></video>
<view class="close-btn-bottom" @tap="closeVideo">×</view> <view class="close-btn-bottom" @tap="closeVideo">×</view>
</view> </view>
<button <button v-if="isBackApp" class="back-app" open-type="launchApp" app-parameter="wechat"
v-if="isBackApp" @binderror="handleLaunchAppError" :style="{
class="back-app"
open-type="launchApp"
app-parameter="wechat"
@binderror="handleLaunchAppError"
:style="{
backgroundImage: `url(${$baseUrl}homepage/backAppBtn.png)`, backgroundImage: `url(${$baseUrl}homepage/backAppBtn.png)`,
}" }">
>
<!-- <text class="back-text">返回app</text> --> <!-- <text class="back-text">返回app</text> -->
</button> </button>
...@@ -96,11 +56,7 @@ ...@@ -96,11 +56,7 @@
<view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile"> <view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile">
<image class="auth-phone-bg" :src="$baseUrl + 'homepage/Q3Res/accessBg3.png'"></image> <image class="auth-phone-bg" :src="$baseUrl + 'homepage/Q3Res/accessBg3.png'"></image>
<view class="auth-phone-btn-container"> <view class="auth-phone-btn-container">
<image <image class="auth-phone-btn" :src="$baseUrl + 'homepage/Q3Res/accessBtn3.png'" @tap="handleAuthPhoneClick">
class="auth-phone-btn"
:src="$baseUrl + 'homepage/Q3Res/accessBtn3.png'"
@tap="handleAuthPhoneClick"
>
</image> </image>
</view> </view>
</view> </view>
...@@ -258,6 +214,11 @@ onMounted(async () => { ...@@ -258,6 +214,11 @@ onMounted(async () => {
const handleCloseTaskCompleteTips = async () => { const handleCloseTaskCompleteTips = async () => {
globalStore.isShowTaskComplete = false; globalStore.isShowTaskComplete = false;
await checkAndUpdateTaskResult(); await checkAndUpdateTaskResult();
// 如果当前在积分权益页,通过事件通知 Integral 组件刷新数据
if (globalStore.curTabIndex === 2) {
uni.$emit('refreshIntegralData');
}
}; };
// 完成任务并显示完成提示 // 完成任务并显示完成提示
...@@ -281,7 +242,7 @@ const handleTaskComplete = async (taskIdParam) => { ...@@ -281,7 +242,7 @@ const handleTaskComplete = async (taskIdParam) => {
globalStore.isShowTaskComplete = true; globalStore.isShowTaskComplete = true;
globalStore.taskCompletePoints = integralStore.queryTodoResult.data[0]?.actualCredits; globalStore.taskCompletePoints = integralStore.queryTodoResult.data[0]?.actualCredits;
globalStore.taskCompleteTitle = integralStore.queryTodoResult.data[0]?.taskName; globalStore.taskCompleteTitle = integralStore.queryTodoResult.data[0]?.taskName;
}else{ } else {
console.info('taskCompleteJSON res error:', integralStore.queryTodoResult); console.info('taskCompleteJSON res error:', integralStore.queryTodoResult);
} }
...@@ -303,6 +264,11 @@ onShow(async () => { ...@@ -303,6 +264,11 @@ onShow(async () => {
//完成了浏览任务 //完成了浏览任务
if (taskId.value > 0) { if (taskId.value > 0) {
await handleTaskComplete(taskId.value); await handleTaskComplete(taskId.value);
} else {
const integralStore = useIntegralStore();
await integralStore.getSigninAndTaskInfo();
await checkAndUpdateTaskResult()
} }
}); });
...@@ -363,7 +329,7 @@ onShareAppMessage((e) => { ...@@ -363,7 +329,7 @@ onShareAppMessage((e) => {
title: integralStore.originInviteHome?.data?.invitationText, title: integralStore.originInviteHome?.data?.invitationText,
path: '/pages/invate/sharepage' + '?inviteCode=' + integralStore.originInviteHome?.data?.invitationCode, path: '/pages/invate/sharepage' + '?inviteCode=' + integralStore.originInviteHome?.data?.invitationCode,
imageUrl: imageUrl:
integralStore.originInviteHome?.data?.invitationImageUrl integralStore.originInviteHome?.data?.invitationImageUrl
}; };
} }
return shareOptions[pageType] || shareOptions[0]; return shareOptions[pageType] || shareOptions[0];
...@@ -448,7 +414,7 @@ const handleTaskClick = async (data) => { ...@@ -448,7 +414,7 @@ const handleTaskClick = async (data) => {
return; return;
} }
switch (data.task.taskTodoExtra.type) { switch (data.task.taskTodoExtra.type) {
case 'Perfect': case 'Perfect':
globalStore.closeTaskPop(); // 先关闭TaskPop globalStore.closeTaskPop(); // 先关闭TaskPop
...@@ -498,6 +464,7 @@ const handleTaskClick = async (data) => { ...@@ -498,6 +464,7 @@ const handleTaskClick = async (data) => {
// console.log('extra66666:', extra1); // console.log('extra66666:', extra1);
break; break;
case 'FirstOrder': //完成首单优选消费 case 'FirstOrder': //完成首单优选消费
globalStore.closeTaskPop(); // 先关闭TaskPop
const extra2 = JSON.parse(data?.task?.taskTodoExtra?.extra); const extra2 = JSON.parse(data?.task?.taskTodoExtra?.extra);
console.log('extra666661111:', extra2); console.log('extra666661111:', extra2);
jump({ jump({
...@@ -507,6 +474,7 @@ const handleTaskClick = async (data) => { ...@@ -507,6 +474,7 @@ const handleTaskClick = async (data) => {
}); });
break; break;
case 'EXCHANGE_GOODS': //消费商品 case 'EXCHANGE_GOODS': //消费商品
globalStore.closeTaskPop(); // 先关闭TaskPop
const extra3 = JSON.parse(data?.task?.taskTodoExtra?.extra); const extra3 = JSON.parse(data?.task?.taskTodoExtra?.extra);
if (extra3.length > 0) { if (extra3.length > 0) {
......
...@@ -784,6 +784,10 @@ export default { ...@@ -784,6 +784,10 @@ export default {
// 已抢完:灰色背景 // 已抢完:灰色背景
classes['sold-out'] = true; classes['sold-out'] = true;
break; break;
case 5:
// 已结束或未开始:灰色背景
classes['disabled'] = true;
break;
default: default:
// 默认状态:金色背景 // 默认状态:金色背景
break; break;
...@@ -813,6 +817,12 @@ export default { ...@@ -813,6 +817,12 @@ export default {
return '已达兑换上限'; return '已达兑换上限';
case 4: case 4:
return '已抢完'; return '已抢完';
case 5:
// 如果有自定义按钮文本,优先使用
if (this.goodsData.buttonText && this.goodsData.buttonText !== '立即兑换') {
return this.goodsData.buttonText;
}
return '已结束';
default: default:
// 如果有自定义按钮文本,优先使用 // 如果有自定义按钮文本,优先使用
if (this.goodsData.buttonText && this.goodsData.buttonText !== '立即兑换') { if (this.goodsData.buttonText && this.goodsData.buttonText !== '立即兑换') {
......
...@@ -631,7 +631,7 @@ ...@@ -631,7 +631,7 @@
<template v-else> <template v-else>
<text v-if="Number(goodItem?.priceMarket) && Number(goodItem?.credits)" class="num0" <text v-if="Number(goodItem?.priceMarket) && Number(goodItem?.credits)" class="num0"
>低至{{ goodItem?.credits }}<text class="price-text0">积分</text >{{ goodItem?.credits }}<text class="price-text0">积分</text
><text class="price-text1">+</text><text class="price-text0">¥</text ><text class="price-text1">+</text><text class="price-text0">¥</text
>{{ goodItem?.priceMarket / 100 }}</text >{{ goodItem?.priceMarket / 100 }}</text
> >
...@@ -2093,9 +2093,62 @@ watch( ...@@ -2093,9 +2093,62 @@ watch(
console.log('isVisible:', isVisible); console.log('isVisible:', isVisible);
}, },
{ immediate: true } { immediate: true }
); );
// 刷新积分页数据的公共方法
const refreshIntegralData = async () => {
try {
const { data } = await fetchIntegralJSON(globalStore.getPreviewScene('integral'));
integralData.value = { ...data };
// 重新初始化相关数据
let bannerData = integralData?.value?.banner;
vipActive.value = [];
bannerData?.forEach((item) => {
vipActive.value.push({
img: item.url,
url: item.link.url,
type: item.link.type,
extra: item.link.extra,
title: item.title,
});
});
goodsDataArr.value = integralData?.value?.goodsList;
swiperData.value = integralData.value?.swiper;
vipLvIcons.value = integralData.value?.viplv?.imgs;
vipLvIconBgs.value = integralData.value?.viplv?.imgBgs;
vipLvNameImgs.value = integralData.value?.viplv?.vipNameImgs;
vipIntegral.value = integralData.value?.vipIntegral;
clickMore.value = integralData.value?.clickMore;
tabInfo.value = integralData.value?.goodsListData?.tabInfo;
listCommon.value = integralData.value?.goodsListData?.listCommon;
goodsData.value = integralData.value?.goodsListData?.goodsData;
productIdUrl.value = integralData.value?.goodsListData?.productIdUrl;
vipRule.value = integralData.value?.qunyiInfo?.vipRule;
imgInfos.value = integralData.value?.qunyiInfo?.imgInfos;
vipQuanyiUrl.value = integralData.value?.qunyiInfo?.vipQuanyiUrl;
vipQuanyiData.value = integralData.value?.qunyiInfo?.vipLvsQuanyi;
tupianBanben.value = integralData.value?.tupianBanben;
quanyiBgs.value = integralData.value?.qunyiInfo?.quanyiBgs;
quanyitiaozhuanInfo.value = integralData.value?.quanyitiaozhuanInfo;
quanyiListIcon.value = [];
imgInfos.value?.forEach((element, index) => {
quanyiListIcon.value.push(element.img);
privilegeSizes.value[index] = { width: element.width, height: element.height, name: element.name };
});
// 刷新用户积分信息
await userStore.loadMemberInfo();
initNetData()
} catch (error) {
console.error('刷新积分页数据失败:', error);
}
};
onMounted(async () => { onMounted(async () => {
// showSignedTips.value = true; // showSignedTips.value = true;
showLoading(); showLoading();
...@@ -2209,6 +2262,9 @@ onMounted(async () => { ...@@ -2209,6 +2262,9 @@ onMounted(async () => {
hideLoading(); hideLoading();
initExposure(); initExposure();
// 监听刷新积分页数据事件
uni.$on('refreshIntegralData', refreshIntegralData);
//曝光埋点累计积分 //曝光埋点累计积分
if (memberInfo.value.grade == 0 && !memberInfo.value.orderUpgrade && points.value >= 1) { if (memberInfo.value.grade == 0 && !memberInfo.value.orderUpgrade && points.value >= 1) {
md.sensorComponentLogTake({ md.sensorComponentLogTake({
...@@ -2232,6 +2288,11 @@ onMounted(async () => { ...@@ -2232,6 +2288,11 @@ onMounted(async () => {
} }
}); });
// 组件卸载时取消事件监听
onBeforeUnmount(() => {
uni.$off('refreshIntegralData', refreshIntegralData);
});
const initExposure = () => { const initExposure = () => {
imgInfos.value?.forEach((item, index) => { imgInfos.value?.forEach((item, index) => {
md.sensorComponentLogTake({ md.sensorComponentLogTake({
...@@ -3044,8 +3105,9 @@ const handleSigninClick = throttleTap(async () => { ...@@ -3044,8 +3105,9 @@ const handleSigninClick = throttleTap(async () => {
}, 1000); }, 1000);
// 关闭签到提示弹窗 // 关闭签到提示弹窗
const handleCloseSignedTips = () => { const handleCloseSignedTips = async() => {
showSignedTips.value = false; showSignedTips.value = false;
await refreshIntegralData();
}; };
// 关闭签到规则说明弹窗 // 关闭签到规则说明弹窗
......
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