listView.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 if (props.appType == '社交亲密度') {
  26. uni.navigateTo({
  27. url: `/pages/intimacy/intimacy?msg=${JSON.stringify(item)}`
  28. })
  29. } else {
  30. uni.navigateTo({
  31. url: `/pages/student/student?msg=${JSON.stringify(item)}`
  32. })
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .box {
  38. margin-top: 22rpx;
  39. padding: 0 20rpx 30rpx 30rpx;
  40. box-sizing: border-box;
  41. width: 710rpx;
  42. background-color: #fff;
  43. overflow: hidden;
  44. .box_item {
  45. display: flex;
  46. justify-content: space-between;
  47. align-items: center;
  48. height: 90rpx;
  49. font-size: 28rpx;
  50. border-bottom: 1rpx solid #e6e6e6;
  51. .item_img {
  52. width: 31rpx;
  53. height: 31rpx;
  54. }
  55. }
  56. }
  57. </style>