1.添加团油银联支付

master
杨杰 3 years ago
parent 0d7b762949
commit aa167bd910
  1. 95
      high-unionPay/pages/goods/refuel-confirm/refuel-confirm.vue
  2. 2
      high-unionPay/pages/unionPay/recharge-centre/recharge-centre.vue

@ -79,6 +79,7 @@
import { import {
getOrderById, getOrderById,
orderToPay, orderToPay,
unionPay,
hltUnionCardPay hltUnionCardPay
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
@ -129,7 +130,6 @@
}) })
let params = { let params = {
"orderId": this.orderNo, "orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword "password": this.PaymentPassword
} }
hltUnionCardPay(params).then(res => { hltUnionCardPay(params).then(res => {
@ -202,26 +202,44 @@
return; return;
} }
if (that.paytype == 'weixin') { if (that.paytype == 'weixin') {
let params = { that.unionPay();
"orderId": that.orderNo, return;
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER"
} }
orderToPay(params).then(res => { if(that.paytype == 'gonghuika'){
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
that.$refs.paymentPassword.modalFun('show');
}
},
//
unionPay() {
let goods = {
"orderId": this.orderNo
}
unionPay(goods).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP this.uniontopay(res.return_data.prepayid);
uni.showLoading({ } else {
title: '支付中...' uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
});
}
}) })
uni.requestPayment({ },
"appId": res.return_data.appId, //
"nonceStr": res.return_data.nonceStr, uniontopay(item) {
"package": res.return_data.package, let that = this;
"paySign": res.return_data.sign, upsdk.pluginReady(function() {
"signType": "MD5", upsdk.pay({
"timeStamp": res.return_data.timeStamp, tn: item,
success: function(res) { success: function(res) {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
@ -230,50 +248,15 @@
}); });
}, },
fail: function(err) { fail: function(err) {
uni.hideLoading();
},
});
// #endif
//
// #ifdef H5
//
that.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
icon: 'none'
})
}
})
return;
}
if(that.paytype == 'gonghuika'){
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetHltCard) {
uni.showToast({ uni.showToast({
title: err.msg,
icon: 'none', icon: 'none',
title: '当前账号还未绑定,前往绑定', duration: 2000
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
}) })
}, 1000) // , err.msg , TN,
} }
}); });
return; });
}
that.$refs.paymentPassword.modalFun('show');
}
} }
} }
} }

@ -14,7 +14,7 @@
<view class="list"> <view class="list">
<view class="box" :class="{'on':item.realPrice == inputAmount}" v-for="(item,index) in amountList" <view class="box" :class="{'on':item.realPrice == inputAmount}" v-for="(item,index) in amountList"
@click="select(item)"> @click="select(item)">
<view class="heTitle">{{item.realPrice}}</view> <view class="heTitle">{{item.price}}</view>
</view> </view>
</view> </view>
<view class="mart5 width90 font18 fcor333 fontwig6"> <view class="mart5 width90 font18 fcor333 fontwig6">

Loading…
Cancel
Save