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