|
|
|
@ -18,9 +18,9 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="content"> |
|
|
|
|
<view class="pay-list"> |
|
|
|
|
<view class="row" @tap="paytype='jinbi'" v-if="pryType == 2 || pryType==3 "> |
|
|
|
|
<view class="row" @tap="paytype='jinbi'"> |
|
|
|
|
<view class="left"> |
|
|
|
|
<image src="../../../static/img/jfx.png"></image> |
|
|
|
|
<image src="../../../static/img/jfx.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="center"> |
|
|
|
|
积分支付(积分:{{user.gold}}) |
|
|
|
@ -34,13 +34,13 @@ |
|
|
|
|
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="center"> |
|
|
|
|
汇联通工会卡(余额:{{tongCardPrice}}元) |
|
|
|
|
银联支付 |
|
|
|
|
</view> |
|
|
|
|
<view class="right"> |
|
|
|
|
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
|
|
|
|
<radio :checked="paytype=='gonghuika'" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 "> |
|
|
|
|
<!-- <view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 "> |
|
|
|
|
<view class="left"> |
|
|
|
|
<image :src="imagewxUrl+imgadres"></image> |
|
|
|
|
</view> |
|
|
|
@ -50,7 +50,7 @@ |
|
|
|
|
<view class="right"> |
|
|
|
|
<radio :checked="paytype=='wxpay'" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -71,8 +71,8 @@ |
|
|
|
|
import { |
|
|
|
|
orderToPay, |
|
|
|
|
orderToGoldPay, |
|
|
|
|
getHuiLianTongCardBalance, |
|
|
|
|
hltUnionCardPay |
|
|
|
|
hltUnionCardPay, |
|
|
|
|
unionPay |
|
|
|
|
} from '../../../Utils/Api.js' |
|
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password' |
|
|
|
|
let app = getApp(); |
|
|
|
@ -113,100 +113,15 @@ |
|
|
|
|
this.amount = parseFloat(e.amount).toFixed(2); |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
let that = this; |
|
|
|
|
let that = this; |
|
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
|
that.getHuiLianTongCardBalance(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//获取选择支付方式 |
|
|
|
|
changeRiado() { |
|
|
|
|
if (!this.user.isSetHltCard) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
|
duration: 2000, |
|
|
|
|
success() { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
}) |
|
|
|
|
}, 1000) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//查询工会卡余额 |
|
|
|
|
//查询详情 |
|
|
|
|
getHuiLianTongCardBalance() { |
|
|
|
|
let params = { |
|
|
|
|
cardNo: this.user.hltCardNo.cardNo |
|
|
|
|
} |
|
|
|
|
getHuiLianTongCardBalance(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.tongCardPrice = res.return_data.balance; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//获取订单数据 |
|
|
|
|
orderToPay() { |
|
|
|
|
let that = this; |
|
|
|
|
if (that.paytype == 'wxpay') { |
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
"orderId": that.orderNo, |
|
|
|
|
"openId": app.globalData.openId, |
|
|
|
|
"orderScene": "GOODS_ORDER" |
|
|
|
|
} |
|
|
|
|
orderToPay(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
// #ifdef MP |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '支付中...' |
|
|
|
|
}) |
|
|
|
|
uni.requestPayment({ |
|
|
|
|
"appId": res.return_data.appId, |
|
|
|
|
"nonceStr": res.return_data.nonceStr, |
|
|
|
|
"package": res.return_data.package, |
|
|
|
|
"paySign": res.return_data.sign, |
|
|
|
|
"signType": "MD5", |
|
|
|
|
"timeStamp": res.return_data.timeStamp, |
|
|
|
|
success: function(res) { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '支付成功' |
|
|
|
|
}) |
|
|
|
|
if (that.jumpType == 4) { |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/tabBar/user/user' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../success/success?id=' + that.couponId |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: function(err) { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
//判断是否是公众号 |
|
|
|
|
// #ifdef H5 |
|
|
|
|
//判断微信浏览器 |
|
|
|
|
that.payRequest(res); |
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else if (that.paytype == 'jinbi') { |
|
|
|
|
if (that.paytype == 'jinbi') { |
|
|
|
|
if (!that.user.isSetPayPwd) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
@ -215,28 +130,7 @@ |
|
|
|
|
} |
|
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
|
} else if (that.paytype == 'gonghuika') { |
|
|
|
|
if (!that.user.isSetPayPwd) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!that.user.isSetHltCard) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
|
duration: 2000, |
|
|
|
|
success() { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
}) |
|
|
|
|
}, 1000) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
|
that.unionPay(); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择支付方式', |
|
|
|
@ -245,6 +139,48 @@ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//银联获取信息 |
|
|
|
|
unionPay() { |
|
|
|
|
let goods = { |
|
|
|
|
"orderId": this.orderNo |
|
|
|
|
} |
|
|
|
|
unionPay(goods).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.uniontopay(res.return_data.prepayid); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//银联支付 |
|
|
|
|
uniontopay(item) { |
|
|
|
|
let that = this; |
|
|
|
|
upsdk.pluginReady(function() { |
|
|
|
|
upsdk.pay({ |
|
|
|
|
tn: item, |
|
|
|
|
success: function(res) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '支付成功' |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../success/success?id=' + this.couponId |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: function(err) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: err.msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
submitHandle(e) { |
|
|
|
|
this.PaymentPassword = e.value; |
|
|
|
|
uni.showLoading({ |
|
|
|
|