<template>
	<view class="commentDetails-index-box">
		<navbar class="navbarSticky" bg="#F6F6F6">
			<view class="commentDetails-header-box flex">
				<van-icon class="commentDetails-header-left" name="arrow-left" @click="back" />
				<text class="commentDetails-header-title">评价详情</text>
			</view>
		</navbar>
		<view class="commentDetails-index-content">
			<view class="commentDetails-index-setType flex">
				<view class="commentDetails-setType-text flex">
                    <view>
                        第{{topData.Times}}次评价
                    </view>
                    <view class="flex">
                        <text>{{topData.ShowTypeStr}}</text>
                    </view>
				</view>
				<view class="commentDetails-setType-time flex">
					<view>
                        来源:{{topData.CreateTypeStr}}
                    </view>
                    <view>
                        时间:{{topData.CreateTime}}
                    </view>
				</view>
			</view>
			<commentDetails :qMsg="Msg" :CourseCommentTimesList="courseTimeList" @refreshData="getStuCommentList"></commentDetails>
            
        </view>

	</view>
</template>
<script>
	import commentDetails from '@/components/setComments/commentDetails'
	import {
		reactive,
		toRefs,
		onMounted,
		getCurrentInstance,
		inject
	} from "vue";
	import navbar from '../../components/navbar.vue'
	export default {
		props: {

		},
		components: {
			navbar,
			commentDetails
		},
		setup() {
			let {
				proxy
			} = getCurrentInstance();
			let data = reactive({
				value: 1,
				optionsList: [{
						text: '部分可见',
						value: 0
					},
					{
						text: '可见不可见',
						value: 1
					},
					{
						text: '活动商品',
						value: 2
					},
				],
				radioList: [{
						name: '使用默认配置',
						id: 1,
						checked: true
					},
					{
						name: '自定义评价',
						id: 2
					}
				],
				checked: '1',
				Msg: {
					CourseId: '',
					CommentTimes:1
				},
				courseTimeList: [], 
				topData:{
					ShowTypeStr:"",
					Times:1,
					CreateTime:"",
					CreateTypeStr:""
				}
			});
			let methods = {
				back() {
					uni.navigateBack({
						delta: 1
					})
				},
				//获取系统生成学员评价列表
				getStuCommentList(){
					proxy.$request("/Teacher/GetStuCommentList", data.Msg).then(res => {
						if (res) {
							data.courseTimeList = res.Data;
						}
					})
				}
			};

			return {
				...toRefs(data),
				...methods
			};
		},
		onLoad(options) {
			let json=JSON.parse(decodeURIComponent(options.comment))
			this.Msg.CourseId = json.CourseId;
			this.topData.ShowTypeStr = json.ShowTypeStr;
			this.topData.Times = json.Times;
			this.topData.CreateTime = json.CreateTime;
			this.topData.CreateTypeStr = json.CreateTypeStr;
			this.Msg.CommentTimes = json.Times;
			this.getStuCommentList();
		},

	};
</script>
<style scoped>
    .commentDetails-setType-time{
        justify-content: space-between;
        font-size: 24rpx;
        font-weight: 500;
        color: #AFAFAF;
        line-height: 42rpx;
        margin-top: 40rpx;
    }
    .commentDetails-setType-text view:last-child{
        flex-shrink: 0;
        margin-left: 15rpx;
    }
    .commentDetails-setType-text view:last-child text {
		color: #D9868D;
		background: #F5DEE0;
		border-radius: 25rpx;
		width: 150rpx;
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		letter-spacing: 1rpx;
        font-size: 24rpx;
	}
	.commentDetails-setType-text view:first-child {
		font-size: 30rpx;
        font-weight: bold;
        color: #282828;
	}
    .commentDetails-setType-text{
        justify-content: space-between;
    }

	.commentDetails-index-setType {
		background: #FCEEEF;
		box-shadow: 0rpx 6rpx 52rpx 0rpx rgba(230, 65, 80, 0.19);
		border-radius: 50rpx;
		margin: 55rpx 50rpx 50rpx 50rpx;
		padding: 33rpx 50rpx;
        flex-direction: column;
	}

	.commentDetails-index-box {
		background: #F6F6F6;
	}

	.commentDetails-index-header-title {
		font-size: 32rpx;
		font-weight: 500;
		color: #282828;
		flex: 1;
		text-align: center;
		padding-right: 40rpx;
	}
    .commentDetails-header-box{
	    padding: 20rpx 42rpx;
		flex-direction: row;
		align-items: center;
	}
	.commentDetails-header-title{
	    font-size: 32rpx;
	    font-weight: 500;
	    color: #282828;
		flex:1;
		    text-align: center;
		    padding-right: 40rpx;
	}
	.commentDetails-header-left{
	    font-size: 40rpx;
	    position: relative;
	    z-index: 3;
	}
	.navbarSticky {
		display: sticky;
		top: 0;
		z-index: 9;
	}
</style>
