功能(小程序):同步用户体验流程到小程序

This commit is contained in:
xiaowang
2026-05-23 21:56:52 +08:00
parent 861eea933b
commit b67dae502f
38 changed files with 2163 additions and 126 deletions
+19 -2
View File
@@ -57,6 +57,7 @@ Page({
needSetPassword: false,
userInfo: null,
orderCount: 0,
pendingReviewCount: 0,
couponCount: 0,
wishlistCount: 0,
unreadMessageCount: 0,
@@ -96,18 +97,20 @@ Page({
}
try {
const [userInfo, orders, coupons, wishlist, unreadMessages] = await Promise.all([
const [userInfo, orders, coupons, wishlist, unreadMessages, pendingReviews] = await Promise.all([
userApi.getUserInfo(),
orderApi.getOrderList(),
couponApi.listUserCoupons(),
wishlistApi.getWishlist(),
userApi.getMyUnreadMessageCount()
userApi.getMyUnreadMessageCount(),
orderApi.listMyPendingReviews().catch(() => [])
])
getApp().refreshUserInfo(userInfo)
this.setData({
userInfo,
orderCount: Array.isArray(orders) ? orders.length : 0,
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)
@@ -160,6 +163,20 @@ Page({
navigation.navigate('/pages/orders/index')
},
/**
* Purpose: handleOpenPendingReviews jumps straight to the order-page pending review focus.
* Usage: bind the pending-review card in profile WXML.
*/
handleOpenPendingReviews() {
if (!navigation.ensureLogin('查看待评价')) {
return
}
navigation.navigate('/pages/orders/index', {
review: 'pending',
source: 'profile'
})
},
/**
* `handleOpenWishlist` page method. Use this from WXML event bindings or lifecycle hooks.
* Call guide: read or update page data with `this.setData(...)` inside the method when state changes.