Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

order-list-item.vue 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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" @scroll="upper">
  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. console.log("22222")
  77. refreshList(true)
  78. if (state._freshing) return;
  79. state._freshing = true;
  80. setTimeout(() => {
  81. state.triggered = false;
  82. state._freshing = false;
  83. }, 1000)
  84. }
  85. const onPulling = (e) => {
  86. console.log("11111")
  87. if (e.detail.deltaY < 0) {
  88. return
  89. }
  90. state.triggered = true
  91. }
  92. const upper = (e) => {
  93. console.log("333333")
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .setHight {
  98. min-height: calc(100vh - 200rpx);
  99. }
  100. .search-layout {
  101. padding-top: 80rpx;
  102. .search-box {
  103. margin: 30rpx 30rpx 0rpx 30rpx;
  104. height: 80rpx;
  105. background: #FFFFFF;
  106. border: 1px solid #DCDCDC;
  107. border-radius: 40rpx;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. box-sizing: border-box;
  112. flex: 1;
  113. }
  114. .search-box .icon {
  115. width: 48rpx;
  116. height: 48rpx;
  117. margin: 0 20rpx;
  118. }
  119. .search-box .search {
  120. flex: 1;
  121. margin-right: 20rpx;
  122. height: 100%;
  123. padding: 0 10rpx;
  124. font-size: 28rpx;
  125. color: #00b38b;
  126. }
  127. .search-btn {
  128. color: white;
  129. background-color: #00B38B;
  130. width: 140rpx;
  131. height: 75rpx;
  132. line-height: 75rpx;
  133. font-size: 32rpx;
  134. border-radius: 40rpx;
  135. text-align: center;
  136. margin-right: 30rpx;
  137. margin-top: 30rpx;
  138. }
  139. }
  140. </style>