<template>
	<view>
		<!-- 蒙层 -->
		<view class="maskWrapper" v-if="isShowInvite && item11.length != 0">
		    <view class="requireText">
		        <text>请您从下方列表中，选中一条信息，作为邀请的内容，发给对方！</text>
		    </view>
		    <scroll-view class="scrollVertical" scroll-y>
		        <radio-group class="chooseList">
					<view v-for="(item, index) in item11" :key="index">
						<radio class="chooseDetail" @click="clickRadio(item)">
						    <view class="courseTitle">
						        <text v-if="item.courseId">课程号</text>
								<text v-if="item.requireId">需求号</text>
						        <text class="courseDetail" v-if="item.courseId">{{item.courseId}}</text>
								<text class="courseDetail" v-if="item.requireId">{{item.requireId}}</text>
						    </view>
						    <view class="courseTitle">
						        <text>科目</text>
								<text class="courseDetail" v-if="item.subject">{{item.subject}}</text>
						        <text class="courseDetail" v-else>{{item.subjectBig}}/{{item.subjectSmall}}</text>
						    </view>
						</radio>
					</view>
		
		        </radio-group>
		    </scroll-view>
		    <view class="commitAndCancel">
		        <view class="cancel" @click="cancelChosed">取消</view>
		        <view class="commit" @click="commitChosed">发送</view>
		    </view>
		</view>
		<view class="maskWrapper" v-else-if="isShowInvite && item11.length == 0">
			<view class="requireText">
				<text>您未发布课程或需求，不能使用邀请功能。请您先发布信息，审核通过后再试</text>
			</view>
			<view class="commitAndCancel">
				<view class="cancel" @click="cancelChosed">取消</view>
				<view class="commit" @click="toNav">发布</view>
			</view>			
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-invite",
		data() {
			return {
			};
		},
		props: {
			isShowInvite: {
				type: Boolean,
				default: false
			},
			item11: {
				type: Array
			}
		},
		methods: {
			cancelChosed() {
				this.$emit("cancelChosed")
			},
			commitChosed() {
				this.$emit("commitChosed")
			},
			clickRadio(course) {
				this.$emit("clickRadio", course)
			},
			// “去发布”按钮
			toNav(){
				uni.reLaunch({ url: '/pages/my/my' })
			},
		}
	}
</script>

<style lang="scss">
/* 以下是蒙层样式 */

.maskWrapper{
    z-index: 999;    
    // margin-left: -20rpx;
    padding-left: 20rpx;
    position: fixed;
    height: 65%;
    bottom: 0;
    background-color: #fff;
    border-top-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
	font-size: 30rpx;
}
/* 可滚动区域 */
.scrollVertical{
    height: 76%;
}

/* 选项区 */
.chooseList{

    display: flex;
    flex-direction: column;
}
/* 单个选项样式 */
.chooseDetail{
    width: 90%;
	padding-top: 10rpx;
	padding-bottom: 10rpx;
    padding-left: 30rpx;
    margin: 10rpx;
    border: 2px solid #35b882;
    border-radius: 30rpx;
   // background-color: #35b882;
	
}
/* 设置选项与圆圈的距离 */
.courseTitle{
    margin-left: 30rpx;
	//color: #fff;
}
/* 课程号、辅导科目详情 */
.courseDetail{
    margin-left: 20rpx;
    font-weight: bold;
}
/* 底部按钮 */
.commitAndCancel{
    display: flex;
    width: 100%;
    justify-content: space-around;
    position: fixed;
    bottom: 40rpx;
}
.cancel,
.commit{
    font-size: 30rpx;
    padding: 20rpx 60rpx;
    border-radius: 50rpx;
    color: white;
}

.commit{
	background-color: #35b882;
}

.cancel{
	background-color: #3ed598;
}
.requireText{
	margin: 30rpx;
	color: gray;
}

.cancel-publish,
.commit-publish{
	font-size: 40rpx;
	padding: 10rpx 30rpx;
	border-radius: 40rpx;
	color: white;
	text-align: center;
	height: 60rpx;
	line-height: 60rpx;
	width: 120rpx;
}
.cancel-publish{
	background-color: #3ed598;
}
.commit-publish{	
	background-color: #35b882;
}
</style>