isbn-order.vue 1.6 KB

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