sender.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="common-page" style="padding: 0;" @click="playGlobalSound">
  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. //点击全局音效
  32. function playGlobalSound(){
  33. uni.$u.playClickSound()
  34. }
  35. const otherParams = ref({
  36. search: '',
  37. })
  38. const scrollRef = ref(null)
  39. const refreshList = () => {
  40. scrollRef.value?.resetUpScroll()
  41. }
  42. let dataList = ref([])
  43. const updateList = (data, page) => {
  44. dataList.value = data
  45. if (!isSearch.value) return
  46. if (data.length > 0) {
  47. uni.$u.ttsModule.speak('查询到' + data.length + '条数据')
  48. } else {
  49. uni.$u.ttsModule.speak('未查询到数据')
  50. }
  51. isSearch.value = false
  52. }
  53. const isSearch = ref(false)
  54. const handleSearch = () => {
  55. isSearch.value = true
  56. refreshList()
  57. }
  58. </script>
  59. <style lang="scss">
  60. .search-area {
  61. padding: 24rpx;
  62. background-color: #ffffff;
  63. z-index: 9;
  64. }
  65. </style>