index.vue 1.3 KB
<template>
	<view>
		<view class="ListItem" @click="openInfoPop">
			<view class="ListItem-l">
				<text>{{ info.uname }}</text>
				<image src="@/static/images/admin/icon12.png" v-if="info.usex === GENDER.MALE" mode=""></image>
				<image src="@/static/images/admin/icon13.png" v-else mode=""></image>
			</view>
			<view class="ListItem-r">
				<text>扣</text>
				<text style="color: #F43535;">{{ info.num }}</text>
				<text>分</text>
			</view>
		</view>
		<info-pop ref="infoPop"/>
	</view>
	
</template>

<script>
	import InfoPop from "../InfoPop/index.vue"
	import { GENDER } from "@/emit/index.js"
	export default {
		name: 'ListItem',
		props: {
			info: {
				type: Object,
				default: () => {
					return {}
				}
			}
		},
		components: {
			InfoPop
		},
		data() {
			return {
				GENDER
			}
		},
		methods: {
			openInfoPop() {
				this.$refs.infoPop.open(this.info)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.ListItem{
		display: flex;
		justify-content: space-between;
		height: 114rpx;
		border-radius: 15rpx;
		align-items: center;
		background: #FFFFFF;
		padding: 0 30rpx;
		margin-bottom: 20rpx;
		.ListItem-l{
			display: flex;
			align-items: center;
			font-size: 30rpx;
			color: #3D4054;
			image{
				height: 28rpx;
				width: 28rpx;
				margin-left: 10rpx;
			}
		}
		.ListItem-r{
			color: #A1A0AB;
			font-size: 26rpx;
		}
	}
</style>