<template>
	<view class="container">
		<view class="pay-content">
			<image :src="`${FILE_URL}/edu-icon/pay.png`" class="pay-img"></image>
			<text class="pay-text">支付成功</text>
			<!-- <button class="play-btn" @click="toWatch">点击观看</button> -->
		</view>
		<view class="pay-member" v-if="!isMember && courseView === '2'" @click="toJoin">
			<text>个人会员或单位会员免费，点击现在入会></text>
		</view>
	</view>
</template>

<script setup>
	import { ref, computed } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import configService from '@/utils/baseurl.js'
	const FILE_URL = configService.FILE_URL;
	import {
		useAuthStore
	} from '@/store/authStore'
	const authStore = useAuthStore();
	const isMember = ref(null)
	const toJoin = () =>{
		uni.navigateTo({
			url: "/pages/swiperDetail/swiperDetail?id=12117"
		})
	}
	const courseId = ref("");
	const courseView = ref("");
	const toWatch = () => {
		// uni.redirectTo({
		// 	url:"/pages/goOnEdu/course/courseDetail/courseDetail?id=" + courseId.value
		// })
		uni.navigateBack({
			delta: 2
		});
	}
	onLoad((option) => {
		const { id, viewMode } = option
		courseId.value = id
		courseView.value = viewMode
		authStore.loadUserInfo()
		isMember.value = authStore.userInfo.isMember == '0' ? false : true
		// console.log('onLoad')
	})
</script>

<style lang="scss" scoped>
	.container {
		height: 100vh;
		width: 100vw;
		// padding: 0 20rpx;
	}
	.pay-content{
		height: 70%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		.pay-img{
			width: 180rpx;
			height: 180rpx;
			margin-bottom: 20rpx;
		}
		.pay-text{
			font-size: 70rpx;
		}
		.play-btn{
			margin-top: 100rpx;
			// width: 200rpx;
			height: 70rpx;
			line-height: 70rpx;
			background-color: #0069f6;
			color: #fff;
			border-radius: 40rpx;
		}
		
	}
	.pay-member{
		color: red;
		text-align: center;
		font-size: 32rpx;
	}
</style>