初始化

master
法外狂徒张三 2024-08-29 19:41:41 +08:00
parent 75842cb2e5
commit 00fd0d3379
3 changed files with 37 additions and 13 deletions

View File

@ -1,5 +1,14 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询firminfoList列表
export function listFirminfo(query) {
return request({
url: '/market/firminfo/list',
method: 'get',
params: query
})
}
// 查询firminfoList详细 // 查询firminfoList详细
export function getFirminfo(firmId) { export function getFirminfo(firmId) {
return request({ return request({

View File

@ -1,9 +1,11 @@
import request from '@/utils/request' import request from '@/utils/request'
export function pay(query1, query2,query3) { export function pay(query) {
return request({ 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
}) })
} }
// 查询接口列表 // 查询接口列表

View File

@ -59,7 +59,7 @@
<el-col :span="8" v-for="customer in apitypeList" v-if="apitypeList.length != 0&&activeNameL=='全部类型'||customer.sysLeixingpick==activeNameL"> <el-col :span="8" v-for="customer in apitypeList" v-if="apitypeList.length != 0&&activeNameL=='全部类型'||customer.sysLeixingpick==activeNameL">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <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"> <div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span> 加载中<span class="dot">...</span>
</div> </div>
@ -145,23 +145,36 @@ export default {
// //
rules: { rules: {
}, },
pay:{ paymentStatus: null, //
alipayUrl: null, // URL
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
async gotoMaintained(customer){ async initiatePayment(customer){
this.pay.subject=customer.sysIntro try {
this.pay.traceNo=Math.floor(Math.random() * 900000) + 100000 this.paymentStatus = 'loading';
this.pay.totalAmount=customer.sysNumber const response = await axios.get('/alipay/pay', {
pay(this.pay.subject,this.pay.traceNo,this.pay.totalAmount).then(response=>{ params: {
console.log(response) 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){ getType(activeNameL){
this.activeNameL=activeNameL this.activeNameL=activeNameL
}, },