sender.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="common-page" style="padding: 0;">
  3. <PageScroll requestStr="/app/orderinfo/getOrderListByUserInfo" @updateList="updateList" ref="scrollRef"
  4. :otherParams="otherParams" :immediate="false">
  5. <u-sticky :customNavHeight="0">
  6. <view class="search-area">
  7. <u-search placeholder="请输入发件人姓名或电话" :searchIconSize="18" bgColor="#f6f7f6" @search="handleSearch"
  8. v-model="otherParams.search" custom-style="font-size:32rpx" placeholder-style="font-size:32rpx"
  9. :clearabled="true" :focus="false" :showAction="false" :height="36"></u-search>
  10. </view>
  11. </u-sticky>
  12. <view class="list-con" v-if="dataList.length">
  13. <OrderItem v-for="cell in dataList" :key="cell.id" :item="cell" class="mt-20">
  14. </OrderItem>
  15. </view>
  16. </PageScroll>
  17. </view>
  18. </template>
  19. <script setup>
  20. import {
  21. reactive
  22. } from 'vue';
  23. import PageScroll from '@/components/pageScroll/index.vue'
  24. import OrderItem from '@/pages/my/components/orderItem.vue';
  25. import {
  26. ref
  27. } from 'vue';
  28. import {
  29. onLoad
  30. } from '@dcloudio/uni-app'
  31. const otherParams = ref({
  32. search: '',
  33. })
  34. const scrollRef = ref(null)
  35. const refreshList = () => {
  36. scrollRef.value?.resetUpScroll()
  37. }
  38. let dataList = ref([])
  39. const updateList = (data, page) => {
  40. dataList.value = data
  41. if (!isSearch.value) return
  42. if (data.length > 0) {
  43. uni.$u.ttsModule.speak('查询到' + data.length + '条数据')
  44. } else {
  45. uni.$u.ttsModule.speak('未查询到数据')
  46. }
  47. isSearch.value = false
  48. }
  49. const isSearch = ref(false)
  50. const handleSearch = () => {
  51. isSearch.value = true
  52. refreshList()
  53. }
  54. </script>
  55. <style lang="scss">
  56. .search-area {
  57. padding: 24rpx;
  58. background-color: #ffffff;
  59. z-index: 9;
  60. }
  61. </style>