style 提示优化

This commit is contained in:
bootx
2025-08-27 13:35:31 +08:00
parent e344971caf
commit e0e6a3a8be
3 changed files with 14 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ import { ref } from 'vue'
import { showDialog } from 'vant'
import type { AuthCodeParam } from '@/views/daxpay/h5/auth/ChannelAuth.api'
import { authAndSet } from '@/views/daxpay/h5/auth/ChannelAuth.api'
import router from '@/router'
const script = document.createElement('script')
script.setAttribute(
@@ -47,7 +48,11 @@ async function init() {
authCode: authCode as string,
channel: channel as string,
})
authAndSet(param.value).then(() => {
authAndSet(param.value).then(({ code, msg }) => {
if (code !== 0) {
router.replace({ name: 'payFail', query: { msg, title: '获取信息失败' } })
return
}
show.value = false
showDialog({
message: '已成功获取用户信息!',

View File

@@ -14,6 +14,7 @@ import { onMounted, ref } from 'vue'
import { showDialog } from 'vant'
import type { AuthCodeParam } from '@/views/daxpay/h5/auth/ChannelAuth.api'
import { authAndSet } from '@/views/daxpay/h5/auth/ChannelAuth.api'
import router from '@/router'
const route = useRoute()
const { appId, channel, queryCode } = route.params
@@ -35,7 +36,11 @@ onMounted(() => {
* 页面初始化
*/
async function init() {
authAndSet(param.value).then(() => {
authAndSet(param.value).then(({ code, msg }) => {
if (code !== 0) {
router.replace({ name: 'payFail', query: { msg, title: '获取信息失败' } })
return
}
show.value = false
showDialog({
message: '已成功获取用户信息!',
@@ -48,7 +53,6 @@ async function init() {
</script>
<style scoped lang="less">
.block {
width: 120px;
height: 120px;

View File

@@ -1,8 +1,8 @@
<template>
<div class="paySuccess">
<div class="payLogo">
<img v-if="isWeiPay === 'wei'" src="../../../../assets/images/weiSuccess.png" alt="">
<img v-else src="../../../../assets/images/success1.png" alt="">
<img v-if="isWeiPay === 'wei'" src="@/assets/images/weiSuccess.png" alt="">
<img v-else src="@/assets/images/success1.png" alt="">
<p :class="{ textColor: isWeiPay === 'wei' }">
支付成功
</p>
@@ -57,7 +57,6 @@ function closeClick() {
WeixinJSBridge.call('closeWindow')
}
catch {
}
try {
AlipayJSBridge.call('closeWebview')