Commit 48a8bedb authored by spc's avatar spc

fixed

parent 78d11b62
...@@ -256,8 +256,13 @@ onMounted(async () => { ...@@ -256,8 +256,13 @@ 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');
}
}; };
// 完成任务并显示完成提示 // 完成任务并显示完成提示
......
...@@ -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,58 @@ watch( ...@@ -2093,9 +2093,58 @@ 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 };
});
} catch (error) {
console.error('刷新积分页数据失败:', error);
}
};
onMounted(async () => { onMounted(async () => {
// showSignedTips.value = true; // showSignedTips.value = true;
showLoading(); showLoading();
...@@ -2209,6 +2258,9 @@ onMounted(async () => { ...@@ -2209,6 +2258,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 +2284,11 @@ onMounted(async () => { ...@@ -2232,6 +2284,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 +3101,9 @@ const handleSigninClick = throttleTap(async () => { ...@@ -3044,8 +3101,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