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 @@
<Brand v-if="globalStore.curTabIndex == 1 && !globalStore.isWxFriendCircle" :scroll-top="scrollTop" />
<Integral v-if="globalStore.curTabIndex == 2 && !globalStore.isWxFriendCircle" :scrollTop="scrollTop" />
<My v-if="globalStore.curTabIndex == 3 && !globalStore.isWxFriendCircle" />
<TabBar
v-if="!globalStore.isWxFriendCircle"
:curTabIndex="globalStore.curTabIndex"
@tabClick="handleTabClick"
/>
<TabBar v-if="!globalStore.isWxFriendCircle" :curTabIndex="globalStore.curTabIndex" @tabClick="handleTabClick" />
<WxFriendCircleSimplePage v-if="globalStore.isWxFriendCircle" />
<!-- 邀请奖品弹窗 -->
<InvitePrizePanel
:visible="globalStore.isShowInvitePrizePanel"
:inviteCount="globalStore.inviteCount"
:prizeName="globalStore.prizeName"
:prizeImage="globalStore.prizeImage"
:prizeType="globalStore.prizeType"
:memberId="globalStore.memberId"
@close="handleCloseInvitePrizePanel"
@record="handleInvitePrizePanelRecord"
@prize="handleInvitePrizePanelPrize"
/>
<InvitePrizePanel :visible="globalStore.isShowInvitePrizePanel" :inviteCount="globalStore.inviteCount"
:prizeName="globalStore.prizeName" :prizeImage="globalStore.prizeImage" :prizeType="globalStore.prizeType"
:memberId="globalStore.memberId" @close="handleCloseInvitePrizePanel" @record="handleInvitePrizePanelRecord"
@prize="handleInvitePrizePanelPrize" />
<!-- 任务完成弹窗 -->
<!-- <TaskComplete
......@@ -34,61 +23,32 @@
/> -->
<!-- 任务弹窗 -->
<TaskPop
:visible="globalStore.isShowTaskPop"
:taskTodo="globalStore.taskTodo"
@close="handleCloseTaskPop"
@taskClick="handleTaskClick"
/>
<TaskPop :visible="globalStore.isShowTaskPop" :taskTodo="globalStore.taskTodo" @close="handleCloseTaskPop"
@taskClick="handleTaskClick" />
<!-- 任务完成提示弹窗 -->
<TaskCompleteTips
:visible="globalStore.isShowTaskComplete"
:points="globalStore.taskCompletePoints"
:taskTitle="globalStore.taskCompleteTitle"
@close="handleCloseTaskCompleteTips"
/>
<TaskCompleteTips :visible="globalStore.isShowTaskComplete" :points="globalStore.taskCompletePoints"
:taskTitle="globalStore.taskCompleteTitle" @close="handleCloseTaskCompleteTips" />
<!-- 任务信息弹窗 -->
<TaskPerson
:visible="globalStore.isShowTaskPerson"
@close="handleCloseTaskPerson"
@submit="handleTaskPersonSubmit"
/>
<TaskPerson :visible="globalStore.isShowTaskPerson" @close="handleCloseTaskPerson"
@submit="handleTaskPersonSubmit" />
<!-- 公众号弹窗 -->
<GongzhonghaoPop
:visible="showGongzhonghaoPop"
:title="gongzhonghaoTitle"
:description="gongzhonghaoDescription"
:qrCodeUrl="gongzhonghaoQrCodeUrl"
@close="handleCloseGongzhonghaoPop"
@download="handleDownloadQrCode"
/>
<GongzhonghaoPop :visible="showGongzhonghaoPop" :title="gongzhonghaoTitle" :description="gongzhonghaoDescription"
:qrCodeUrl="gongzhonghaoQrCodeUrl" @close="handleCloseGongzhonghaoPop" @download="handleDownloadQrCode" />
<!-- 视频弹窗 -->
<view v-if="showVideo" class="video-popup1">
<video
:src="currentVideoUrl"
controls
autoplay
:style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
@loadedmetadata="onVideoLoadedMeta"
@play="onVideoPlay"
></video>
<video :src="currentVideoUrl" controls autoplay :style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
@loadedmetadata="onVideoLoadedMeta" @play="onVideoPlay"></video>
<view class="close-btn-bottom" @tap="closeVideo">×</view>
</view>
<button
v-if="isBackApp"
class="back-app"
open-type="launchApp"
app-parameter="wechat"
@binderror="handleLaunchAppError"
:style="{
<button v-if="isBackApp" class="back-app" open-type="launchApp" app-parameter="wechat"
@binderror="handleLaunchAppError" :style="{
backgroundImage: `url(${$baseUrl}homepage/backAppBtn.png)`,
}"
>
}">
<!-- <text class="back-text">返回app</text> -->
</button>
......@@ -96,11 +56,7 @@
<view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile">
<image class="auth-phone-bg" :src="$baseUrl + 'homepage/Q3Res/accessBg3.png'"></image>
<view class="auth-phone-btn-container">
<image
class="auth-phone-btn"
:src="$baseUrl + 'homepage/Q3Res/accessBtn3.png'"
@tap="handleAuthPhoneClick"
>
<image class="auth-phone-btn" :src="$baseUrl + 'homepage/Q3Res/accessBtn3.png'" @tap="handleAuthPhoneClick">
</image>
</view>
</view>
......@@ -258,6 +214,11 @@ onMounted(async () => {
const handleCloseTaskCompleteTips = async () => {
globalStore.isShowTaskComplete = false;
await checkAndUpdateTaskResult();
// 如果当前在积分权益页,通过事件通知 Integral 组件刷新数据
if (globalStore.curTabIndex === 2) {
uni.$emit('refreshIntegralData');
}
};
// 完成任务并显示完成提示
......@@ -281,7 +242,7 @@ const handleTaskComplete = async (taskIdParam) => {
globalStore.isShowTaskComplete = true;
globalStore.taskCompletePoints = integralStore.queryTodoResult.data[0]?.actualCredits;
globalStore.taskCompleteTitle = integralStore.queryTodoResult.data[0]?.taskName;
}else{
} else {
console.info('taskCompleteJSON res error:', integralStore.queryTodoResult);
}
......@@ -303,6 +264,11 @@ onShow(async () => {
//完成了浏览任务
if (taskId.value > 0) {
await handleTaskComplete(taskId.value);
} else {
const integralStore = useIntegralStore();
await integralStore.getSigninAndTaskInfo();
await checkAndUpdateTaskResult()
}
});
......@@ -498,6 +464,7 @@ const handleTaskClick = async (data) => {
// console.log('extra66666:', extra1);
break;
case 'FirstOrder': //完成首单优选消费
globalStore.closeTaskPop(); // 先关闭TaskPop
const extra2 = JSON.parse(data?.task?.taskTodoExtra?.extra);
console.log('extra666661111:', extra2);
jump({
......@@ -507,6 +474,7 @@ const handleTaskClick = async (data) => {
});
break;
case 'EXCHANGE_GOODS': //消费商品
globalStore.closeTaskPop(); // 先关闭TaskPop
const extra3 = JSON.parse(data?.task?.taskTodoExtra?.extra);
if (extra3.length > 0) {
......
......@@ -784,6 +784,10 @@ export default {
// 已抢完:灰色背景
classes['sold-out'] = true;
break;
case 5:
// 已结束或未开始:灰色背景
classes['disabled'] = true;
break;
default:
// 默认状态:金色背景
break;
......@@ -813,6 +817,12 @@ export default {
return '已达兑换上限';
case 4:
return '已抢完';
case 5:
// 如果有自定义按钮文本,优先使用
if (this.goodsData.buttonText && this.goodsData.buttonText !== '立即兑换') {
return this.goodsData.buttonText;
}
return '已结束';
default:
// 如果有自定义按钮文本,优先使用
if (this.goodsData.buttonText && this.goodsData.buttonText !== '立即兑换') {
......
......@@ -631,7 +631,7 @@
<template v-else>
<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
>{{ goodItem?.priceMarket / 100 }}</text
>
......@@ -2096,6 +2096,59 @@ watch(
{ 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 () => {
// showSignedTips.value = true;
showLoading();
......@@ -2209,6 +2262,9 @@ onMounted(async () => {
hideLoading();
initExposure();
// 监听刷新积分页数据事件
uni.$on('refreshIntegralData', refreshIntegralData);
//曝光埋点累计积分
if (memberInfo.value.grade == 0 && !memberInfo.value.orderUpgrade && points.value >= 1) {
md.sensorComponentLogTake({
......@@ -2232,6 +2288,11 @@ onMounted(async () => {
}
});
// 组件卸载时取消事件监听
onBeforeUnmount(() => {
uni.$off('refreshIntegralData', refreshIntegralData);
});
const initExposure = () => {
imgInfos.value?.forEach((item, index) => {
md.sensorComponentLogTake({
......@@ -3044,8 +3105,9 @@ const handleSigninClick = throttleTap(async () => {
}, 1000);
// 关闭签到提示弹窗
const handleCloseSignedTips = () => {
const handleCloseSignedTips = async() => {
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