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,6 +28,19 @@ | ||
| 28 | <view class="company-container"> | 28 | <view class="company-container"> |
| 29 | <view class="company-list-box" v-if="(addressInfo && userType == '用户')||userType == '运输企业负责人'||userType == '清运车辆驾驶员'"> | 29 | <view class="company-list-box" v-if="(addressInfo && userType == '用户')||userType == '运输企业负责人'||userType == '清运车辆驾驶员'"> |
| 30 | <view class="company-list-header"> | 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 | <view class="company-list-header-left" v-if="(addressInfo && userType == '用户')"> | 44 | <view class="company-list-header-left" v-if="(addressInfo && userType == '用户')"> |
| 32 | <u-dropdown active-color="#19a97c"> | 45 | <u-dropdown active-color="#19a97c"> |
| 33 | <u-dropdown-item :height="'240rpx'" :placement="'left'" v-model="registrationAreaValue" | 46 | <u-dropdown-item :height="'240rpx'" :placement="'left'" v-model="registrationAreaValue" |
| @@ -118,6 +131,7 @@ import { queryRole } from "@/apis/user"; | @@ -118,6 +131,7 @@ import { queryRole } from "@/apis/user"; | ||
| 118 | import { useMainStore } from "@/stores/index.js"; | 131 | import { useMainStore } from "@/stores/index.js"; |
| 119 | import { onLoad, onShow } from '@dcloudio/uni-app'; | 132 | import { onLoad, onShow } from '@dcloudio/uni-app'; |
| 120 | import { computed, ref } from 'vue'; | 133 | import { computed, ref } from 'vue'; |
| 134 | +const searchKeyword = ref('') | ||
| 121 | const mainStore = useMainStore() | 135 | const mainStore = useMainStore() |
| 122 | const userType = computed(() => mainStore.userType); | 136 | const userType = computed(() => mainStore.userType); |
| 123 | const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单') | 137 | const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单') |
| @@ -350,6 +364,16 @@ const handleCleanGarbage = (companyObj, tel, userAddress) => { | @@ -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,7 +453,8 @@ const queryList = (pageNo, pageSize) => { | ||
| 429 | registrationArea: registrationAreaValue.value, | 453 | registrationArea: registrationAreaValue.value, |
| 430 | searchValue: carTypeValue.value, | 454 | searchValue: carTypeValue.value, |
| 431 | userTypeValue:userTypeValue, | 455 | userTypeValue:userTypeValue, |
| 432 | - userType:userType.value | 456 | + userType:userType.value, |
| 457 | + name: searchKeyword.value | ||
| 433 | } | 458 | } |
| 434 | // 查询公司信息 | 459 | // 查询公司信息 |
| 435 | queryEnterpriseList(query).then(res => { | 460 | queryEnterpriseList(query).then(res => { |
| @@ -621,7 +646,13 @@ const queryList = (pageNo, pageSize) => { | @@ -621,7 +646,13 @@ const queryList = (pageNo, pageSize) => { | ||
| 621 | font-size: small; | 646 | font-size: small; |
| 622 | font-weight: small; | 647 | font-weight: small; |
| 623 | align-items: center; | 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 | .company-list-header-left { | 656 | .company-list-header-left { |
| 626 | text-align: center; | 657 | text-align: center; |
| 627 | margin-bottom: 15rpx; | 658 | margin-bottom: 15rpx; |
garbage-removal/src/pages/order/order-driver/index.vue
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | </view> | 21 | </view> |
| 22 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" | 22 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" |
| 23 | :activeStyle="{ 'color': '#ffffff', 'font-weight': 'bolder' }" :inactiveStyle="{ color: '#ffffff' }" | 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 | </template> | 25 | </template> |
| 26 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> | 26 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> |
| 27 | <swiper-item class="swiper-item" v-for="(item, index) in list" :key="index"> | 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,7 +37,7 @@ import swiperListItem from './swiper-list-item/index.vue'; | ||
| 37 | import { queryOrderList } from "@/apis/order.js"; | 37 | import { queryOrderList } from "@/apis/order.js"; |
| 38 | 38 | ||
| 39 | // 初始化订单类型列表,添加count属性 | 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 | const current = ref(0); | 41 | const current = ref(0); |
| 42 | const swiperCurrent = ref(0) | 42 | const swiperCurrent = ref(0) |
| 43 | const uTabsElement = ref() | 43 | const uTabsElement = ref() |
garbage-removal/src/pages/order/order-other/index.vue
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | </view> | 25 | </view> |
| 26 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" | 26 | <u-tabs lineWidth=" 40" lineColor="#ffffff" lineHeight="6" |
| 27 | :activeStyle="{ 'color': '#ffffff', 'font-weight': 'bolder' }" :inactiveStyle="{ color: '#ffffff' }" | 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 | </template> | 29 | </template> |
| 30 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> | 30 | <swiper class="swiper" :current="swiperCurrent" @translation="translation" @animationfinish="animationfinish"> |
| 31 | <swiper-item class="swiper-item" v-for="( item, index ) in list " :key="index"> | 31 | <swiper-item class="swiper-item" v-for="( item, index ) in list " :key="index"> |