<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> <view class="time"> <u-icon name="clock" customStyle="margin-right: 10rpx;" ></u-icon> {{item.time}} </view> </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: `/packageIndex/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: 2rpx 2rpx 8rpx rgba(0, 0, 0, 0.2); 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 { display: flex; align-items: center; margin-top: 20rpx; color: #a0a1a4; } } .right { height: fit-content; padding: 10rpx 20rpx; background-color: #408bf6; color: #fff; border-radius: 10rpx; } .green { background-color: green; } } } </style>