feat(frontend): daily-task reportEvent 接入 + exhibition 错位实现迁移
Phase F.2 前端接入: - asset-detail.vue: onLoad 触发 daily_browse_asset reportEvent(后端幂等: status=completed/claimed 时 skip;本地不缓存避免跨天去重逻辑复杂) - exhibition.vue: 删除原 exhibition 页 onLoad 的 daily_browse_asset reportEvent 调用(错位实现,浏览发生在详情页不在展厅页) - myWorks.vue: handleAssetSelect 成功分支新增 daily_place_asset reportEvent - daily-tasks.vue: 移除多余的 task-progress 文本显示(接口不返回 current_count/target_count,前端 UI 也不展示) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
cc7794e0f4
commit
5ab1a537db
@ -242,6 +242,7 @@
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import { onLoad, onShow, onHide, onUnload } from '@dcloudio/uni-app';
|
||||
import { getAssetDetailApi, getMintOrderDetailApi, likeAssetApi, unlikeAssetApi, getAssetMaterialsApi, getAssetLikersApi } from '@/utils/api.js';
|
||||
import { reportEvent } from '@/utils/task-api.js';
|
||||
import { getPreloadApi } from '@/utils/preloadApi/index';
|
||||
import { getAssetCoverRealUrl } from '@/utils/assetImageHelper.js';
|
||||
import LikeUsersModal from '@/pages/components/LikeUsersModal.vue';
|
||||
@ -857,6 +858,13 @@ onLoad((options) => {
|
||||
// 订阅跨页面点赞事件
|
||||
uni.$on('assetLikeChanged', handleAssetLikeChangedExternal);
|
||||
|
||||
// 触发每日首次浏览藏品任务(spec §3 / Phase F.2)
|
||||
// 后端幂等:completed/claimed 状态时 skip;本地不缓存避免跨天去重逻辑复杂
|
||||
const starIdBrowse = uni.getStorageSync('star_id') || 1;
|
||||
reportEvent('daily_browse_asset', starIdBrowse).catch(err => {
|
||||
console.error('上报浏览事件失败:', err);
|
||||
});
|
||||
|
||||
// craft_confirm 模式:不需要调用 loadData,而是加载本地表单数据
|
||||
if (fromParam.value === 'craft_confirm') {
|
||||
craftConfirmMode.value = true;
|
||||
|
||||
@ -377,7 +377,6 @@ export default {
|
||||
import NftCard from '../components/NftCard.vue';
|
||||
import { getMyGalleriesApi, placeAssetToGalleryApi, getMyAssetsApi, removeAssetFromGalleryApi, getUserGalleriesApi, getRandomGalleryApi } from '@/utils/api.js';
|
||||
import { getAssetCoverRealUrl } from '@/utils/assetImageHelper.js';
|
||||
import { reportEvent } from '@/utils/task-api.js';
|
||||
import GuideOverlay from "@/components/GuideOverlay.vue";
|
||||
|
||||
const store = useStore();
|
||||
@ -1561,12 +1560,6 @@ export default {
|
||||
// 加载展馆槽位信息
|
||||
loadGallerySlots();
|
||||
|
||||
// 上报每日首次预览事件
|
||||
const starId = uni.getStorageSync('star_id') || 1
|
||||
reportEvent('daily_browse_asset', starId).catch(err => {
|
||||
console.error('上报预览事件失败:', err)
|
||||
})
|
||||
|
||||
// 启动倒计时定时器(每秒更新一次)
|
||||
countdownTimer = setInterval(() => {
|
||||
updateCountdowns();
|
||||
|
||||
@ -218,7 +218,7 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, computed } from 'vue';
|
||||
import { getMyExhibitedAssetsApi, getMyLikedAssetsApi, getMyTodayLikedAssetsApi, getMyWeekLikedAssetsApi, getMyGalleriesApi, placeAssetToGalleryApi, getAssetMaterialsApi, claimLikeBetRevenue } from '@/utils/api.js';
|
||||
import { getExhibitionRevenue, claimExhibitionRevenue } from '@/utils/task-api.js';
|
||||
import { getExhibitionRevenue, claimExhibitionRevenue, reportEvent } from '@/utils/task-api.js';
|
||||
import AssetSelector from '../components/AssetSelector.vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { doubleTapLike } from '@/utils/likeHelper.js';
|
||||
@ -346,6 +346,13 @@ const handleAssetSelect = async ({ asset, isReplace, oldAsset }) => {
|
||||
console.log('调用展出接口: asset_id=', asset.asset_id, 'ownerId=', ownerId, 'slotId=', targetSlotId);
|
||||
await placeAssetToGalleryApi(asset.asset_id, ownerId, targetSlotId);
|
||||
|
||||
// 触发每日首次上架任务(spec §3 / Phase F.2)
|
||||
// 后端幂等:completed/claimed 状态时 skip
|
||||
const starIdPlace = uni.getStorageSync('star_id') || 1;
|
||||
reportEvent('daily_place_asset', starIdPlace).catch(err => {
|
||||
console.error('上报上架事件失败:', err);
|
||||
});
|
||||
|
||||
uni.showToast({ title: '展出成功', icon: 'success' });
|
||||
await loadExhibitedAssets();
|
||||
|
||||
|
||||
@ -59,8 +59,6 @@
|
||||
<view v-for="task in sortedTasks" :key="task.task_key" class="task-item">
|
||||
<view class="task-info">
|
||||
<text class="task-name">{{ task.name }}</text>
|
||||
<text class="task-progress" v-if="task.current_count !== undefined">({{
|
||||
task.current_count }}/{{ task.target_count }})</text>
|
||||
</view>
|
||||
|
||||
<view class="task-right">
|
||||
@ -717,13 +715,6 @@ const handleCloseClick = (e) => {
|
||||
text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.task-progress {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-family: 'yt', sans-serif;
|
||||
text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.task-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user