review-order.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="common-page" style="padding: 0" @click="playGlobalSound">
  3. <PageScroll requestStr="/app/orderreview/reviewOrderList" @updateList="updateList" ref="scrollRef"
  4. :otherParams="otherParams" :immediate="true" v-model:total="total">
  5. <view class="list-con" v-if="dataList.length">
  6. <ReviewOrderItem v-for="cell in dataList" :key="cell.orderId" :item="cell" class="mt-20" @click="handleReviewOrder(cell)">
  7. </ReviewOrderItem>
  8. </view>
  9. <!-- 底部统计 -->
  10. <view class="fixed-bottom total-count" v-if="total > 0">
  11. 共计{{ total }}条
  12. </view>
  13. </PageScroll>
  14. </view>
  15. </template>
  16. <script setup>
  17. import { ref } from "vue";
  18. import { onShow } from "@dcloudio/uni-app";
  19. import PageScroll from "@/components/pageScroll/index.vue";
  20. import ReviewOrderItem from "./components/reviewOrderItem.vue";
  21. //点击全局音效
  22. function playGlobalSound() {
  23. uni.$u.playClickSound();
  24. }
  25. const otherParams = ref({});
  26. const scrollRef = ref(null);
  27. const refreshList = () => {
  28. scrollRef.value?.resetUpScroll();
  29. };
  30. let dataList = ref([]);
  31. let total = ref(0);
  32. const updateList = (data) => {
  33. dataList.value = data;
  34. };
  35. const handleReviewOrder = (item) => {
  36. uni.navigateTo({
  37. url: `/pages/index/detail/review-detail?id=${item.orderId}`
  38. });
  39. };
  40. onShow(() => {
  41. refreshList();
  42. });
  43. </script>
  44. <style lang="scss" scoped>
  45. .list-con {
  46. padding: 10rpx 30rpx;
  47. gap: 30rpx;
  48. }
  49. .total-count {
  50. background-color: #4caf50;
  51. color: #ffffff;
  52. text-align: center;
  53. padding: 24rpx;
  54. font-size: 32rpx;
  55. font-weight: 500;
  56. margin-top: 20rpx;
  57. display: flex;
  58. justify-content: center;
  59. }
  60. </style>