perf: 支持约课以及消息推送能力

This commit is contained in:
richarjiang
2026-04-12 21:44:44 +08:00
parent 9639f44698
commit c60821c5ff
28 changed files with 963 additions and 86 deletions

View File

@@ -182,10 +182,12 @@
import { ref, computed, onMounted } from 'vue'
import type { CardType, CreateOrderResponse } from '@mp-pilates/shared'
import { CardTypeCategory } from '@mp-pilates/shared'
import { getErrorMessage } from '../../utils/auth'
import { get, post } from '../../utils/request'
import { formatPrice, getCardTypeLabel, getCardCoverClass } from '../../utils/format'
import { getSystemLayout } from '../../utils/system'
import { useUserStore } from '../../stores/user'
import { requestOrderPaidSubscriptionMessage } from '../../utils/wechat-subscription'
import CustomNavBar from '../../components/CustomNavBar.vue'
const userStore = useUserStore()
@@ -287,8 +289,8 @@ async function handleBuy() {
if (!isNewUser) {
handleBuy()
}
} catch {
uni.showToast({ title: '登录失败', icon: 'none' })
} catch (err: unknown) {
uni.showToast({ title: getErrorMessage(err, '登录失败'), icon: 'none' })
}
}
},
@@ -334,6 +336,7 @@ async function doPurchase() {
})
// Payment succeeded — refresh memberships then navigate
await requestOrderPaidSubscriptionMessage().catch(() => undefined)
uni.showToast({ title: '购买成功!', icon: 'success' })
await userStore.fetchMemberships()
setTimeout(() => {