Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

order-list-item.vue 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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="请输入车牌号" @blur="onKeyInput" v-model="searchKeyWords" />
  8. </view>
  9. </view>
  10. <!-- 数据为空 -->
  11. <empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="ordersList.length === 0" />
  12. <template v-else>
  13. <!-- 列表 -->
  14. <block v-for="(item,index) in ordersList" :key="index">
  15. <!-- 新办订单 -->
  16. <order-list-item-new :item="item" />
  17. </block>
  18. <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt" 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 useOrderListItem from "@/composables/order/useOrderListItem";
  24. import { reactive} from "vue";
  25. const state = reactive({
  26. triggered: false, //设置当前下拉刷新的状态
  27. freshing: true,
  28. _freshing: false
  29. })
  30. const props = defineProps({
  31. index: {
  32. type: Number,
  33. default() {
  34. return 0
  35. }
  36. },
  37. refresh: { //是否刷新列表
  38. type: Boolean,
  39. default: true
  40. }
  41. })
  42. const { config, params, ordersList, onKeyInput, refreshList, searchKeyWords } = useOrderListItem(props);
  43. //自定义下拉刷新被触发
  44. const onRefresh = () => {
  45. console.log("22222")
  46. refreshList(true)
  47. if (state._freshing) return;
  48. state._freshing = true;
  49. setTimeout(() => {
  50. state.triggered = false;
  51. state._freshing = false;
  52. }, 1000)
  53. }
  54. const onPulling = (e) => {
  55. console.log("11111")
  56. if (e.detail.deltaY < 0) {
  57. return
  58. }
  59. state.triggered = true
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .setHight {
  64. min-height: calc(100vh - 200rpx);
  65. }
  66. .search-layout {
  67. padding-top: 90rpx;
  68. .search-box {
  69. margin: 30rpx 30rpx 0rpx 30rpx;
  70. height: 80rpx;
  71. background: #FFFFFF;
  72. // border: 1px solid #DCDCDC;
  73. border-radius: 40rpx;
  74. display: flex;
  75. justify-content: center;
  76. align-items: center;
  77. box-sizing: border-box;
  78. flex: 1;
  79. }
  80. .search-box .icon {
  81. width: 48rpx;
  82. height: 48rpx;
  83. margin: 0 20rpx;
  84. }
  85. .search-box .search {
  86. flex: 1;
  87. margin-right: 20rpx;
  88. height: 100%;
  89. padding: 0 10rpx;
  90. font-size: 28rpx;
  91. color: #00b38b;
  92. }
  93. .search-btn {
  94. color: white;
  95. background-color: #00B38B;
  96. width: 140rpx;
  97. height: 75rpx;
  98. line-height: 75rpx;
  99. font-size: 32rpx;
  100. border-radius: 40rpx;
  101. text-align: center;
  102. margin-right: 30rpx;
  103. margin-top: 30rpx;
  104. }
  105. }
  106. </style>