<template>
	<view>
		<view class="box">
			<view class="form lanBox">
				<view class="lan border-bottom" v-for="(item,index) in ranklist">
					<view class="left">
						<view class="view">
							<view class="t-icon" :class="'t-icon-'+item.key_name" v-if="item.key_name!='score'&&item.key_name!='head_circumference'"></view>
							<view class="score" v-if="item.key_name=='score'">A</view>
							<image src="../../static/head.png" v-if="item.key_name=='head_circumference'"></image>
						</view>
						{{item.name}}
					</view>
					<view class="right">{{item.value?item.value:"0"}}{{item.unit}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// import {
	// 	mapState
	// } from "vuex";
	export default {
		data() {
			return {
				id: "",
				type: "",
				ranklist: []
			};
		},
		// computed: {
		// 	...mapState([])
		// },
		onLoad(options) {
			let that = this
			uni.setNavigationBarTitle({
				title: this.$t('titleDetail')
			})
			that.id = options.id
			that.getList()
		},
		methods: {
			getList() {
				let that = this
				that.$model.gethistorydetail({
					id: that.id,
				}).then((res) => {
					console.log("历史记录详情", res)
					this.ranklist = res.data
				})
			},
		}


	};
</script>

<style scoped="scoped" lang="scss">
	.box {
		min-height: 100vh;
		background-color: #fff;
	}

	.lanBox {
		padding: 0px 15px 0;
	}

	.lan {
		display: flex;
		align-items: center;
		font-size: 32rpx;
		height: 50px;
		line-height: 50px;
		justify-content: space-between;
		border-bottom: 1px solid #f7f7f7;

		.left {
			display: flex;
			align-items: center;
			text-align: left;
			font-size: 32rpx;
			padding-left: 30px;

			.view {
				width: 18px;
				height: 18px;
				position: absolute;
				left: 15px;
				padding: 2px;
				background-color: #c7c7c7;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.t-icon,
			image {
				width: 16px;
				height: 16px;
			}

		}

		.right {
			display: flex;
			align-items: center;
			justify-content: flex-end;
			width: 50%;
			min-height: 38px;
			box-sizing: border-box;
			line-height: 36px;
		}
	}
</style>