Commit 0e4ee2664447094687f0c815fc94a866bcf4013d
1 parent
fe819ede
调整
Showing
3 changed files
with
35 additions
and
4 deletions
garbage-removal/src/pages/home/index.vue
| ... | ... | @@ -28,6 +28,19 @@ |
| 28 | 28 | <view class="company-container"> |
| 29 | 29 | <view class="company-list-box" v-if="(addressInfo && userType == '用户')||userType == '运输企业负责人'||userType == '清运车辆驾驶员'"> |
| 30 | 30 | <view class="company-list-header"> |
| 31 | + | |
| 32 | + <view class="search-box" v-if="(addressInfo && userType == '用户')"> | |
| 33 | + <u-search | |
| 34 | + v-model="searchKeyword" | |
| 35 | + :show-action="true" | |
| 36 | + action-text="搜索" | |
| 37 | + placeholder="请输入公司名称" | |
| 38 | + @search="handleSearch" | |
| 39 | + @custom="handleSearch" | |
| 40 | + @clear="handleClearSearch" | |
| 41 | + ></u-search> | |
| 42 | + </view> | |
| 43 | + | |
| 31 | 44 | <view class="company-list-header-left" v-if="(addressInfo && userType == '用户')"> |
| 32 | 45 | <u-dropdown active-color="#19a97c"> |
| 33 | 46 | <u-dropdown-item :height="'240rpx'" :placement="'left'" v-model="registrationAreaValue" |
| ... | ... | @@ -118,6 +131,7 @@ import { queryRole } from "@/apis/user"; |
| 118 | 131 | import { useMainStore } from "@/stores/index.js"; |
| 119 | 132 | import { onLoad, onShow } from '@dcloudio/uni-app'; |
| 120 | 133 | import { computed, ref } from 'vue'; |
| 134 | +const searchKeyword = ref('') | |
| 121 | 135 | const mainStore = useMainStore() |
| 122 | 136 | const userType = computed(() => mainStore.userType); |
| 123 | 137 | const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单') |
| ... | ... | @@ -350,6 +364,16 @@ const handleCleanGarbage = (companyObj, tel, userAddress) => { |
| 350 | 364 | }) |
| 351 | 365 | } |
| 352 | 366 | |
| 367 | +const handleSearch = (value) => { | |
| 368 | + // 重新加载数据 | |
| 369 | + paging.value.reload() | |
| 370 | +} | |
| 371 | + | |
| 372 | +const handleClearSearch = () => { | |
| 373 | + searchKeyword.value = '' | |
| 374 | + paging.value.reload() | |
| 375 | +} | |
| 376 | + | |
| 353 | 377 | /** |
| 354 | 378 | * 搜索 |
| 355 | 379 | */ |
| ... | ... | @@ -429,7 +453,8 @@ const queryList = (pageNo, pageSize) => { |
| 429 | 453 | registrationArea: registrationAreaValue.value, |
| 430 | 454 | searchValue: carTypeValue.value, |
| 431 | 455 | userTypeValue:userTypeValue, |
| 432 | - userType:userType.value | |
| 456 | + userType:userType.value, | |
| 457 | + name: searchKeyword.value | |
| 433 | 458 | } |
| 434 | 459 | // 查询公司信息 |
| 435 | 460 | queryEnterpriseList(query).then(res => { |
| ... | ... | @@ -621,7 +646,13 @@ const queryList = (pageNo, pageSize) => { |
| 621 | 646 | font-size: small; |
| 622 | 647 | font-weight: small; |
| 623 | 648 | align-items: center; |
| 649 | + .search-box { | |
| 650 | + margin-bottom: 20rpx; | |
| 624 | 651 | |
| 652 | + ::v-deep .u-search { | |
| 653 | + background-color: #fff; | |
| 654 | + } | |
| 655 | + } | |
| 625 | 656 | .company-list-header-left { |
| 626 | 657 | text-align: center; |
| 627 | 658 | margin-bottom: 15rpx; | ... | ... |
garbage-removal/src/pages/order/order-driver/index.vue
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | </view> |
| 22 | 22 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" |
| 23 | 23 | :activeStyle="{ 'color': '#ffffff', 'font-weight': 'bolder' }" :inactiveStyle="{ color: '#ffffff' }" |
| 24 | - ref="uTabsElement" :list="displayList" :current="current" @change="tabsChange" :scrollable="false"></u-tabs> | |
| 24 | + ref="uTabsElement" :list="displayList" :current="current" @change="tabsChange" :scrollable="true"></u-tabs> | |
| 25 | 25 | </template> |
| 26 | 26 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> |
| 27 | 27 | <swiper-item class="swiper-item" v-for="(item, index) in list" :key="index"> |
| ... | ... | @@ -37,7 +37,7 @@ import swiperListItem from './swiper-list-item/index.vue'; |
| 37 | 37 | import { queryOrderList } from "@/apis/order.js"; |
| 38 | 38 | |
| 39 | 39 | // 初始化订单类型列表,添加count属性 |
| 40 | -const list = ref([{ name: '待清运', count: 0 }, { name: '清运中', count: 0 }, { name: '全部', count: 0 }, { name: '已完成', count: 0 }]) | |
| 40 | +const list = ref([, { name: '清运中', count: 0 }, { name: '全部', count: 0 }, { name: '已完成', count: 0 }]) | |
| 41 | 41 | const current = ref(0); |
| 42 | 42 | const swiperCurrent = ref(0) |
| 43 | 43 | const uTabsElement = ref() | ... | ... |
garbage-removal/src/pages/order/order-other/index.vue
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | </view> |
| 26 | 26 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" |
| 27 | 27 | :activeStyle="{ 'color': '#ffffff', 'font-weight': 'bolder' }" :inactiveStyle="{ color: '#ffffff' }" |
| 28 | - ref="uTabsElement" :list="displayList" :current="current" @change="tabsChange" :scrollable="false"></u-tabs> | |
| 28 | + ref="uTabsElement" :list="displayList" :current="current" @change="tabsChange" :scrollable="true"></u-tabs> | |
| 29 | 29 | </template> |
| 30 | 30 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> |
| 31 | 31 | <swiper-item class="swiper-item" v-for="( item, index ) in list " :key="index"> | ... | ... |