You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order-list-item.vue 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!-- 订单列表 -->
  2. <template>
  3. <!-- 搜索框 -->
  4. <view class="as-layout-horizontal as-gravity-center-start search-layout">
  5. <view class="search-box">
  6. <image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill"></image>
  7. <input class="search" placeholder="请输入车牌号" @input="onKeyInput" v-model="searchKeyWords" />
  8. </view>
  9. <view class="search-btn" @click="doSearch">搜索</view>
  10. </view>
  11. <!-- 数据为空 -->
  12. <empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="ordersList.length === 0" />
  13. <template v-else>
  14. <!-- 列表 -->
  15. <block v-for="(item,index) in ordersList" :key="index">
  16. <!-- 新办订单 -->
  17. <order-list-item-new :item="item" />
  18. </block>
  19. <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt"
  20. v-if="ordersList.length > 0" />
  21. </template>
  22. </template>
  23. <script setup lang="ts">
  24. import orderListItemNew from "./order-list-item-new.vue";
  25. import orderListItemCardSign from "./order-list-item-card-sign.vue";
  26. import orderListItemObu from "./order-list-item-obu.vue";
  27. import orderListItemLogoffEtc from "./order-list-item-logoff-etc.vue";
  28. import orderListItemEditCar from "./order-list-item-edit-car.vue";
  29. import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue';
  30. import orderListItemRecharge from "./order-list-item-cancel-recharge.vue";
  31. import { OrderTypes } from "@/datas/enum";
  32. import useOrderListItem from "@/composables/order/useOrderListItem";
  33. import { reactive, watch } from "vue";
  34. import { onLoad } from "@dcloudio/uni-app";
  35. const state = reactive({
  36. triggered: false, //设置当前下拉刷新的状态
  37. freshing: true,
  38. _freshing: false
  39. })
  40. const props = defineProps({
  41. index: {
  42. type: Number,
  43. default() {
  44. return 0
  45. }
  46. },
  47. refresh: { //是否刷新列表
  48. type: Boolean,
  49. default: true
  50. }
  51. })
  52. console.log("props.index", props)
  53. const { config, params, ordersList, doSearch, onKeyInput, refreshList, searchKeyWords } = useOrderListItem(props);
  54. //自定义下拉刷新被触发
  55. const onRefresh = () => {
  56. console.log("22222")
  57. refreshList(true)
  58. if (state._freshing) return;
  59. state._freshing = true;
  60. setTimeout(() => {
  61. state.triggered = false;
  62. state._freshing = false;
  63. }, 1000)
  64. }
  65. const onPulling = (e) => {
  66. console.log("11111")
  67. if (e.detail.deltaY < 0) {
  68. return
  69. }
  70. state.triggered = true
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .setHight {
  75. min-height: calc(100vh - 200rpx);
  76. }
  77. .search-layout {
  78. padding-top: 180rpx;
  79. .search-box {
  80. margin: 30rpx 30rpx 0rpx 30rpx;
  81. height: 80rpx;
  82. background: #FFFFFF;
  83. border: 1px solid #DCDCDC;
  84. border-radius: 40rpx;
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. box-sizing: border-box;
  89. flex: 1;
  90. }
  91. .search-box .icon {
  92. width: 48rpx;
  93. height: 48rpx;
  94. margin: 0 20rpx;
  95. }
  96. .search-box .search {
  97. flex: 1;
  98. margin-right: 20rpx;
  99. height: 100%;
  100. padding: 0 10rpx;
  101. font-size: 28rpx;
  102. color: #00b38b;
  103. }
  104. .search-btn {
  105. color: white;
  106. background-color: #00B38B;
  107. width: 140rpx;
  108. height: 75rpx;
  109. line-height: 75rpx;
  110. font-size: 32rpx;
  111. border-radius: 40rpx;
  112. text-align: center;
  113. margin-right: 30rpx;
  114. margin-top: 30rpx;
  115. }
  116. }
  117. </style>