|
|
@ -18,30 +18,7 @@ |
|
|
|
<view class="val">{{info.a}}</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<view class="card"> |
|
|
|
<view class="pay"> |
|
|
|
<!-- <view class="h2">选择支付方式</view> --> |
|
|
|
<!-- <view class="row border"> |
|
|
|
<view class="wxIcon"> |
|
|
|
<image src="@/static/images/carIcon/xfbIcon.png" mode=""></image> |
|
|
|
</view> |
|
|
|
<view class="text">支付宝</view> |
|
|
|
<view class="icon"> |
|
|
|
<!-- <image src="@/static/images/index/noSelect.png" mode=""></image> --> |
|
|
|
<!-- <image src="@/static/images/carIcon/isSelect.png" mode=""></image> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<!-- <view class="row"> |
|
|
|
<view class="wxIcon"> |
|
|
|
<image src="@/static/images/carIcon/wxIcon.png" mode=""></image> |
|
|
|
</view> |
|
|
|
<view class="text">微信</view> |
|
|
|
<view class="icon"> |
|
|
|
<image src="@/static/images/index/noSelect.png" mode=""></image> |
|
|
|
<image src="@/static/images/carIcon/isSelect.png" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="footerBtn pad"> |
|
|
|
<view class="btnBg" @click="getStudentByPayment()">确认支付</view> |
|
|
@ -54,7 +31,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getStudentByPayment, pre_create, param_sign |
|
|
|
getStudentByPayment, pre_create, param_sign,course_info |
|
|
|
} from '@/config/api.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
@ -72,14 +49,14 @@ |
|
|
|
this.trainingApplyId = options.trainingApplyId |
|
|
|
} |
|
|
|
// this.getYSBLink() |
|
|
|
this.getStudentByPayment() |
|
|
|
this.course_infoFn() |
|
|
|
this.initWx() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
// this.getStudentByPayment() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 初始化微信分享方法 |
|
|
|
initWx() { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
plus.share.getServices((s) => { |
|
|
@ -96,7 +73,13 @@ |
|
|
|
}); |
|
|
|
// #endif |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取订单信息 |
|
|
|
async course_infoFn() { |
|
|
|
const {data: res} = await course_info({trainingApplyId: this.trainingApplyId}) |
|
|
|
this.amount = res.amount |
|
|
|
this.schoolName = res.schoolName |
|
|
|
}, |
|
|
|
// 1,下订单 |
|
|
|
async getStudentByPayment(type) { |
|
|
|
console.log('来到了这没有') |
|
|
|
const { |
|
|
@ -104,13 +87,11 @@ |
|
|
|
} = await pre_create({ |
|
|
|
trainingApplyId: this.trainingApplyId |
|
|
|
}) |
|
|
|
this.amount = res.amount |
|
|
|
this.schoolName = res.schoolName |
|
|
|
console.log('创建的订单信息') |
|
|
|
console.log(res) |
|
|
|
this.param_sign(res.orderNo) |
|
|
|
}, |
|
|
|
// 加密数据 |
|
|
|
// 2,加密数据 |
|
|
|
async param_sign(outOrderNo) { |
|
|
|
let obj = { |
|
|
|
outOrderNo, |
|
|
@ -118,13 +99,13 @@ |
|
|
|
} |
|
|
|
console.log(JSON.stringify(obj)) |
|
|
|
const {data: res} = await param_sign({jsonParam:JSON.stringify(obj)}) |
|
|
|
this.encodeData = res.encodeData |
|
|
|
console.log('加密后的数据') |
|
|
|
console.log(res.encodeData) |
|
|
|
this.getYSBLink() |
|
|
|
this.getYSBLink(res.encodeData, outOrderNo) |
|
|
|
}, |
|
|
|
async getYSBLink() { |
|
|
|
if(!this.encodeData) return this.$u.toast('没有获取到支付信息') |
|
|
|
// 3,生成h5链接 这个商户号与生产地址应该由后端传来的,会变 |
|
|
|
async getYSBLink(encodeData, outTradeNo) { |
|
|
|
if(!encodeData) return this.$u.toast('没有获取到支付信息') |
|
|
|
const channelNo = 'QD202404083509'; |
|
|
|
//common普通的h5平台,如果当前的运行环境为微信小程序则platform的值为pay_miniPro |
|
|
|
const platform = 'common'; |
|
|
@ -134,13 +115,12 @@ |
|
|
|
const preUrl = 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html' |
|
|
|
// 生产地址 |
|
|
|
// const preUrl = 'https://zmcht.zybank.com.cn/cem_ysb/index.html'; |
|
|
|
// let obj = {"outOrderNo":orderNo || "2024041211570300000308","timestamp":"1632815312300"} |
|
|
|
const distinctId = this.userId |
|
|
|
const payLink = `${preUrl}?encodeData=${this.encodeData}#/checkStandPre?platform=${platform}&channelNo=${channelNo}&checkStand_v3=true&distinctId=${distinctId}`; |
|
|
|
console.log('payLink') |
|
|
|
const distinctId = this.userId //惟一标识 |
|
|
|
const payLink = `${preUrl}?encodeData=${encodeData}#/checkStandPre?platform=${platform}&channelNo=${channelNo}&checkStand_v3=true&distinctId=${distinctId}`; |
|
|
|
console.log('第三方收银台') |
|
|
|
console.log(payLink) |
|
|
|
this.$store.commit('updateWebVeiwUrl', payLink) |
|
|
|
this.$goPage('/pages/indexEntry/enroll/payment/payh5') |
|
|
|
this.$goPage('/pages/indexEntry/enroll/payment/payh5?outTradeNo='+ outTradeNo) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -150,10 +130,13 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.pageBg { |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
.card { |
|
|
|
width: 100%; |
|
|
|
margin-bottom: 20rpx; |
|
|
|
padding: 0 20rpx; |
|
|
|
margin: 50rpx 0; |
|
|
|
padding: 40rpx 20rpx; |
|
|
|
|
|
|
|
.orderInfo { |
|
|
|
text-align: center; |
|
|
|