wangxy hai 13 horas
pai
achega
590d6e2219

+ 3 - 15
api/kehu.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 export function getKehuUpdate(data = {}) {
   return request({
-    url: '/app/kehu/update',
+    url: '/kehu/mine/update',
     headers: {
       isToken: true
     },
@@ -13,19 +13,7 @@ export function getKehuUpdate(data = {}) {
 
 export function getKehuUser(data = {}) {
   return request({
-    url: '/app/kehu/update',
-    headers: {
-      isToken: true
-    },
-    method: 'post',
-    data,
-    timeout: 20000
-  })
-}
-
-export function getKehuInfo(data = {}) {
-  return request({
-    url: '/app/kehu/info',
+    url: '/kehu/mine/info',
     headers: {
       isToken: true
     },
@@ -38,7 +26,7 @@ export function getKehuInfo(data = {}) {
 
 export function getKehuLogout(data = {}) {
   return request({
-    url: '/app/kehu/logout',
+    url: '/kehu/mine/logout',
     headers: {
       isToken: true
     },

+ 1 - 1
pages/client/hetong/HetongInfo.vue

@@ -142,7 +142,7 @@
 	}
 	function handleGoLishi() {
 		uni.redirectTo({
-			url: '/pages/kehu/hetong/HetongList'
+			url: '/pages/client/hetong/HetongList'
 		})
 	}
 

+ 1 - 1
pages/kehu/hetong/HetongInfo.vue

@@ -142,7 +142,7 @@
 	}
 	function handleGoLishi() {
 		uni.redirectTo({
-			url: '/pages/client/hetong/HetongList'
+			url: '/pages/kehu/hetong/HetongList'
 		})
 	}
 

+ 6 - 2
pages/kehu/my/my.vue

@@ -2,8 +2,7 @@
 	<view class="client-my-page">
 		<view class="my-head-box" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.myHeadBj + ')' }">
 			<view class="head-img-box">
-				<image class="head-img" :src="myInfoData.userImg" v-if="myInfoData.userImg"></image>
-				<icon class="phone-default-userImg" v-else :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.defaultUserImg + ')' }"></icon>
+				<icon class="phone-default-userImg" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.defaultUserImg + ')' }"></icon>
 			</view>
 			<view class="head-content-box">
 				<text>{{myInfoData.realName}}</text>
@@ -104,6 +103,11 @@
 	// 获取用户头像
 	function goToPage(data){
 		switch (data) {
+			case 'cj':
+			    uni.navigateTo({
+			    	url:'/pages/kehu/hetong/hetongList?from=my'
+			    })
+				break;
 			case 'grcj':
 			    uni.navigateTo({
 			    	url:'/pages/kehu/my/myInfo?from=my'

+ 17 - 106
pages/kehu/my/myInfo.vue

@@ -2,14 +2,6 @@
 	<view class="my-info-page">
 		<!-- 导航区域 -->
 		<customNavbarVue title="个人信息" :show-back-btn="true" @back="handleBack"></customNavbarVue>
-		<!-- 头像 -->
-		<view class="user-img-box">
-			<view class="user-title">头像</view>
-			<uni-file-picker return-type="object" v-model="data.images" :del-icon="false" mode="grid" disable-preview :auto-upload="false"
-				@select="handleSelect" file-mediatype="image" class="phone-file-picker user-file-picker">
-			</uni-file-picker>
-			<icon class="user-jt-icon" :style="{ backgroundImage: 'url(' + data.jtIcon + ')' }"></icon>
-		</view>
 		<!-- 姓名 -->
 		<view class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>姓名</view>
@@ -24,13 +16,18 @@
 		</view>
 		<!-- 证件号 -->
 		<view class="form-label-input">
-			<view class="phone-form-label"><text class="form-label-require">*</text>证件号</view>
+			<view class="phone-form-label" @click="idCardChange">
+				<text class="form-label-require">*</text>
+				<text v-if="data.idtype ==1">身份证号</text>
+				<text v-if="data.idtype ==2">护照号</text>
+				<icon @click="idCardChange" class="change-icon">切换</icon>
+			</view>
 			<input v-model="data.idcard"  placeholder="请输入证件号" />
 			<icon :style="{ backgroundImage: 'url(' + data.jtIcon + ')' }"></icon>
 		</view>
 		<view class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>具体地址</view>
-			<input v-model="data.dizhi"  placeholder="请输入具体地址" />
+			<input v-model="data.juzhuDizhi"  placeholder="请输入具体地址" />
 			<icon :style="{ backgroundImage: 'url(' + data.jtIcon + ')' }"></icon>
 		</view>
 
@@ -57,105 +54,23 @@
 
 	const data = reactive({
 		from: 'shouye', // my | kaoshi | shouye
-		icon: '',
 		realName: '',
 		idcard: '',
 		userName: '',
 		userId: null,
-		images: null,
 		jtIcon: '',
-		dizhi: ''
+		juzhuDizhi: '',
+		idtype: 1,
 	})
 
 	onLoad((options) => {
 		data.from = options.from || 'shouye';
 		data.jtIcon= cacheManager.get('projectImg').nav_bar_jt_bottom;
-		defaultImage1.url= cacheManager.get('projectImg').user_default_img;
 		initPage();
 	})
-
-	function handleSelect(e) {
-		doUploadImage(e)
-	}
-
-	function genderSelect(genderValue){
-		data.gender = genderValue;
-	}
-
-	function doUploadImage(params) {
-		const filePath = params.tempFiles[0];
-		const fileUrl = params.tempFilePaths;
-
-		
-		try {
-			const suffix = filePath.file.name.split('.').pop();
-			let req = {
-				prefix: 'resource/',
-				suffix: suffix,
-			}
-			uni.showLoading({
-				title: '上传中...',
-				mask: true
-			});
-			getAliyunPolicy(req).then(res => {
-				if (res.code == 0) {
-					const policyData = res.data;
-					
-					const formData = {
-						key:  policyData.key,
-						policy:  policyData.policy,
-						signature:  policyData.signature,
-						OSSAccessKeyId:  policyData.accessid,
-						success_action_status:  '200',
-					}
-					
-					uni.uploadFile({
-						url: policyData.uploadUrl,
-						filePath: fileUrl[0],
-						name: 'file',
-						formData: formData,
-						success(uploadRes) {
-							if (uploadRes.statusCode === 200) {
-								console.log('uploadRes',uploadRes)
-								data.icon = `${policyData.downloadUrl}/${policyData.key}`;
-								console.log( `${policyData.downloadUrl}/${policyData.key}`)
-								uni.showToast({
-									title: '上传成功',
-									icon: 'success'
-								});
-								data.images = { url: data.icon, extname: 'png', name: 'touxiang.png' }
-							} else {
-								uni.showToast({
-									icon: 'none',
-									title: '上传失败',
-								});
-								uni.hideLoading();
-							}
-			
-						},
-						fail(err) {
-							uni.showToast({
-								icon: 'none',
-								title: '上传失败',
-							});
-							uni.hideLoading();
-						}
-					});
-
-				} else {
-					uni.showToast({
-						title: '获取凭证失败',
-					});
-					uni.hideLoading();
-				}
-			})
-		} catch (error) {
-			uni.showToast({
-				title: '上传失败',
-				icon: 'none'
-			});
-			uni.hideLoading();
-		}
+	
+	function idCardChange() {
+		data.idtype = data.idtype == 1 ? 2 : 1;
 	}
 
 	function handleUpdate() {
@@ -166,9 +81,6 @@
 		if (!data.userName) {
 			arr.push('电话');
 		}
-		if (!data.icon) {
-			arr.push('头像');
-		}
 		if (!data.idcard) {
 			arr.push('证件号');
 		}
@@ -181,8 +93,8 @@
 		}
 		
 		const opt = {
-			dizhi: data.dizhi,
-			icon: data.icon, 
+			juzhuDizhi: data.juzhuDizhi,
+			idtype: data.idtype, 
 			idcard: data.idcard,
 			realName: data.realName,
 			userId: data.userId,
@@ -205,14 +117,13 @@
 
 	function initPage() {
 		myApi.getMineUser().then(res => {
-			const {gender,icon,idcard,realName,userName,userId} = res.data;
-			data.gender = res.data.gender;
-			data.icon = res.data.icon;
+			const {juzhuDizhi,idtype,idcard,realName,userName,userId} = res.data;
+			data.idtype = res.data.idtype;
 			data.idcard = res.data.idcard;
 			data.realName = res.data.realName; 
 			data.userName = res.data.userName;
 			data.userId = res.data.userId;
-			data.images = data.icon?{ url: data.icon, extname: 'png', name: 'touxiang.png' }:defaultImage1.value
+			data.juzhuDizhi = res.data.juzhuDizhi
 		})
 	}
 </script>

+ 17 - 0
utils/common.js

@@ -169,3 +169,20 @@ export function jsonp2(url, params, callbackName = 'jsonp_callback') {
       document.body.appendChild(script);
     });
 }
+export function throttleAdvanced(func, delay = 5000) {
+    let lastExecTime = 0; // 记录上次成功执行的时间戳
+
+    return function(...args) {
+        const currentTime = Date.now(); // 获取当前时间戳
+
+        // 如果当前时间距离上次执行时间已经超过了设定的延迟时间
+        if (currentTime - lastExecTime >= delay) {
+            // 使用 apply 确保函数上下文和参数正确传递
+            console.log(11111)
+            func.apply(this, args);
+            // 更新最后一次执行的时间戳为当前时间
+            lastExecTime = currentTime;
+        }
+        // 如果时间间隔未到,则什么都不做,忽略此次调用
+    };
+}