<template>
	<view class="scoreDetailspage" v-if="!Loading" style="background-color: #F6F6F6;">
		<navbar class="navbarSticky" bg="rgba(255,255,255,0)">
			<view class="scoreDetails-header-box flex">
				<van-icon class="scoreDetails-header-left" name="arrow-left" @click="back"/>
				<view style="padding-right: 46rpx;flex: 1;text-align:center;font-size: 32rpx;color:#282828;">
					
				</view>
			</view>
		</navbar>
        <view class="scoreDetails-header">
			<view style="font-size: 50rpx;font-weight: 800;color: #FFFFFF;">
				{{ExamScore.ExamName}}
			</view>
			<view style="padding:0 20rpx;border-radius:45rpx;margin-top:20rpx;display:inline-block;background:rgba(255,255,255,0.1);height:45rpx;line-height:45rpx;font-size: 26rpx;font-weight: 400;color: #FFFFFF;">
				2022.08.16-2022.09.12
			</view>
        </view>
		<view v-if="!Loading" style="margin:40px 17px 20px 17px;padding-top:20rpx;padding-bottom:40rpx;background: #FFFFFF;box-shadow: 0px 5rpx 38rpx 0px rgba(176,176,176,0.2);border-radius: 30rpx;">
			<view class="flex" style="justify-content: center;">
				<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1661094206000_479.png" mode="widthFix" style="width:75rpx;"></image>
				<view style="width:120rpx;height: 120rpx;border-radius: 120rpx;line-height: 120rpx; text-align:center;background-color: #FFF;margin:0 20rpx;margin-top:-56rpx;">
					<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png" mode="widthFix" style="width:80rpx;height: 80rpx;"></image>
				</view>
				<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1661094206000_62.png" mode="widthFix" style="width:75rpx;margin-top: 1rpx;"></image>
			</view>
			<view style="font-size: 36rpx;font-weight: 800;color: #282828;text-align: center;">
				{{ExamScore.StuName}}
			</view>
			<template v-if="ExamScore.AnalysisType==1">
				<view class="scoreDetails-title flex">
					<text>1-8题统计表</text>
					<view>(共8小题)</view>
				</view>
				<dline :ScoreList="ExamScore.PartScoreList"></dline>
			</template>
			<template v-for="(x,i) in ExamScore.ModuleScoreList">
				<view class="scoreDetails-title flex">
					<text>{{i==0?'一':'二'}}试板块分析</text>
				</view>
				<columnsd :ScoreList="x.GroupList"></columnsd>
			</template>
			<template v-for="(x,i) in ExamScore.GroupRankList">
				<view class="scoreDetails-title flex">
					<text>{{i==0?'一':'二'}}试排名统计</text>
				</view>
				<ranks :ScoreList="x.GroupList"></ranks>
			</template>
			<view class="scoreDetails-title flex">
				<text>总分排名统计</text>
			</view>
			<ranks :ScoreList="ExamScore.TRankScoreList"></ranks>
			<!-- <template v-if="!ExamScore.GroupModuleList">
				<view class="scoreDetails-title flex">
					<text>各板块掌握情况</text>
				</view>
				<view class="index-student-information">
					<penta :ModuleList="ExamScore.ModuleList" v-if="!Loading"></penta>
					<allGraspTheSituation :ModuleList="ExamScore.ModuleList"></allGraspTheSituation>
				</view>
			</template>
			<template v-else>
				<template  v-for="x in ExamScore.GroupModuleList">
					<view class="scoreDetails-title flex">
						<text>{{x.GroupName.GroupName}}掌握情况</text>
					</view>
					<view class="index-student-information">
						<penta :ModuleList="x.GroupList" v-if="!Loading"></penta>
						<allGraspTheSituation :ModuleList="x.GroupList"></allGraspTheSituation>
					</view>
				</template>
			</template>
			<view class="scoreDetails-title flex">
				<text>试卷难度分析</text>
			</view>
			<view class="index-student-information">
			   <line :DifficultyList="ExamScore.DifficultyList" v-if="!Loading"></line> 
			   <dfficultyAnalysis :DifficultyList="ExamScore.DifficultyList"></dfficultyAnalysis>
			</view>
			<view class="scoreDetails-title flex">
				<text>难度掌握情况</text>
			</view>
			<view class="index-student-information">
				<triangle :DifficultyRateList="ExamScore.DifficultyRateList" v-if="!Loading"></triangle>
				<graspTheSituation :DifficultyRateList="ExamScore.DifficultyRateList"></graspTheSituation>
			</view> -->
		</view>
	</view>
</template>

<script>
    import dline from '@/components/charts/dline'
    import columnsd from '@/components/charts/columns'
    import ranks from '@/components/charts/ranks'
	import vue, {
		ref,
		reactive,
		toRefs,
		toRef,
		getCurrentInstance,
		watch,
		computed,
		onMounted,
		provide,
		nextTick,
	} from "vue";

	 import {
		 getSweepCode
	 } from '../../api/index.js'
	import {
		getImageColor
	} from '../../utils/index.js'
	import indexassembly from './components/indexassembly.vue'
	import navbar from '../../components/navbar.vue'
	import bottom from '../../components/bottom.vue'
	export default {
		components: {
			navbar,
            dline,
            columnsd,
            ranks
		},
		setup(props) {
			let {
				proxy
			} = getCurrentInstance();
			let data = reactive({
				userData: {},
				Msg:{
					ExamId:0,
					StuUId:0,
					StuId:0
				},
				ExamScore:{},
				Loading :true
			});

			let methods = {
				//获取学生成绩
				getExamStuScore(){
					proxy.$request("/Exam/GetExamStatAnalysisInfo", data.Msg).then(res => {
						data.ExamScore = res.Data;
						data.Loading = false;
					})
				},
				back() {
					uni.navigateBack({
						delta:1
					});
				},
				queryScore(){
					// uni.navigateTo({
					// 	url:"/pages/webview/upload?url="+encodeURIComponent('https://doc.weixin.qq.com/forms/AJEAPAfgABUAaEAeAaUAAcP3Sbh3adRUf')
					// })
					wx.navigateToMiniProgram({
					  appId: 'wxd45c635d754dbf59',
					  path: 'pages/detail/detail.html?url=https%3A%2F%2Fdoc.weixin.qq.com%2Fforms%2FAJEAPAfgABUAaEAeAaUAAcP3Sbh3adRUf',
					  envVersion: 'release',
					  success(res) {
					    console.log('跳转了')
					    // 跳转成功
					  },
					  fail: function (e) {
					    wx.showModal({
					      title: '提示',
					      content: '跳转失败',
					      showCancel: false,
					    })
					  }
					})
				}
			};

			onMounted(() => {

			});
			return {
				...toRefs(data),
				...methods,
			};
		},
		onLoad(options){
			this.Msg.ExamId = options.examId;
			this.Msg.StuUId = options.stuUId;
			this.Msg.StuId = options.stuId;
		},
		onShow() {
			this.userData = uni.getStorageSync('userInfo');
			this.getExamStuScore();
		},
		// onShareAppMessage() {
		// 	return {
		// 		title: "甲小鹤",
		// 		query: "/pages/index/index",
		// 		imageUrl: "",
		// 	};
		// },
		// onShareTimeline() {
		// 	return {
		// 		title: "甲小鹤",
		// 		query: "/pages/index/index",
		// 		imageUrl: "",
		// 	};
		// },
	};
</script>

<style scoped>
	.score-shenqing{
		width: 120rpx;
		height: 27rpx;
		background: linear-gradient(90deg, #E53F4E, #EE7F82);
		box-shadow: 0px 0px 10rpx 0px rgba(247,167,174,0.63);
		border-radius: 10rpx;
		margin-left: 20rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 27rpx;
		text-align: center;
	}
    .index-student-information{
        min-height: 500rpx;
		background: rgba(255,255,255,.7);
		border-radius: 50rpx;
        padding: 65rpx 0 70rpx 0;
    }
    .scoreDetails-title view{
        font-size: 25rpx;
		color: #ABABAB;
		margin-left: 20rpx;
		padding: 13rpx 0 0 0;
    }
    .scoreDetails-title text{
        font-size: 36rpx;
		font-weight: 800;
		color: #282828;
    }
    .scoreDetails-title{
        margin: 70rpx 50rpx 0rpx 50rpx;
    }
    .scoreDetails-Fraction-num view:last-child{
        font-size: 20rpx;
        color: #EDCFD1;
        margin-top: 5rpx;
        letter-spacing: 1rpx;
    }
    .scoreDetails-Fraction-num view text{
        font-size: 40rpx;
        font-weight: 800;
        font-family: Source Han Sans CN;
        font-style: italic;
        color: #282828;
        margin-right: 10rpx;
    }
    .scoreDetails-Fraction-num view:first-child{
        color: #747474;
        font-size: 20rpx;
    }
    .scoreDetails-Fraction-img.activeThree{
        background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653531754000_932.png')no-repeat center #FFF0F1;
        background-size: 36rpx 36rpx;
    }
    .scoreDetails-Fraction-img.activeTwo{
        background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653531758000_626.png')no-repeat center #FFF0F1;
        background-size: 36rpx 36rpx;
    }
    .scoreDetails-Fraction-img.activeOne{
        background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653531750000_401.png')no-repeat center #FFF0F1;
        background-size: 36rpx 36rpx;
    }
    .scoreDetails-Fraction-img{
        width: 62rpx;
        height: 62rpx;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 19rpx;
        flex-shrink: 0;
    }
    .scoreDetails-Fraction-content{
        align-items: center;
    }
    .scoreDetails-Fraction{
        border-radius: 50rpx;
        background: #FFFFFF;
        padding: 52rpx 48rpx 38rpx 60rpx;
        justify-content: space-between;
        margin: 56rpx 50rpx 0 50rpx;
    }
    .scoreDetails-header-num text{
        font-size: 60rpx;
        font-weight: 800;
    }
    .scoreDetails-header-num view{
        font-size: 26rpx;
        font-weight: 400;
        margin-top: 10rpx;
    }
    .scoreDetails-header-num{
        width: 122rpx;
        height: 122rpx;
        background: #DA2F3E;
        border-radius: 30rpx;
        flex-direction: column;
        color: #FFFFFF;
        flex-shrink: 0;
        text-align: center;
    }
    .scoreDetails-header-title{
        font-size: 50rpx;
        font-weight: 800;
        color: #282828;
		    width: 100%;
		    overflow: hidden;
		    text-overflow: ellipsis;
		    white-space: nowrap;
		    align-content: normal;
    }
    .scoreDetails-header-name{
        font-size: 30rpx;
        font-weight: 400;
        color: #505050;
        letter-spacing: 1rpx;
        margin-bottom: 18rpx;
    }
    .scoreDetails-header-tetx{
        flex-grow: 1;
		    flex: 1;
		    width: 1px;
    }
    .scoreDetails-header-img .img{
        display: block;
		border: 2rpx solid rgba(164, 164, 164, 0.32);
		border-radius: 50%;
		width: 115rpx;
		height: 115rpx;
		box-sizing: border-box;
		margin: 4rpx;
    }
    .scoreDetails-header-img{
        width: 122rpx;
        height: 122rpx;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: #FFFFFF;
        margin-right: 30rpx;
    }
    .scoreDetails-header{
        margin: 0rpx 50rpx 0 50rpx;
        align-items: center;
    }
    .scoreDetails-header-left{
        font-size: 40rpx;
    }
	.scoreDetails-header-box{
            padding: 23rpx 31rpx;
    }
    .scoreDetailspage{
        min-height: 100vh;
		background-color: #f6f6f6;
		box-sizing: border-box;
		background-image: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1660901987000_847.png');
		/* background-position: 0 300rpx; */
		background-repeat: no-repeat;
		background-size: 100% auto;
    }
	.navbarSticky {
		display: sticky;
		top: 0;
		z-index: 9;
	}
	
</style>
