geek payment notify api is ready

This commit is contained in:
RockYang
2024-09-18 22:24:05 +08:00
parent 2beffd3dd3
commit f887a39912
5 changed files with 79 additions and 74 deletions

View File

@@ -139,9 +139,15 @@ const routes = [
{
path: '/admin/login',
name: 'admin-login',
meta: {title: 'Geek-AI 控制台登录'},
meta: {title: '控制台登录'},
component: () => import('@/views/admin/Login.vue'),
},
{
path: '/payReturn',
name: 'pay-return',
meta: {title: '支付回调'},
component: () => import('@/views/PayReturn.vue'),
},
{
name: 'admin',
path: '/admin',

View File

@@ -106,6 +106,12 @@
</div>
<el-dialog v-model="showDialog" :show-close=false hide-footer width="auto">
<div style="padding-bottom: 10px">
<el-button type="success" @click="payCallback(true)">支付成功</el-button>
<el-button type="danger" @click="payCallback(false)">支付失败</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -143,6 +149,7 @@ const payWays = ref([])
const vipInfoText = ref("")
const store = useSharedStore()
const profileKey = ref(0)
const showDialog = ref(false)
onMounted(() => {
@@ -193,8 +200,9 @@ const pay = (product, payWay) => {
user_id: user.value.id,
device: "jump"
}).then(res => {
window.open(res.data, '_blank');
window.open(res.data, '_blank');
loading.value = false
showDialog.value = true
}).catch(e => {
setTimeout(() => {
ElMessage.error("生成支付订单失败:" + e.message)
@@ -210,6 +218,13 @@ const redeemCallback = (success) => {
}
}
const payCallback = (success) => {
showDialog.value = false
if (success) {
profileKey.value += 1
}
}
</script>
<style lang="stylus">

View File

@@ -0,0 +1,13 @@
<template>
<div>
支付回调
</div>
</template>
<script setup>
import {useRouter} from "vue-router";
const router = useRouter()
console.log(router.currentRoute.value.query)
window.close()
</script>