功能:新增下一阶段运营能力和生产部署

This commit is contained in:
xiaowang
2026-05-24 18:09:11 +08:00
parent 8116abc9b5
commit 1d077d4089
157 changed files with 9206 additions and 74 deletions
+20 -3
View File
@@ -13,6 +13,7 @@ const couponApi = require('../../api/coupon')
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const orderApi = require('../../api/order')
const growthApi = require('../../api/growth')
/**
* Purpose: userApi supports index.js by holding or executing the user api page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
@@ -46,6 +47,18 @@ const theme = require('../../utils/theme')
const { DEFAULT_AVATAR } = require('../../utils/config')
const { runWithLoading } = require('../../utils/loading')
function formatGrowthSummary(summary) {
if (!summary) {
return null
}
return {
levelName: summary.levelName || '成长新客',
growthValue: Number(summary.growthValue || 0),
appointmentCount: Number(summary.appointmentCount || 0),
reviewCount: Number(summary.reviewCount || 0)
}
}
/**
* profile page logic.
* Call guide: page data drives the WXML template, and each method is called by user events or lifecycle callbacks.
@@ -61,6 +74,7 @@ Page({
couponCount: 0,
wishlistCount: 0,
unreadMessageCount: 0,
growthSummary: null,
defaultAvatar: DEFAULT_AVATAR
}),
@@ -91,19 +105,21 @@ Page({
orderCount: 0,
couponCount: 0,
wishlistCount: 0,
growthSummary: null,
loading: false
})
return
}
try {
const [userInfo, orders, coupons, wishlist, unreadMessages, pendingReviews] = await Promise.all([
const [userInfo, orders, coupons, wishlist, unreadMessages, pendingReviews, growthSummary] = await Promise.all([
userApi.getUserInfo(),
orderApi.getOrderList(),
couponApi.listUserCoupons(),
wishlistApi.getWishlist(),
userApi.getMyUnreadMessageCount(),
orderApi.listMyPendingReviews().catch(() => [])
orderApi.listMyPendingReviews().catch(() => []),
growthApi.getGrowthSummary().catch(() => null)
])
getApp().refreshUserInfo(userInfo)
@@ -113,7 +129,8 @@ Page({
pendingReviewCount: Array.isArray(pendingReviews) ? pendingReviews.length : 0,
couponCount: Array.isArray(coupons) ? coupons.length : 0,
wishlistCount: Array.isArray(wishlist) ? wishlist.length : 0,
unreadMessageCount: Number((unreadMessages && unreadMessages.unreadCount) || 0)
unreadMessageCount: Number((unreadMessages && unreadMessages.unreadCount) || 0),
growthSummary: formatGrowthSummary(growthSummary)
})
await this.checkPopupMessages()
} catch (error) {