user-orders.vue 1.4 KB

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