index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <uv-index-list :index-list="indexList">
  4. <template v-for="(item, index) in itemArr" :key="index">
  5. <uv-index-item>
  6. <uv-index-anchor :text="indexList[index]" size="16"></uv-index-anchor>
  7. <view class="chat_list">
  8. <uni-list :border="true">
  9. <uni-list-chat :to="`../../mine/personal_message/personal_message?id=${id}&name=${name}`"
  10. v-for="({ id, name, phone, avatar}, index) in item" @click="clickChat" :title="name" :avatar="avatar"
  11. :note="phone" time="研发部" :clickable="true" :avatar-circle="true" :key="index">
  12. </uni-list-chat>
  13. </uni-list>
  14. </view>
  15. </uv-index-item>
  16. </template>
  17. </uv-index-list>
  18. </view>
  19. </template>
  20. <script setup lang="ts">
  21. import { onMounted, reactive, ref } from 'vue'
  22. import headImg from "/static/images/mine/headImg.jpg";
  23. const indexList = ref([])
  24. const itemArr = ref([])
  25. onMounted(() => {
  26. const dept = '研发部'
  27. uni.setNavigationBarTitle({
  28. title: dept
  29. });
  30. indexList.value = ["A", "B", "C", "F", "G"]
  31. itemArr.value = [
  32. [
  33. {
  34. id: 1,
  35. name: '张三',
  36. phone: '13579543684',
  37. avatar: headImg
  38. },
  39. {
  40. id: 2,
  41. name: '李四',
  42. phone: '13987654321',
  43. avatar: headImg
  44. },
  45. {
  46. id: 3,
  47. name: '王五',
  48. phone: '13812345678',
  49. avatar: headImg
  50. },
  51. ],
  52. [
  53. {
  54. id: 4,
  55. name: '赵六',
  56. phone: '13765432109',
  57. avatar: headImg
  58. },
  59. {
  60. id: 5,
  61. name: '孙七',
  62. phone: '13698765432',
  63. avatar: headImg
  64. },
  65. {
  66. id: 6,
  67. name: '周八',
  68. phone: '13524689753',
  69. avatar: headImg
  70. }
  71. ],
  72. [
  73. {
  74. id: 7,
  75. name: '吴九',
  76. phone: '13456789012',
  77. avatar: headImg
  78. },
  79. {
  80. id: 8,
  81. name: '郑十',
  82. phone: '13367890123',
  83. avatar: headImg
  84. },
  85. {
  86. id: 9,
  87. name: '钱十一',
  88. phone: '13278901234',
  89. avatar: headImg
  90. }
  91. ],
  92. [
  93. {
  94. id: 16,
  95. name: '郑十八',
  96. phone: '13876543210',
  97. avatar: headImg
  98. },
  99. {
  100. id: 17,
  101. name: '吴十九',
  102. phone: '13712345678',
  103. avatar: headImg
  104. },
  105. {
  106. id: 18,
  107. name: '周二十',
  108. phone: '13534567890',
  109. avatar: headImg
  110. }
  111. ],
  112. [
  113. {
  114. id: 19,
  115. name: '二十一',
  116. phone: '13445678901',
  117. avatar: headImg
  118. },
  119. {
  120. id: 20,
  121. name: '二十二',
  122. phone: '13356789012',
  123. avatar: headImg
  124. },
  125. {
  126. id: 21,
  127. name: '二十三',
  128. phone: '13267890123',
  129. avatar: headImg
  130. }
  131. ]
  132. ]
  133. })
  134. function clickTop() {
  135. console.log('clickTop');
  136. }
  137. function clickChat(e) {
  138. console.log('clickChat', e);
  139. }
  140. </script>
  141. <style lang="scss">
  142. </style>