You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
4.3 KiB
190 lines
4.3 KiB
<template>
|
|
<view class="pageBg">
|
|
<view class="pad">
|
|
<view class="card">
|
|
<view class="orderInfo">
|
|
<view class="schoolName">翔力驾校</view>
|
|
<view class="price">
|
|
<text class="uint">¥</text>{{ info.a }}
|
|
</view>
|
|
<!-- <view class="num">交易单号:65465879312</view> -->
|
|
</view>
|
|
<view class="li border">
|
|
<view class="lab">订单金额</view>
|
|
<view class="val">¥ {{info.a}}</view>
|
|
</view>
|
|
<view class="li">
|
|
<view class="lab">订单编号</view>
|
|
<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="paySubmit">确认支付</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { getStudentByPayment } from '@/config/api.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
trainingApplyId: '',
|
|
info: {
|
|
a: '待对接'
|
|
}
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
if(options.trainingApplyId) {
|
|
this.trainingApplyId = options.trainingApplyId
|
|
}
|
|
this.getStudentByPayment()
|
|
this.initWx()
|
|
},
|
|
methods: {
|
|
initWx() {
|
|
// #ifdef APP-PLUS
|
|
plus.share.getServices((s) => {
|
|
var shares = {};
|
|
for (var i = 0; i < s.length; i++) {
|
|
var t = s[i];
|
|
console.log("...........", t);
|
|
shares[t.id] = t;
|
|
}
|
|
var sweixin = shares['weixin'];
|
|
this.sweixin = sweixin
|
|
}, function(e) {
|
|
console.log("获取分享服务列表失败:" + e.message);
|
|
});
|
|
// #endif
|
|
},
|
|
wxPay() {
|
|
// #ifdef APP-PLUS
|
|
this.sweixin ? this.sweixin.launchMiniProgram({
|
|
// path: '/pages/payment/payment?tokenCode=' + this.payInfo.tokenCode, //跳转小程序页面路径 pages/index/index
|
|
path: '/' , //跳转小程序页面路径 pages/index/index
|
|
type: 0, //可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。
|
|
id: 'gh_012fd4bda1c2' //小程序的原始id
|
|
}) : plus.nativeUI.alert('当前环境不支持微信操作!');
|
|
// #endif
|
|
},
|
|
async getStudentByPayment() {
|
|
const {data: res} = await getStudentByPayment({trainingApplyId: this.trainingApplyId})
|
|
this.$store.dispatch('getUserInfo')
|
|
},
|
|
paySubmit() {
|
|
console.log('这是什么')
|
|
console.log(this.sweixin)
|
|
this.wxPay()
|
|
// this.$goPage('/pages/indexEntry/enroll/paymentSuccess/paymentSuccess')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.card {
|
|
width: 100%;
|
|
margin-bottom: 20rpx;
|
|
padding: 0 20rpx;
|
|
.orderInfo {
|
|
text-align: center;
|
|
.schoolName {
|
|
font-size: 28rpx;
|
|
color: #ccc;
|
|
padding: 40rpx 0 20rpx 0;
|
|
}
|
|
|
|
.price {
|
|
font-size: 72rpx;
|
|
font-weight: 600;
|
|
text.uint {
|
|
font-size: 44rpx;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
|
|
.num {
|
|
font-size: 24rpx;
|
|
color: #ADADAD;
|
|
}
|
|
}
|
|
.li {
|
|
display: flex;
|
|
height: 88rpx;
|
|
line-height: 88rpx;
|
|
&.border{
|
|
border-bottom: 1px solid #F6F7FA;
|
|
}
|
|
.lab {
|
|
color: #ccc;
|
|
width: 230rpx;
|
|
}
|
|
.val {
|
|
font-weight: 500;
|
|
flex: 1;
|
|
text-align: right;
|
|
}
|
|
}
|
|
}
|
|
.pay {
|
|
.h2 {
|
|
font-size: 32rpx;
|
|
font-weight: 500;
|
|
margin-bottom: 24rpx;
|
|
}
|
|
.row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
height: 88rpx;
|
|
&.border{
|
|
border-bottom: 1px solid #F6F7FA;
|
|
}
|
|
.wxIcon {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
}
|
|
.text {
|
|
margin-left: 20rpx;
|
|
flex: 1;
|
|
text-align: left;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
.icon {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
</style>
|