|
|
@ -18,7 +18,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
<view class="content"> |
|
|
|
<view class="pay-list"> |
|
|
|
<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"> |
|
|
|
<view class="left"> |
|
|
|
<image src="../../../static/img/jfx.png"></image> |
|
|
|
<image src="../../../static/img/jfx.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -34,13 +34,13 @@ |
|
|
|
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image> |
|
|
|
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="center"> |
|
|
|
<view class="center"> |
|
|
|
汇联通工会卡(余额:{{tongCardPrice}}元) |
|
|
|
银联支付 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="right"> |
|
|
|
<view class="right"> |
|
|
|
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
|
|
|
<radio :checked="paytype=='gonghuika'" color="#0083f5" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</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"> |
|
|
|
<view class="left"> |
|
|
|
<image :src="imagewxUrl+imgadres"></image> |
|
|
|
<image :src="imagewxUrl+imgadres"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -50,7 +50,7 @@ |
|
|
|
<view class="right"> |
|
|
|
<view class="right"> |
|
|
|
<radio :checked="paytype=='wxpay'" color="#0083f5" /> |
|
|
|
<radio :checked="paytype=='wxpay'" color="#0083f5" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -71,8 +71,8 @@ |
|
|
|
import { |
|
|
|
import { |
|
|
|
orderToPay, |
|
|
|
orderToPay, |
|
|
|
orderToGoldPay, |
|
|
|
orderToGoldPay, |
|
|
|
getHuiLianTongCardBalance, |
|
|
|
hltUnionCardPay, |
|
|
|
hltUnionCardPay |
|
|
|
unionPay |
|
|
|
} from '../../../Utils/Api.js' |
|
|
|
} from '../../../Utils/Api.js' |
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password' |
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password' |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
@ -115,98 +115,13 @@ |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
that.getHuiLianTongCardBalance(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
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() { |
|
|
|
orderToPay() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
if (that.paytype == 'wxpay') { |
|
|
|
if (that.paytype == 'jinbi') { |
|
|
|
|
|
|
|
|
|
|
|
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.user.isSetPayPwd) { |
|
|
|
if (!that.user.isSetPayPwd) { |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
@ -215,35 +130,56 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
} else if (that.paytype == 'gonghuika') { |
|
|
|
} else if (that.paytype == 'gonghuika') { |
|
|
|
if (!that.user.isSetPayPwd) { |
|
|
|
that.unionPay(); |
|
|
|
uni.navigateTo({ |
|
|
|
} else { |
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!that.user.isSetHltCard) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '请选择支付方式', |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
return; |
|
|
|
//银联获取信息 |
|
|
|
|
|
|
|
unionPay() { |
|
|
|
|
|
|
|
let goods = { |
|
|
|
|
|
|
|
"orderId": this.orderNo |
|
|
|
} |
|
|
|
} |
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
unionPay(goods).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.uniontopay(res.return_data.prepayid); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择支付方式', |
|
|
|
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', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
submitHandle(e) { |
|
|
|
submitHandle(e) { |
|
|
|
this.PaymentPassword = e.value; |
|
|
|
this.PaymentPassword = e.value; |
|
|
|