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.

app-order-list.vue 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. </template> -->
  12. </template>
  13. <script setup lang="ts">
  14. import orderListItemNew from "./order-list-item-new.vue";
  15. import orderListItemCardSign from "./order-list-item-card-sign.vue";
  16. import orderListItemObu from "./order-list-item-obu.vue";
  17. import orderListItemLogoffEtc from "./order-list-item-logoff-etc.vue";
  18. import orderListItemEditCar from "./order-list-item-edit-car.vue";
  19. import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue';
  20. import orderListItemRecharge from "./order-list-item-cancel-recharge.vue";
  21. import { OrderTypes } from "@/datas/enum";
  22. import useOrderListItem from "@/composables/order/useOrderListItem";
  23. import { reactive, watch } from "vue";
  24. import { onLoad } from "@dcloudio/uni-app";
  25. import { getItem, StorageKeys, setItem } from "@/utils/storage";
  26. import { hasLogin, msg, timesDiff } from "@/utils/utils";
  27. import { request } from "@/utils/network/request.js";
  28. import { orderList, appPage } from "@/utils/network/api";
  29. const tools = require("../../static/etcUtil/tools.js");
  30. import { stringToJson } from "@/utils/network/encryption";
  31. const state = reactive({
  32. triggered: false, //设置当前下拉刷新的状态
  33. freshing: true,
  34. _freshing: false,
  35. ordersList: []
  36. })
  37. const searchKeyWords = ref('');
  38. const props = defineProps({
  39. index: {
  40. type: Number,
  41. default() {
  42. return 0
  43. }
  44. },
  45. refresh: { //是否刷新列表
  46. type: Boolean,
  47. default: true
  48. }
  49. })
  50. const { config, params, onKeyInput, refreshList } = useOrderListItem(props);
  51. //自定义下拉刷新被触发
  52. const onRefresh = () => {
  53. console.log("22222")
  54. refreshList(true)
  55. if (state._freshing) return;
  56. state._freshing = true;
  57. setTimeout(() => {
  58. state.triggered = false;
  59. state._freshing = false;
  60. }, 1000)
  61. }
  62. const onPulling = (e) => {
  63. console.log("11111")
  64. if (e.detail.deltaY < 0) {
  65. return
  66. }
  67. state.triggered = true
  68. }
  69. onLoad(() => {
  70. getList()
  71. })
  72. //搜索
  73. const doSearch = () => {
  74. // #ifdef MP-WEIXIN
  75. if (!searchKeyWords.value) {
  76. msg('请输入需要搜索的车牌号!');
  77. return;
  78. }
  79. refreshList(true);
  80. // #endif
  81. // #ifdef MP-ALIPAY
  82. tools.showLoadingAlert("加载中");
  83. refreshList(true);
  84. tools.hideLoadingAlert();
  85. // #endif
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .setHight {
  90. min-height: calc(100vh - 200rpx);
  91. }
  92. .search-layout {
  93. padding-top: 180rpx;
  94. .search-box {
  95. margin: 30rpx 30rpx 0rpx 30rpx;
  96. height: 80rpx;
  97. background: #FFFFFF;
  98. border: 1px solid #DCDCDC;
  99. border-radius: 40rpx;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. box-sizing: border-box;
  104. flex: 1;
  105. }
  106. .search-box .icon {
  107. width: 48rpx;
  108. height: 48rpx;
  109. margin: 0 20rpx;
  110. }
  111. .search-box .search {
  112. flex: 1;
  113. margin-right: 20rpx;
  114. height: 100%;
  115. padding: 0 10rpx;
  116. font-size: 28rpx;
  117. color: #00b38b;
  118. }
  119. .search-btn {
  120. color: white;
  121. background-color: #00B38B;
  122. width: 140rpx;
  123. height: 75rpx;
  124. line-height: 75rpx;
  125. font-size: 32rpx;
  126. border-radius: 40rpx;
  127. text-align: center;
  128. margin-right: 30rpx;
  129. margin-top: 30rpx;
  130. }
  131. }
  132. </style>