RegistrationDetails.vue 2.2 KB
<template>
	<view class="content">
		<view style="padding-top: 16px;">
			<view class="bo">
				<view class="title"><text class="left">培训名称:</text><text class="right">{{postData.work_name}}</text>
				</view>
				<view class="money"><text class="left">培训金额(元):</text><text class="right">{{postData.price}}元</text>
				</view>
				<view class="time"><text class="left">报名时间:</text><text
						class="right">{{postData.create_time_text}}</text></view>
				<view class="zhiBox" @click="payment" v-if="postData.is_pay==0">
					<text class="zhifu">支付</text>
				</view>
				<view class="zhiBox"v-if="postData.is_pay==1">
					<text class="zhifu">已支付</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import request from '../../utils/request.js'
	import wexinPay from '../../utils/jws.js'
	export default {
		data() {
			return {
				postData: ""
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getData()
		},
		methods: {
			getData() {
				request.post('/api/index/sign_up_detail', {
					id: this.id
				}).then(res => {
					this.postData = res.data
				}).catch(err => {

				})
			},
			payment() {
				let url='/pages/index/Information'
				request.post('/api/index/pay', {
					id:this.id
				}).then(res => {
                     console.log(res,'res')
					 wexinPay(res.data,url)
				}).catch(err => {
					
				})
				// let authURL = 'http://ranqi-admin.t.brotop.cn/api/index/auth?token=' + uni
				// 	.getStorageSync('Authorization') + '&url=/pages/index/index'
				// window.location.href = authURL;
			}
		}
	}
</script>

<style>
	.time {
		margin-bottom: 52px;
	}

	.money {
		margin-bottom: 49px;
	}

	.title {
		margin-bottom: 72px;
	}

	.bo {
		background-color: #FFFFFF;
		margin: 16px 16px 0 16px;
		padding: 16px;
	}

	.content {
		background-color: #F2F3F5;
		height: 100vh;
	}

	.right {
		color: #323233;
		font-size: 30rpx;
		font-weight: bold;
		margin-left: 15px;
	}

	.left {
		color: #646566;
		font-size: 32rpx;
	}

	.zhiBox {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100rpx;
		background: #67d96a;
		border-radius: 16rpx;
		margin: 0 72px;
	}

	.zhifu {
		color: #FFFFFF;
		font-size: 36rpx;
	}
</style>