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 4.5KB

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