feat:客服

This commit is contained in:
李伊帆
2026-10-16 08:53:45 +08:00
parent e22ebd6bef
commit 03839624ed
42 changed files with 1375 additions and 483 deletions

View File

@@ -1,6 +1,6 @@
import { onShow } from '@dcloudio/uni-app'
import { computed, ref } from 'vue'
import { logout } from '@/api/auth'
import { cancelAccount, logout } from '@/api/auth'
import { fetchProfile } from '@/api/profile'
import { getErrorMessage } from '@/utils/api-error'
import { teardownMessageInbox } from '@/hooks/use-message-inbox'
@@ -58,7 +58,7 @@ export function usePrivacy() {
function onItemTap(itemId: string) {
if (itemId === 'password') {
uni.navigateTo({ url: '/pages/mine/set-password/verify/index' })
uni.navigateTo({ url: '/pages/forgot-password/index?from=privacy' })
return
}
if (itemId === 'phone') {
@@ -72,7 +72,17 @@ export function usePrivacy() {
confirmColor: '#f04438',
success: (res) => {
if (!res.confirm) return
uni.showToast({ title: '注销功能待对接', icon: 'none' })
void (async () => {
try {
await cancelAccount()
teardownMessageInbox()
clearStoredToken()
uni.showToast({ title: '账号已注销', icon: 'success' })
uni.reLaunch({ url: '/pages/login/index' })
} catch (err) {
uni.showToast({ title: getErrorMessage(err, '注销失败'), icon: 'none' })
}
})()
},
})
}