初始化
parent
75842cb2e5
commit
00fd0d3379
|
@ -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({
|
||||||
|
|
|
@ -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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询接口列表
|
// 查询接口列表
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue