瀏覽代碼

按钮防抖处理、志愿者注册图片上传处理

chenjj 3 天之前
父節點
當前提交
60c541f987

+ 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>

+ 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 - 1
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 }}
@@ -59,6 +59,13 @@ 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: '沟通',

+ 9 - 4
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>
 
@@ -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;

+ 111 - 107
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 {
@@ -143,12 +142,12 @@ const getOrderDetail = async () => {
 		});
 		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) {
@@ -177,90 +176,93 @@ const getOrderDetail = async () => {
 
 // 获取当前位置信息
 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 () => {
+	
 	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查询参数传递位置信息
+	// 获取结束服务时的位置
+	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) {
@@ -397,12 +399,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 +421,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(() => {
 

+ 35 - 5
pages_home/components/updata-imgs/index.vue

@@ -12,10 +12,15 @@
                     <up-icon name="close-circle-fill" color="#f64a1f"
                         size="18"></up-icon>
                 </view>
-                <img class="upload-img" :src="item.url" :alt="item.fileName" srcset="">
+                <!-- <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 < fileCount">
+            <!-- <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: {
@@ -113,6 +119,7 @@ defineExpose({
     width: 68px;
     margin-right: 12px;
     margin-bottom: 12px;
+    object-fit: contain;
 }
 
 .upload-box {
@@ -121,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>

+ 10 - 6
pages_home/pages/details/index.vue

@@ -35,8 +35,10 @@
             <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>

+ 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: [
     {

+ 14 - 18
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: '身份证正面',
@@ -158,7 +159,8 @@ const updata_list = [
 		ref: zsImg,
 		// permission: [1, 2],
 		required: true,
-		fileCount:1
+		fileCount:1,
+		dece:'点击上传身份证正面'
 	},
 	{
 		title: '身份证反面',
@@ -168,7 +170,8 @@ const updata_list = [
 		ref: zsImg,
 		// permission: [1, 2],
 		required: true,
-		fileCount:1
+		fileCount:1,
+		dece:'点击上传身份证反面'
 	},
 	{
 		title: '职业、资质证书',
@@ -178,7 +181,8 @@ const updata_list = [
 		ref: zsImg,
 		// permission: [1, 2],
 		required: false,
-		fileCount:6
+		fileCount:6,
+		dece:'点击上传职业、资质证书'
 	}
 ]
 
@@ -232,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,  '');// 移除非数字字符
@@ -251,7 +254,6 @@ const validatePriceInput = (value) => {
 				title: '请输入价格区间内的价格',
 				icon: 'none'
 			})
-			console.log("TCL: validatePriceInput -> error", value)
 		}
 	}
 };
@@ -300,8 +302,11 @@ const com_column = computed(() => {
 	return column_list
 })
 
-function onSubmit() {
-	try {
+const onSubmit = () =>{
+	uni.$u.debounce(submitForm, 300)
+}
+function submitForm() {
+		try {
 
 		// return;
 		// 校验表单并获取数据
@@ -499,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, {
@@ -525,7 +523,6 @@ function servesInit() {
 
 	handlerList(serviceOptions.value, serviceKeys.itemKey)
 
-	console.log('serviceKeys', serviceKeys);
 
 }
 async function getRegister() {
@@ -569,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,
@@ -698,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>