<template>
	<view>
		<uni-section title="量表测试" type="line" padding>
			<uni-grid :column="2" :highlight="true" @change="changeHandle">
				<uni-grid-item v-for="(item, index) in menuList" :index="index" :key="index">
					<view class="grid-item-box">
						<image :src="item.imageUrl" class="image" mode="aspectFill" />
						<text class="text">{{ item.name }}</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menuList: [{
						name: '情商测试',
						imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/paymentPage/pay_scale_info.png',
						pageUrl: '/newScale/EQtest/index'
					},
					{
						name: '异性吸引指数测试',
						imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/paymentPage/pay_scale_info.png',
						pageUrl: '/newScale/Charm/index'
					},
					{
						name: '你是否在逐渐老化',
						imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Senile/paymentPage/pay_scale_info.png',
						pageUrl: '/newScale/Senile/index'
					},
					{
						name: 'MBTI 16型人格测试',
						imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/paymentPage/pay_scale_info.png',
						pageUrl: '/newScale/Mbti/index'
					}
				]
			}
		},
		methods: {
			changeHandle(e) {
				let {
					index
				} = e.detail
				uni.navigateTo({
					url: this.menuList[index].pageUrl
				})
			}
		}
	}
</script>

<style scoped>
	.grid-item-box {
		flex: 1;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
		text-align: center;
	}

	.grid-item-box image {
		width: 340rpx;
	}

	.image {
		width: 200rpx;
		height: 200rpx;
	}

	.text {
		font-size: 32rpx;
		margin-top: 5px;
	}
</style>