single.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div>
  3. <van-nav-bar title="单聊" fixed @click-left="onClickLeft" @click-right="onClickRight">
  4. <template #left>
  5. <div>
  6. <van-icon name="arrow-left" color="black" size="18" />
  7. </div>
  8. </template>
  9. <template #right>
  10. <van-icon name="ellipsis" color="black" size="18" />
  11. </template>
  12. </van-nav-bar>
  13. <van-pull-refresh v-model="loading" @refresh="onRefresh">
  14. <div class="w-full h-full border">12231</div>
  15. </van-pull-refresh>
  16. <ProfileNewsChatInput :shareGroup="false"></ProfileNewsChatInput>
  17. </div>
  18. </template>
  19. <script setup>
  20. const route = useRoute()
  21. const router = useRouter()
  22. definePageMeta({
  23. layout: false
  24. })
  25. // 刷新次数
  26. const count = ref(0)
  27. const loading = ref(false)
  28. // 刷新
  29. const onRefresh = () => {
  30. setTimeout(() => {
  31. showToast('刷新成功')
  32. loading.value = false
  33. count.value++
  34. }, 1000)
  35. }
  36. const onClickLeft = () => router.back()
  37. const onClickRight = () => {
  38. navigateTo({
  39. path: '/chat/set-single',
  40. query: {
  41. ...{
  42. userId: '2'
  43. }
  44. }
  45. })
  46. }
  47. </script>
  48. <style lang="scss" scoped></style>