初始化

master
法外狂徒张三 2024-08-30 22:37:11 +08:00
parent 1d4071d451
commit 60dd3c9b86
2 changed files with 15 additions and 102 deletions

View File

@ -1,11 +1,11 @@
import request from '@/utils/request' import request from '@/utils/request'
export function pay(data) { export function pay(query) {
return request({ return request({
url: '/pay/alipay/pay/payZFB', url: '/pay/alipay/pay',
method: 'post', method: 'get',
data: data params: query
}) })
} }
// 查询接口列表 // 查询接口列表

View File

@ -94,29 +94,6 @@
@pagination="getList" @pagination="getList"
/> />
<el-dialog title="" :visible.sync="dialogTableVisible">
<el-card class="box-card">
<ul class="msg-box">
<li>
<h4>我要支付</h4>
</li>
<li>
<h4 style="margin-bottom: 15px;">支付金额</h4>
<h4 style="margin-bottom: 15px;">{{rechargeParams.totalAmt}}</h4>
</li>
<li>
<h4 style="margin-bottom: 15px;">支付方式</h4>
<el-radio-group v-model="rechargeParams.paymentType" @change="paymentTypeChange">
<el-radio border :label="''+ 1">支付宝</el-radio>
<el-radio border :label="''+ 0">微信</el-radio>
</el-radio-group>
</li>
</ul>
<div style="text-align: center; margin-top: 30px;">
<el-button type="primary" @click="surePay"></el-button>
</div>
</el-card>
</el-dialog>
</el-tabs> </el-tabs>
@ -132,7 +109,6 @@ export default {
data() { data() {
return { return {
dialogTableVisible:false,
all:"全部类型", all:"全部类型",
activeNameL:"全部类型", activeNameL:"全部类型",
editableTabs: [], editableTabs: [],
@ -170,87 +146,23 @@ export default {
// //
rules: { rules: {
}, },
amountVal: '', pay:{
disabled: false,
// },
returnUrl:'http://localhost:80/#/entertainment/payment',
//
rechargeParams: {
"totalAmt": '', //
"paymentType": "0", //[0:,1:,2:,3:]
"transType": "1", //[0:,1:]
"subject":""
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
paymentTypeChange(val) {
this.rechargeParams.paymentType = val
},
//
async surePay() {
if (this.rechargeParams.totalAmt === '') {
this.$message.warning('请输入金额');
return;
}
if (this.rechargeParams.paymentType === '0') {
} else if (this.rechargeParams.paymentType === '1') {
let praem = {
// 便
outTradeNo:this.getProjectNum() + Math.floor(Math.random() * 10000),
//
totalAmount:this.rechargeParams.totalAmt,
//
returnUrl:this.returnUrl,
//
subject:'支付金额',
//
productCode:'FAST_INSTANT_TRADE_PAY'
}
pay(praem).then(code => {
if (code.code === 200) {
//
this.$message.success('支付宝支付')
const payDiv = document.getElementById('payDiv');
if (payDiv) {
document.body.removeChild(payDiv);
}
const div = document.createElement('div');
div.id = 'payDiv';
div.innerHTML = code.data;
document.body.appendChild(div);
document.getElementById('payDiv').getElementsByTagName('form')[0].submit();
}
})
}
},
//
getProjectNum () {
const projectTime = new Date() //
const Year = projectTime.getFullYear() // IE.
const Month = projectTime.getMonth() + 1 //
const Day = projectTime.getDate() //
var CurrentDate = Year
if (Month >= 10) { // 1010
CurrentDate += Month
} else {
CurrentDate += '0' + Month
}
if (Day >= 10) {
CurrentDate += Day
} else {
CurrentDate += '0' + Day
}
return CurrentDate
},
gotoMaintained(customer){ gotoMaintained(customer){
this.dialogTableVisible=true; this.pay.subject=customer.sysIntro
this.rechargeParams.totalAmt=customer.sysNumber; this.pay.traceNo=Math.floor(Math.random() * 900000) + 100000
this.rechargeParams.subject=customer.sysIntro; this.pay.totalAmount=customer.sysNumber
this.pay.returnUrl = `http://47.116.173.119:80/alipay/pay?subject=${this.pay.subject}&traceNo=${this.pay.traceNo}&totalAmount=${this.pay.totalAmount}`;
pay(this.pay).then(res => {
console.log(res);
})
}, },
getType(activeNameL){ getType(activeNameL){
this.activeNameL=activeNameL this.activeNameL=activeNameL
@ -270,6 +182,7 @@ export default {
// Map // Map
this.editableTabs = Array.from(uniqueSysLeixingpick.values()) ; this.editableTabs = Array.from(uniqueSysLeixingpick.values()) ;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
} }