Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

app-order-list.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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" />
  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. <block v-for="(item,index) in ordersList" :key="index">
  15. <order-list-item-new :item="item" />
  16. </block>
  17. <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt"
  18. v-if="ordersList.length > 0" />
  19. </template> -->
  20. </template>
  21. <script setup lang="ts">
  22. import orderListItemNew from "./order-list-item-new.vue";
  23. import orderListItemCardSign from "./order-list-item-card-sign.vue";
  24. import orderListItemObu from "./order-list-item-obu.vue";
  25. import orderListItemLogoffEtc from "./order-list-item-logoff-etc.vue";
  26. import orderListItemEditCar from "./order-list-item-edit-car.vue";
  27. import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue';
  28. import orderListItemRecharge from "./order-list-item-cancel-recharge.vue";
  29. import { OrderTypes } from "@/datas/enum";
  30. import useOrderListItem from "@/composables/order/useOrderListItem";
  31. import { reactive, watch } from "vue";
  32. import { onLoad } from "@dcloudio/uni-app";
  33. import { getItem, StorageKeys, setItem } from "@/utils/storage";
  34. import { hasLogin, msg, timesDiff } from "@/utils/utils";
  35. import { request } from "@/utils/network/request.js";
  36. import { orderList, appPage } from "@/utils/network/api";
  37. const tools = require("../../static/etcUtil/tools.js");
  38. import { stringToJson } from "@/utils/network/encryption";
  39. const state = reactive({
  40. triggered: false, //设置当前下拉刷新的状态
  41. freshing: true,
  42. _freshing: false,
  43. ordersList: []
  44. })
  45. const searchKeyWords = ref('');
  46. const props = defineProps({
  47. index: {
  48. type: Number,
  49. default() {
  50. return 0
  51. }
  52. },
  53. refresh: { //是否刷新列表
  54. type: Boolean,
  55. default: true
  56. }
  57. })
  58. const { config, params, onKeyInput, refreshList } = useOrderListItem(props);
  59. //自定义下拉刷新被触发
  60. const onRefresh = () => {
  61. console.log("22222")
  62. refreshList(true)
  63. if (state._freshing) return;
  64. state._freshing = true;
  65. setTimeout(() => {
  66. state.triggered = false;
  67. state._freshing = false;
  68. }, 1000)
  69. }
  70. const onPulling = (e) => {
  71. console.log("11111")
  72. if (e.detail.deltaY < 0) {
  73. return
  74. }
  75. state.triggered = true
  76. }
  77. onLoad(() => {
  78. getList()
  79. })
  80. //搜索
  81. const doSearch = () => {
  82. // #ifdef MP-WEIXIN
  83. if (!searchKeyWords.value) {
  84. msg('请输入需要搜索的车牌号!');
  85. return;
  86. }
  87. refreshList(true);
  88. // #endif
  89. // #ifdef MP-ALIPAY
  90. tools.showLoadingAlert("加载中");
  91. refreshList(true);
  92. tools.hideLoadingAlert();
  93. // #endif
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .setHight {
  98. min-height: calc(100vh - 200rpx);
  99. }
  100. .search-layout {
  101. padding-top: 180rpx;
  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>