diff --git a/src/views/market/apitype/index.vue b/src/views/market/apitype/index.vue index 5373dae..c8855aa 100644 --- a/src/views/market/apitype/index.vue +++ b/src/views/market/apitype/index.vue @@ -59,7 +59,7 @@
- +
加载中...
@@ -145,34 +145,16 @@ export default { // 表单校验 rules: { }, - paymentStatus: null, // 初始支付状态 - alipayUrl: null, // 支付宝支付页面的URL }; }, created() { this.getList(); }, methods: { - async initiatePayment(customer){ - try { - this.paymentStatus = 'loading'; - const response = await axios.get('/alipay/pay', { - params: { - subject: customer.sysIntro, - traceNo: Math.floor(Math.random() * 900000) + 100000, // 商户订单号 - totalAmount: customer.sysNumber, // 金额,单位为元 - }, - }); - this.alipayUrl = URL.createObjectURL(new Blob([response.data], { type: 'text/html' })); - window.location.href = this.alipayUrl; // 或者使用iframe显示 - - this.paymentStatus = 'success'; - - } catch (error) { - console.error('支付请求失败:', error); - this.paymentStatus = 'error'; - } + async goToPaySuccess(customer){ + //在这里我选择了window.open(url,'_self')形式,也就是不跳转新的页面,在本页面直接跳转 + window.open("http://127.0.0.1:8080/alipay/pay?subject="+customer.sysIntro+"&traceNo="+Math.floor(Math.random() * 900000) + 100000+"&totalAmount="+customer.sysNumber,'_self') }, getType(activeNameL){