listView.vue 1.1 KB

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