Newer
Older
xinJiangMiniProgranm / packageB / components / record.vue
<template>
	<view class="record">
		<view class="record-item" v-for="item in list" :key="item.code" @click="handleClick(item.code)">
			<view class="left">
				<text class="code">{{item.code}}</text>
				<text class="time">{{item.time}}</text>
			</view>
			<view :class="item.status === '已评估' ? 'green right' : 'right'">
				{{item.status}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						code: '1111',
						status: '待评估',
						time: '2022-12-12'
					},
					{
						code: '222',
						status: '已评估',
						time: '2022-12-12'
					},
					{
						code: '333',
						status: '待评估',
						time: '2022-12-12'
					},
				]
			}
		},
		methods: {
			// 点击卡片
			handleClick(code) {
				wx.navigateTo({
					url: `/packageB/recordDetail/recordDetail?code=${code}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.record {
		height: 100%;
		padding: 40rpx;
		z-index: 1;
		.record-item {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			background: #fff;
			border-radius: 16rpx;
			box-shadow: 4px 5px 7px #ccc;
			margin-top: 32rpx;
			padding: 40rpx 32rpx;
			&:first-child {
				margin-top: 0;
			}
			.left {
				display: flex;
				flex-direction: column;
				.code {
					font-weight: 600;
					font-size: 36rpx;
					color: #000;
				}
				.time {
					margin-top: 20rpx;
					color: #333;
				}
			}
			.right {
				height: fit-content;
				padding: 10rpx 20rpx;
				background-color: #408bf6;
				color: #fff;
				border-radius: 10rpx;
			}
			.green {
				background-color: green;
			}
		}
	}
</style>