<template>
	<view class="tabs-content" :style="{ paddingBottom : `${props.paddingBottom || 0}rpx` }">
		<view v-if="!isMember && payType==='2' && !hasBuy" class="pay-member" @click="toJoin">
			<text>个人会员或单位会员免费,点击现在入会></text>
		</view>
		<image :src="content" v-if="showType === 'image'" style="width: 100%" mode="widthFix"></image>
		<u-parse :html="content" :selectable="true" v-else></u-parse>
		<!-- 课程简介-测试用,看能不能看到底部 -->
	</view>
</template>

<script setup>
	import {
		ref,
		defineProps,
		computed
	} from 'vue'
	import {
		useAuthStore
	} from '@/store/authStore.js';
	import {
		onLoad,
	} from '@dcloudio/uni-app'
	const authStore = useAuthStore();
	const isMember = computed(()=>{
		return authStore.userInfo.isMember == '0' ? false : true
	})
	const props = defineProps({
		paddingBottom: {
			type: Number,
			required: false,
			default: 10
		},
		showType: {
			type: String,
			required: true,
			default: "image"
		},
		content: {
			type: String,
			required: true,
			default: ""
		},
		payType: {
			type: String,
			required: true,
			default: "1"
		},
		hasBuy: {
			type: Boolean,
			required: true,
			default: false
		}
	});
	
	const toJoin = () =>{
		uni.navigateTo({
			url: '/pages/joinClub/joinClub'
		})
	}
	// const content = ref("<p>20名协会成员于10月15adhjshajdhsadsajdakshdjahjkd,骄傲的噶说的话吗,计划的哈手机号,很多看啥看,撒海空军的卡号是,按开机动画就撒开,安达市快点哈尽快,打火机客户打款,收获颇丰。此次活动增进了大家对科技前沿的认识。</p><img src='/static/notice/ditu.jpg' /><img src='/static/notice/ditu.jpg' /><img src='/static/notice/ditu.jpg' /><img src='/static/notice/ditu.jpg' />")
</script>

<style lang="scss" scoped>
	.tabs-content {
		padding-top: 10rpx;
		height: inherit;
		position: relative;
	}

	.pay-member {
		color: red;
		// text-align: center;
		margin-bottom: 5rpx;
		font-size: 32rpx;
	}
</style>