|
|
@ -68,7 +68,7 @@ |
|
|
|
import { |
|
|
|
import { |
|
|
|
create, |
|
|
|
create, |
|
|
|
wechatPay, |
|
|
|
wechatPay, |
|
|
|
getHuiLianTongCardBalance, |
|
|
|
getHuiLianTongCardBalance, |
|
|
|
getThirdPartyByDetail |
|
|
|
getThirdPartyByDetail |
|
|
|
} from "../../Utils/Api.js"; |
|
|
|
} from "../../Utils/Api.js"; |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
@ -85,41 +85,41 @@ |
|
|
|
imgadres: 'wxpay.png', |
|
|
|
imgadres: 'wxpay.png', |
|
|
|
tongCardPrice: 0, |
|
|
|
tongCardPrice: 0, |
|
|
|
cardId: '', //工会卡号 |
|
|
|
cardId: '', //工会卡号 |
|
|
|
typevas: '', |
|
|
|
typevas: '', |
|
|
|
paytypeList: [] //支付方式 |
|
|
|
paytypeList: [] //支付方式 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
this.cardId = options.cardId; |
|
|
|
this.cardId = options.cardId; |
|
|
|
this.typevas = options.RechargeType; |
|
|
|
this.typevas = options.RechargeType; |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
this.getThirdPartyByDetail(); |
|
|
|
this.getThirdPartyByDetail(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
select(amount) { |
|
|
|
select(amount) { |
|
|
|
this.inputAmount = amount; |
|
|
|
this.inputAmount = amount; |
|
|
|
}, |
|
|
|
}, |
|
|
|
//查询支付方式 |
|
|
|
//查询支付方式 |
|
|
|
getThirdPartyByDetail() { |
|
|
|
getThirdPartyByDetail() { |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
this.showType = 2; |
|
|
|
this.showType = 2; |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
// #ifdef MP |
|
|
|
// #ifdef MP |
|
|
|
this.showType = 1; |
|
|
|
this.showType = 1; |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
let datas = { |
|
|
|
let datas = { |
|
|
|
platformId: this.showType, |
|
|
|
platformId: this.showType, |
|
|
|
"companyId": app.globalData.companyId, |
|
|
|
"companyId": app.globalData.companyId, |
|
|
|
productType: 8 |
|
|
|
productType: 8 |
|
|
|
} |
|
|
|
} |
|
|
|
getThirdPartyByDetail(datas).then(res => { |
|
|
|
getThirdPartyByDetail(datas).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
this.paytypeList = res.return_data.productPayType.split(','); |
|
|
|
this.paytypeList = res.return_data.productPayType.split(','); |
|
|
|
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1); |
|
|
|
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
doDeposit() { |
|
|
|
doDeposit() { |
|
|
|
if (!this.cardId) { |
|
|
|
if (!this.cardId) { |
|
|
@ -165,34 +165,34 @@ |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title: '正在提交订单...' |
|
|
|
title: '正在提交订单...' |
|
|
|
}) |
|
|
|
}) |
|
|
|
let datas = { |
|
|
|
let datas = { |
|
|
|
"childOrderList": [{ |
|
|
|
"childOrderList": [{ |
|
|
|
"goodsId": app.globalData.userInfo.id, |
|
|
|
"goodsId": app.globalData.userInfo.id, |
|
|
|
"goodsPrice": this.inputAmount, |
|
|
|
"goodsPrice": this.inputAmount, |
|
|
|
"goodsType": 8, |
|
|
|
"goodsType": 8, |
|
|
|
"saleCount": 1, |
|
|
|
"saleCount": 1, |
|
|
|
goodsSpecName:this.cardId |
|
|
|
goodsSpecName: this.cardId |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
create(datas).then(res => { |
|
|
|
create(datas).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
//模板模拟支付,实际应用请调起微信/支付宝 |
|
|
|
//模板模拟支付,实际应用请调起微信/支付宝 |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
"orderNo": res.return_data.orderNo, |
|
|
|
"orderNo": res.return_data.orderNo, |
|
|
|
"openId": app.globalData.openId, |
|
|
|
"openId": app.globalData.openId, |
|
|
|
"openIdType": 2 |
|
|
|
"openIdType": 2 |
|
|
|
} |
|
|
|
} |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
// #ifdef MP |
|
|
|
// #ifdef MP |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
"orderNo": res.return_data.orderNo, |
|
|
|
"orderNo": res.return_data.orderNo, |
|
|
|
"openId": app.globalData.openId, |
|
|
|
"openId": app.globalData.openId, |
|
|
|
"openIdType": 1 |
|
|
|
"openIdType": 1 |
|
|
|
} |
|
|
|
} |
|
|
|
// #endif |
|
|
|
// #endif |
|
|
|
wechatPay(params).then(res => { |
|
|
|
wechatPay(params).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
@ -215,11 +215,11 @@ |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
success() { |
|
|
|
success() { |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
if (that.typevas == 'Hlt') { |
|
|
|
if (that.typevas == |
|
|
|
|
|
|
|
'Hlt') { |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '../union-card-success/union-card-success?price=' + |
|
|
|
url: '../union-card-success/union-card-success?price=' + |
|
|
|
that |
|
|
|
that.inputAmount |
|
|
|
.inputAmount |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.navigateBack({}) |
|
|
|
uni.navigateBack({}) |
|
|
|