|
|
|
@ -73,8 +73,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 line1 mart5 marb5"></view> |
|
|
|
|
<view class="height50 width100 backcorfff" v-if="couponList.payType == 2 || couponList.payType==3 " |
|
|
|
|
@tap="paytype='jinbi'"> |
|
|
|
|
<view class="height50 width100 backcorfff" @tap="paytype='jinbi'"> |
|
|
|
|
<view class="width70 flleft fcor333 fontwig6 font16 text1" style="padding-left: 4%;"> |
|
|
|
|
积分支付<text class="font14 fcor666 margle">可用积分: {{user.gold}}</text> |
|
|
|
|
</view> |
|
|
|
@ -83,25 +82,14 @@ |
|
|
|
|
<radio :checked="paytype=='jinbi'" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 line1 mart5 marb5" v-if="couponList.payType == 2 || couponList.payType==3 "></view> |
|
|
|
|
<view class="height50 width100 backcorfff" @tap="paytype='weixin'" |
|
|
|
|
v-if="couponList.payType == 1 || couponList.payType==3 "> |
|
|
|
|
<view class="width94 line1 mart5 marb5"></view> |
|
|
|
|
<view class="height50 width100 backcorfff" @tap="paytype='unionPay'"> |
|
|
|
|
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;"> |
|
|
|
|
微信支付 |
|
|
|
|
银联支付 |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
style="align-items: center;"> |
|
|
|
|
<radio :checked="paytype=='weixin'" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 line1 mart5 marb5" v-if="couponList.payType == 1 || couponList.payType==3 "></view> |
|
|
|
|
<view class="height50 width100 backcorfff" @tap="paytype='gonghuika'"> |
|
|
|
|
<view class="width70 flleft fcor333 fontwig6 font16 text1" style="padding-left: 4%;"> |
|
|
|
|
汇联通工会卡<text class="font14 fcor666 margle">可用余额: {{tongCardPrice}}元</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
style="align-items: center;"> |
|
|
|
|
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
|
|
|
|
<radio :checked="paytype=='unionPay'" color="#0083f5" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -139,7 +127,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true"> |
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" radius="6" :showCloseIcon="true"> |
|
|
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view> |
|
|
|
|
<view class="width92 height110 tccs mart10" v-for="(items, index) in UserNormalDiscountList" :key="items" |
|
|
|
|
@click="radioChanges(items)"> |
|
|
|
@ -154,7 +142,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</wybPopup> |
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle"/> |
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" /> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -168,15 +156,13 @@ |
|
|
|
|
orderToPay, |
|
|
|
|
orderToGoldPay, |
|
|
|
|
findUser, |
|
|
|
|
unionPay, |
|
|
|
|
hltUnionCardPay, |
|
|
|
|
getHuiLianTongCardBalance |
|
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
|
import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
|
import ssPaymentPassword from '../../components/sanshui-payment-password' |
|
|
|
|
let app = getApp(); |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
wybPopup, |
|
|
|
@ -214,7 +200,7 @@ |
|
|
|
|
this.getCouponById(); |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
let that =this; |
|
|
|
|
let that = this; |
|
|
|
|
that.paytype = ''; |
|
|
|
|
that.user = app.globalData.userInfo; |
|
|
|
|
that.getUserNormalDiscountList(); |
|
|
|
@ -255,7 +241,6 @@ |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
app.globalData.userInfo = res.return_data; |
|
|
|
|
this.user = res.return_data; |
|
|
|
|
this.getHuiLianTongCardBalance(); |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
@ -331,19 +316,6 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//查询工会卡余额 |
|
|
|
|
//查询详情 |
|
|
|
|
getHuiLianTongCardBalance() { |
|
|
|
|
let params = { |
|
|
|
|
cardNo: this.user.hltCardNo.cardNo |
|
|
|
|
} |
|
|
|
|
getHuiLianTongCardBalance(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.tongCardPrice = res.return_data.balance; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// H5获取手机号 |
|
|
|
|
jumpH5Bding() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
@ -362,7 +334,7 @@ |
|
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
this.user = res.return_data |
|
|
|
|
this.user = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
uni.setStorage({ |
|
|
|
@ -390,7 +362,7 @@ |
|
|
|
|
}) |
|
|
|
|
let goods = { |
|
|
|
|
"memDiscountId": this.memDiscountId, |
|
|
|
|
"identificationCode":app.globalData.identificationCode, |
|
|
|
|
"identificationCode": app.globalData.identificationCode, |
|
|
|
|
"highChildOrderList": [{ |
|
|
|
|
"goodsType": 1, |
|
|
|
|
"goodsId": this.couponId, |
|
|
|
@ -400,12 +372,6 @@ |
|
|
|
|
addOrder(goods).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
// uni.redirectTo({ |
|
|
|
|
// url: '../pay/payment/payment?amount=' + res.return_data.payPrice + |
|
|
|
|
// '&paytype=' + this.couponList.payType + '&orderId=' + res.return_data.id + |
|
|
|
|
// '&couponId=' + this.couponId + '&typeaout=' + res.return_data |
|
|
|
|
// .highChildOrderList[0].ext1 |
|
|
|
|
// }) |
|
|
|
|
this.jumpType = res.return_data.highChildOrderList[0].ext1; |
|
|
|
|
this.orderId = res.return_data.id; |
|
|
|
|
this.orderToPay(res.return_data); |
|
|
|
@ -440,55 +406,7 @@ |
|
|
|
|
//获取订单数据 |
|
|
|
|
orderToPay(item) { |
|
|
|
|
let that = this; |
|
|
|
|
if (that.paytype == 'weixin') { |
|
|
|
|
let params = { |
|
|
|
|
"orderId": item.id, |
|
|
|
|
"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: '支付成功' |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../pay/success/success?id=' + that.couponId |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: function(err) { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.navigateBack({}) |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
// #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' |
|
|
|
@ -496,29 +414,8 @@ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
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'); |
|
|
|
|
} else if (that.paytype == 'unionPay') { |
|
|
|
|
this.unionPay(); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择支付方式', |
|
|
|
@ -527,55 +424,67 @@ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
submitHandle(e) { |
|
|
|
|
this.PaymentPassword = e.value; |
|
|
|
|
if(this.PaymentPassword == ''){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请勿手动关闭弹窗', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
//银联获取信息 |
|
|
|
|
unionPay() { |
|
|
|
|
let goods = { |
|
|
|
|
"orderId": this.orderId |
|
|
|
|
} |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '支付中...' |
|
|
|
|
}) |
|
|
|
|
if (this.paytype == 'jinbi') { |
|
|
|
|
let params = { |
|
|
|
|
"orderId": this.orderId, |
|
|
|
|
"password": this.PaymentPassword |
|
|
|
|
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 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
orderToGoldPay(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//银联支付 |
|
|
|
|
uniontopay(item) { |
|
|
|
|
let that = this; |
|
|
|
|
upsdk.pluginReady(function() { |
|
|
|
|
upsdk.pay({ |
|
|
|
|
tn: item, |
|
|
|
|
success: function(res) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '支付成功' |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../pay/success/success?id=' + this.couponId |
|
|
|
|
url: '../pay/success/success?id=' + that.couponId |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (res.return_code == '102130') { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
|
}, |
|
|
|
|
fail: function(err) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: err.msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
|
|
|
|
} |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//支付密码弹出 |
|
|
|
|
submitHandle(e) { |
|
|
|
|
this.PaymentPassword = e.value; |
|
|
|
|
if (this.PaymentPassword == '') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请勿手动关闭弹窗', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '支付中...' |
|
|
|
|
}) |
|
|
|
|
let params = { |
|
|
|
|
"orderId": this.orderId, |
|
|
|
|
"cardNo": this.user.hltCardNo.cardNo, |
|
|
|
|
"password": this.PaymentPassword |
|
|
|
|
} |
|
|
|
|
hltUnionCardPay(params).then(res => { |
|
|
|
|
orderToGoldPay(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
uni.showToast({ |
|
|
|
@ -584,79 +493,18 @@ |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../pay/success/success?id=' + this.couponId |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (res.return_code == '102130') { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../login/updatePas/updatePas' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
payRequest: function(self) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '支付中...' |
|
|
|
|
}) |
|
|
|
|
jweixin.config({ |
|
|
|
|
// debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
|
|
|
|
appId: self.return_data.appId, // 必填,公众号的唯一标识 |
|
|
|
|
timestamp: self.return_data.timeStamp, // 必填,生成签名的时间戳 |
|
|
|
|
nonceStr: self.return_data.nonceStr, // 必填,生成签名的随机串 |
|
|
|
|
signature: self.return_data.sign, // 必填,签名,见附录1 |
|
|
|
|
jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 |
|
|
|
|
}); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
jweixin.ready(function() { |
|
|
|
|
jweixin.checkJsApi({ |
|
|
|
|
jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2, |
|
|
|
|
success: function(res) {}, |
|
|
|
|
fail: function(res) {} |
|
|
|
|
}); |
|
|
|
|
jweixin.chooseWXPay({ |
|
|
|
|
appId: self.return_data.appId, |
|
|
|
|
timestamp: self.return_data |
|
|
|
|
.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 |
|
|
|
|
nonceStr: self.return_data.nonceStr, // 支付签名随机串,不长于 32 位 |
|
|
|
|
package: self.return_data |
|
|
|
|
.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***) |
|
|
|
|
signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' |
|
|
|
|
paySign: self.return_data.sign, // 支付签名 |
|
|
|
|
success: function(res) { |
|
|
|
|
// 支付成功后的回调函数 |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '支付成功' |
|
|
|
|
}) |
|
|
|
|
if (that.jumpType == 4) { |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/tabBar/user/user' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../success/success?id=' + that.couponId |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
cancel: function(r) {}, |
|
|
|
|
fail: function(res) {} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
jweixin.error(function(res) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '支付失败了', |
|
|
|
|
duration: 4000 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|