isbn-order.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="common-page" style="padding: 0;">
  3. <PageScroll requestStr="/app/orderinfo/getOrderListByIsbn" @updateList="updateList" ref="scrollRef"
  4. :otherParams="otherParams" method="post">
  5. <view class="list-con" v-if="dataList.length">
  6. <OrderItem v-for="cell in dataList" :key="cell.id" :item="cell" class="mt-20">
  7. </OrderItem>
  8. </view>
  9. </PageScroll>
  10. </view>
  11. </template>
  12. <script setup>
  13. import {
  14. reactive
  15. } from 'vue';
  16. import PageScroll from '@/components/pageScroll/index.vue'
  17. import OrderItem from '@/pages/my/components/orderItem.vue';
  18. import {
  19. ref
  20. } from 'vue';
  21. import {
  22. onLoad
  23. } from '@dcloudio/uni-app'
  24. const otherParams = ref({
  25. isbnList: '',
  26. })
  27. const scrollRef = ref(null)
  28. const refreshList = () => {
  29. scrollRef.value?.resetUpScroll()
  30. }
  31. let dataList = ref([])
  32. const updateList = (data, page) => {
  33. dataList.value = data
  34. if (data.length > 0 && page == 1) {
  35. uni.$u.ttsModule.speak('查询到' + data.length + '条数据')
  36. }
  37. if (data.length == 0 && page == 1) {
  38. uni.$u.ttsModule.speak('未查询到数据')
  39. }
  40. }
  41. // const isbnList = ref([]);
  42. onLoad(() => {
  43. const storedList = uni.getStorageSync('isbnList');
  44. if (storedList) {
  45. otherParams.value.isbnList = storedList.map(v => v.isbn)
  46. refreshList()
  47. }
  48. })
  49. </script>
  50. <style lang="scss">
  51. .search-area {
  52. padding: 24rpx;
  53. background-color: #ffffff;
  54. z-index: 9;
  55. }
  56. </style>