listView.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="box">
  3. <view class="box_item" v-for="item in list" :key="item.id" @click="goPage(item.id)">
  4. {{ item.name }}({{ item.number }})
  5. <img class="item_img" src="../../static/images/right.png" />
  6. </view>
  7. <view class="no_data" v-if="!list.length">暂无数据</view>
  8. </view>
  9. </template>
  10. <script setup>
  11. import { onLoad } from '@dcloudio/uni-app'
  12. const props = defineProps({
  13. list: Array,
  14. appType: String
  15. })
  16. onLoad(() => {})
  17. // 点击每一个学生回调
  18. const goPage = (id) => {
  19. // console.log(id)
  20. if (props.appType == '学生轨迹') {
  21. uni.navigateTo({
  22. url: `/pages/track/track?id=${id}`
  23. })
  24. } else {
  25. uni.navigateTo({
  26. url: '/pages/student/student'
  27. })
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .box {
  33. margin-top: 22rpx;
  34. padding: 0 20rpx 60rpx 30rpx;
  35. box-sizing: border-box;
  36. width: 710rpx;
  37. background-color: #fff;
  38. overflow: hidden;
  39. .box_item {
  40. display: flex;
  41. justify-content: space-between;
  42. align-items: center;
  43. height: 90rpx;
  44. font-size: 28rpx;
  45. border-bottom: 1rpx solid #e6e6e6;
  46. .item_img {
  47. width: 31rpx;
  48. height: 31rpx;
  49. }
  50. }
  51. .no_data {
  52. margin-top: 20rpx;
  53. text-align: center;
  54. font-size: 28rpx;
  55. }
  56. }
  57. </style>