调整支付功能
This commit is contained in:
@@ -34,7 +34,7 @@ const request = (parameter, hideLoding) => {
|
||||
|
||||
// 加载提示
|
||||
if(!hideLoding) uni.showLoading({
|
||||
title: '加载中',
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
});
|
||||
|
||||
@@ -47,11 +47,11 @@ const request = (parameter, hideLoding) => {
|
||||
data : parameter.data || {},
|
||||
method : parameter.method || 'GET',
|
||||
success : res => {
|
||||
uni.hideLoading()
|
||||
if (res.header.Authorization){
|
||||
updateToken('token', res.header.Authorization)
|
||||
}
|
||||
if(res.statusCode === 200){
|
||||
uni.hideLoading()
|
||||
const resolveData = res.data
|
||||
if(resolveData.status_code === 200) {
|
||||
resolve(resolveData.data)
|
||||
|
||||
@@ -34,7 +34,7 @@ const umsDiff = (diffPriceId, data) =>{
|
||||
const umsState = (trade_id) => {
|
||||
return request({
|
||||
url : 'payments/query/' + trade_id,
|
||||
})
|
||||
}, false)
|
||||
}
|
||||
|
||||
// 斗拱支付 - 咨询单
|
||||
@@ -164,6 +164,9 @@ const payInfo = data => {
|
||||
}
|
||||
|
||||
const payWechat = data => {
|
||||
|
||||
console.log('111')
|
||||
|
||||
return request({
|
||||
url : "pay/cashier_desk/wechat",
|
||||
method : 'POST',
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
"aliasPath": "/login/login",
|
||||
"name": "Login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "抖火法律-登录"
|
||||
"navigationBarTitleText": "抖火法律-登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/login/agreement",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<!-- web.douhuotest.douhuofalv dev=0是线上 dev=1是线下 -->
|
||||
<wx-open-launch-weapp
|
||||
username="gh_918c81628d6f"
|
||||
:path="'pages/pay/pay?type=h5&dev=0&trade_id=' + tradeId + '&token=' + token"
|
||||
:path="'pages/pay/pay?type=h5&dev=1&trade_id=' + tradeId + '&token=' + token"
|
||||
>
|
||||
<script type="text/wxtag-template">
|
||||
<style>
|
||||
@@ -96,8 +96,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
getState : false,
|
||||
tradeId : '',
|
||||
tradeId : '20230712115651357160000028',
|
||||
token : this.$store.getters.getToken,
|
||||
orderNo : '',
|
||||
orderId : '',
|
||||
@@ -109,16 +108,12 @@
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if(this.getState && this.tradeId != ''){
|
||||
if(this.tradeId != ''){
|
||||
this.onGetOrderPayState()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let { orderId, orderType } = this.$Route.query
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
payInfo({
|
||||
order_type : orderType,
|
||||
order_id : orderId
|
||||
@@ -139,9 +134,8 @@
|
||||
methods: {
|
||||
// 查询订单状态
|
||||
onGetOrderPayState(){
|
||||
// 查询支付状态
|
||||
uni.showLoading({
|
||||
title: '查询支付结果...',
|
||||
title: '查询支付',
|
||||
mask : true
|
||||
})
|
||||
let outTime;
|
||||
@@ -155,11 +149,11 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
umsState(this.trade_id).then(res => {
|
||||
umsState(this.tradeId).then(res => {
|
||||
resNumb++
|
||||
if(res.state === 'success'){
|
||||
clearInterval(outTime)
|
||||
console.log('支付成功')
|
||||
this.payMakePop = true
|
||||
}
|
||||
}).catch(err => {
|
||||
clearInterval(outTime)
|
||||
@@ -185,8 +179,7 @@
|
||||
order_id : this.orderId,
|
||||
openid : openId,
|
||||
use_fire : 0,
|
||||
fire : 0,
|
||||
type : payType
|
||||
fire : 0
|
||||
}).then(res => {
|
||||
let wxConfig = JSON.parse(res.wechat)
|
||||
jweixin.config({
|
||||
@@ -215,6 +208,11 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
// 获取微信授权信息-获取oppid
|
||||
@@ -241,14 +239,13 @@
|
||||
type : payType
|
||||
}).then(res => {
|
||||
let { trade_id } = res;
|
||||
this.getState = true
|
||||
this.tradeId = trade_id
|
||||
switch (payType){
|
||||
case 'mp':
|
||||
this.tradeId = res.trade_id
|
||||
this.tradeId = trade_id
|
||||
break;
|
||||
case 'mp_alipay':
|
||||
this.tradeId = res.trade_id
|
||||
this.tradeId = trade_id
|
||||
window.location.href = res.alipay
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user