feat:将 pages 里的 uni.showToast 替换成 wd-toast
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { navigateBackPlus } from '@/utils'
|
||||
import { saveImageToAlbum } from '@/utils/download'
|
||||
|
||||
@@ -63,6 +64,8 @@ definePage({
|
||||
},
|
||||
})
|
||||
|
||||
const toast = useToast()
|
||||
|
||||
const qrCodeUrl = ref('/static/images/qrcode.png') // 客服二维码图片地址
|
||||
const servicePhone = ref('18818818818') // 客服电话号码
|
||||
|
||||
@@ -76,10 +79,7 @@ function handleCallPhone() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: servicePhone.value,
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '拨打失败',
|
||||
})
|
||||
toast.show('拨打失败')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
import type { UserProfileVO } from '@/api/system/user/profile'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { getUserProfile } from '@/api/system/user/profile'
|
||||
import { LOGIN_PAGE } from '@/router/config'
|
||||
import { useUserStore } from '@/store'
|
||||
@@ -89,6 +90,7 @@ definePage({
|
||||
|
||||
const userStore = useUserStore()
|
||||
const tokenStore = useTokenStore()
|
||||
const toast = useToast()
|
||||
const { userInfo } = storeToRefs(userStore)
|
||||
const userProfile = ref<UserProfileVO | null>(null) // 用户详细信息
|
||||
|
||||
@@ -138,10 +140,7 @@ function handleLogout() {
|
||||
return
|
||||
}
|
||||
await tokenStore.logout()
|
||||
uni.showToast({
|
||||
title: '退出登录成功',
|
||||
icon: 'success',
|
||||
})
|
||||
toast.success('退出登录成功')
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: LOGIN_PAGE })
|
||||
}, 500)
|
||||
|
||||
Reference in New Issue
Block a user