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

+ 19 - 5
App.vue

@@ -2,13 +2,25 @@
 // import WebSocketManager from '@/utils/WebSocketManager.js';
 import { watch } from 'vue';
 import store from '@/store'
+import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
 export default {
-	data:{
+	data: {
 		userId: uni.getStorageSync('userId') //读取本地存储
 	},
 	onLaunch: function () {
 		console.log('App Launch')
-		
+		console.log("App Launch");
+		uni.loadFontFace({
+			family: "uicon-iconfont",
+			source: 'url("https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf")',
+			global: true,
+			success: (success) => {
+				console.log("Font loaded successfully", success);
+			},
+			fail: (fail) => {
+				console.log("Font loading failed", fail);
+			},
+		});
 	},
 	onShow: function () {
 		//设置默认角色
@@ -18,15 +30,17 @@ export default {
 	onHide: function () {
 		console.log('App Hide')
 	},
-	onMounted() { 
-		 
+	onMounted() {
+
 		console.log("TCL: onMounted -> onMounted", onMounted)
-		
+
 	},
 }
+
 </script>
 
 <style lang="scss">
+/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
 @import "uview-plus/index.scss";
 @import '@/static/scss/index.scss';
 </style>

+ 8 - 3
components/CustomTabBar/index.vue

@@ -7,8 +7,8 @@
                         <view class="message-style" v-if="item.key === 'chat' && messageCount > 0">
                         </view>
                         <view v-if="item.key === 'chat'" class="chat-box">
-                             <image v-if="item.key != selectIndex" class="img" :src="item.iconPath"></image>
-                             <image v-else class="img" :src="item.selectedIconPath"></image>
+                             <image v-if="item.key != selectIndex" class="img2" :src="item.iconPath"></image>
+                             <image v-else class="img2" :src="item.selectedIconPath"></image>
                         </view>
                        <template v-else>
                             <image v-if="item.key != selectIndex" class="img" :src="item.iconPath"></image>
@@ -171,7 +171,7 @@ export default {
 <style lang="scss">
 .tab_bar {
     width: 100vw;
-    height: 160rpx;
+    height: 190rpx;
     position: fixed;
     bottom: 0rpx;
     /* 模糊大小就是靠的blur这个函数中的数值大小 */
@@ -206,6 +206,11 @@ export default {
                 text-align: center;
 
                 .img {
+                    width: 70rpx;
+                    height: 70rpx;
+                }
+
+                .img2 {
                     width: 50rpx;
                     height: 50rpx;
                 }

+ 1 - 1
pages/chat.vue

@@ -266,7 +266,7 @@ onMounted(() =>{
     bottom: 0;
     left: 0px;
     right: 0px;
-    padding-bottom: 150rpx;
+    padding-bottom: 190rpx;
     background: #FAF8F7;
 
     .scroll-view-class {

+ 11 - 8
pages/classify.vue

@@ -99,10 +99,8 @@ const pages = ref({
   total: null,
 })
 async function getList(type) {
-  console.log("TCL: getList -> type", type)
   try {
 
-    console.log(data.value.length, pages.value.total);
     if (type === 'top') {
       data.value = [];
       pages.value.total = 0;
@@ -116,9 +114,9 @@ async function getList(type) {
         return;
       }
     } else {
-      uni.showLoading({
-        title: '数据加载中...',
-      })
+      // uni.showLoading({
+      //   title: '数据加载中...',
+      // })
     }
 
 
@@ -152,7 +150,7 @@ async function getList(type) {
       }
     }, 500)
 
-    type !== 'bottom' && uni.hideLoading()
+    // type !== 'bottom' && uni.hideLoading()
   }
 }
 
@@ -162,6 +160,7 @@ async function getList(type) {
  * 3:开始或结束服务
  */
 function btnClick(row, type) {
+  uni.setStorageSync('tabKey', tabKey.value);//存储当前tab的下标
   if (type === 1) {
     uni.navigateTo({
       url: `/pages_classify/pages/order/index?secondOrderId=${row.secondOrderId}`,
@@ -197,7 +196,11 @@ onShow(() => {
   const initIndex = userType === 1 ? 2 : 1;//默认选中待服务
 
   const params = getApp().globalData.switchTabParams || {}
-  tabKey.value = params.tabKey || initIndex;
+
+  const storage_tabKey = uni.getStorageSync('tabKey'); //读取本地存储
+
+  tabKey.value = params.tabKey || storage_tabKey || initIndex;//优先显示外部传入的tabKey,其次存储在本地的tabKey,最后默认选中待服务
+
   onChange(column.value[tabKey.value])
   // 使用后建议清除参数,避免重复读取
   getApp().globalData.switchTabParams = null
@@ -224,7 +227,7 @@ onShow(() => {
     left: 0px;
     right: 0px;
     background: rgba(245, 245, 245, 1);
-    padding-bottom: 150rpx;
+    padding-bottom: 190rpx;
   }
 }
 </style>

+ 0 - 2
pages/common/orderList/index.vue

@@ -43,12 +43,10 @@ const loadmoreInfo = ref({
 	nomoreText: '已经到底啦~'
 })
 const scrolltolower = () => {
-    console.log('底部');
     emit('refresh','bottom');
 };
 
 const onCustomRefresh = () => {
-    console.log('下拉刷新');
     isRefreshing.value = true;
     emit('refresh','top');
 };

+ 2 - 1
pages/common/orderList/listItem.vue

@@ -72,7 +72,8 @@ const order_status = inject('order_status');
  * 2:沟通
  */
 function onClick(type) {
-    inject_click(props.data, type);
+    uni.$u.debounce(inject_click(props.data, type), 300)
+    
 }
 </script>
 

+ 8 - 3
pages/common/orderList/userItem.vue

@@ -30,7 +30,7 @@
         <view class="item-btns">
           <view v-for="item in btns" :key="item.name">
             <view :class="['btn-m', (item.name === '取消' || item.name === '退款') ? 'btn-cancel-refund' : '']" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
-              @click="item.onClick(data)">
+              @click="onClick(item,data) ">
               <image v-if="item.name === '查看'" src="/static/img/组 14145@1x.png" class="btn-icon"></image>
               <image v-if="item.name === '沟通'" src="/static/img/容器 165@1x.png" class="btn-icon"></image>
               {{ item.name }}
@@ -57,13 +57,18 @@ const props = defineProps({
 });
 
 const order_status = inject('order_status');
-console.log("TCL: order_status", order_status)
+
+//防抖处理
+const onClick =(record,data)=>{
+  uni.$u.debounce(()=>{
+    record.onClick(data)
+  }, 300)
+}
 
 const btns = [
   {
     name: '沟通',
     onClick: (e) => {
-      console.log("TCL: e", e)
       uni.navigateTo({
         url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}&conversationType=2`
       });

+ 10 - 5
pages/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view>
     <!-- 首页顶部定位区域 -->
-    <view class="home-banner" :class="{ 'home-banner-with-bg': showAddressBg }">
+    <view class="home-banner" :class="{ 'home-banner-with-bg': showAddressBg }" >
       <view class="home-banner-left" @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>
@@ -10,7 +10,7 @@
 
     <view class="home-main">
       <view class="custom-swiper" v-if="list3.length > 0">
-        <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'554rpx'"></up-swiper>
+        <up-swiper :list="list3" :indicator="false" indicatorMode="line" circular :height="'554rpx'"></up-swiper>
       </view>
     </view>
 
@@ -203,7 +203,7 @@ const getBanners = async () => {
       list3.value = res.data.picture.split(',')
     }
 
-    const value_res = await slideshow(20)
+    const value_res = await slideshow(111)
     if (value_res.code === 200 && value_res.data.picture) {
       ValueZone.value = value_res.data.picture.split(',')
     }
@@ -278,6 +278,8 @@ onPageScroll(e => {
 })
 
 onMounted(async () => {
+
+  console.log("TCL:  uni.$u", )
   getNotice()
   const token = getToken();
 
@@ -298,6 +300,9 @@ onMounted(async () => {
   } else {
     getList();
   }
+
+
+
 })
 
 onUnload(() => { })
@@ -341,7 +346,7 @@ onUnload(() => { })
     }
 
     .address-text {
-      width: 178rpx;
+      // width: 178rpx;
       height: 42rpx;
       font-family: PingFang SC;
       font-size: 28rpx;
@@ -349,7 +354,7 @@ onUnload(() => { })
       line-height: 40rpx;
       letter-spacing: normal;
       color: #000000;
-      max-width: 120rpx;
+      max-width: 60%;
       white-space: nowrap;
       overflow: hidden;
       text-overflow: ellipsis;

+ 17 - 35
pages/login.vue

@@ -7,8 +7,6 @@
       <text class="title">金邻助家</text>
     </view>
 
-
-
     <view class="slogan-content">
       <text class="slogan-text">着力打造全国居家服务行业标准</text>
       <text class="slogan-text">和建立综合信用评价体系</text>
@@ -17,7 +15,7 @@
     <image src="/static/13779@1x.png" mode="widthFix" class="house-illustration"></image>
 
     <view class="actions-container">
-      <up-button @click="handleLogin" :customStyle="WeChat">微信授权登录</up-button>
+      <up-button @click="onLogin" :customStyle="WeChat">微信授权登录</up-button>
       <view class="xieyi text-center">
         <up-checkbox-group v-model="checkboxValue">
           <up-checkbox label="我已认真阅读、理解并同意" name="agree" usedAlone @change="onCheckboxChange" class="text-grey1">
@@ -41,7 +39,7 @@ import { useRouter } from 'vue-router' // 根据实际情况选择路由库
 import store from '@/store'
 import { onShow, onLoad } from '@dcloudio/uni-app'
 import {
-	userOrWorker
+  userOrWorker
 } from '@/api/login';
 const imagePath = '/static/9efd1.png' // Path to the logo image (red tree)
 
@@ -56,6 +54,7 @@ const loginForm = reactive({
   referrerId: '',
 })
 
+
 const checkboxValue = ref(false)
 const globalData = ref({
   statusBarHeight: 47,
@@ -129,8 +128,11 @@ const handleUserAgrement = () => {
 }
 
 // 登录方法
+const onLogin = () => {
+  uni.$u.debounce(handleLogin, 300)
+}
+
 const handleLogin = async () => {
-  console.log('checkboxValue', checkboxValue.value)
 
   if (!checkboxValue.value) {
     uni.showToast({
@@ -143,13 +145,7 @@ const handleLogin = async () => {
   uni.showLoading({
     title: '登录中,请耐心等待...',
   }) // 使用uni-app的loading方法替代$modal.loading
-  // 获取服务商信息
-  uni.getProvider({
-    service: 'oauth',
-    success: (res) => {
-      console.log(res)
-    },
-  })
+
 
   // 获取code
   uni.login({
@@ -167,16 +163,6 @@ const handleLogin = async () => {
 
       loginForm.code = res.code
 
-      // 打印当前登录信息
-      console.log('登录信息:', loginForm)
-
-      // 获取用户信息
-      uni.getUserInfo({
-        success: (res) => {
-          console.log('用户信息', res)
-        },
-      })
-
       pwdLogin()
 
       uni.hideLoading()
@@ -191,7 +177,6 @@ const pwdLogin = async () => {
     return
   }
   store.dispatch('Login', loginForm).then(() => {
-    // uni.hideLoading(); // 关闭加载提示
     loginSuccess()
   })
 }
@@ -199,20 +184,17 @@ const pwdLogin = async () => {
 // 登录成功后,处理函数
 const loginSuccess = () => {
   store.dispatch('GetInfo').then((res) => {
-    console.log("TCL: loginSuccess -> res", res)
-    console.log(store.state.user.userOrWorker, '>>>>99')
     uni.setStorageSync('userType', store.state.user.userOrWorker)
     uni.setStorageSync('userId', res.user.userId)
-    userOrWorker({userType: store.state.user.userOrWorker})
-		.then(res => {
-			console.log("TCL: loginSuccess -> res", res)
-				uni.switchTab({
+    userOrWorker({ userType: store.state.user.userOrWorker })
+      .then(res => {
+        uni.switchTab({
           url: '/pages/index',
         })
-		})
-		.catch(err => {
-			console.error('设置失败:', err);
-		});
+      })
+      .catch(err => {
+        console.error('设置失败:', err);
+      });
   })
 }
 
@@ -222,7 +204,7 @@ const getSystemInfo = () => {
     success: (res) => {
       const statusBarHeight = res.statusBarHeight
       const navBarHeight =
-        res.platform === 'android' ? 48 : 44 + res.statusBarHeight
+        (res.platform === 'android') ? 48 : 44 + res.statusBarHeight
       globalData.value = { statusBarHeight, navBarHeight }
     },
   })
@@ -300,7 +282,7 @@ const onCheckboxChange = (value) => {
   .title {
     width: 360rpx;
     height: 128rpx;
-  font-family: Poppins;
+    font-family: Poppins;
     font-size: 90rpx;
     font-weight: 600;
     line-height: 127.81rpx;

+ 1 - 1
pages/mine/index.scss

@@ -43,7 +43,7 @@
     bottom: 0;
     background: #FAF8F7;
     overflow-y: auto;
-    padding-bottom: 150rpx;
+    padding-bottom: 190rpx;
 
 
 

+ 5 - 5
pages/mine/index.vue

@@ -24,7 +24,7 @@
 
                             </view>
                         </view>
-                        <img src="/static/serverImg/mine/setting.png" alt="" style="width: 40rpx; height: 40rpx;"
+                        <img src="/static/serverImg/mine/setting.png" alt="" style="width: 60rpx; height: 60rpx;"
                             @click="handLsetTing">
                     </view>
                 </view>
@@ -407,9 +407,9 @@ onMounted(() =>{
 const init = async () => {
     try {
         // uni.hideLoading();
-        uni.showLoading({
-            title: '数据加载中...',
-        })
+        // uni.showLoading({
+        //     title: '数据加载中...',
+        // })
 
         if (userType === 2) {
             const res1 = await getVolunteerAccountInfo()
@@ -435,7 +435,7 @@ const init = async () => {
             icon: 'error',
         })
     } finally {
-        uni.hideLoading()
+        // uni.hideLoading()
     }
 }
 

+ 13 - 13
pages_classify/pages/handle/index.vue

@@ -176,9 +176,9 @@ const slideData = computed(() => {
 
 const getOrderDetail = async () => {
   try {
-    uni.showLoading({
-      title: '数据加载中...',
-    })
+    // uni.showLoading({
+    //   title: '数据加载中...',
+    // })
     const res = await getVolunteerOrderInfo({
       secondOrderId: secondOrderId.value,
     })
@@ -212,20 +212,20 @@ const getOrderDetail = async () => {
       icon: 'error',
     })
   } finally {
-    uni.hideLoading()
+    // uni.hideLoading()
   }
 }
 
 const change = async (e) => {
   if (e.state && !orderStatus.value) {
     try {
-      uni.showLoading({
-        title: '获取位置信息...'
-      })
+      // uni.showLoading({
+      //   title: '获取位置信息...'
+      // })
       
       // 获取开始服务时的位置
       const locationData = await getCurrentLocation().catch(err => {
-        uni.hideLoading()
+        // uni.hideLoading()
         verify.value.initialization()
         throw new Error('无法获取位置信息,请确保已开启位置权限')
       })
@@ -254,15 +254,15 @@ const change = async (e) => {
         icon: 'none'
       })
     } finally {
-      uni.hideLoading()
+      // uni.hideLoading()
     }
   }
   
   if (e.state && orderStatus.value) {
     try {
-      uni.showLoading({
-        title: '获取位置信息...'
-      })
+      // uni.showLoading({
+      //   title: '获取位置信息...'
+      // })
       
       // // 获取结束服务时的位置
       // const locationData = await getCurrentLocation().catch(err => {
@@ -295,7 +295,7 @@ const change = async (e) => {
       })
       verify.value.initialization()
     } finally {
-      uni.hideLoading()
+      // uni.hideLoading()
     }
   }
 }

+ 126 - 117
pages_classify/pages/order/index.vue

@@ -7,11 +7,9 @@
 				<view class="info-list">
 					<view>被服务人员:{{ detaile.clientName }}</view>
 					<view style="display: flex;">服务类别:
-             <!-- <dict-tag :options="lrr_service_category"
-							:value="detaile.businessTireName" /> -->
-              {{ detaile.businessTireName }}
-            </view>
-					<view @click="onPhone">电话号码:<label class="phone">{{ detaile.clientPhoneNumber }}</label></view>
+						{{ detaile.businessTireName }}
+					</view>
+					<view @click="onPhone">电话号码:<label class="phone">{{ detaile.clientPhoneNumber.replace(/(\d{3})\d{4}(\d{4})/,  '$1****$2')  }}</label></view>
 					<view>地址:{{ detaile.address }}</view>
 				</view>
 			</view>
@@ -19,13 +17,13 @@
 		<view class="service-info order-card">
 			<view class="font-title ">备注信息</view>
 			<view class="info-list">
-				{{ detaile.remark }}
+				{{ detaile.remark || '暂无备注信息'}}
 			</view>
 		</view>
 		<view class="service-info order-card" v-if="detaile.orderStatus === '3'">
 			<view class="font-title ">反馈信息</view>
 			<view class="info-list">
-				<up-textarea v-model="detaile.volunteerReview" placeholder="请输入内容" ></up-textarea>
+				<up-textarea v-model="detaile.volunteerReview" placeholder="请输入内容"></up-textarea>
 			</view>
 		</view>
 
@@ -39,7 +37,8 @@
 				</view>
 				<view class="upload-box-see">
 					<view class="upload-img-item" v-for="(item) in volunteerPicture" :key="item.url">
-						<up-image class="upload-img-see" :show-loading="true" :src="item.url" :alt="item.fileName"></up-image>
+						<up-image class="upload-img-see" :show-loading="true" :src="item.url"
+							:alt="item.fileName" mode="widthFix"></up-image>
 					</view>
 				</view>
 			</view>
@@ -48,12 +47,13 @@
 				<view class="font-title">用户评价信息</view>
 				<view class="user-box">
 					<view class="info-list">
-						<view  class="info-item">{{ detaile.userReview || '用户未完成评价'}}</view>
+						<view class="info-item">{{ detaile.userReview || '用户未完成评价' }}</view>
 					</view>
 				</view>
 				<view class="upload-box-see">
 					<view class="upload-img-item" v-for="(item) in userPicture" :key="item.url">
-						<up-image class="upload-img-see" :show-loading="true" :src="item.url" :alt="item.fileName"></up-image>
+						<up-image class="upload-img-see" :show-loading="true" :src="item.url"
+							:alt="item.fileName"></up-image>
 					</view>
 				</view>
 			</view>
@@ -77,8 +77,7 @@
 
 
 		<view class=" footer-g" v-if="detaile.orderStatus === '3'">
-			<!-- <up-button type="primary" text="确定结束" @click="onSubmit"></up-button> -->
-			<view class="status-btn" @click="onSubmit">确定结束</view>
+			<view class="status-btn" @click="submit">确定结束</view>
 		</view>
 	</view>
 </template>
@@ -94,7 +93,7 @@ import DictTag from '@/components/DictTag/index.vue'
 const fileList = ref([]);
 const secondOrderId = ref('');
 const detaile = ref({
-	volunteerReview:''
+	volunteerReview: ''
 });
 
 const {
@@ -138,17 +137,17 @@ const userPicture = computed(() => {
 
 const getOrderDetail = async () => {
 	try {
-		uni.showLoading({
-			title: '数据加载中...'
-		});
+		// uni.showLoading({
+		// 	title: '数据加载中...'
+		// });
 		const res = await getVolunteerOrderInfo({ secondOrderId: secondOrderId.value });
 		console.log('API response:', res);
-		
+
 		// Check if the response was successful
 		if (res.code === 200) {
 			// Directly assign the data from response
 			detaile.value = res.data;
-			
+
 			// Check if volunteer pictures exist and process them
 			if (res.data.volunteerPicture) {
 				fileList.value = res.data.volunteerPicture.split(',').map(item => {
@@ -161,7 +160,7 @@ const getOrderDetail = async () => {
 				icon: 'error',
 			});
 		}
-		
+
 		console.log('detaile.value after assignment:', detaile.value);
 
 	} catch (error) {
@@ -171,99 +170,105 @@ const getOrderDetail = async () => {
 			icon: 'error',
 		})
 	} finally {
-		uni.hideLoading();
+		// uni.hideLoading();
 	}
 }
 
 // 获取当前位置信息
 const getCurrentLocation = () => {
-  return new Promise((resolve, reject) => {
-    // 先检查用户是否授权了位置权限
-    uni.getSetting({
-      success: (res) => {
-        if (!res.authSetting['scope.userLocation']) {
-          // 如果用户未授权,先请求授权
-          uni.authorize({
-            scope: 'scope.userLocation',
-            success: () => {
-              // 授权成功后获取位置
-              getLocation(resolve, reject);
-            },
-            fail: (err) => {
-              console.error('位置授权失败:', err);
-              uni.showModal({
-                title: '提示',
-                content: '需要获取您的位置信息,请在设置中打开位置权限',
-                confirmText: '去设置',
-                success: (res) => {
-                  if (res.confirm) {
-                    uni.openSetting();
-                  }
-                }
-              });
-              reject(err);
-            }
-          });
-        } else {
-          // 已授权,直接获取位置
-          getLocation(resolve, reject);
-        }
-      },
-      fail: (err) => {
-        console.error('获取设置失败:', err);
-        reject(err);
-      }
-    });
-  });
+	return new Promise((resolve, reject) => {
+		// 先检查用户是否授权了位置权限
+		uni.getSetting({
+			success: (res) => {
+				if (!res.authSetting['scope.userLocation']) {
+					// 如果用户未授权,先请求授权
+					uni.authorize({
+						scope: 'scope.userLocation',
+						success: () => {
+							// 授权成功后获取位置
+							getLocation(resolve, reject);
+						},
+						fail: (err) => {
+							console.error('位置授权失败:', err);
+							uni.showModal({
+								title: '提示',
+								content: '需要获取您的位置信息,请在设置中打开位置权限',
+								confirmText: '去设置',
+								success: (res) => {
+									if (res.confirm) {
+										uni.openSetting();
+									}
+								}
+							});
+							reject(err);
+						}
+					});
+				} else {
+					// 已授权,直接获取位置
+					getLocation(resolve, reject);
+				}
+			},
+			fail: (err) => {
+				console.error('获取设置失败:', err);
+				reject(err);
+			}
+		});
+	});
 }
 
 // 获取位置的具体实现
 const getLocation = (resolve, reject) => {
-  // 删除开发环境模拟位置的代码,始终获取真实位置
-  uni.getLocation({
-    type: 'gcj02',
-    isHighAccuracy: true, // 高精度
-    highAccuracyExpireTime: 3000, // 高精度过期时间
-    success: (res) => {
-      const { longitude, latitude } = res;
-      console.log('当前位置 - 经度:', longitude);
-      console.log('当前位置 - 纬度:', latitude);
-      resolve({
-        longitude,
-        latitude
-      });
-    },
-    fail: (err) => {
-      console.error('获取位置失败:', err);
-      // 获取位置失败时向用户提示
-      uni.showToast({
-        title: '获取位置失败,请确保已开启位置权限',
-        icon: 'none',
-        duration: 2000
-      });
-      reject(err);
-    }
-  });
+	// 删除开发环境模拟位置的代码,始终获取真实位置
+	uni.getLocation({
+		type: 'gcj02',
+		isHighAccuracy: true, // 高精度
+		highAccuracyExpireTime: 3000, // 高精度过期时间
+		success: (res) => {
+			const { longitude, latitude } = res;
+			console.log('当前位置 - 经度:', longitude);
+			console.log('当前位置 - 纬度:', latitude);
+			resolve({
+				longitude,
+				latitude
+			});
+		},
+		fail: (err) => {
+			console.error('获取位置失败:', err);
+			// 获取位置失败时向用户提示
+			uni.showToast({
+				title: '获取位置失败,请确保已开启位置权限',
+				icon: 'none',
+				duration: 2000
+			});
+			reject(err);
+		}
+	});
 }
-
-const onSubmit = async() => {
+const submit = () => {
+	uni.$u.debounce(onSubmit, 300)
+}
+const onSubmit = async () => {
+	try {
+	// 调用结束服务接口,通过URL查询参数传递位置信息
+	// uni.showLoading({
+    //         title: '正在结束服务...',
+    // })
 	const img_urls = fileList.value.map(item => item.url).join(',');
 	console.log('submit', fileList.value, img_urls);
 
-	      // 获取结束服务时的位置
-      const locationData = await getCurrentLocation().catch(err => {
-        uni.hideLoading()
-        verify.value.initialization()
-        throw new Error('无法获取位置信息,请确保已开启位置权限')
-      })
-      
-      // 构建参数字符串
-      const params = `volunteerPicture=${img_urls}&volunteerReview=${detaile.value.volunteerReview}&secondOrderId=${secondOrderId.value}&serviceFinishLongitude=${locationData.longitude.toString()}&serviceFinishLatitude=${locationData.latitude.toString()}`
-      
-      // 调用结束服务接口,通过URL查询参数传递位置信息
-
-	getVolunteerFinishSecondOrder(params).then(res => {
-		if (res.code === 200) {
+	// 获取结束服务时的位置
+	const locationData = await getCurrentLocation().catch(err => {
+		// uni.hideLoading()
+		verify.value.initialization()
+		throw new Error('无法获取位置信息,请确保已开启位置权限')
+	})
+
+	// 构建参数字符串
+	const params = `volunteerPicture=${img_urls}&volunteerReview=${detaile.value.volunteerReview}&secondOrderId=${secondOrderId.value}&serviceFinishLongitude=${locationData.longitude.toString()}&serviceFinishLatitude=${locationData.latitude.toString()}`
+
+	
+	const res = await getVolunteerFinishSecondOrder(params);
+	if (res.code === 200) {
 			uni.showToast({
 				title: '服务结束',
 				icon: 'success',
@@ -282,9 +287,11 @@ const onSubmit = async() => {
 				icon: 'error',
 			})
 		}
-
-	})
-
+	} catch (error) {
+		console.log("TCL: onSubmit -> error", error)
+	} finally {
+		// uni.hideLoading()
+	}
 }
 
 onLoad((options) => {
@@ -397,12 +404,14 @@ onLoad((options) => {
 			}
 		}
 	}
+
 	.upload-box-see {
 		display: flex;
 		flex-direction: column;
 		align-items: center;
 		justify-content: center;
-		.upload-img-see{
+
+		.upload-img-see {
 			margin-bottom: 12px;
 		}
 	}
@@ -417,18 +426,18 @@ onLoad((options) => {
 }
 
 .status-btn {
-        // width: 716rpx;
-        height: 96rpx;
-        border-radius: 16rpx;
-        background: rgba(221, 94, 69, 1);
-
-        display: flex;
-        align-items: center;
-        justify-content: center;
-
-        font-size: 32rpx;
-        font-weight: 400;
-        color: rgba(255, 255, 255, 1);
-        margin-bottom: 88rpx;
-    }
+	// width: 716rpx;
+	height: 96rpx;
+	border-radius: 16rpx;
+	background: rgba(221, 94, 69, 1);
+
+	display: flex;
+	align-items: center;
+	justify-content: center;
+
+	font-size: 32rpx;
+	font-weight: 400;
+	color: rgba(255, 255, 255, 1);
+	margin-bottom: 88rpx;
+}
 </style>

+ 66 - 81
pages_home/components/cust-form/index.vue

@@ -59,29 +59,15 @@
                     <up-button size="small" type="primary" text="前往人脸识别" @click="startFace"></up-button>
                 </up-form-item>
 
-                <!-- <up-form-item v-if="item.type === 'city'" :label="item.label" :prop="item.key" borderBottom
-                    labelWidth="94" :required="item.required">
-                    <view @click.self="() => openCity(item)">
-                        <up-input v-model="formData[item.key]" disabled disabledColor="#ffffff" placeholder="省、市、区等地区信息"
-                            border="none"></up-input>
-                    </view>
-                    <template #right>
-                        <up-icon name="map" size="22" @click="onCityWx(item)"></up-icon>
-                    </template>
-                </up-form-item> -->
-
                 <up-form-item v-if="item.type === 'city'" :label="item.label" :prop="item.key" borderBottom
                     labelWidth="94" :required="item.required">
-                    <pickerAddress 
-                        @change="(info)=>addressChange(info,item)"
-                        :selectValue="[ formData.provinceInd, formData.cityInd, formData.districtInd ]"
-                        >
+                    <pickerAddress @change="(info) => addressChange(info, item)"
+                        :selectValue="[formData.provinceInd, formData.cityInd, formData.districtInd]">
                         <view class="inp"
-                            :class="formData.provinceName&&formData.cityName&&formData.districtName?'':'address-inp'"
-                            >
-                            {{formData.provinceName ? formData.provinceName:'省'}} /
-                            {{formData.cityName ? formData.cityName:'市'}} /
-                            {{formData.districtName ? formData.districtName:'区'}}
+                            :class="formData.provinceName && formData.cityName && formData.districtName ? '' : 'address-inp'">
+                            {{ formData.provinceName ? formData.provinceName : '省' }} /
+                            {{ formData.cityName ? formData.cityName : '市' }} /
+                            {{ formData.districtName ? formData.districtName : '区' }}
                         </view>
                     </pickerAddress>
                     <template #right>
@@ -101,7 +87,6 @@
                 </up-form-item>
             </view>
         </up-form>
-        <!-- <up-button type="primary" text="提交" customStyle="margin-top: 50px" @click="onSubmit"></up-button> -->
 
         <up-action-sheet :show="showSex" :actions="actions.option" :title="'请选择' + actions.label"
             @close="showSex = false" @select="ActionSheetSelect">
@@ -126,8 +111,8 @@ import {
     onShow,
     onUnload
 } from "@dcloudio/uni-app";
-import { splitAddress,getCityCode } from '@/utils/adress'
-import {regionAddresstree} from '@/api/home.js'
+import { splitAddress, getCityCode } from '@/utils/adress'
+import { regionAddresstree } from '@/api/home.js'
 
 import pickerAddress from '../pickerAddress/pickerAddress.vue'
 
@@ -146,16 +131,16 @@ const formData = reactive({
     city: null,
 
     provinceName: '', // 省
-		provinceCode: '',
-		provinceInd: 21,
+    provinceCode: '',
+    provinceInd: 21,
 
-		cityName: '', // 市
-		cityCode: '',
-		cityInd: 0,
+    cityName: '', // 市
+    cityCode: '',
+    cityInd: 0,
 
-		districtName: '',
-		districtCode: '',
-		districtInd: 17,
+    districtName: '',
+    districtCode: '',
+    districtInd: 17,
 
     // address: "永川区",
     // age: "1",
@@ -330,62 +315,62 @@ function clickPick(row) {
 }
 
 
-function addressChange(info,row) {
-        actions.value = row
-		console.log(info, '>>>>data');
-
-		if (!info || !info.data) {
-			console.error('Invalid address change info:', info);
-			return;
-		}
+function addressChange(info, row) {
+    actions.value = row
+    console.log(info, '>>>>data');
 
-		if (!Array.isArray(info.data) || info.data.length < 3) {
-			console.error('Invalid address data:', info.data);
-			return;
-		}
+    if (!info || !info.data) {
+        console.error('Invalid address change info:', info);
+        return;
+    }
 
-		const code = Array.isArray(info.code) ? info.code : ['', '', ''];
+    if (!Array.isArray(info.data) || info.data.length < 3) {
+        console.error('Invalid address data:', info.data);
+        return;
+    }
 
-		let indexArray;
-		if (Array.isArray(info.index)) {
-			indexArray = info.index;
-		} else if (info.index && typeof info.index[Symbol.iterator] === 'function') {
-			indexArray = Array.from(info.index);
-		} else {
-			indexArray = [0, 0, 0];
-		}
+    const code = Array.isArray(info.code) ? info.code : ['', '', ''];
 
-    
-        Object.assign(formData, {
-            provinceName: info.data[0],
-            provinceCode: info.code[0],
-            provinceInd:indexArray[0] || 0,
-            cityName: info.data[1],
-            cityCode:info.code[1],
-            cityInd:indexArray[1] || 0,
-            districtName: info.data[2],
-            districtCode:info.code[2],
-            districtInd:indexArray[2] || 0
-        })
-        console.log('formData===>',formData);
-        
+    let indexArray;
+    if (Array.isArray(info.index)) {
+        indexArray = info.index;
+    } else if (info.index && typeof info.index[Symbol.iterator] === 'function') {
+        indexArray = Array.from(info.index);
+    } else {
+        indexArray = [0, 0, 0];
     }
+
+
+    Object.assign(formData, {
+        provinceName: info.data[0],
+        provinceCode: info.code[0],
+        provinceInd: indexArray[0] || 0,
+        cityName: info.data[1],
+        cityCode: info.code[1],
+        cityInd: indexArray[1] || 0,
+        districtName: info.data[2],
+        districtCode: info.code[2],
+        districtInd: indexArray[2] || 0
+    })
+    console.log('formData===>', formData);
+
+}
 function onCityWx(row) {
-    console.log('地区选点',row);
+    console.log('地区选点', row);
     wx.chooseLocation({
-        success:async function (res) {
-            console.log('res.address',res.address);
-            
+        success: async function (res) {
+            console.log('res.address', res.address);
+
             const result = splitAddress(res.address);
-			console.log("TCL: onCityWx -> result", result)
+            console.log("TCL: onCityWx -> result", result)
             const res_dara = await regionAddresstree();
-            const handlecityData = getCityCode([result.province,result.city,result.district].join(' '),res_dara.data)
-			console.log("TCL: onCityWx -> handlecityData", handlecityData)
-            addressChange(handlecityData,row)
+            const handlecityData = getCityCode([result.province, result.city, result.district].join(' '), res_dara.data)
+            console.log("TCL: onCityWx -> handlecityData", handlecityData)
+            addressChange(handlecityData, row)
 
-             Object.assign(formData, {
+            Object.assign(formData, {
                 // [row.key]: `${result.province}${result.city}${result.district}`,
-                address:result.detail
+                address: result.detail
             })
 
             // Object.assign(cityData, {     
@@ -407,7 +392,7 @@ function onCityWx(row) {
 
             // address:result.detail
             // })
-            
+
             // Object.assign(formData, {
             //     [row.key]: `${result.province}${result.city}${result.district}`,
             //     address:result.detail
@@ -416,15 +401,15 @@ function onCityWx(row) {
         fail: function (err) {
             console.log(err);
             uni.showToast({
-			title:'获取地址失败',
-			icon: 'error',
-		});
+                title: '获取地址失败',
+                icon: 'error',
+            });
         },
     })
 }
 
 onShow(() => {
- 
+
 })
 onUnload(() => {
 

+ 47 - 16
pages_home/components/updata-imgs/index.vue

@@ -5,17 +5,22 @@
                     v-if="data.required">*</span> </view>
             <view class="updata-title-text font-text ">{{ data.text }}</view>
         </view>
-        <!-- <view class="updata-img-box" @click="updataFile">
-            <image :src="img" style="width: 117px;height: 75px;" />
-        </view> -->
+
         <view class="upload-box">
-            <view class="upload-img-item" v-for="(item, index) in fileList" :key="item.url">
-                <view class="delete-icon" @click="deletePic(index)"><up-icon name="close-circle-fill" color="#f64a1f"
-                        size="18"></up-icon></view>
-                <img class="upload-img" :src="item.url" :alt="item.fileName" srcset="">
+            <view class="upload-img-item" v-for="(item, index) in fileList" :key="item.url"  >
+                <view class="delete-icon" @click="deletePic(index)">
+                    <up-icon name="close-circle-fill" color="#f64a1f"
+                        size="18"></up-icon>
+                </view>
+                <!-- <img class="upload-img" :src="item.url" :alt="item.fileName" srcset=""> -->
+                <up-image :src="item.url" class="upload-img" mode="widthFix"></up-image>
             </view>
-            <img src="/static/img/upload.png" alt="" class="upload-img" @click="uploadClick('img')"
-                v-if="fileList.length < 10">
+            <!-- <img src="/static/img/upload.png" alt="" class="upload-img" @click="uploadClick('img')"
+                v-if="fileList.length < fileCount"> -->
+                <view v-if="fileList.length < fileCount"  @click="uploadClick('img')" class="updata-bg-view">
+                    <up-icon name="plus" color="#999999" size="28"></up-icon>
+                    <text class="updata-dece">{{ data.dece }}</text>
+                </view>
         </view>
     </view>
 </template>
@@ -30,7 +35,8 @@ const props = defineProps({
         default: {
             title: '上传头像',
             text: '上传您的头像',
-            img: "/static/img/updata-user-img.png"
+            img: "/static/img/updata-user-img.png",
+            dece:'点击上传文件'
         },
     },
     fileList: {
@@ -50,7 +56,9 @@ const fileList = ref([]);
 
 // 删除图片
 const deletePic = (index) => {
-    fileList.value.splice(index, 1);
+	
+    fileList.value = fileList.value.filter((item, i) => i !== index).filter(Boolean);
+	console.log("TCL: deletePic -> fileList.value", fileList.value)
     getFile();
 };
 const uploadClick = async (type) => {
@@ -68,12 +76,11 @@ function getFile() {
 }
 
 function setFile(files){
-    console.log('fileList=>files',files);
-
-    const arr_file = files.split(',').map(item=> {
+    const files_array = files.split(',').filter(Boolean);
+    const arr_file = files_array.map(item=> {
         return {url:item}
     })
-    console.log('fileList',files.split(','));
+    console.log('fileList',arr_file);
     fileList.value = arr_file
 }
 watch(()=>props.fileList,()=>{
@@ -112,6 +119,7 @@ defineExpose({
     width: 68px;
     margin-right: 12px;
     margin-bottom: 12px;
+    object-fit: contain;
 }
 
 .upload-box {
@@ -120,13 +128,36 @@ defineExpose({
 
     .upload-img-item {
         position: relative;
+        width: 100%;
+        display: flex;
+    align-items: center;
+    justify-content: center;
 
         .delete-icon {
             position: absolute;
             top: -7px;
-            right: 7px;
+            right: -10px;
             z-index: 1;
         }
     }
 }
+
+.updata-bg-view {
+    width: 700rpx;
+    height: 256rpx;
+    border-radius: 16rpx;
+    background: rgba(245, 245, 245, 1);
+
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+
+    font-size: 28rpx;
+    font-weight: 400;
+    color: rgba(153, 153, 153, 1);
+    .updata-dece {
+        margin-top: 12rpx;
+    }
+}
 </style>

+ 15 - 11
pages_home/pages/details/index.vue

@@ -28,15 +28,17 @@
             </view>
 
             <view class="status-card">
-                <view class="card-title">技能简介</view>
+                <view class="card-title">个人简介</view>
                 <view class="card-text"> {{ details.skillDescribe }} </view>
             </view>
 
             <view class="status-card">
                 <view class="card-title">用户头像</view>
                 <view class="card-imgs">
-                    <img class="upload-img" v-for="(item, index) in volunteerPicture_img" :key="index + 'userimg'"
-                        :src="item" :alt="item.fileName" srcset="">
+                    <!-- <img class="upload-img" v-for="(item, index) in volunteerPicture_img" :key="index + 'userimg'"
+                        :src="item" :alt="item.fileName" srcset=""> -->
+                        <up-image v-for="(item, index) in volunteerPicture_img" :key="index + 'userimg'"
+                         :src="item" class="upload-img" mode="widthFix"   :alt="item.fileName"></up-image>
                 </view>
 
             </view>
@@ -46,10 +48,12 @@
                 
                 <view class="id-card-container" v-if="idCardImages.hasSeparateImages">
                     <view class="id-card-item" v-if="idCardImages.front">
-                        <img class="id-card-img" :src="idCardImages.front" alt="身份证正面">
+                        <!-- <img class="id-card-img" :src="idCardImages.front" alt="身份证正面"> -->
+                        <up-image :src="idCardImages.front" class="upload-img" mode="widthFix"  alt="身份证正面"></up-image>
                     </view>
                     <view class="id-card-item" v-if="idCardImages.back">
-                        <img class="id-card-img" :src="idCardImages.back" alt="身份证背面">
+                        <!-- <img class="id-card-img" :src="idCardImages.back" alt="身份证背面"> -->
+                        <up-image :src="idCardImages.back" class="upload-img" mode="widthFix"  alt="身份证背面"></up-image>
                     </view>
                 </view>
             </view>
@@ -58,8 +62,8 @@
                 <view class="card-title">资格证书</view>
                 <view class="card-imgs">
                     <view v-for="(item, index) in certificationPicture_img" :key="index + 'cer'">
-                        <img class="upload-img" :src="item" :alt="item.fileName" srcset="">
-
+                        <!-- <img class="upload-img" :src="item" :alt="item.fileName" srcset=""> -->
+                        <up-image :src="item" class="upload-img" mode="widthFix"  :alt="item.fileName"></up-image>
                     </view>
                 </view>
             </view>
@@ -220,9 +224,9 @@ function idToIndexs(array, targetId, path = []) {
 async function getRegister() {
 
     try {
-        uni.showLoading({
-            title: '数据加载中...'
-        });
+        // uni.showLoading({
+        //     title: '数据加载中...'
+        // });
         const op_res = await getTreeList({ parentId: data.value.key });
         const res = await getVolunteerInfo({ serviceCategory: data.value.key });
         if (res.data) {
@@ -245,7 +249,7 @@ async function getRegister() {
             icon: 'error',
         });
     } finally {
-        uni.hideLoading();
+        // uni.hideLoading();
     }
 }
 

+ 8 - 0
pages_home/pages/register/data.js

@@ -68,6 +68,14 @@ const rules = {
       message: '请填写年龄',
       trigger: ['blur', 'change'],
     },
+    {
+      validator: (rule, value, callback) => {
+        return uni.$u.test.digits(value)
+      },
+      message: '年龄必须为数字',
+      // 触发器可以同时用blur和change,二者之间用英文逗号隔开
+      trigger: ['change', 'blur'],
+    },
   ],
   idCard: [
     {

+ 19 - 22
pages_home/pages/register/index.vue

@@ -148,7 +148,8 @@ const updata_list = [
 		ref: userImg,
 		// permission: [1, 2],
 		required: true,
-		fileCount:1
+		fileCount:1,
+		dece:'点击上传头像'
 	},
 	{
 		title: '身份证正面',
@@ -157,7 +158,9 @@ const updata_list = [
 		key: 'idCardPictureFront',
 		ref: zsImg,
 		// permission: [1, 2],
-		required: true
+		required: true,
+		fileCount:1,
+		dece:'点击上传身份证正面'
 	},
 	{
 		title: '身份证反面',
@@ -167,7 +170,8 @@ const updata_list = [
 		ref: zsImg,
 		// permission: [1, 2],
 		required: true,
-		fileCount:2
+		fileCount:1,
+		dece:'点击上传身份证反面'
 	},
 	{
 		title: '职业、资质证书',
@@ -177,7 +181,8 @@ const updata_list = [
 		ref: zsImg,
 		// permission: [1, 2],
 		required: false,
-		fileCount:6
+		fileCount:6,
+		dece:'点击上传职业、资质证书'
 	}
 ]
 
@@ -231,7 +236,6 @@ const sex_status = {
 }
 
 const validatePriceInput = (value) => {
-	console.log("TCL: validatePriceInput -> value", value)
 	// 确保输入是纯数字
 	if (!/^\d*$/.test(value)) {
 		serviceKeys.price = value.replace(/[^0-9.]/g,  '');// 移除非数字字符
@@ -250,7 +254,6 @@ const validatePriceInput = (value) => {
 				title: '请输入价格区间内的价格',
 				icon: 'none'
 			})
-			console.log("TCL: validatePriceInput -> error", value)
 		}
 	}
 };
@@ -299,8 +302,11 @@ const com_column = computed(() => {
 	return column_list
 })
 
-function onSubmit() {
-	try {
+const onSubmit = () =>{
+	uni.$u.debounce(submitForm, 300)
+}
+function submitForm() {
+		try {
 
 		// return;
 		// 校验表单并获取数据
@@ -498,21 +504,14 @@ function servesInit() {
 		obj[backfill[i]] = ids[i];
 		obj[backfill[i] + 'name'] = names[i];
 	}
-	console.log('obj', obj, names, ids);
 
 
-	console.log('indexs', indexs, names, ids);
-	// const indexs = idToIndexs(serviceOptions.value, details.value.businessManagementId + '')
-	// const names = indexs.businessTierName.split('-');
-	// console.log('indexs',indexs,names);
 	if (obj.itemKey) {
 		const row = handlerList(serviceOptions.value, obj.classKey)
-		console.log(1, row);
 		serviceItems.value = row.children;
 	}
 	if (obj.threeKey) {
 		const row = handlerList(serviceOptions.value, obj.itemKey)
-		console.log(2, row);
 		serviceItems2.value = row.children;
 	}
 	Object.assign(serviceKeys, {
@@ -524,15 +523,14 @@ function servesInit() {
 
 	handlerList(serviceOptions.value, serviceKeys.itemKey)
 
-	console.log('serviceKeys', serviceKeys);
 
 }
 async function getRegister() {
 
 	try {
-		uni.showLoading({
-			title: '数据加载中...'
-		});
+		// uni.showLoading({
+		// 	title: '数据加载中...'
+		// });
 		const res = await getVolunteerInfo({ serviceCategory: data.value.key });
 		if (res.data) {
 			details.value = { ...res.data, age: res.data.age + '' };
@@ -560,7 +558,7 @@ async function getRegister() {
 			icon: 'error',
 		});
 	} finally {
-		uni.hideLoading();
+		// uni.hideLoading();
 	}
 }
 
@@ -568,7 +566,6 @@ async function getRegister() {
 
 const serviceChange = (item, key) => {
 
-	console.log("TCL: serviceChange -> item", item)
 	if (item.maxPrice && item.minPrice) {
 		min_max_price.value = {
 			minPrice: item.minPrice,
@@ -697,7 +694,7 @@ onLoad((options) => {
 	border: 1px solid #fff;
 	padding: 8rpx 16rpx;
 	border-radius: 16rpx;
-	margin-right: 16rpx;
+	margin-right: 10rpx;
 	margin-bottom: 16rpx;
 }
 

+ 4 - 4
pages_mine/pages/setupUser/index.vue

@@ -5,16 +5,16 @@
 			<up-icon name="arrow-right" class="icon"></up-icon>
 			<up-divider></up-divider>
 		</view>
-		<view class="wrapper">
+		<!-- <view class="wrapper">
 			<text class="text">绑定</text>
 			<up-icon name="arrow-right" class="icon"></up-icon>
 			<up-divider></up-divider>
-		</view>
-		<view class="wrapper" @click="handlServiceAddress">
+		</view> -->
+		<!-- <view class="wrapper" @click="handlServiceAddress">
 			<text class="text">被服务地址</text>
 			<up-icon name="arrow-right" class="icon"></up-icon>
 			<up-divider></up-divider>
-		</view>
+		</view> -->
 		<view class="wrapper" @click="logoOut">
 			<text class="text">退出登陆</text>
 			<up-icon name="arrow-right" class="icon"></up-icon>

+ 6 - 1
utils/wxRequest.js

@@ -98,10 +98,13 @@ const uploadFile = async (files) => {
 export const wxUploadFile = async (type,fileNum) => {
     try {
         console.log('11');
-        
+    
         //选择文件
         const files = await getWxFile(type,fileNum);
         console.log('选择文件', files,files.tempFiles);
+         uni.showLoading({
+            title: '文件上传中...',
+          })
         //上传服务器
         const u_files = await uploadFile(files.tempFiles);
         console.log('上传服务器', u_files);
@@ -110,6 +113,8 @@ export const wxUploadFile = async (type,fileNum) => {
         console.log('上传失败-wxUploadFile', error);
         throw error;
 
+    } finally {
+        uni.hideLoading()
     }
 
 }