初始化

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'
// 查询firminfoList列表
export function listFirminfo(query) {
return request({
url: '/market/firminfo/list',
method: 'get',
params: query
})
}
// 查询firminfoList详细
export function getFirminfo(firmId) {
return request({

View File

@ -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
})
}
// 查询接口列表

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-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
},