初始化
parent
75842cb2e5
commit
00fd0d3379
|
@ -1,5 +1,14 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询firminfoList列表
|
||||
export function listFirminfo(query) {
|
||||
return request({
|
||||
url: '/market/firminfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询firminfoList详细
|
||||
export function getFirminfo(firmId) {
|
||||
return request({
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
export function pay(query1, query2,query3) {
|
||||
export function pay(query) {
|
||||
return request({
|
||||
url: 'http://10.0.2.1:81/alipay/pay?subject='+query1+'&traceNo='+query2+'&totalAmount='+query3
|
||||
url: '/pay/alipay/pay',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询接口列表
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<el-col :span="8" v-for="customer in apitypeList" v-if="apitypeList.length != 0&&activeNameL=='全部类型'||customer.sysLeixingpick==activeNameL">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-image :src="customer.sysTypes" @click="gotoMaintained(customer)">
|
||||
<el-image :src="customer.sysTypes" @click="initiatePayment(customer)">
|
||||
<div slot="placeholder" class="image-slot">
|
||||
加载中<span class="dot">...</span>
|
||||
</div>
|
||||
|
@ -145,23 +145,36 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
pay:{
|
||||
|
||||
},
|
||||
paymentStatus: null, // 初始支付状态
|
||||
alipayUrl: null, // 支付宝支付页面的URL
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
async gotoMaintained(customer){
|
||||
this.pay.subject=customer.sysIntro
|
||||
this.pay.traceNo=Math.floor(Math.random() * 900000) + 100000
|
||||
this.pay.totalAmount=customer.sysNumber
|
||||
pay(this.pay.subject,this.pay.traceNo,this.pay.totalAmount).then(response=>{
|
||||
console.log(response)
|
||||
})
|
||||
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';
|
||||
}
|
||||
},
|
||||
|
||||
getType(activeNameL){
|
||||
this.activeNameL=activeNameL
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue