listView.vue 1.3 KB

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