Преглед изворни кода

Merge branch 'dev-1.2.0' into release

jiayubo пре 3 месеци
родитељ
комит
d2ec3105a3

+ 5 - 5
api/home.js

@@ -1,10 +1,10 @@
 import request from '../utils/request'
 
-export function slideshow(slideshowId) {
-    return request({
-        url: `/web/core/slideshow/${slideshowId}`,
-        method: 'get',
-    })
+export function slideshow(slideshowType) {
+  return request({
+    url: `/web/core/slideshow/type/${slideshowType}`,
+    method: 'get',
+  })
 }
 
 //设置当前地址

+ 35 - 42
api/volunteerDetailsApi/details.js

@@ -1,6 +1,6 @@
 import upload from '@/utils/upload'
 import request from '@/utils/request'
-const lrr_service_category = 'service_category';
+const lrr_service_category = 'service_category'
 
 // 获取选择项健值第一项
 // export function typeOptionSelect(params = {}) {
@@ -22,36 +22,32 @@ const lrr_service_category = 'service_category';
 
 // 获取选择项健值第三项
 export function dictListlrData(params) {
-	return request({
-		url: '/system/dict/data/list',
-		method: 'get',
-		params:{
-			pageNum: 1,
-			pageSize: 10,
-			dictType: order_status,
-		}
-	})
+  return request({
+    url: '/system/dict/data/list',
+    method: 'get',
+    params: {
+      pageNum: 1,
+      pageSize: 10,
+      dictType: order_status,
+    },
+  })
 }
 
-
-
-
 // 获取志愿者详情页
 export function getDetailsvolunteerId(data) {
   return request({
-    url: `/core/volunteer/info/getDetails`, 
+    url: `/core/volunteer/info/getDetails`,
     method: 'post',
     data,
   })
 }
 
-
 // 获取志愿者列表信息
 export function volunteerinfolist(params) {
   return request({
     url: '/core/volunteer/info/list',
     method: 'get',
-	params:params
+    params: params,
   })
 }
 
@@ -73,61 +69,60 @@ export function volBusinessTypeList(params) {
   })
 }
 
+// 历史搜索
+export function searchHistoryBusinessTireNameHistory(params) {
+  return request({
+    url: '/core/searchHistory/info/businessTireNameHistory',
+    method: 'get',
+    params: params,
+  })
+}
 
 // 获取志愿者所有排班时间
 export function volunteergetTimesByDate(params) {
   return request({
-    url: '/core/volunteer/work-date/getTimesByDate',  
+    url: '/core/volunteer/work-date/getTimesByDate',
     method: 'get',
-	params:params,
-  });
+    params: params,
+  })
 }
 
-
 // 志愿者排班日期
 export function volunteerwork(params) {
   return request({
-    url: '/core/volunteer/work-date/getVolunteerWorkDate',  
+    url: '/core/volunteer/work-date/getVolunteerWorkDate',
     method: 'get',
-	  params:params
-  });
+    params: params,
+  })
 }
 
-
-
-
-
 // 确认支付
 export function ordersCreateOrder(data) {
   return request({
-    url: '/core/users/orders/createOrder',  
+    url: '/core/users/orders/createOrder',
     method: 'post',
-	data:data,
-  });
+    data: data,
+  })
 }
 
-
-
 //查询所有业务列表(树形结构)
 export function volunteerSeachgetTreeList(params) {
   return request({
-    url: '/core/business/management/getTreeList',  
+    url: '/core/business/management/getTreeList',
     method: 'get',
-	params:params,
-  });
+    params: params,
+  })
 }
 
-
 // 获取服务类型健值
 export function volunteerDataList(params) {
   return request({
-    url: 'system/dict/data/list',  
+    url: 'system/dict/data/list',
     method: 'get',
-	params:params,
-  });
+    params: params,
+  })
 }
 
-
 // 支付失败/取消支付
 export function coreUsersOrdersPayCancel(data) {
   return request({
@@ -137,7 +132,6 @@ export function coreUsersOrdersPayCancel(data) {
   })
 }
 
-
 // 获取志愿者图片列表
 export function volunteerVolunteerPicture(params) {
   return request({
@@ -155,4 +149,3 @@ export function systemConfig(params) {
     params: params,
   })
 }
-

+ 3 - 3
components/Services/services.vue

@@ -36,7 +36,7 @@
             <view class="demo-price-distance">
               <view class="demo-price-distance-text-1">
                 <text class="demo-price-distance-text-2">¥</text>
-                <text class="demo-price-distance-text">130</text>
+                <text class="demo-price-distance-text">{{ item.businessPrice }}</text>
               </view>
               <button class="demo-price-distance-button" @click="goToDetail(item)">抢购</button>
             </view>
@@ -70,7 +70,7 @@
           <view class="demo-price-distance">
             <view class="demo-price-distance-text-1">
               <text class="demo-price-distance-text-2">¥</text>
-              <text class="demo-price-distance-text">130</text>
+              <text class="demo-price-distance-text">{{ item.businessPrice }}</text>
             </view>
             <button class="demo-price-distance-button" @click="goToDetail(item)">抢购</button>
           </view>
@@ -267,7 +267,7 @@ const goToDetail = async (item) => {
     color: #FFFFFF;
     font-size: 30rpx;
     padding: 0;
-    margin-left: 132rpx;
+    margin-left: 70rpx;
   }
 }
 

+ 15 - 20
pages/index.vue

@@ -2,14 +2,14 @@
   <view>
     <!-- 首页顶部定位区域 -->
     <view class="home-banner" :class="{ 'home-banner-with-bg': showAddressBg }">
-      <view class="home-banner-left">
+      <view class="home-banner-left" :class="{ 'with-bg': userType == 1 }">
         <view class="location-group" @click="cityClick">
           <img src="@/static/uview/common/map-pin-fill@1x.png" alt="" class="map-pin-fill">
           <text class="address-text">{{ data.address.name }}</text>
           <image src="/static/img/Subscript.png" mode="widthFix" class="map-pin-Subscript"></image>
         </view>
-        <view class="address-text-bg"></view>
-        <view class="search-group" @click="searchClick">
+        <view class="address-text-bg" v-if="userType == 1"></view>
+        <view class="search-group" @click="searchClick" v-if="userType == 1">
           <img src="/static/img/map-pin-fill@1x.png" alt="" class="arrow-right">
           <view class="address-text-bg-text">搜索服务</view>
         </view>
@@ -73,7 +73,6 @@ const rightList = ref([])
 const leftList = ref([])
 const list3 = ref(['']) // Initialize with at least one empty item
 const ValueZone = ref(['']) // Initialize with at least one empty item
-const hotList = ref([])
 const ValueZoneSwiper = ref([''])
 const userType = uni.getStorageSync('userType') || 1; //读取本地存储
 const text1 = ref('');
@@ -216,21 +215,17 @@ onReachBottom(() => {
 
 const getBanners = async () => {
   try {
-    const res = await slideshow(21)
+    const res = await slideshow(10)
     if (res.code === 200 && res.data.picture) {
       list3.value = res.data.picture.split(',')
     }
 
-    const value_res = await slideshow(111)
+    const value_res = await slideshow(20)
     if (value_res.code === 200 && value_res.data.picture) {
       ValueZone.value = value_res.data.picture.split(',')
     }
-
-    const hot_res = await slideshow(11)
-    if (hot_res.code === 200 && hot_res.data.picture) {
-      hotList.value = hot_res.data.picture.split(',')
-    }
-    const hot_node = await slideshow(22)
+    
+    const hot_node = await slideshow(30)
     if (hot_node.code === 200 && hot_node.data.picture) {
       ValueZoneSwiper.value = hot_node.data.picture.split(',')
     }
@@ -298,10 +293,9 @@ onPageScroll(e => {
 
 onMounted(async () => {
 
-  try {
-    console.log("TCL:  uni.$u",)
-    getNotice()
-    const token = getToken();
+  console.log("TCL:  uni.$u",)
+  getNotice()
+  const token = getToken();
 
     const res_dara = await regionAddresstree()
     addresstree.value = res_dara.data
@@ -320,9 +314,6 @@ onMounted(async () => {
     } else {
       getList();
     }
-  } catch (error) {
-    getList();
-  }
 })
 
 </script>
@@ -359,9 +350,13 @@ onMounted(async () => {
     width: 516rpx;
     height: 64rpx;
     border-radius: 36rpx;
-    background: rgba(255, 255, 255, 0.56);
+    background: transparent;
     margin-left: 16rpx;
 
+    &.with-bg {
+      background: rgba(255, 255, 255, 0.56);
+    }
+
     .location-group {
       display: flex;
       align-items: center;

+ 64 - 227
pages_classify/pages/handle/index.vue

@@ -2,50 +2,45 @@
 <template>
   <view>
     <view class="order-detail">
-      <view class="service-info">
-        <PositioningMap :address="detaile.address" />
-      </view>
-      <view class="user-info order-card">
-        <view class="handle-user">
-          <view class="handle-user-left">
-            <img :src="detaile.avatar" alt=""
-              style="width: 96rpx; height: 96rpx; margin-right: 32rpx" />
-            <view class="handle-user-info">
-              <view class="user-name">{{ detaile.clientName }}</view>
-              <view class="user-id" style="display: flex">服务类别:{{ detaile.businessTireName }}</view>
-            </view>
-          </view>
-          <!-- <view class="user-phone" @click="onPhone(detaile.clientPhoneNumber)">
-            <up-icon name="phone" color="#fff" size="25"></up-icon>
-          </view> -->
-        </view>
+      <PositioningMap :address="detaile.address" />
+    </view>
 
-        <view class="handle-adress">
-          <up-icon name="map" color="rgba(156, 163, 175, 1)" size="20"></up-icon>
-          <view class="adress-text">{{ detaile.address }}</view>
-          <!-- <up-icon name="pushpin" color="rgba(221, 94, 69, 1)" size="25"></up-icon> -->
-        </view>
-        <view>
-          <view class="handle-remark">
-            <text class="remark-title">服务次数:{{detaile.singleQuantity }}次</text>
-          </view>
-          <view class="handle-remark">
-            <text class="remark-title">服务时间: {{ detaile.workDate + '  '+  detaile.workStartTime }}</text>
-          </view>
-        </view>
+    <view class="user-info">
+      <view class="handle-user-info">
+        <view class="user-name">下单时间:{{ detaile.createTime }}</view>
+        <view>上门时间:{{ detaile.workDate + ' ' + detaile.workStartTime }}</view>
+        <view>服务人员:{{ detaile.clientName }} 123123456</view>
+        <view class="user-id" style="display: flex">服务类别:{{ detaile.businessTireName }}</view>
+        <view class="adress-text">地址:{{ detaile.address }}</view>
         <view class="handle-remark">
           <view class="remark-title">备注</view>
           <view class="remark-text">{{ detaile.remark || '暂无备注' }}</view>
         </view>
+
       </view>
-    </view>
-    <view class="footer-g">
-      <view class="handle-start" v-if="orderStatus && detaile.serviceStartTime && dateData">
-        服务已开始:<text class="handle-time">{{ dateData }}</text>
+      <view class="footer-g">
+        <view class="handle-start" v-if="orderStatus && detaile.serviceStartTime && dateData">
+          服务已开始:<text class="handle-time">{{ dateData }}</text>
+        </view>
+        <Slide ref="verify" @change="change" :sliderText="slideData" :btnType="orderStatus ? 'upload' : 'start'" />
       </view>
-      <Slide ref="verify" @change="change" :sliderText="slideData" :btnType="orderStatus ? 'upload' : 'start'" />
     </view>
+
+    <!-- <view class="handle-adress">
+      <up-icon name="map" color="rgba(156, 163, 175, 1)" size="20"></up-icon>
+    </view> -->
+    <!-- <view>
+      <view class="handle-remark">
+        <text class="remark-title">服务次数:{{ detaile.singleQuantity }}次</text>
+      </view>
+      <view class="handle-remark">
+        <text class="remark-title">服务时间: {{ detaile.workDate + ' ' + detaile.workStartTime }}</text>
+      </view>
+    </view> -->
+
+
   </view>
+
 </template>
 
 <script setup>
@@ -81,7 +76,7 @@ const getCurrentLocation = () => {
     // 先检查用户是否授权了位置权限
     uni.getSetting({
       success: (res) => {
-				console.log("TCL: getCurrentLocation -> res", res)
+        console.log("TCL: getCurrentLocation -> res", res)
         // 已授权,直接获取位置
         getLocation(resolve, reject);
         // if (!res.authSetting['scope.getFuzzyLocation']) {
@@ -214,21 +209,21 @@ const change = async (e) => {
       // uni.showLoading({
       //   title: '获取位置信息...'
       // })
-      
+
       // 获取开始服务时的位置
       // const locationData = await getCurrentLocation().catch(err => {
       //   // uni.hideLoading()
       //   verify.value.initialization()
       //   throw new Error('无法获取位置信息,请确保已开启位置权限')
       // })
-    
-      const locationData =await getLatLong()
+
+      const locationData = await getLatLong()
       // 构建参数字符串
       const params = `secondOrderId=${secondOrderId.value}&serviceStartLongitude=${locationData.longitude.toString()}&serviceStartLatitude=${locationData.latitude.toString()}`
-      
+
       // 调用开始服务接口,通过URL查询参数传递位置信息
       const res = await getTimesByDate(params)
-      
+
       if (res.code === 200) {
         uni.showToast({
           title: '已开始服务',
@@ -250,13 +245,13 @@ const change = async (e) => {
       // uni.hideLoading()
     }
   }
-  
+
   if (e.state && orderStatus.value) {
     try {
       // uni.showLoading({
       //   title: '获取位置信息...'
       // })
- 
+
       uni.showToast({
         title: '操作成功',
         icon: 'success',
@@ -284,7 +279,7 @@ const change = async (e) => {
 onLoad((options) => {
   secondOrderId.value = options.secondOrderId
   getOrderDetail()
-  
+
   // // 初始检查位置权限
   // getCurrentLocation().then(location => {
   //   console.log('位置权限正常,可以获取位置');
@@ -309,190 +304,32 @@ onUnload(() => {
 })
 </script>
 <style lang="scss" scoped>
-.order-detail {
-  position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 280rpx;
-  overflow-y: auto;
-
-  .service-info {
-    // height: 360px;
-  }
-  .order-card {
-    border-radius: 8px;
-    background: rgba(255, 255, 255, 1);
-    padding: 12px;
-    margin-bottom: 12px;
-  }
-
-  .font-title {
-    margin-bottom: 12px;
-  }
-
-  .user-box {
-    display: flex;
-
-    .user-img {
-      width: 65.8px;
-      height: 65.8px;
-      margin-right: 12px;
-    }
-  }
-
-  .register-box {
-    display: flex;
-    margin-bottom: 12px;
-
-    .register-img {
-      width: 90px;
-      height: 90px;
-      margin-right: 12px;
-    }
-  }
 
-  .info-list {
-    flex: 1;
-    font-size: 14px;
-    font-weight: 500;
-    letter-spacing: 0px;
-    line-height: 23.27px;
-    color: rgba(51, 51, 51, 1);
-  }
-
-  .price {
-    font-size: 18px;
-    font-weight: 500;
-    color: rgba(246, 74, 31, 1);
-
-    .price-yuan {
-      font-size: 13px;
-      font-weight: 700;
-      color: rgba(246, 74, 31, 1);
-    }
-  }
-
-  .upload-img {
-    height: 68px;
-    width: 68px;
-    margin-right: 12px;
-    margin-bottom: 12px;
-  }
-
-  .upload-box {
-    display: flex;
-    flex-wrap: wrap;
-
-    .upload-img-item {
-      position: relative;
-
-      .delete-icon {
-        position: absolute;
-        top: -7px;
-        right: 7px;
-        z-index: 1;
-      }
-    }
-  }
-
-  .phone {
-    color: #3c9cff;
-  }
-}
-
-.handle-user {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-
-  .handle-user-left {
-    display: flex;
-    align-items: center;
-
-    .handle-user-info {
-      .user-name {
-        font-size: 32rpx;
-        font-weight: 400;
-        color: rgba(17, 24, 39, 1);
-      }
-
-      .user-id {
-        font-size: 28rpx;
-        font-weight: 400;
-        color: rgba(107, 114, 128, 1);
-      }
-    }
-  }
-
-  .user-phone {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-
-    width: 80rpx;
-    height: 80rpx;
-    border-radius: 50%;
-    background: rgba(221, 94, 69, 1);
-  }
-}
-
-.handle-adress {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  margin-top: 38rpx;
-
-  .adress-text {
-    flex: 1;
-    text-align: left;
-    padding-left: 24rpx;
-    font-size: 32rpx;
-    font-weight: 400;
-    color: rgba(75, 85, 99, 1);
-  }
-}
-
-.handle-remark {
-  margin-top: 30rpx;
-
-  .remark-title {
-    font-size: 28rpx;
-    font-weight: 400;
-    color: rgba(17, 24, 39, 1);
-    margin-bottom: 20rpx;
-  }
-
-  .remark-text {
-    border-radius: 16rpx;
-    background: rgba(249, 250, 251, 1);
-    padding: 32rpx;
-    font-size: 32rpx;
-    font-weight: 400;
-    color: rgba(75, 85, 99, 1);
-  }
-}
-
-.handle-start {
-  margin-bottom: 30rpx;
-  font-size: 32rpx;
-  font-weight: 400;
-  color: rgba(75, 85, 99, 1);
-  text-align: center;
-
-  .handle-time {
-    font-size: 32rpx;
-    font-weight: 400;
-    color: rgba(17, 24, 39, 1);
-  }
-}
-
-.footer-g {
-  padding: 12px;
+.handle-user-info {
+  // display: flex;
+  // flex-direction: column;
+  // gap: 10rpx;
   position: absolute;
-  bottom: 18px;
-  left: 0px;
-  right: 0px;
-  background: rgba(255, 255, 255, 1);
+  top: 531rpx;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: red;
+  width: 750rpx;
+    height: 804rpx;
+    border-radius: 20rpx 20rpx 0rpx 0rpx;
+  // margin-left: 38rpx;
+  // margin-right: 36rpx;
+  // margin-top: 50rpx;
+  // > view {
+  //   padding-bottom: 16rpx;
+  //   border-bottom: 1px solid #f0f0f0;
+  //   margin-bottom: 16rpx;
+  //   font-size: 28rpx;
+  //   color: #333;
+  //   // display: flex;
+  //   // justify-content: flex-start;
+  //   // align-items: center;
+  // }
 }
 </style>

+ 1 - 1
pages_home/pages/Volunteerside/detiles.vue

@@ -3,7 +3,7 @@
     <view>
       <view class="home-main">
         <view class="custom-swiper">
-          <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'697rpx'" :indicatorStyle="{ bottom: '20px' }"></up-swiper>
+          <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'697rpx'" :indicatorStyle="{ bottom: '60px' }"></up-swiper>
         </view>
       </view>
     </view>

+ 22 - 22
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -135,12 +135,12 @@
       </view>
     </view>
 
-    <!-- 底部第一层弹框 -->
-    <view>
-      <up-popup :show="show" @close="close" @open="open"> </up-popup>
-      <up-popup :show="show" @open="upPopupOpen" :custom-style="popupStyle">
-        <scroll-view scroll-y class="popup-scroll-content">
-          <!-- <view>
+  <!-- 底部第一层弹框 -->
+  <view>
+    <up-popup :show="show" @close="close" @open="open"> </up-popup>
+    <up-popup :show="show" @open="upPopupOpen" :custom-style="popupStyle">
+      <scroll-view scroll-y class="popup-scroll-content">
+        <!-- <view>
             <view class="Wrapper">
               <image src="/static/img/Location.png" class="Wrapper-img" />
               <span class="Wrapper-content">李四</span>
@@ -235,17 +235,17 @@
         </up-cell-group>
       </view>
 
-      <view class="Wrap-Payment">
-        <!-- 支付金额 -->
-        <view class="payment-header">
-          <text class="payment-title">现在支付</text>
-          <text class="payment-amount">¥{{ computeMoney }}</text>
-        </view>
+    <view class="Wrap-Payment">
+      <!-- 支付金额 -->
+      <view class="payment-header">
+        <text class="payment-title">现在支付</text>
+        <text class="payment-amount">¥{{ computeMoney }}</text>
+      </view>
 
-        <up-line></up-line>
+      <up-line></up-line>
 
-        <!-- 钱包支付选项 -->
-        <view class="payment-option">
+      <!-- 钱包支付选项 -->
+      <!-- <view class="payment-option">
           <view class="option-left">
             <image src="/static/钱包.png" class="payment-icon"></image>
             <text class="option-text">钱包</text>
@@ -255,7 +255,7 @@
               :label="item.name" :name="item.name"></up-radio>
           </up-radio-group>
         </view>
-        <up-line></up-line>
+        <up-line></up-line> -->
 
         <!-- 微信支付选项 -->
         <view class="payment-option">
@@ -269,13 +269,13 @@
           </up-radio-group>
         </view>
 
-        <up-line></up-line>
+      <up-line></up-line>
 
-        <!-- 其他支付方式 -->
-        <view class="other-payment">
-          <text class="other-payment-text">其他方式支付</text>
-          <up-icon name="arrow-right" size="14" color="#1890ff"></up-icon>
-        </view>
+      <!-- 其他支付方式 -->
+      <view class="other-payment">
+        <text class="other-payment-text">其他方式支付</text>
+        <up-icon name="arrow-right" size="14" color="#1890ff"></up-icon>
+      </view>
 
         <!-- 条款说明 -->
         <view class="terms-of-service">

+ 230 - 38
pages_home/pages/search/index.vue

@@ -4,17 +4,30 @@
     <u-input placeholder="请输入搜索的服务" prefixIcon="search" v-model="value" class="rounded-input" @confirm="handleSearch"
       clearable @clear="handleClear"></u-input>
     <!-- 历史记录 -->
-    <view class="history-search">
+    <view class="history-search" v-if="historyList.length > 0">
       <view class="history-search-title">历史搜索</view>
-      <view>
+      <view @click="clearHistory">
         <image src="@/static/img/delete-bin-6-fill@1x.png" mode="widthFix" class="delete-icon"></image>
         清空
       </view>
     </view>
+    <!-- 历史搜索列表 -->
+    <view class="history-list" v-if="historyList.length > 0">
+      <view class="history-item" v-for="(item, index) in historyList" :key="index" @click="searchByHistory(item)">
+        {{ item.businessTierName || item }}
+      </view>
+    </view>
+    <!-- 无历史记录提示 -->
+    <view class="no-history" v-if="historyList.length === 0">
+      <text>暂无搜索历史记录</text>
+    </view>
 
     <!-- tab -->
     <view>
-      <up-tabs :list="list2"></up-tabs>
+      <up-tabs 
+        :list="list2" 
+        @change="handleTabChange">
+      </up-tabs>
     </view>
     <!-- 瀑布流展示区域 -->
     <view class="home-ranking">
@@ -32,7 +45,7 @@
 <script setup>
 import { ref, reactive, onMounted, watch } from 'vue'
 import { onShow, onReachBottom } from '@dcloudio/uni-app'
-import { volTierName, volBusinessTypeList } from '@/api/volunteerDetailsApi/details.js'
+import { volTierName, volBusinessTypeList, searchHistoryBusinessTireNameHistory } from '@/api/volunteerDetailsApi/details.js'
 import RankingList from '@/pages/common/rankingList/index.vue'
 import ServIces from '@/components/Services/services.vue'
 import store from '@/store'
@@ -44,7 +57,9 @@ const rightList = ref([])
 const leftList = ref([])
 const ValueZoneSwiper = ref([''])
 
-const list2 = reactive([]);  
+const list2 = reactive([]);
+// 历史搜索列表
+const historyList = ref([]);
 
 // 用户类型
 const userType = uni.getStorageSync('userType') || 1; //读取本地存储
@@ -69,6 +84,67 @@ const loadmoreInfo = ref({
   nomoreText: '已经到底啦~',
 })
 
+/**
+ * 获取历史搜索记录
+ */
+const getHistoryList = async () => {
+  try {
+    console.log('开始获取历史搜索记录')
+    const res = await searchHistoryBusinessTireNameHistory({})
+    console.log('历史搜索API响应:', res)
+    if (res && res.data) {
+      // 检查返回的数据类型并适当处理
+      if (Array.isArray(res.data)) {
+        // 如果是简单字符串数组,转换为对象数组
+        if (typeof res.data[0] === 'string') {
+          historyList.value = res.data.map(item => ({ businessTierName: item }))
+        } else {
+          historyList.value = res.data
+        }
+      } else {
+        historyList.value = []
+      }
+      console.log('设置历史记录列表:', historyList.value)
+    } else {
+      console.log('API返回数据为空或没有data字段')
+      historyList.value = []
+    }
+  } catch (error) {
+    console.error('获取历史搜索记录失败:', error)
+    historyList.value = []
+  }
+}
+
+/**
+ * 清空历史搜索记录
+ */
+const clearHistory = async () => {
+  try {
+    // 这里假设接口支持清空历史记录,如果没有专门的清空接口,可能需要另外实现
+    await searchHistoryBusinessTireNameHistory({ clear: true })
+    historyList.value = []
+    uni.showToast({
+      title: '历史记录已清空',
+      icon: 'none'
+    })
+  } catch (error) {
+    console.error('清空历史记录失败:', error)
+    uni.showToast({
+      title: '清空历史记录失败',
+      icon: 'none'
+    })
+  }
+}
+
+/**
+ * 点击历史记录进行搜索
+ */
+const searchByHistory = (item) => {
+  // 处理不同的数据格式
+  value.value = typeof item === 'string' ? item : item.businessTierName
+  handleSearch()
+}
+
 /**
  * 处理搜索确认事件
  */
@@ -95,6 +171,56 @@ async function handleLoadmore(e) {
   }
 }
 
+/**
+ * 处理Tab切换事件
+ * @param {Object} e - 事件对象,包含选中tab的索引
+ */
+const handleTabChange = (e) => {
+  // 安全地获取索引
+  const index = typeof e === 'object' && e !== null ? (e.index !== undefined ? e.index : 0) : (typeof e === 'number' ? e : 0);
+  
+  console.log('切换到Tab:', e, '索引:', index)
+  
+  // 重置页码
+  pages.value.current = 1
+  
+  // 设置businessManagementId
+  if (index === 0) {
+    // 如果是"全部"选项,设置为0
+    pages.value.businessManagementId = 0
+  } else if (index > 0 && index < list2.length) {
+    const selectedTab = list2[index]
+    console.log('选中的Tab数据:', selectedTab)
+    
+    // 从businessManagementId字段获取,其次id字段获取
+    if (selectedTab && selectedTab.businessManagementId !== undefined) {
+      pages.value.businessManagementId = selectedTab.businessManagementId
+    } else if (selectedTab && selectedTab.id !== undefined) {
+      pages.value.businessManagementId = selectedTab.id
+    } else {
+      pages.value.businessManagementId = 0
+    }
+    
+    // 如果有children中的id,设置到请求参数中
+    if (selectedTab && selectedTab.children && Array.isArray(selectedTab.children) && selectedTab.children.length > 0) {
+      // 查找第一个有id的child
+      const firstChildWithId = selectedTab.children.find(child => child && child.id !== undefined);
+      if (firstChildWithId && firstChildWithId.id !== undefined) {
+        console.log('使用children中的ID:', firstChildWithId.id);
+        pages.value.businessManagementId = firstChildWithId.id;
+      }
+    }
+  } else {
+    // 默认为0
+    pages.value.businessManagementId = 0
+  }
+  
+  console.log('设置businessManagementId:', pages.value.businessManagementId)
+  
+  // 执行搜索
+  getList()
+}
+
 /**
  * 获取列表数据
  * 支持分页和关键词搜索
@@ -112,7 +238,7 @@ const getList = async () => {
       pageNum: pages.value.current,
       pageSize: pages.value.pageSize,
       serviceCategory: pages.value.serviceCategory || '',
-      businessManagementId: 0,
+      businessManagementId: pages.value.businessManagementId,
       // API接口使用的模糊搜索参数
       businessTierName: value.value, // 名称搜索参数
 
@@ -129,7 +255,7 @@ const getList = async () => {
 
     const paramstyle = {
       businessTierName: value.value, // 名称搜索参数
-      businessManagementId: 0,
+      businessManagementId: pages.value.businessManagementId,
     }
     console.log('businessManagementId 类型:', typeof params.businessManagementId);
     console.log('businessManagementId 值:', params.businessManagementId);
@@ -141,25 +267,73 @@ const getList = async () => {
 
     // 调用API获取数据
     const res = await volTierName(params)
-    const res1 = await volBusinessTypeList(paramstyle)
-    if (res1 && res1.data) {
-      // 清空原有数据
-      list2.splice(0, list2.length)
+    
+    // 如果用户输入了搜索关键词,始终更新标签列表以显示相关标签
+    // 如果没有关键词,且标签列表为空,则获取所有标签
+    if (value.value || list2.length === 0) {
+      const res1 = await volBusinessTypeList(paramstyle)
       
-      // 添加全部选项
-      list2.push({
-        name: '全部',
-        value: '0'
-      })
+      // 搜索成功后更新历史记录
+      if (value.value) {
+        getHistoryList() // 刷新历史记录
+      }
       
-      // 转换API返回的数据为up-tabs需要的格式
-      res1.data.forEach(item => {
+      if (res1 && res1.data) {
+        // 打印原始数据以检查id字段
+        console.log('原始API返回的Tabs数据:', JSON.stringify(res1.data))
+        
+        // 记住当前选中的标签名称,以便在重新生成列表后恢复选择
+        let selectedTabName = '';
+        if (list2.length > 0 && pages.value && pages.value.businessManagementId !== undefined) {
+          const currentIndex = Math.min(Math.max(0, pages.value.businessManagementId === 0 ? 0 : 1), list2.length - 1);
+          selectedTabName = list2[currentIndex]?.name || '';
+        }
+        
+        // 清空原有数据
+        list2.splice(0, list2.length)
+
+        // 添加全部选项
         list2.push({
-          name: item.businessTierName,
+          name: '全部',
+          value: '0',
+          businessManagementId: 0,
+          id: 0
         })
-      })
-      
-      console.log('转换后的Tabs数据:', list2)
+
+        // 转换API返回的数据为up-tabs需要的格式
+        res1.data.forEach(item => {
+          // 检查是否有children数组
+          let childrenIds = [];
+          if (item.children && Array.isArray(item.children)) {
+            // 收集所有children的ID
+            childrenIds = item.children.map(child => child.id).filter(id => id !== undefined);
+            console.log('项目children IDs:', childrenIds);
+          }
+          
+          list2.push({
+            name: item.businessTierName,
+            // 尝试获取正确的ID字段 - 优先使用businessManagementId,其次使用id
+            businessManagementId: item.businessManagementId || item.id || 0,
+            id: item.id || item.businessManagementId || 0,
+            // 保存children的id数组
+            childrenIds: childrenIds,
+            // 保存完整的children数据
+            children: item.children || []
+          })
+        })
+        
+        // 尝试恢复选中的标签
+        if (selectedTabName) {
+          // 查找具有相同名称的标签
+          const matchingIndex = list2.findIndex(item => item.name === selectedTabName);
+          if (matchingIndex !== -1 && pages.value) {
+            // 设置businessManagementId为找到的匹配项的ID
+            pages.value.businessManagementId = list2[matchingIndex].businessManagementId || list2[matchingIndex].id || 0;
+          }
+        }
+
+        console.log('转换后的Tabs数据:', JSON.stringify(list2))
+      }
     }
 
     if (!res || !res.rows) {
@@ -219,6 +393,8 @@ onMounted(() => {
 
   // 加载数据
   getList()
+  // 获取历史搜索记录
+  getHistoryList()
 })
 
 /**
@@ -266,32 +442,48 @@ const handleClear = () => {
     display: flex;
     justify-content: space-between;
     align-items: center;
-    margin-top: 18rpx;
+    margin-top: 24rpx;
     margin-left: 44rpx;
     margin-right: 44rpx;
+    padding-bottom: 6rpx;
+    border-bottom: 2rpx solid #f0f0f0;
 
     .history-search-title {
-      width: 120rpx;
-      height: 36rpx;
+      width: 140rpx;
+      height: 40rpx;
       font-family: PingFang SC;
-      font-size: 30rpx;
-      font-weight: 500;
-      line-height: 36rpx;
+      font-size: 32rpx;
+      font-weight: 600;
+      line-height: 40rpx;
       letter-spacing: normal;
       color: #313131;
     }
 
     .delete-icon {
-      /* 自动布局子元素 */
-      width: 24rpx;
-      height: 24rpx;
-      font-family: PingFang SC;
-      font-size: 24rpx;
-      font-weight: normal;
-      line-height: 48rpx;
-      text-align: right;
-      letter-spacing: normal;
-      color: #7B7B7B;
+      width: 28rpx;
+      height: 28rpx;
+      margin-right: 6rpx;
+    }
+  }
+
+  /* 历史搜索列表样式 */
+  .history-list {
+    display: flex;
+    flex-wrap: wrap;
+    margin: 20rpx 44rpx;
+    padding: 10rpx 0;
+    background-color: #f9f9f9;
+    border-radius: 16rpx;
+
+    .history-item {
+      padding: 14rpx 28rpx;
+      margin: 12rpx;
+      background-color: #EAEAEA;
+      border-radius: 30rpx;
+      font-size: 28rpx;
+      color: #000;
+      font-weight: 500;
+      box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1);
     }
   }