<template>
	<view>

		<view class="block">
			<view class="item-container" @click="navRoseChart">
				<view class="analysis-name">
					<view class="t-icon t-icon-xtubiao-"></view>
					<text class="analysis-text">优劣科目分析</text>
				</view>
			</view>


			<view class="item-container" @click="navRadarChart">
				<view class="analysis-name">
					<view class="t-icon t-icon-xtubiao-3"></view>
					<text class="analysis-text">考试能力分析</text>
				</view>
			</view>


			<view class="item-container" @click="navArcbarChart">
				<view class="analysis-name">
					<view class="t-icon t-icon-xtubiao-6"></view>
					<text class="analysis-text">成绩占比分析</text>
				</view>
			</view>
		</view>
		
		<!-- <view class="nosub-box" v-if="!subscribe">
			<view style="display: flex; align-items: center;margin: 30rpx 0 0 15rpx;">
				<view class="nosub-text">综合分析模块</view>
			</view>
			<view class="nosub-content">孩子成绩综合全面分析</view>
			<button class="nosub-btn" @click="getSubscribe">点击订阅</button>
		</view> -->

	</view>

</template>

<script>
	import {
		mapState ,mapMutations
	} from 'vuex'
	export default {
		name: "analysis-box",
		computed: {
			...mapState('m_parent', ['subscribe']),
		},
		data() {
			return {

			};
		},
		methods: {
			...mapMutations('m_parent',['updateSubscribe']),
			//获取订阅
			// getSubscribe() {
			// 	this.updateSubscribe(true)
			// 	const orderInfo = {
			// 		order_price: 0.01,
			// 	}
				//获取服务供应商
				// uni.getProvider({
				// 	service: 'payment',
				// 	success: function(res) {
				// 		console.log(res.provider)
				// 		if (res.provider.indexOf('wxpay')) {
				// 			//调用客户端支付api
				// 			uni.requestPayment({
				// 				provider: res.provider,
				// 				orderInfo: orderInfo
				// 			})
				// 		}
				// 	}
				// })

			// },
			//导航玫瑰图页面
			navRoseChart(e) {
				console.log(e);
				uni.navigateTo({
					url: "/gradepkg/rose-chart/rose-chart"
				})
			},
			//导航雷达图页面
			navRadarChart(e) {
				console.log(e);
				uni.navigateTo({
					url: "/gradepkg/radar-chart/radar-chart"
				})
			},
			//导航到进度条页面
			navArcbarChart(e) {
				console.log(e);
				uni.navigateTo({
					url: "/gradepkg/arcbar-chart/arcbar-chart"
				})
			},
		}
	}
</script>

<style lang="scss">
	.block {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		width: 347rpx;
		height: 345rpx;

		.item-container {
			display: flex;
			align-items: center;
			border-radius: 16rpx;
			background-color: #FFFFFF;
			box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
			width: 347rpx;
			height: 100rpx;

			.analysis-name {
				display: flex;
				align-items: center;
				justify-content: flex-start;
				width: 100%;
				margin: 20rpx 0rpx 20rpx 40rpx;

				.analysis-text {
					margin: 26rpx;
					font-size: 30rpx;
					font-weight: bold;
					color: #3B4144;
				}
			}
		}
	}

	.nosub-box {
		display: flex;
		flex-direction: column;
		border-radius: 16rpx;
		background: $card-back-base64;
		background-size: cover; //背景图片自适应
		box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
		width: 347rpx;
		height: 345rpx;

		.nosub-text {
			font-size: 35rpx;
			font-weight: bold;
			margin-left: 10rpx;
			background-image: linear-gradient(to right, #ce866e, #e8997d);
			background-clip: text;//裁剪成文字的前景色
			color: transparent;//文字颜色变成透明
		}

		.nosub-content {
			margin: 25rpx 65rpx 0 25rpx;
			font-size: 45rpx;
			font-weight: bold;
			background-image: linear-gradient(to right, #ce866e, #e8997d);
			background-clip: text;//裁剪成文字的前景色
			color: transparent;//文字颜色变成透明
		}
		.nosub-btn{
			margin-top: 30rpx;
			line-height: 65rpx;
			height: 65rpx;
			width: 80%;
			border-radius: 30rpx;
			font-size: 30rpx;
			font-weight: bold;
			background-image: linear-gradient(to right, #ba7a63, #ffa789);
		}
	}
</style>
