<template> <view class="stu"> <view @click="goStu(item)" v-for="(item,index) in list" :key="index" class="stu-item"> <view class="stu-item-img"> <image v-if="item.teacher_photo == ''" style="width: 100%;height: 100%;border-radius: 50%;" src="@/static/image/male.png" mode=""> </image> <image v-else style="width: 100%;height: 100%;border-radius: 50%;" :src="item.teacher_photo" mode=""> </image> </view> <view class="stu-item-text"> <view class="stu-item-text-top"> {{item.teacher_name}} </view> <view class="stu-item-text-bottom"> <text style="margin-right: 10rpx;" v-for="(item1,index1) in item.teacher_class"> {{item1.class_name}}</text> </view> </view> <view class="stu-item-icon"> {{str}} <uni-icons color="#05CCA1" type="right" size="20"></uni-icons> </view> </view> </view> </template> <script> export default { props: { list: { type: Array, default: () => [] }, active: { type: Number, default: () => 0 }, str:{ type: String, default: () => '查看课表' } }, methods: { goStu(item) { this.$emit('itemClick', item) } } } </script> <style lang="scss" scoped> .stu { width: 100%; .stu-item { padding: 32rpx; box-sizing: border-box; display: flex; background-color: #fff; border-radius: 10rpx; box-shadow: 0px 0px 8px 0px rgba(147, 147, 147, 0.20); margin-bottom: 32rpx; .stu-item-img { width: 100rpx; height: 100rpx; margin-right: 32rpx; } .stu-item-text { flex: 1; .stu-item-text-top { font-size: 32rpx; margin-bottom: 10rpx; } .stu-item-text-bottom { color: #999; font-size: 24rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 320rpx; } } .stu-item-icon { display: flex; align-items: center; color: #05CCA1; } } } </style>