MS-IOHQJGHXZHQD\Administrator il y a 1 semaine
Parent
commit
984b3b4d8b

+ 117 - 56
src/App.vue

@@ -1,6 +1,6 @@
 <script>
 import { getTechnicianToken } from "@/api/newLogin";
-import { getTechnicianList, getTechnician } from "@/api/index";
+
 export default {
 	globalData: {
 		couponSelected: {}
@@ -24,72 +24,78 @@ export default {
 			let isWechat = navigator.userAgent.toLowerCase().includes('micromessenger');
 			// 非微信环境直接跳过
 			//if (!isWechat) return;//guo
-
+			let openid = uni.getStorageSync('wx_copenid')
 			const code = this.$utils.getQueryStr('code');
-			const token = uni.getStorageSync('access-token');
-
-			// 已有登录态,不用登录
-			if (token) {
-				this.getTechnicianFun()
-				return
-			};
-			// // 1. 没有code → 跳转微信静默授权
-			// if (!code && isWechat) {
-			// 	let appid = 'wx9dc677bd41e82569'
-			// 	//https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9dc677bd41e82569&redirect_uri=https://city.baoxianzhanggui.com/fragrance/wxcode/&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
-			// 	let ruri = encodeURIComponent('https://city.baoxianzhanggui.com/fragrance/');
-			// 	const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${ruri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
-			// 	window.location.href = authUrl
-			// }
-
-			let params = {
-				//code: this.$utils.('code') //guo
-				code: '021LKB1w3Cj6e73aak1w3Lg1Ji1LKB1F'
+			if (openid) {
+				this.checkMerchantStatus()
+			} else {
+				// // 1. 没有code → 跳转微信静默授权
+				// if (!code && isWechat) {
+				// 	let appid = 'wx9dc677bd41e82569'
+				// 	//https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9dc677bd41e82569&redirect_uri=https://city.baoxianzhanggui.com/fragrance/wxcode/&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
+				// 	let ruri = encodeURIComponent('https://city.baoxianzhanggui.com/fragrance/');
+				// 	const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${ruri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
+				// 	window.location.href = authUrl
+				// }
+
+				let params = {
+					//code: this.$utils.('code') //guo
+					code: '031VMh000FD7zW1OwB200nJFjM1VMh0q'
+				}
+				getTechnicianToken(params).then(res => {
+					if (res.data.code == 200) {
+						uni.setStorageSync('wx_copenid', res.data.data.copenid);
+						this.checkMerchantStatus()
+					}
+				})
 			}
-			getTechnicianToken(params).then(res => {
 
-				if (res.data.code == 200) {
-					uni.setStorageSync('wx_copenid', res.data.data.copenid);
-					uni.setStorageSync('access-token', res.data.data.token);
-					this.getTechnicianFun()
-				}
-			})
+
+
 		},
 		//查询商户注册和入驻信息   auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
-		getTechnicianFun() {
-			return
-			let openid = uni.getStorageSync('wx_copenid')
-			getTechnician({ openid: openid }).then(res => {
-
-				if (res.data.code == 200) {
-					if (!res.data.result) return
-					getTechnicianList({ userId: res.data.result.id}).then(response => {
-						if (!response.data.result) return
-						if (response.data.result.merchant.auditStatus == -1 || response.data.result.auditStatus == 1 || response.data.result.auditStatus == 2 || response.data.result.auditStatus == 3) {
-							if (!response.data.result.merchantAuditFile.length) {
-								uni.navigateTo({
-									url: '/pages/join/staff?ShopInfo=' + encodeURIComponent(JSON.stringify(response.data.result))
-								})
-
-							} else {
-								uni.navigateTo({
-									url: '/pages/join/applyJoin?ShopInfo=' + encodeURIComponent(JSON.stringify(response.data.result))
-								})
-							}
-
-						} else if (response.data.result.auditStatus == 0) {
-							uni.navigateTo({
-								url: '/pages/join/applyJoin?ShopInfo=' + encodeURIComponent(JSON.stringify(response.data.result))
-							})
-						}
 
-					})
+		async checkMerchantStatus() {
+			const openid = uni.getStorageSync('wx_copenid')
+			const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+			if (!merchantInfo) return
+			//merchantInfo.merchant.auditStatus = 2  //guo
+			if (merchantInfo.merchant.auditStatus == -1) {//未注册
+				uni.navigateTo({
+					url: '/pages/join/staff'
+				})
+				return
 
+			} else if (merchantInfo.merchant.auditStatus == 0 || merchantInfo.merchant.auditStatus == 1 || merchantInfo.merchant.auditStatus == 2 || merchantInfo.merchant.auditStatus == 3) {
+				if (merchantInfo.merchant.auditStatus == 0) { //待入驻
+					if (!this.$utils.checkLogin({ type: 'navigate' })) return;
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+					return
+				}
+				if (merchantInfo.merchantAuditFile.length) {//已有入驻信息
+					if (!this.$utils.checkLogin({ type: 'navigate' })) return;
+					uni.switchTab({
+						url: '/pages/index/index?merchantInfo=' + encodeURIComponent(JSON.stringify(merchantInfo))
+					})
 
+				} else {//无入驻信息
+					if (merchantInfo.merchant.auditStatus == 1 || merchantInfo.merchant.auditStatus == 3) {
+						uni.navigateTo({
+							url: '/pages/join/staff?merchantInfo=' + encodeURIComponent(JSON.stringify(merchantInfo))
+						})
+					} if (merchantInfo.merchant.auditStatus == 2) {
+						uni.switchTab({
+							url: '/pages/index/index'
+						})
+					}
 				}
-			})
+			}
+
 		},
 
+
 	},
 	onHide() {
 		console.log('App Hide')
@@ -116,4 +122,59 @@ page {
 	--theme-color-gradient: linear-gradient(131deg, #00DAAB 0%, #07CDC4 100%);
 	;
 }
+
+// 弹窗
+.modal-wrap {
+	width: 590rpx;
+	height: 314rpx;
+	background: #fff;
+	border-radius: 16rpx;
+
+	.title {
+		font-weight: 600;
+		font-size: 32rpx;
+		color: #1D2129;
+		text-align: center;
+		margin-top: 32rpx;
+	}
+
+	.content {
+		padding: 32rpx 48rpx;
+		font-weight: 400;
+		font-size: 30rpx;
+		color: #4E5969;
+	}
+
+	.btn-box {
+		display: flex;
+		border-top: 1rpx solid #E7E7E7;
+	}
+
+	.btn {
+		flex: 1;
+		height: 90rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 30rpx;
+		color: #1D2129;
+		font-weight: 400;
+	}
+
+	.left {
+		font-weight: 400;
+		font-size: 30rpx;
+		color: #86909C;
+		text-align: center;
+		border-right: 1rpx solid #E7E7E7;
+	}
+
+	.right {
+		font-weight: 400;
+		font-size: 30rpx;
+		color: #1D2129;
+		text-align: center;
+	}
+
+}
 </style>

+ 23 - 20
src/api/dynamic.js

@@ -9,14 +9,7 @@ export function discoverList(data) {
     });
 }
 
-// 我的动态列表
-export function myDynamicList(data) {
-    return request({
-        method: 'get',
-        url: '/api/moment/v1/my',
-        data
-    });
-}
+
 
 // 技师动态列表
 export function jsDynamicList(data) {
@@ -27,8 +20,10 @@ export function jsDynamicList(data) {
     });
 }
 
-// 草稿动态列表
-export function draftDynamicList(data) {
+//guo
+
+//  查询草稿箱列表
+export function draftList(data) {
     return request({
         method: 'get',
         url: '/api/moment/v1/drafts',
@@ -36,7 +31,8 @@ export function draftDynamicList(data) {
     });
 }
 
-// 发布/保存动态
+
+// 发布动态或保存草稿
 export function dynamicPublish(data) {
     return request({
         method: 'post',
@@ -44,7 +40,22 @@ export function dynamicPublish(data) {
         data
     });
 }
-
+// 动态详情
+export function dynamicDetail(data) {
+    return request({
+        method: 'get',
+        url: '/api/moment/v1/detail',
+        data
+    });
+}
+// 我的动态列表
+export function myDynamicList(data) {
+    return request({
+        method: 'get',
+        url: '/api/moment/v1/my',
+        data
+    });
+}
 // 编辑动态
 export function dynamicEdit(data) {
     return request({
@@ -54,11 +65,3 @@ export function dynamicEdit(data) {
     });
 }
 
-// 动态详情
-export function dynamicDetail(data) {
-    return request({
-        method: 'get',
-        url: '/api/moment/v1/detail',
-        data
-    });
-}

+ 10 - 62
src/api/index.js

@@ -9,18 +9,6 @@ export function getCityCode(data) {
 }
 
 
-// 图片上传
-export function imgUpload(data) {
-    return request({
-        method: 'post',
-        url: '/common/upload',
-        data,
-        header: {
-            'content-type': 'multipart/form-data'
-        }
-    });
-}
-
 // 图片上传(多个)
 export function imgsUpload(data) {
     return request({
@@ -81,23 +69,7 @@ export function getProjectByJsId(data) {
     });
 }
 
-// 项目详情
-export function projectDetails(data) {
-    return request({
-        method: 'post',
-        url: '/api/xiangmu/v1/getByid',
-        data
-    });
-}
 
-// 首页-项目分类
-export function getCateList(data) {
-    return request({
-        method: 'get',
-        url: '/api/xiangmu/v1/highlights',
-        data
-    });
-}
 
 // 商户-列表
 export function engineer(data) {
@@ -117,14 +89,6 @@ export function engineerDetails(data) {
     });
 }
 
-// 登录-用户信息更新
-export function infoUpdate(data) {
-    return request({
-        method: 'post',
-        url: '/wx/update',
-        data
-    });
-}
 
 // 获取用户信息
 export function getInfo(data) {
@@ -144,15 +108,6 @@ export function getSignature(data) {
     });
 }
 
-// 添加免车费
-export function freeFare(data) {
-    return request({
-        method: 'post',
-        url: '/api/js/v1/wx/freeFare',
-        data
-    });
-}
-
 // 上下岗
 export function netStaffWork(data) {
     return request({
@@ -379,14 +334,7 @@ export function complaintEnum(data) {
     });
 }
 
-// 获取部门
-export function getCityList(data) {
-    return request({
-        method: 'get',
-        url: '/system/dept/list',
-        data
-    });
-}
+
 
 // 获取部门车费
 export function getFareSetting(data) {
@@ -660,27 +608,27 @@ export function getServiceCategoryList(dictType) {
     });
 }
 //查询商户注册和入驻信息
-export function getTechnicianList(data) {
+export function getTechnicianInfo(data) {
     return request({
         method: 'get',
-        url:'/technician/technician/getTechnicianList',
+        url:'/technician/technician/getTechnicianInfo',
         data
     });
 }
 
-//查询商户信息
-export function getTechnician(data) {
+//入驻申请提交
+export function applyFile(data) {
     return request({
-        method: 'get',
-        url:'/technician/technician/getTechnician',
+        method: 'post',
+        url:'/technician/technician/applyFile',
         data
     });
 }
-//入驻申请提交
-export function applyFile(data) {
+//修改资料
+export function updateTechnician(data) {
     return request({
         method: 'post',
-        url:'/technician/technician/applyFile',
+        url:'/technician/technician/updateTechnician',
         data
     });
 }

+ 28 - 4
src/api/newLogin.js

@@ -12,7 +12,7 @@ export function getTechnicianToken(data) {
 export function sendMsg(data) {
     return request({
         method: 'get',
-        url: '/technician/technician/sendMsg',
+        url: '/weChat/sendMsg',
         data
     });
 }
@@ -40,12 +40,36 @@ export function resetPassword(data) {
         // }
     });
 }
-
-//获取图形验证码
+// 获取图形验证码
 export function captchaImage(data) {
     return request({
         method: 'get',
-        url: '/nightFragrance/captchaImage',
+        url: '/captchaImage',
+        data
+    });
+}
+
+//校验图形验证码
+export function getValidateCaptcha(data) {
+    return request({
+        method: 'post',
+        url: '/technician/technician/getValidateCaptcha',
+        data
+    });
+}
+//获取省市树
+export function provinceCityTree (data) {
+    return request({
+        method: 'get',
+        url: '/area/provinceCityTree',
+        data
+    });
+}
+// 获取部门
+export function regionList(data) {
+    return request({
+        method: 'get',
+        url: '/system/dept/region/list',
         data
     });
 }

+ 3 - 3
src/components/cl-upload/cl-upload/cl-upload.vue

@@ -696,7 +696,7 @@ export default {
 					success: (uploadFileRes) => {
 						const data = JSON.parse(uploadFileRes.data)
 						uni.hideLoading();
-						that.success(data)
+						that.success(data,tempFile)
 
 						if (!this.autoUpload) {
 							that.FileList.map((item, index) => {
@@ -754,8 +754,8 @@ export default {
 		 * @param {array} data 上传成功后的数据
 		 * @return {array} 返回数据
 		 * */
-		success(data) {
-			this.$emit('onSuccess', data);
+		success(data,tempFile) {
+			this.$emit('onSuccess', data,tempFile);
 
 			// 自定义数据结构-选择性开启
 			// const list = data.map(item=> {

+ 14 - 3
src/components/upload/index.vue

@@ -1,8 +1,10 @@
 <template>
 	<u-upload :name="name" :disabled="disabled" :width="width" :height="height" :accept="accept" :fileList="fileList"
 		:multiple="multiple" :maxCount="maxCount"  :previewFullImage="true"
-		@afterRead="afterRead" @delete="onDelete">
-		<slot name="content" :data="fileList"></slot>
+		@afterRead="afterRead" @delete="onDelete" @beforeRead="beforeRead">
+		<slot name="content" :data="fileList">
+			
+		</slot>
 
 		<image v-if="customImg" src="@/static/discover/ic_upload.png" mode=""
 			:style="{ width: width + 'px', height: height + 'px', borderRadius: '12rpx' }"></image>
@@ -115,9 +117,14 @@ export default {
 
 	},
 	methods: {
+		// 上传前的处理函数
+		beforeRead(event) {
+			console.log(event,'66666666')
+		},
 		// 上传后的处理函数
 		async afterRead(event) {
 			// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+			console.log(event,'event')
 			let lists = [].concat(event.file);
 			let fileListLen = this[`fileList`].length;
 
@@ -141,8 +148,10 @@ export default {
 					} else {
 						// 压缩后可能是 File 对象(H5)或 URL 字符串(App/小程序)
 						const compressedResult = await this.compressImage(file.url);
+						console.log(compressedResult,'compressedResult')
 						// 保存原始 URL 用于预览,压缩结果用于上传
 						lists[i].compressedFile = compressedResult;
+						lists[i].contentType = 'image/' + fileExtension;
 					}
 				} else if (isVideo) {
 					// 视频验证
@@ -158,6 +167,7 @@ export default {
 						uni.$u.toast(`音频大小不能超过 ${maxSizeMB}MB`);
 						return;
 					}
+					lists[i].type = 'audio/' + fileExtension;
 				} else {
 					// 无法判断类型或类型不支持,检查是否有file.type
 					if (file.type) {
@@ -284,7 +294,8 @@ export default {
 						if (blob) {
 							// 确保文件名以 .jpg 结尾
 							const originalName = url.split('/').pop() || 'image';
-							const fileName = originalName.endsWith('.jpg') || originalName.endsWith('.jpeg')
+							console.log(originalName,'originalName')
+							const fileName = originalName.endsWith('.jpg') || originalName.endsWith('.jpeg') || originalName.endsWith('.png')
 								? originalName
 								: originalName + '.jpg';
 							const file = new File([blob], fileName, { type: 'image/jpeg' });

+ 94 - 86
src/pages/index/index.vue

@@ -120,7 +120,7 @@
 			</view>
 
 			<!-- 我的技能 -->
-			<view class="card skills-section">
+			<view class="card skills-section" v-if="skillList"> 
 				<view class="section-header">
 					<view class="section-heading-wrap">
 						<view class="section-heading-box">
@@ -241,18 +241,19 @@
 		</view>
 
 		<!-- 未入驻提示 -->
-		<u-popup :show="showModal" mode="center" border-radius="16rpx" :mask-close-able="false">
+		<u-popup :show="showModal" mode="center" :round="16" :mask-close-able="false">
 			<view class="modal-wrap">
 				<!-- 标题居中 -->
-				<view class="title">提示</view>
+				<view class="title">{{ auditStatus == 0 ? '提示' : '入驻审核驳回' }}</view>
 				<!-- 正文 -->
 				<view class="content">
-					请提交入驻资料并由后台人员审核通过后,<br>即可开通操作权限
+					请提交入驻资料并由后台人员审核通过后,即可开通操作权限
 				</view>
 				<!-- 底部双按钮(必显示) -->
 				<view class="btn-box">
-					<view class="btn left" @click="cancel">我在想想</view>
-					<view class="btn right" @click="goEnter">立即入驻</view>
+					<view v-if="auditStatus == 3" class="btn">修改入驻信息</view>
+					<view v-if="auditStatus == 0" class="btn left" @click="cancel">我在想想</view>
+					<view v-if="auditStatus == 0" class="btn right" @click="goEnter">立即入驻</view>
 				</view>
 			</view>
 		</u-popup>
@@ -279,7 +280,6 @@
 	} from '@/api/order.js';
 
 	import {
-		getTechnician,
 		switchToOffline,
 		getSkillList
 	} from '@/api/workbench.js';
@@ -323,9 +323,10 @@
 					{ label: '免车费', icon: '/static/workbench/freeCar.png', path: '/workbench/fare/index' },
 					{ label: '开通新技能', icon: '/static/workbench/newSkill.png', path: '/workbench/skill/add' },
 					{ label: '我的合同', icon: '/static/workbench/contract.png', path: '/workbench/contract/index' },
-					{ label: '我的资料', icon: '/static/workbench/info.png', path: '/pages/my/indent?title=编辑资料' },
+					{ label: '我的资料', icon: '/static/workbench/info.png', path: '/pages/join/applyJoin?title=编辑资料' },
 					{ label: '城市管理', icon: '/static/workbench/city.png', path: '/workbench/city/index' },
 				],
+				auditStatus: 0,
 			}
 		},
 		computed: {
@@ -357,18 +358,47 @@
 			},
 		},
 		onShow() {
-			this.loadPageData()
-		},
-		onLoad() {
 			setTimeout(() => {
-				console.log('666')
-				this.showModal = true
-			}, 500);
+				this.loadPageData()
+				this.getSkillList();
+			},300)
+				
+		},
+		async onLoad() {
+			this.auditStatus = await this.checkMerchantStatus()
+			//this.auditStatus=0 //guo
+			if(this.auditStatus == 0 || this.auditStatus == 3){
+					this.showModal = true
+					return
+			}
+			if(this.auditStatus == 1){
+				uni.showToast({
+					title: '入驻审核中,暂无操作权限',
+					icon: 'none'
+				})	
+				
+			}
+			console.log('onLoad')
+			
 		},
 		methods: {
+			//查询商户状态  auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
+			 async checkMerchantStatus() {
+				const openid = uni.getStorageSync('wx_copenid')
+				const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+				if(!merchantInfo) return
+				this.cJsId = merchantInfo.merchant.id; //用户id
+				/**
+				 * 服务标签(1:按摩推拿 2:陪玩)
+				 */
+				this.serviceTag = merchantInfo.merchant.serviceTag
+				uni.setStorageSync('serviceTag', merchantInfo.merchant.serviceTag)
+				uni.setStorageSync('userId', merchantInfo.merchant.id)
+				return merchantInfo.merchant.auditStatus//用户状态
+				
+			},
 			// 我在想想:关闭弹窗
 			cancel() {
-				console.log('5555')
 				this.showModal = false
 			},
 			// 立即入驻:跳转入驻页
@@ -384,28 +414,8 @@
 				// this.fetchIncome()
 				// this.fetchWorkData()
 				// this.fetchBankCards()
-
-				this.getWorkInfo();
-			},
-			getWorkInfo() {
-				let params = {
-					openid: uni.getStorageSync('wx_copenid')
-				}
-				getTechnician(params).then(res => {
-					console.log('res----', res)
-					if (res.data.code == 200) {
-						this.cJsId = res.data.result.id; //用户id
-						/**
-						 * 服务标签(1:按摩推拿 2:陪玩)
-						 */
-						this.serviceTag = res.data.result.serviceTag
-						uni.setStorageSync('serviceTag', res.data.result.serviceTag)
-						uni.setStorageSync('userId', res.data.result.id)
-						this.getSkillList();
-					}
-
-				})
 			},
+			
 			getSkillList() {
 				let params = {
 					auditStatus: "1", //审核状态:0-待审核,1-审核通过,2-审核驳回
@@ -604,7 +614,20 @@
 					}
 				})
 			},
-			onRejectOrder() {
+			async onRejectOrder() {
+				this.auditStatus = await this.checkMerchantStatus()
+				if(this.auditStatus == 0 || this.auditStatus == 3){
+					this.showModal = true
+					return
+				}
+				if(this.auditStatus == 1){
+					uni.showToast({
+						title: '入驻审核中,暂无操作权限',
+						icon: 'none'
+					})
+					return	
+					
+				}
 				this.showRejectPopup = true
 				this.rejectReason = ''
 			},
@@ -655,7 +678,20 @@
 					})
 				})
 			},
-			onSlideStart(e) {
+			async onSlideStart(e) {
+				this.auditStatus = await this.checkMerchantStatus()
+				if(this.auditStatus == 0 || this.auditStatus == 3){
+					this.showModal = true
+					return
+				}
+				if(this.auditStatus == 1){
+					uni.showToast({
+						title: '入驻审核中,暂无操作权限',
+						icon: 'none'
+					})
+					return	
+					
+				}
 				this.isSliding = true
 				this.slideStartX = e.touches[0].clientX - this.slideX
 				this.initSlideRange()
@@ -720,7 +756,20 @@
 					url: '/workbench/rating/index'
 				})
 			},
-			goWithdraw() {
+			async goWithdraw() {
+				this.auditStatus = await this.checkMerchantStatus()
+				if(this.auditStatus == 0 || this.auditStatus == 3){
+					this.showModal = true
+					return
+				}
+				if(this.auditStatus == 1){
+					uni.showToast({
+						title: '入驻审核中,暂无操作权限',
+						icon: 'none'
+					})
+					return	
+					
+				}
 				uni.navigateTo({
 					url: '/workbench/withdraw/apply'
 				})
@@ -815,55 +864,14 @@
 		},
 	}
 </script>
-
-<style lang="scss" scoped>
-	// 弹窗
-	.modal-wrap {
-		width: 620rpx;
-		background: #fff;
-		border-radius: 16rpx;
-		overflow: hidden;
-
-		.title {
-			font-size: 42rpx;
-			text-align: center;
-			padding: 40rpx 30rpx 20rpx;
-			font-weight: 500;
-			color: #333;
-		}
-
-		.content {
-			font-size: 36rpx;
-			color: #333;
-			padding: 0 40rpx 40rpx;
-			line-height: 1.7;
-		}
-
-		.btn-box {
-			display: flex;
-			border-top: 1rpx solid #eee;
-		}
-
-		.btn {
-			flex: 1;
-			height: 90rpx;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			font-size: 36rpx;
-		}
-
-		.left {
-			color: #333;
-			border-right: 1rpx solid #eee;
-		}
-
-		.right {
-			color: #007aff;
-		}
-
+<style scoped>
+	.uni-modal{
+		background: #eb0000!important;
+		border-radius: 16rpx!important;
 	}
+	</style>
 
+<style lang="scss" scoped>
 	$primary: #1ecbc3;
 	$primary-dark: #0fa89e;
 	$text-main: #333333;

+ 587 - 43
src/pages/join/applyJoin.vue

@@ -14,16 +14,16 @@
                 <uni-list-item title="手机号" :rightText="baseInfo.phone" />
                 <view style="height: 1rpx;background-color: #e5e5e5c2;width: 100%;"></view>
                 <view class="input-box">
-                     
-                    <u-input v-model="baseInfo.teName" border="none" placeholder="昵称" class="input-item"
+
+                    <u-input v-model="baseInfo.nickName" border="none" placeholder="昵称" class="input-item"
                         placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;text-align: right;">
                         <template slot="prefix">
                             <view class="label">
                                 <text>昵称</text>
+                                <text class="status2">{{ auditStatus }}</text>
                             </view>
                         </template>
                     </u-input>
-                    <!-- <view style="height: 1rpx;background-color: #E7E7E7;"></view> -->
                 </view>
                 <!-- <uni-list-item showArrow title="昵称" :class="{ 'hasText': baseInfo.nickName }" clickable
                     @click="introduceYourselfEdit(baseInfo.introduceYourself)"
@@ -46,7 +46,18 @@
             <uni-list>
 
                 <uni-list-item title="形象照" :class="{ 'portraitPhotoRow': baseInfo.portraitPhoto }" showArrow clickable
-                    @click="portraitPhotoFun" :rightText="baseInfo.portraitPhoto ? '形象照' : '形象照'">
+                    @click="portraitPhotoFun" :rightText="baseInfo.portraitPhoto ? '形象照' : '去上传'">
+                    <!-- 自定义 body -->
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            形象照
+                            <view
+                                :class="baseInfo.portraitPhotoList.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.portraitPhotoList.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.portraitPhotoList.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}
+                            </view>
+                        </view>
+                    </template>
                     <template v-slot:footer v-if="baseInfo.portraitPhoto">
                         <image class="slot-image"
                             :src="baseInfo.portraitPhoto ? baseInfo.portraitPhoto : '/static/logo.png'" mode="widthFix">
@@ -56,22 +67,104 @@
                 <uni-list-item showArrow title="生活照"
                     :rightText="baseInfo.cImgList.length > 0 ? baseInfo.cImgList.length + '项' : '去上传'"
                     :class="{ 'hasText': baseInfo.cImgList.length > 0 }" clickable
-                    @click="pictureUpLoad('cImgList', '生活照', 9)" />
-                <uni-list-item showArrow title="宣传视频" :rightText="baseInfo.promotionalVideo.length > 0 ? '已上传' : '去上传'"
-                    clickable @click="pictureUpLoad('promotionalVideo', '宣传视频')" />
+                    @click="pictureUpLoad('cImgList', '生活照', 9)">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            生活照
+                            <view :class="baseInfo.cImgList.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.cImgList.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.cImgList.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
+                <uni-list-item showArrow title="宣传视频" :class="{ 'hasText': baseInfo.promotionalVideo.length > 0 }"
+                    :rightText="baseInfo.promotionalVideo.length > 0 ? baseInfo.promotionalVideo.length + '项' : '去上传'"
+                    clickable @click="pictureUpLoad('promotionalVideo', '宣传视频')">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            宣传视频
+                            <view
+                                :class="baseInfo.promotionalVideo.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.promotionalVideo.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.promotionalVideo.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
 
-                <uni-list-item showArrow title="身份证" :rightText="baseInfo.idCard.length > 2 ? '已上传' : '去上传'" clickable
-                    @click="idCardEditFun('idCard')" />
+                <uni-list-item showArrow title="身份证"
+                    :class="{ 'hasText': (baseInfo.idCard[0].length > 0 || baseInfo.idCard[1].length > 0 || baseInfo.idCard[2].length) > 0 }"
+                    :rightText="checkLength(baseInfo.idCard)" clickable @click="idCardEditFun('idCard')">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            身份证
+                            <view :class="(baseInfo.idCard || []).some(subArr => (subArr || []).some(item => item.auditStatus == 1)) ? 'status2' : 'status1'" 
+                            v-if="(baseInfo.idCard || []).every(subArr =>(subArr || []).every(item => item.auditStatus != 2))">
+                            {{(baseInfo.idCard || []).some(subArr =>(subArr || []).some(item => item.auditStatus == 1)) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
 
-                <uni-list-item showArrow title="健康证" :rightText="baseInfo.healthCertificate.length > 0 ? '已上传' : '去上传'"
-                    clickable @click="pictureUpLoad('healthCertificate', '健康证', 3)" />
-                <uni-list-item showArrow title="从业资格证" :rightText="baseInfo.certification.length > 0 ? '已上传' : '去上传'"
-                    clickable @click="pictureUpLoad('certification', '从业资格证', 3)" />
-                <uni-list-item showArrow title="无犯罪证明" :rightText="baseInfo.noCrime.length > 0 ? '已上传' : '去上传'"
-                    clickable @click="pictureUpLoad('noCrime', '无犯罪证明', 9)" />
 
-                <uni-list-item showArrow title="承诺文件" :rightText="baseInfo.commitDocment[0].length > 0 && baseInfo.commitDocment[1].length > 0 && baseInfo.commitDocment[2].length > 0
-                    ? '已上传' : '去上传'" clickable @click="commitDocmentEditFun('commitDocment')" />
+                <uni-list-item showArrow title="健康证" :class="{ 'hasText': baseInfo.healthCertificate.length > 0 }"
+                    :rightText="baseInfo.healthCertificate.length > 0 ? baseInfo.healthCertificate.length + '项' : '去上传'"
+                    clickable @click="pictureUpLoad('healthCertificate', '健康证', 3)">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            健康证
+                            <view
+                                :class="baseInfo.healthCertificate.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.healthCertificate.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.healthCertificate.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}
+                            </view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
+                <uni-list-item showArrow title="从业资格证" :class="{ 'hasText': baseInfo.certification.length > 0 }"
+                    :rightText="baseInfo.certification.length > 0 ? baseInfo.certification.length + '项' : '去上传'"
+                    clickable @click="pictureUpLoad('certification', '从业资格证', 3)">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            从业资格证
+                            <view
+                                :class="baseInfo.certification.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.certification.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.certification.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
+                <uni-list-item showArrow title="无犯罪证明" :class="{ 'hasText': baseInfo.noCrime.length > 0 }"
+                    :rightText="baseInfo.noCrime.length > 0 ? baseInfo.noCrime.length + '项' : '去上传'" clickable
+                    @click="pictureUpLoad('noCrime', '无犯罪证明', 9)">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            无犯罪证明
+                            <view :class="baseInfo.noCrime.some(item => item.auditStatus == 1) ? 'status2' : 'status1'"
+                                v-if="baseInfo.noCrime.every(item => item.auditStatus != 2)">{{
+                                    baseInfo.noCrime.some(item => item.auditStatus == 1) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
+
+                <uni-list-item showArrow title="承诺文件"
+                    :class="{ 'hasText': (baseInfo.commitDocument[0].length > 0 || baseInfo.commitDocument[1].length > 0 || baseInfo.commitDocument[2].length) > 0 }"
+                    :rightText="checkLength(baseInfo.commitDocument)" clickable
+                    @click="commitDocmentEditFun('commitDocument')">
+                    <template v-slot:body>
+                        <view class="slot-box slot-text">
+                            承诺文件
+                            <view :class="(baseInfo.commitDocument || []).some(subArr => (subArr || []).some(item => item.auditStatus == 1)) ? 'status2' : 'status1'" 
+                            v-if="(baseInfo.commitDocument || []).every(subArr =>(subArr || []).every(item => item.auditStatus != 2))">
+                            {{(baseInfo.commitDocument || []).some(subArr =>(subArr || []).some(item => item.auditStatus == 1)) ? '审核中' : '审核驳回'}}</view>
+                        </view>
+                    </template>
+
+                </uni-list-item>
 
             </uni-list>
         </view>
@@ -88,16 +181,25 @@
 </template>
 
 <script>
+import { applyFile, updateTechnician } from '@/api/index.js'
+import { baseUrl } from '@/common/config.js'
 export default {
 
     data() {
         return {
+            status: '审核中',
+            title: '',
             // 任务数据
             tasks: [
                 { taskName: '222' }
             ],
             baseInfo: {
+                commitDocumentAuditStatus: 0,
+                idCardAuditStatus: 0,
+                id: '',
                 portraitPhoto: '',
+                portraitPhotoList: [],
+                //portraitPhoto: '',
                 name: '萧然然',
                 gender: '女',
                 phone: '18366668888',
@@ -106,35 +208,193 @@ export default {
                 intro: '',
                 avatar: '',
                 lifeImg: [],
-                idCard: '',
                 introduceYourself: '',
-                cImgList: [],
+                cImgList: [],//生活照
                 healthCertificate: [],
                 certification: [],
                 noCrime: [],
                 promotionalVideo: [],
-                idCard: [],
-                commitDocment: [[], [], []],
+                idCard: [[], [], []],
+                commitDocument: [[], [], []],
             },
             ShopInfo: {},
 
         }
     },
+    watch: {
+        // 深度监听对象内部属性
+        'baseInfo.portraitPhotoList'(newVal, oldVal) {
+            if (newVal) {
+                console.log(newVal, '8888')
+                this.baseInfo.portraitPhoto = newVal[0].url
+            } else if (oldVal && !newVal) {
+                // 头像被清空
+                uni.showToast({ title: '头像已移除', icon: 'none' })
+            }
+        }
+    },
     onLoad(options) {
-        console.log(options, '66666')
+        console.log(options)
+        if (options.title) {
+            this.title = options.title
+        }
         if (options.ShopInfo) {
             this.ShopInfo = JSON.parse(options.ShopInfo)
             this.baseInfo.name = this.ShopInfo.teName
             this.baseInfo.gender = this.ShopInfo.teSex == 0 ? '女' : '男'
             this.baseInfo.phone = this.ShopInfo.tePhone
             this.baseInfo.nickName = this.ShopInfo.teNickName
-            this.baseInfo.city = this.ShopInfo.teAddress
+            this.baseInfo.city = this.ShopInfo.operationCenterName
+        } else {
+            this.checkMerchantStatus()
         }
 
     },
+    onReady() {
+        // 页面渲染完成后再设置标题
+        uni.setNavigationBarTitle({
+            title: this.title
+        })
+    },
     onShow() {
+        //console.log(this.baseInfo, 'baseInfo')
+
     },
     methods: {
+
+
+        //查询商户状态
+        async checkMerchantStatus() {
+            const openid = uni.getStorageSync('wx_copenid')
+            const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+
+            if (!merchantInfo) return
+            this.ShopInfo = merchantInfo
+            this.baseInfo.id = this.ShopInfo.merchant.id
+            this.baseInfo.name = merchantInfo.merchant.teName
+            this.baseInfo.gender = merchantInfo.merchant.teSex == 0 ? '女' : '男'
+            this.baseInfo.phone = merchantInfo.merchant.tePhone
+            this.baseInfo.nickName = merchantInfo.merchant.teNickName
+            this.baseInfo.city = merchantInfo.merchant.provinceName + '/' + merchantInfo.merchant.cityName + ' ' + merchantInfo.merchant.operationCenterName
+            this.baseInfo.introduceYourself = merchantInfo.merchant.teBrief
+            console.log(this.baseInfo, 'baseInfo.commitDocument')
+            // 文件类型(1:形象照 2:生活照 3:宣传视频 4-身份证正面 5-身份证反面 6-手持身份证 
+            // 7-健康证 8-从业资格证,9-无犯罪证明,10-承诺书,11-承诺录音,12-承诺录像,13-其他 )
+            merchantInfo.merchantAuditFile.map(m => {
+                if (m.fileType == 1) {
+                    this.baseInfo.portraitPhotoList = [{
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 2) {
+                    this.baseInfo.cImgList.push({
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    })
+                }
+                if (m.fileType == 3) {
+                    this.baseInfo.promotionalVideo = [{
+                        size: m.fileSize * 1024,
+                        type: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 4) {
+                    this.baseInfo.idCard[0] = [{
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 5) {
+                    this.baseInfo.idCard[1] = [{
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 6) {
+                    this.baseInfo.idCard[2] = [{
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 7) {
+                    this.baseInfo.healthCertificate.push({
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    })
+                }
+                if (m.fileType == 8) {
+                    this.baseInfo.certification.push({
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    })
+                }
+                if (m.fileType == 9) {
+                    this.baseInfo.noCrime.push({
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    })
+                }
+                if (m.fileType == 10) {
+                    this.baseInfo.commitDocument[0] = [{
+                        size: m.fileSize * 1024,
+                        contentType: m.contentType,
+                        url: m.fileUrl,
+                        status: 'success',
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 11) {
+                    this.baseInfo.commitDocument[1] = [{
+                        size: m.fileSize * 1024,
+                        type: m.contentType,
+                        url: m.fileUrl,
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+                if (m.fileType == 12) {
+                    this.baseInfo.commitDocument[2] = [{
+                        size: m.fileSize * 1024,
+                        type: m.contentType,
+                        url: m.fileUrl,
+                        auditStatus: m.auditStatus,
+                    }]
+                }
+            })
+
+            setTimeout(() => {
+                this.baseInfo.portraitPhoto = this.baseInfo.portraitPhotoList[0].url
+                console.log(this.baseInfo, 'baseInfo')
+            }, 200);
+
+        },
         commitDocmentEditFun(value) {
             let str = uni.$u.queryParams({
                 fieldName: value,
@@ -156,7 +416,6 @@ export default {
                 title: title,
                 maxlength: maxlength
             })
-            console.log(str)
             uni.navigateTo({ url: `/pages/join/lifePhotosEdit${str}` })
 
         },
@@ -165,7 +424,6 @@ export default {
             uni.navigateTo({ url: '/pages/join/introduceYourselfEdit?introduceYourself=' + this.baseInfo.introduceYourself })
         },
         portraitPhotoFun() {
-            console.log('8888888')
             uni.chooseImage({
                 count: 1,
                 sizeType: ['original', 'compressed'],
@@ -202,25 +460,254 @@ export default {
                     }
                 },
                 fail: () => {
-                    uni.showToast({
-                        title: '选择图片失败',
-                        icon: 'none'
-                    })
+                    // uni.showToast({
+                    //     title: '选择图片失败',
+                    //     icon: 'none'
+                    // })
                 }
             });
         },
+        checkLength(arr) {
+            let count = 0
+            arr.forEach(item => {
+                if (item.length > 0) {
+                    count++
+                }
+            })
+            return count ? count + '项' : '去上传'
+        },
 
 
         // 提交表单
         submitForm() {
+            console.log(this.baseInfo, 'baseInfo')
             // 接口请求提交入驻资料
-            console.log('提交入驻', this.baseInfo)
-            applyFile(this.baseInfo).then(res => {
+            if (this.baseInfo.nickName.trim() == '' || this.baseInfo.introduceYourself.trim() == '') {
+                uni.$u.toast('请完善基础信息!')
+                return
+            }
+            if (this.baseInfo.portraitPhotoList.length == 0) {
+                uni.$u.toast('请上传形象照!')
+                return
+            }
+            if (this.baseInfo.cImgList.length == 0) {
+                uni.$u.toast('请上传生活照!')
+                return
+            }
+            if (this.baseInfo.promotionalVideo.length == 0) {
+                uni.$u.toast('请上传宣传视频!')
+                return
+            }
+            let count = 0
+            this.baseInfo.idCard.forEach(item => {
+                if (item.length > 0) {
+                    count++
+                }
+            })
+            if (count != 3) {
+                uni.$u.toast('请上传3张身份证!')
+                return
+            }
+            if (this.baseInfo.healthCertificate.length == 0) {
+                uni.$u.toast('请上传健康证明!')
+                return
+            }
+            if (this.baseInfo.certification.length == 0) {
+                uni.$u.toast('请上传从业资格证!')
+                return
+            }
+            if (this.baseInfo.noCrime.length == 0) {
+                uni.$u.toast('请上传无犯罪证明!')
+                return
+            }
+
+            let count1 = 0
+            this.baseInfo.commitDocument.forEach(item => {
+                if (item.length > 0) {
+                    count1++
+                }
+            })
+            if (count1 != 3) {
+                uni.$u.toast('请上传承诺文件!')
+                return
+            }
+
+            let cImgList = this.baseInfo.cImgList.map((item, index) => {
+                return {
+                    fileType: '2',
+                    files: [
+                        {
+                            fileName: '生活照' + (index + 1),
+                            fileUrl: item.url,
+                            contentType: item.contentType,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+            let promotionalVideo = this.baseInfo.promotionalVideo.map((item, index) => {
+                return {
+                    fileType: '3',
+                    files: [
+                        {
+                            fileName: '宣传视频',
+                            fileUrl: item.url,
+                            contentType: item.type,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+            let healthCertificate = this.baseInfo.healthCertificate.map((item, index) => {
+                return {
+                    fileType: '7',
+                    files: [
+                        {
+                            fileName: '健康证' + (index + 1),
+                            fileUrl: item.url,
+                            contentType: item.contentType,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+            let certification = this.baseInfo.certification.map((item, index) => {
+                return {
+                    fileType: '8',
+                    files: [
+                        {
+                            fileName: '从业资格' + (index + 1),
+                            fileUrl: item.url,
+                            contentType: item.contentType,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+            let noCrime = this.baseInfo.noCrime.map((item, index) => {
+                return {
+                    fileType: '9',
+                    files: [
+                        {
+                            fileName: '无犯罪证明' + (index + 1),
+                            fileUrl: item.url,
+                            contentType: item.contentType,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+            let commitBook = this.baseInfo.commitDocument[0].map((item, index) => {
+                return {
+                    fileType: '10',
+                    files: [
+                        {
+                            fileName: '承诺书' + (index + 1),
+                            fileUrl: item.url,
+                            contentType: item.contentType,
+                            fileSize: Number((item.size / 1024).toFixed(2)),
+                        }
+                    ]
+                }
+            })
+
+
+            let params = {
+                technician: {
+                    id: this.baseInfo.id,
+                    teNickName: this.baseInfo.nickName,
+                    teBrief: this.baseInfo.introduceYourself,
+
+                },
+                req: [
+                    {
+                        fileType: '1',
+                        files: [
+                            {
+                                fileName: '形象照',
+                                fileUrl: this.baseInfo.portraitPhotoList[0].url,
+                                contentType: this.baseInfo.portraitPhotoList[0].contentType,
+                                fileSize: Number((this.baseInfo.portraitPhotoList[0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    },
+                    {
+                        fileType: '4',
+                        files: [
+                            {
+                                fileName: '身份证正面',
+                                fileUrl: this.baseInfo.idCard[0][0].url,
+                                contentType: this.baseInfo.idCard[0][0].contentType,
+                                fileSize: Number((this.baseInfo.idCard[0][0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    }, {
+                        fileType: '5',
+                        files: [
+                            {
+                                fileName: '身份证反面',
+                                fileUrl: this.baseInfo.idCard[1][0].url,
+                                contentType: this.baseInfo.idCard[1][0].contentType,
+                                fileSize: Number((this.baseInfo.idCard[1][0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    }, {
+                        fileType: '6',
+                        files: [
+                            {
+                                fileName: '手持身份证',
+                                fileUrl: this.baseInfo.idCard[2][0].url,
+                                contentType: this.baseInfo.idCard[2][0].contentType,
+                                fileSize: Number((this.baseInfo.idCard[2][0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    }, {
+                        fileType: '11',
+                        files: [
+                            {
+                                fileName: '承诺录音',
+                                fileUrl: this.baseInfo.commitDocument[1][0].url,
+                                contentType: this.baseInfo.commitDocument[1][0].type,
+                                fileSize: Number((this.baseInfo.commitDocument[1][0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    }, {
+                        fileType: '12',
+                        files: [
+                            {
+                                fileName: '承诺录像',
+                                fileUrl: this.baseInfo.commitDocument[2][0].url,
+                                contentType: this.baseInfo.commitDocument[2][0].type,
+                                fileSize: Number((this.baseInfo.commitDocument[2][0].size / 1024).toFixed(2)),
+                            }
+                        ]
+                    },
+                    ...cImgList,
+                    ...promotionalVideo,
+                    ...healthCertificate,
+                    ...certification,
+                    ...noCrime,
+                    ...commitBook,
+
+                ]
+
+            }
+
+            console.log('params', params)
+            let api = applyFile
+            if (this.title == '编辑资料') {
+                api = updateTechnician
+            }
+            api(params).then(res => {
                 if (res.data.code == 200) {
                     uni.showToast({
                         title: '提交成功',
-                        icon: 'success'
                     })
+                    setTimeout(() => {
+                        uni.switchTab({
+                            url: '/pages/index/index'
+                        })
+                    }, 300)
                 } else {
                     uni.showToast({
                         title: res.data.msg,
@@ -268,6 +755,39 @@ export default {
         text-align: left;
     }
 
+    .slot-text {
+        font-weight: 400;
+        font-size: 30rpx;
+        color: #1D2129 !important;
+
+    }
+
+    .status1 {
+        background: #FFF7E8;
+        border-radius: 4rpx 4rpx 4rpx 4rpx;
+        padding: 4rpx 12rpx;
+        margin-left: 16rpx;
+
+        font-weight: 400;
+        font-size: 24rpx;
+        color: #FF7D00;
+        line-height: 34rpx;
+        text-align: center;
+
+    }
+
+    .status2 {
+        background: #FFF5F5;
+        border-radius: 4rpx 4rpx 4rpx 4rpx;
+        padding: 4rpx 12rpx;
+        margin-left: 16rpx;
+
+        font-weight: 400;
+        font-size: 24rpx;
+        color: #F53F3F;
+
+    }
+
     .uni-list-item__extra-text {
         font-weight: 400;
         font-size: 30rpx;
@@ -297,14 +817,6 @@ export default {
 
 }
 
-::v-deep .slot-image {
-    width: 58px;
-    height: 58px;
-
-    border-radius: 50%;
-
-}
-
 ::v-deep .portraitPhotoRow {
     .uni-list-item__content-title {
         margin-top: 13rpx;
@@ -319,7 +831,35 @@ export default {
     display: flex;
     align-items: center;
     justify-content: space-between;
+
     //border-bottom: 0.2rpx solid #E7E7E7;
+    .status1 {
+        background: #FFF7E8;
+        border-radius: 4rpx 4rpx 4rpx 4rpx;
+        padding: 4rpx 12rpx;
+        margin-left: 16rpx;
+
+        font-weight: 400;
+        font-size: 24rpx;
+        color: #FF7D00;
+        line-height: 34rpx;
+        text-align: center;
+
+    }
+
+    .status2 {
+        background: #FFF5F5;
+        border-radius: 4rpx 4rpx 4rpx 4rpx;
+        padding: 4rpx 12rpx;
+        margin-left: 16rpx;
+
+        font-weight: 400;
+        font-size: 24rpx;
+        color: #F53F3F;
+        line-height: 34rpx;
+        text-align: center;
+
+    }
 
 
     .u-input {
@@ -404,6 +944,10 @@ export default {
         height: 106rpx;
     }
 
+    ::v-deep .uni-list-item:hover {
+        background-color: #FFFFFF !important;
+    }
+
     .baseInfo {
         margin: 16rpx 32rpx;
         background: #FFFFFF;
@@ -445,9 +989,9 @@ export default {
         /* #ifndef APP-NVUE */
         display: block;
         /* #endif */
-        margin-right: 10px;
-        width: 30px;
-        height: 30px;
+        width: 58rpx;
+        height: 58rpx;
+        border-radius: 50%;
     }
 
     .slot-text {

+ 73 - 24
src/pages/join/commitDocumentEdit.vue

@@ -4,8 +4,9 @@
             <view class="content">
                 <view class="title">承诺书</view>
                 <view class="tip">请上传 大小不超过 2MB 格式为 jpg/jpeg/png 的文件</view>
-                <Upload :maxCount="9" @fileList="onUpload($event, 'commitment')" :fileList="commitment">
-                    <view class="upload-block" slot="content">
+                <Upload :maxCount="9" @fileList="onUpload($event, 'commitment')" :fileList="commitment" :width="76"
+                    :height="76">
+                    <view class="upload-block 999" slot="content">
                         <view class="icon-bg">
                             <image src="/static/login/cameraIcon.png" mode="widthFix"
                                 style="width: 52rpx;height: 52rpx;">
@@ -40,7 +41,8 @@
                 <view v-if="audioDuration" class="audio-info">
                     录音时长: {{ audioDuration }}秒
                 </view> -->
-                <!-- <Upload accept="audio" :maxCount="1" @fileList="onUpload($event, 'recording')" :fileList="recording">
+
+                <Upload :maxCount="1" @fileList="onUpload($event, 'recording')" :fileList="recording">
                     <view class="upload-block" slot="content">
                         <view class="icon-bg">
                             <image src="/static/login/cameraIcon.png" mode="widthFix"
@@ -51,18 +53,23 @@
                         </view>
 
                     </view>
+                </Upload>
 
-
-                </Upload> -->
             </view>
             <view class="content">
                 <view class="title">承诺录像</view>
                 <view class="tip">请上传 大小不超过 50MB 格式为 mp4/mov/mkv/wmv 的文件</view>
-                
+
                 <view class="media-area">
                     <view v-if="formData.videoUrl">
-                        <uni-icons class="icon iconfont icon-cuo" type="trash-filled" size="20"
-                            @tap="delectVideo"></uni-icons>
+                        <!-- <uni-icons class="icon iconfont icon-cuo" type="trash-filled" size="20"
+                            @tap="delectVideo"></uni-icons> -->
+                        <view class="icon iconfont icon-cuo">
+                            <image src="/static/login/close2.png" mode="" style="width: 32rpx;height: 32rpx;"
+                                @tap="delectVideo">
+                            </image>
+                        </view>
+
                         <video ref="myVideo" :src="formData.videoUrl" class="video-container" controls></video>
                     </view>
                     <clUpload v-else v-model="fileList" :action="uploadApi" :headers="headers" :count="maxCount"
@@ -153,18 +160,17 @@ export default {
         if (query.fieldName) this.fieldName = query.fieldName
         if (query.fieldVal) {
             let fieldVal = JSON.parse(query.fieldVal)
-            console.log(fieldVal, 'fieldVal')
             this.commitment = fieldVal[0] ? fieldVal[0] : []
             this.recording = fieldVal[1] ? fieldVal[1] : []
             this.videoRecording = fieldVal[2] ? fieldVal[2] : []
+            if (this.videoRecording.length > 0) {
+                this.formData.videoUrl = this.videoRecording[0].url
+                this.formData.videoCoverUrl = this.videoRecording[0].coverUrl
+            }
+
         }
         // 初始化微信SDK(包含录音功能)
         this.initRecorder();
-
-        console.log(this.commitment, 'query')
-        console.log(this.recording, 'query')
-        console.log(this.videoRecording, 'query')
-        // console.log(this.title, 'query')
     },
     onReady() {
 
@@ -280,7 +286,8 @@ export default {
 
 
 
-        onSuccess(reslut) {
+        onSuccess(reslut, tempFile) {
+            console.log(reslut, tempFile)
             // 把服务端返回的图片地址添加到list中与组件数据同步
             if (reslut.code === 200) {
                 const isVideo =
@@ -291,6 +298,12 @@ export default {
                 if (isVideo) {
                     this.formData.videoUrl = baseUrl + reslut.url
                     this.formData.videoCoverUrl = baseUrl + reslut.coverUrl
+                    this.videoRecording = [{
+                        url: baseUrl + reslut.url,
+                        type: tempFile.tempFile.type,
+                        size: tempFile.size,
+                        coverUrl: baseUrl + reslut.coverUrl,
+                    }]
                 } else {
                     this.fileList.push(baseUrl + reslut.url)
                 }
@@ -343,6 +356,7 @@ export default {
             const prevPage = pages[pages.length - 2]
             // 直接修改上一页data里的字段
             prevPage.$data.baseInfo[this.fieldName] = [this.commitment, this.recording, this.videoRecording]
+            console.log(prevPage.$data.baseInfo, '99999999999999')
             uni.navigateBack()
         }
 
@@ -404,18 +418,53 @@ export default {
         border: none !important;
     }
 }
+::v-deep .u-upload__success {
+    display: none;
+}
 
-::v-deep .media-area,
-.video-container {
-    width: 160rpx;
-    height: 160rpx;
+::v-deep .u-upload__wrap__preview__image {
+    border-radius: 12rpx !important;
+}
+
+::v-deep .u-upload__deletable {
+    border-top-right-radius: 12rpx;
+    border-bottom-left-radius: 12rpx;
+    
+}
+
+::v-deep .u-upload__deletable__icon {
+    position: static !important;
+    -webkit-transform: scale(0.8) !important;
+
+}
 
-    .uni-video-cover-duration {
-        font-size: 20rpx;
-        font-weight: 400;
+.media-area {
+    margin: 20rpx 0 20rpx;
+    justify-content: space-between;
+    position: relative;
+    width: 340upx;
+    height: 240upx;
+
+    .icon-cuo {
+        width: 40rpx;
+        height: 40rpx;
         position: absolute;
-        right: 8rpx;
-        bottom: 4rpx;
+        right: 0;
+        top: 0;
+        color: #ffffff !important;
+        z-index: 999;
+        border-bottom-left-radius: 12rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+
+
+
+    .video-container {
+        width: 340upx;
+        height: 240upx;
+        border-radius: 12rpx;
     }
 }
 </style>

+ 392 - 127
src/pages/join/cropImage.vue

@@ -10,8 +10,26 @@
       <!-- 原图显示区域 -->
       <image class="original-image" :src="imageSrc" mode="aspectFit"></image>
 
-      <!-- 裁剪框遮罩 -->
-      <view class="crop-mask"></view>
+      <!-- 用于裁剪的 canvas(隐藏)- 仅在小程序环境中渲染 -->
+      <canvas v-if="!isH5" canvas-id="cropCanvas" id="cropCanvas" class="crop-canvas" width="200" height="200"></canvas>
+
+      <!-- 四块镂空遮罩,实现框外变暗、框内高亮 -->
+      <view class="mask-top" :style="{ height: cropBox.y + 'px' }"></view>
+      <view class="mask-left" :style="{
+        top: cropBox.y + 'px',
+        width: cropBox.x + 'px',
+        height: cropBox.size + 'px'
+      }"></view>
+      <view class="mask-right" :style="{
+        top: cropBox.y + 'px',
+        left: cropBox.x + cropBox.size + 'px',
+        width: containerSize.width - cropBox.x - cropBox.size + 'px',
+        height: cropBox.size + 'px'
+      }"></view>
+      <view class="mask-bottom" :style="{
+        top: cropBox.y + cropBox.size + 'px',
+        height: containerSize.height - cropBox.y - cropBox.size + 'px'
+      }"></view>
 
       <!-- 裁剪框 -->
       <view class="crop-box" :style="{
@@ -43,6 +61,7 @@
 </template>
 
 <script>
+import { baseUrl } from '@/common/config.js'
 export default {
   data() {
     return {
@@ -68,16 +87,26 @@ export default {
       touchStart: {},
       resizeStart: {},
       isDragging: false,
-      isResizing: false
+      isResizing: false,
+      isH5: false,
+      tempBlobUrl: ''
     }
   },
   onLoad(options) {
     this.imageSrc = decodeURIComponent(options.imageSrc)
     this.initCropBox()
+    const sysInfo = uni.getSystemInfoSync()
+    this.isH5 = sysInfo.platform === 'h5'
   },
   onReady() {
     this.getImageInfo()
   },
+  onUnload() {
+    // 销毁blob内存
+    if (this.isH5 && this.tempBlobUrl) {
+      URL.revokeObjectURL(this.tempBlobUrl)
+    }
+  },
   methods: {
     initCropBox() {
       this.cropBox.size = 200
@@ -91,7 +120,6 @@ export default {
           this.calculateCropBox()
         },
         fail: () => {
-          // 如果获取图片信息失败,使用默认尺寸
           this.imageSize.width = 1000
           this.imageSize.height = 1000
           this.calculateCropBox()
@@ -100,45 +128,23 @@ export default {
     },
     calculateCropBox() {
       const sysInfo = uni.getSystemInfoSync()
-      
-      // header高度约为 88rpx = 44px
       const headerHeight = 44
-      
       this.containerSize.width = sysInfo.windowWidth
       this.containerSize.height = sysInfo.windowHeight - headerHeight
-
-      // 计算图片缩放比例(aspectFit模式)
       this.scale = Math.min(
         this.containerSize.width / this.imageSize.width,
         this.containerSize.height / this.imageSize.height
       )
-
-      // 图片实际显示尺寸
       this.displayWidth = this.imageSize.width * this.scale
       this.displayHeight = this.imageSize.height * this.scale
-
-      // 图片居中偏移(考虑状态栏和header)
       this.imageOffsetX = (this.containerSize.width - this.displayWidth) / 2
       this.imageOffsetY = (this.containerSize.height - this.displayHeight) / 2
-      
-      // 如果图片比容器小,确保偏移量不为负
       this.imageOffsetX = Math.max(0, this.imageOffsetX)
       this.imageOffsetY = Math.max(0, this.imageOffsetY)
-
-      // 裁剪框最大尺寸(不超过图片显示尺寸)
       const maxBoxSize = Math.min(200, Math.min(this.displayWidth, this.displayHeight))
       this.cropBox.size = Math.max(80, maxBoxSize)
-      
-      // 裁剪框初始位置(居中在图片上)
       this.cropBox.x = this.imageOffsetX + (this.displayWidth - this.cropBox.size) / 2
       this.cropBox.y = this.imageOffsetY + (this.displayHeight - this.cropBox.size) / 2
-      
-      // 调试信息
-      console.log('容器高度:', this.containerSize.height)
-      console.log('图片显示高度:', this.displayHeight)
-      console.log('图片Y偏移:', this.imageOffsetY)
-      console.log('裁剪框初始Y:', this.cropBox.y)
-      console.log('裁剪框最大Y:', this.imageOffsetY + this.displayHeight - this.cropBox.size)
     },
     onTouchStart(e) {
       const touch = e.touches[0]
@@ -153,27 +159,19 @@ export default {
     onTouchMove(e) {
       if (!this.isDragging) return
       e.preventDefault()
-
       const touch = e.touches[0]
       const deltaX = touch.clientX - this.touchStart.x
       const deltaY = touch.clientY - this.touchStart.y
-
       let newX = this.touchStart.boxX + deltaX
       let newY = this.touchStart.boxY + deltaY
-
-      // 限制裁剪框在图片显示区域内
       const maxX = this.imageOffsetX + this.displayWidth - this.cropBox.size
       const maxY = this.imageOffsetY + this.displayHeight - this.cropBox.size
-      
-      // 确保边界值有效
       const effectiveMinX = Math.min(this.imageOffsetX, maxX)
       const effectiveMaxX = Math.max(this.imageOffsetX, maxX)
       const effectiveMinY = Math.min(this.imageOffsetY, maxY)
       const effectiveMaxY = Math.max(this.imageOffsetY, maxY)
-      
       newX = Math.max(effectiveMinX, Math.min(newX, effectiveMaxX))
       newY = Math.max(effectiveMinY, Math.min(newY, effectiveMaxY))
-
       this.cropBox.x = newX
       this.cropBox.y = newY
     },
@@ -190,33 +188,24 @@ export default {
       }
       this.isDragging = true
       this.isResizing = false
-
       document.addEventListener('mousemove', this.onMouseMove)
       document.addEventListener('mouseup', this.onMouseUp)
     },
     onMouseMove(e) {
       if (!this.isDragging && !this.isResizing) return
-
       if (this.isDragging && !this.isResizing) {
         const deltaX = e.clientX - this.touchStart.x
         const deltaY = e.clientY - this.touchStart.y
-
         let newX = this.touchStart.boxX + deltaX
         let newY = this.touchStart.boxY + deltaY
-
-        // 限制裁剪框在图片显示区域内
         const maxX = this.imageOffsetX + this.displayWidth - this.cropBox.size
         const maxY = this.imageOffsetY + this.displayHeight - this.cropBox.size
-        
-        // 确保边界值有效
         const effectiveMinX = Math.min(this.imageOffsetX, maxX)
         const effectiveMaxX = Math.max(this.imageOffsetX, maxX)
         const effectiveMinY = Math.min(this.imageOffsetY, maxY)
         const effectiveMaxY = Math.max(this.imageOffsetY, maxY)
-        
         newX = Math.max(effectiveMinX, Math.min(newX, effectiveMaxX))
         newY = Math.max(effectiveMinY, Math.min(newY, effectiveMaxY))
-
         this.cropBox.x = newX
         this.cropBox.y = newY
       } else if (this.isResizing) {
@@ -241,7 +230,6 @@ export default {
       }
       this.isResizing = true
       this.isDragging = false
-
       document.addEventListener('touchmove', this.onCornerTouchMove)
       document.addEventListener('touchend', this.onCornerTouchEnd)
     },
@@ -267,7 +255,6 @@ export default {
       }
       this.isResizing = true
       this.isDragging = false
-
       document.addEventListener('mousemove', this.onCornerMouseMove)
       document.addEventListener('mouseup', this.onCornerMouseUp)
     },
@@ -284,42 +271,32 @@ export default {
       const deltaX = clientX - this.resizeStart.x
       const deltaY = clientY - this.resizeStart.y
       const corner = this.resizeStart.corner
-
       let newSize = this.resizeStart.boxSize
       let newX = this.resizeStart.boxX
       let newY = this.resizeStart.boxY
-
       const minSize = 80
       const maxSize = Math.min(this.displayWidth, this.displayHeight)
-
       switch (corner) {
         case 'br':
-          // 右下角:向右下方拖动放大
           newSize = Math.max(minSize, Math.min(maxSize, this.resizeStart.boxSize + deltaX))
           break
         case 'bl':
-          // 左下角:向左拖动放大,X位置右移
           newSize = Math.max(minSize, Math.min(maxSize, this.resizeStart.boxSize - deltaX))
           newX = this.resizeStart.boxX + deltaX
           break
         case 'tr':
-          // 右上角:向上拖动放大,Y位置下移
           newSize = Math.max(minSize, Math.min(maxSize, this.resizeStart.boxSize - deltaY))
           newY = this.resizeStart.boxY + deltaY
           break
         case 'tl':
-          // 左上角:向左上方拖动放大,X右移,Y下移
           const deltaTL = Math.max(-deltaX, -deltaY)
           newSize = Math.max(minSize, Math.min(maxSize, this.resizeStart.boxSize + deltaTL))
           newX = this.resizeStart.boxX + deltaX
           newY = this.resizeStart.boxY + deltaY
           break
       }
-
-      // 确保位置在图片边界内
       newX = Math.max(this.imageOffsetX, Math.min(newX, this.imageOffsetX + this.displayWidth - newSize))
       newY = Math.max(this.imageOffsetY, Math.min(newY, this.imageOffsetY + this.displayHeight - newSize))
-
       this.cropBox.size = newSize
       this.cropBox.x = newX
       this.cropBox.y = newY
@@ -329,54 +306,266 @@ export default {
     },
     confirm() {
       uni.showLoading({ title: '裁剪中...' })
-
+      const sysInfo = uni.getSystemInfoSync()
+      const isH5 = sysInfo.platform === 'h5'
+      if (isH5) {
+        this.cropImageH5()
+      } else {
+        this.cropImageMiniProgram()
+      }
+    },
+    cropImageH5() {
+      // 销毁上一次blob,释放内存
+      if (this.tempBlobUrl) {
+        URL.revokeObjectURL(this.tempBlobUrl)
+        this.tempBlobUrl = ''
+      }
       const canvas = document.createElement('canvas')
       const ctx = canvas.getContext('2d')
-      canvas.width = this.cropBox.size
-      canvas.height = this.cropBox.size
-
+      const outputSize = 150
+      canvas.width = outputSize
+      canvas.height = outputSize
       const img = new Image()
       img.crossOrigin = 'anonymous'
       img.src = this.imageSrc
-
       img.onload = () => {
-        // 计算裁剪区域在原图中的坐标
         const boxInImageX = this.cropBox.x - this.imageOffsetX
         const boxInImageY = this.cropBox.y - this.imageOffsetY
-        
         const cropX = boxInImageX / this.scale
         const cropY = boxInImageY / this.scale
         const cropSize = this.cropBox.size / this.scale
-
-        // 确保裁剪区域在原图范围内
         const actualCropX = Math.max(0, cropX)
         const actualCropY = Math.max(0, cropY)
         const actualCropSize = Math.min(cropSize, img.width - actualCropX, img.height - actualCropY)
-
-        ctx.drawImage(img, actualCropX, actualCropY, actualCropSize, actualCropSize, 0, 0, canvas.width, canvas.height)
-
-        const croppedImage = canvas.toDataURL('image/png')
-
+        ctx.clearRect(0, 0, outputSize, outputSize)
+        ctx.drawImage(img, actualCropX, actualCropY, actualCropSize, actualCropSize, 0, 0, outputSize, outputSize)
+
+        const quality = 0.65 // 进一步降低压缩质量
+        if (canvas.toBlob) {
+          canvas.toBlob((blob) => {
+            this.tempBlobUrl = URL.createObjectURL(blob)
+            // 清空原图img内存缓冲区
+            img.src = ''
+            this.handleCropResult(this.tempBlobUrl)
+          }, 'image/jpeg', quality)
+        } else {
+          const jpgBase64 = canvas.toDataURL('image/jpeg', quality)
+          const arr = jpgBase64.split(',')
+          const byteStr = atob(arr[1])
+          const byteArr = new Uint8Array([...byteStr].map(c => c.charCodeAt(0)))
+          const blob = new Blob([byteArr], { type: 'image/jpeg' })
+          this.tempBlobUrl = URL.createObjectURL(blob)
+          img.src = ''
+          this.handleCropResult(this.tempBlobUrl)
+        }
+      }
+      img.onerror = () => {
         uni.hideLoading()
-        
+        uni.showToast({ title: '裁剪失败', icon: 'none' })
+      }
+    },
+    //
+    cropImageMiniProgram() {
+      uni.getImageInfo({
+        src: this.imageSrc,
+        success: (imgInfo) => {
+          const boxInImageX = this.cropBox.x - this.imageOffsetX
+          const boxInImageY = this.cropBox.y - this.imageOffsetY
+          const cropX = boxInImageX / this.scale
+          const cropY = boxInImageY / this.scale
+          const cropSize = this.cropBox.size / this.scale
+
+          // 确保裁剪区域不超出原图边界
+          const actualCropX = Math.max(0, Math.min(cropX, imgInfo.width - 1))
+          const actualCropY = Math.max(0, Math.min(cropY, imgInfo.height - 1))
+          const maxCropSize = Math.min(
+            cropSize,
+            imgInfo.width - actualCropX,
+            imgInfo.height - actualCropY
+          )
+          const actualCropSize = Math.max(1, maxCropSize)
+
+          // 输出尺寸等于实际裁剪区域大小,不填充,保持正方形
+          const outputSize = Math.min(Math.floor(cropSize), 200)
+
+          const ctx = uni.createCanvasContext('cropCanvas')
+          ctx.clearRect(0, 0, 200, 200)
+          ctx.drawImage(
+            this.imageSrc,
+            cropX,      // 直接使用,不再调整
+            cropY,      // 直接使用,不再调整
+            cropSize,
+            cropSize,
+            0,
+            0,
+            outputSize,
+            outputSize
+          )
+          ctx.draw(false, () => {
+            uni.canvasToTempFilePath({
+              canvasId: 'cropCanvas',
+              x: 0,
+              y: 0,
+              width: outputSize,
+              height: outputSize,
+              fileType: 'jpeg',
+              quality: 0.8,
+              success: (res) => {
+                this.handleCropResult(res.tempFilePath)
+              },
+              fail: (err) => {
+                uni.hideLoading()
+                console.error('canvas导出失败', err)
+                uni.showToast({ title: '裁剪导出图片失败', icon: 'none' })
+              }
+            })
+          })
+        },
+        fail: () => {
+          uni.hideLoading()
+          uni.showToast({ title: '读取原图失败', icon: 'none' })
+        }
+      })
+    },
+    // 裁剪完成统一入口:先上传,成功再回传页面
+    async handleCropResult(tempFilePath) {
+      try {
+        // 执行上传
+        const obj = await this.uploadCropImage(tempFilePath)
+        console.log('obj', obj)
         // 更新上一页数据
         const pages = getCurrentPages()
         if (pages.length >= 2) {
           const prevPage = pages[pages.length - 2]
           if (prevPage && prevPage.$data && prevPage.$data.baseInfo) {
-            prevPage.$data.baseInfo.portraitPhoto = croppedImage
+            prevPage.$data.baseInfo.portraitPhotoList = [{
+              url: obj.fullImgUrl,
+              //fileUrl: obj.fileUrl,
+              contentType: 'image/jpeg',
+              type: 'jpg',
+              size: obj.size
+            }]
           }
         }
-        
-        uni.$emit('cropSuccess', croppedImage)
         uni.navigateBack()
+        // 上传成功再返回线上地址给上一页
+        uni.$emit('cropSuccess', uploadUrl)
+        uni.navigateBack()
+      } catch (err) {
+        uni.hideLoading()
+        uni.showToast({ title: err.message || '上传失败', icon: 'none' })
+      }
+    },
+    async getImageFileInfo(tempPath) {
+      const sysInfo = uni.getSystemInfoSync()
+      const isH5 = sysInfo.platform === 'h5'
+
+      if (isH5 && tempPath.startsWith('blob:')) {
+        // H5 微信服务号:从blob读取
+        const res = await fetch(tempPath)
+        const blob = await res.blob()
+        const size = blob.size
+        const type = blob.type || 'image/png'
+        const format = type.split('/')[1]
+        return {
+          size,
+          kb: (size / 1024).toFixed(2),
+          mb: (size / 1024 / 1024).toFixed(3),
+          type,
+          format
+        }
+      } else {
+        // 小程序:uni.getFileInfo 读取本地临时文件
+        return new Promise((resolve, reject) => {
+          uni.getFileInfo({
+            filePath: tempPath,
+            success: async (res) => {
+              // 小程序无直接type,通过图片后缀判断
+              let format = 'png'
+              if (tempPath.includes('.jpg') || tempPath.includes('.jpeg')) format = 'jpeg'
+              if (tempPath.includes('.webp')) format = 'webp'
+              const type = `image/${format}`
+              const size = res.size
+              resolve({
+                size,
+                kb: (size / 1024).toFixed(2),
+                mb: (size / 1024 / 1024).toFixed(3),
+                type,
+                format
+              })
+            },
+            fail: reject
+          })
+        })
+      }
+    },
+    // 格式化文件大小
+    formatFileSize(bytes) {
+      if (bytes === 0) return '0 B'
+      const k = 1024
+      const sizes = ['B', 'KB', 'MB', 'GB']
+      const i = Math.floor(Math.log(bytes) / Math.log(k))
+      return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
+    },
+    // 【核心修复】完整上传函数,返回线上图片地址
+    async uploadCropImage(tempFilePath) {
+      const token = uni.getStorageSync('access-token')
+      if (!token) throw new Error('登录失效,请重新登录')
+      const headers = { Authorization: `tf: ${token}` }
+      const sysInfo = uni.getSystemInfoSync()
+      const isH5 = sysInfo.platform === 'h5'
+      let uploadResult = null
+
+      const imgInfo = await this.getImageFileInfo(tempFilePath)
+      console.log('裁剪图片完整信息:', imgInfo)
+      // 弹窗展示大小、格式
+      // uni.showToast({
+      //   title: `大小${imgInfo.kb}KB ${imgInfo.format}`,
+      //   icon: 'none',
+      //   duration: 1800
+      // })
+
+      // 分支1:H5 微信服务号 blob 上传
+      if (isH5 && tempFilePath.startsWith('blob:')) {
+        const resBlob = await fetch(tempFilePath)
+        const blob = await resBlob.blob()
+        const size = blob.size
+        console.log('裁剪图片大小', size, this.formatFileSize(size))
+        const formData = new FormData()
+        formData.append('file', blob, 'crop_avatar.jpg')
+        formData.append('biz', 'temp')
+        const resp = await fetch(`${baseUrl}/common/uploads`, {
+          method: 'POST',
+          headers,
+          body: formData
+        })
+        console.log('formData', formData)
+        uploadResult = await resp.json()
+
+      } else {
+        // 分支2:微信小程序 补充完整uni.uploadFile逻辑(原代码缺失)
+        uploadResult = await new Promise((resolve, reject) => {
+          uni.uploadFile({
+            url: `${baseUrl}/common/uploads`,
+            filePath: tempFilePath,
+            name: 'file',
+            header: headers,
+            formData: { biz: 'temp' },
+            success: (res) => resolve(JSON.parse(res.data)),
+            fail: reject
+          })
+        })
       }
 
-      img.onerror = () => {
-        uni.hideLoading()
-        uni.showToast({ title: '裁剪失败', icon: 'none' })
-        uni.navigateBack()
+      //console.log('上传结果', uploadResult)
+
+      // 校验后端返回
+      if (!uploadResult || uploadResult.code !== 200) {
+        throw new Error(uploadResult?.msg || '接口返回失败')
       }
+      // 拼接完整线上图片地址
+      const fullImgUrl = `${baseUrl}/${uploadResult.url.replace(/^\//, '')}`
+      return { fileUrl: uploadResult.url, size: imgInfo.size, fullImgUrl: fullImgUrl }
     }
   }
 }
@@ -403,8 +592,14 @@ export default {
   font-size: 32rpx;
   padding: 10rpx 20rpx;
 
-  &.cancel { color: #999; }
-  &.confirm { color: #4CAF50; font-weight: bold; }
+  &.cancel {
+    color: #999;
+  }
+
+  &.confirm {
+    color: #4CAF50;
+    font-weight: bold;
+  }
 }
 
 .header-title {
@@ -417,64 +612,134 @@ export default {
   flex: 1;
   position: relative;
   overflow: hidden;
-}
 
-.original-image {
-  width: 100%;
-  height: 100%;
-}
+  .original-image {
+    width: 100%;
+    height: 100%;
+  }
 
-.crop-mask {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: rgba(0, 0, 0, 0.7);
-}
+  // 裁剪用canvas(隐藏)
+  .crop-canvas {
+    position: absolute;
+    width: 200px;
+    height: 200px;
+    opacity: 0;
+    pointer-events: none;
+  }
 
-.crop-box {
-  position: absolute;
-  border: 2px solid #fff;
-  box-sizing: border-box;
-  z-index: 10;
-  cursor: move;
-  touch-action: none;
-  user-select: none;
+  // 四块半透明遮罩,框外变暗
+  .mask-top,
+  .mask-bottom,
+  .mask-left,
+  .mask-right {
+    position: absolute;
+    background: rgba(0, 0, 0, 0.7);
+    z-index: 5;
+  }
 
-  .grid-lines {
-    width: 100%;
-    height: 100%;
-    position: relative;
+  .mask-top {
+    left: 0;
+    right: 0;
+    top: 0;
+  }
 
-    .grid-line {
-      position: absolute;
-      background: rgba(255, 255, 255, 0.5);
+  .mask-bottom {
+    left: 0;
+    right: 0;
+  }
 
-      &.horizontal {
-        width: 100%; height: 1px; top: 33.33%;
-        &:nth-child(2) { top: 66.66%; }
-      }
+  .mask-left {
+    left: 0;
+  }
 
-      &.vertical {
-        width: 1px; height: 100%; left: 33.33%;
-        &:nth-child(4) { left: 66.66%; }
-      }
-    }
+  .mask-right {
+    right: 0;
   }
 
-  .corner-tl, .corner-tr, .corner-bl, .corner-br {
+  .crop-box {
     position: absolute;
-    width: 30rpx;
-    height: 30rpx;
-    border: 3px solid #fff;
-    background: #333;
-    cursor: nwse-resize;
-  }
+    border: 2px solid #fff;
+    box-sizing: border-box;
+    z-index: 10;
+    cursor: move;
+    touch-action: none;
+    user-select: none;
+    background: transparent;
+    filter: brightness(1.08); // 轻微提亮框内图片,增强高亮对比
+
+    .grid-lines {
+      width: 100%;
+      height: 100%;
+      position: relative;
+
+      .grid-line {
+        position: absolute;
+        background: rgba(255, 255, 255, 0.5);
+
+        &.horizontal {
+          width: 100%;
+          height: 1px;
+          top: 33.33%;
+
+          &:nth-child(2) {
+            top: 66.66%;
+          }
+        }
+
+        &.vertical {
+          width: 1px;
+          height: 100%;
+          left: 33.33%;
 
-  .corner-tl { top: -15rpx; left: -15rpx; border-right: none; border-bottom: none; }
-  .corner-tr { top: -15rpx; right: -15rpx; border-left: none; border-bottom: none; cursor: nesw-resize; }
-  .corner-bl { bottom: -15rpx; left: -15rpx; border-right: none; border-top: none; cursor: nesw-resize; }
-  .corner-br { bottom: -15rpx; right: -15rpx; border-left: none; border-top: none; }
+          &:nth-child(4) {
+            left: 66.66%;
+          }
+        }
+      }
+    }
+
+    .corner-tl,
+    .corner-tr,
+    .corner-bl,
+    .corner-br {
+      position: absolute;
+      width: 30rpx;
+      height: 30rpx;
+      border: 3px solid #fff;
+      background: #333;
+    }
+
+    .corner-tl {
+      top: -15rpx;
+      left: -15rpx;
+      border-right: none;
+      border-bottom: none;
+      cursor: nwse-resize;
+    }
+
+    .corner-tr {
+      top: -15rpx;
+      right: -15rpx;
+      border-left: none;
+      border-bottom: none;
+      cursor: nesw-resize;
+    }
+
+    .corner-bl {
+      bottom: -15rpx;
+      left: -15rpx;
+      border-right: none;
+      border-top: none;
+      cursor: nesw-resize;
+    }
+
+    .corner-br {
+      bottom: -15rpx;
+      right: -15rpx;
+      border-left: none;
+      border-top: none;
+      cursor: nwse-resize;
+    }
+  }
 }
 </style>

+ 67 - 21
src/pages/join/idCardEdit.vue

@@ -18,7 +18,7 @@
 
                     </Upload>
                     <view class="options">
-                        <view style="display: flex;align-items: center;">
+                        <view style="display: flex;align-items: center;" @tap="delectImg('idCardFront')">
                             <image src="/static/login/deleteIcon.png" style="width: 24rpx; height: 24rpx;"
                                 mode="widthFix">
                             </image>
@@ -33,37 +33,51 @@
                             </image>
                             <view class="options-text">查看</view>
                         </view>
-
-
-
                     </view>
                     <view class="up-text">身份证人像面</view>
                 </view>
 
-                <view style="width: 334rpx;height: 264rpx;">
-                    <Upload name="idCardBack" width="187rpx" height="220rpx" :maxCount="1"
+                <view style="width: 334rpx;height: 204rpx;position: relative;">
+                    <Upload name="idCardFront" width="334rpx" height="210rpx" :maxCount="1"
                         @fileList="onUpload($event, 'idCardBack')" :fileList="idCardBack">
                         <view class="upload-block" slot="content">
+
                             <view class="icon-bg">
                                 <image src="/static/login/cameraIcon.png" mode="widthFix" width="54.64rpx"
                                     height="52rpx">
                                 </image>
                                 <!-- <u-icon name="camera-fill" color="#fff" size="20"></u-icon> -->
                             </view>
+
                         </view>
-                    </Upload>
 
-                    <view class="up-text">身份证国徽面</view>
-                </view>
+                    </Upload>
+                    <view class="options">
+                        <view style="display: flex;align-items: center;" @tap="delectImg('idCardBack')">
+                            <image src="/static/login/deleteIcon.png" style="width: 24rpx; height: 24rpx;"
+                                mode="widthFix">
+                            </image>
 
+                            <view class="options-text">删除</view>
+                        </view>
 
+                        <view style="height: 32rpx;border: 0.5rpx solid #FFFFFF;"></view>
+                        <view style="display: flex;align-items: center;">
+                            <image src="/static/login/lookGigIcon.png" style="width: 24rpx; height: 24rpx;"
+                                mode="widthFix">
+                            </image>
+                            <view class="options-text">查看</view>
+                        </view>
+                    </view>
 
+                    <view class="up-text">身份证国徽面</view>
+                </view>
             </view>
 
-            <view style="width: 334rpx;height: 284rpx;">
-                <Upload name="idCardBack" width="187rpx" height="220rpx" :maxCount="1"
+            <view style="width: 334rpx;height: 264rpx;position: relative;">
+                <Upload name="idCardBack" width="334rpx" height="210rpx" :maxCount="1"
                     @fileList="onUpload($event, 'idCardHand')" :fileList="idCardHand">
-                    <view class="upload-block  full-width" slot="content">
+                    <view class="upload-block" slot="content">
                         <view class="icon-bg">
                             <image src="/static/login/cameraIcon.png" mode="widthFix" width="54.64rpx" height="52rpx">
                             </image>
@@ -71,6 +85,23 @@
                         </view>
                     </view>
                 </Upload>
+                <view class="options">
+                        <view style="display: flex;align-items: center;" @tap="delectImg('idCardHand')">
+                            <image src="/static/login/deleteIcon.png" style="width: 24rpx; height: 24rpx;"
+                                mode="widthFix">
+                            </image>
+
+                            <view class="options-text">删除</view>
+                        </view>
+
+                        <view style="height: 32rpx;border: 0.5rpx solid #FFFFFF;"></view>
+                        <view style="display: flex;align-items: center;">
+                            <image src="/static/login/lookGigIcon.png" style="width: 24rpx; height: 24rpx;"
+                                mode="widthFix">
+                            </image>
+                            <view class="options-text">查看</view>
+                        </view>
+                    </view>
 
                 <view class="up-text">手持身份证照片</view>
             </view>
@@ -118,9 +149,10 @@ export default {
         if (query.fieldName) this.fieldName = query.fieldName
         if (query.fieldVal) {
             let fieldVal = JSON.parse(query.fieldVal)
-            this.idCardFront = fieldVal[0] ? [fieldVal[0]] : []
-            this.idCardBack = fieldVal[1] ? [fieldVal[1]] : []
-            this.idCardHand = fieldVal[2] ? [fieldVal[2]] : []
+            console.log(fieldVal, 'query')
+            this.idCardFront = fieldVal[0] ? fieldVal[0] : []
+            this.idCardBack = fieldVal[1] ? fieldVal[1]: []
+            this.idCardHand = fieldVal[2] ? fieldVal[2] : []
         }
 
         // console.log(this.fileList, 'query')
@@ -134,7 +166,17 @@ export default {
     onShow() {
     },
     methods: {
-
+        delectImg(t) {
+            uni.showModal({
+                title: '提示',
+                content: '是否要删除此照片',
+                success: res => {
+                    if (res.confirm) {
+                        this[t] = [];
+                    }
+                },
+            })
+        },
         // upload事件
         onUpload(e, t) {
             this[t] = e;
@@ -149,7 +191,7 @@ export default {
             // 上一页实例
             const prevPage = pages[pages.length - 2]
             // 直接修改上一页data里的字段
-            prevPage.$data.baseInfo[this.fieldName] = [...this.idCardFront, ...this.idCardBack, ...this.idCardHand]
+            prevPage.$data.baseInfo[this.fieldName] = [this.idCardFront, this.idCardBack, this.idCardHand]
             uni.navigateBack()
         }
 
@@ -223,10 +265,7 @@ export default {
     position: relative;
     overflow: hidden;
 
-    &.full-width {
-        width: 100%;
-        height: 240rpx;
-    }
+   
 
     .icon-bg {
         width: 60rpx;
@@ -240,4 +279,11 @@ export default {
 
 
 }
+
+
+::v-deep .u-upload__deletable {
+    display: none;
+    
+}
+
 </style>

+ 11 - 0
src/pages/join/introduceYourselfEdit.vue

@@ -42,10 +42,21 @@ export default {
         onSubmit() {
             // 获取页面栈
             const pages = getCurrentPages()
+            // 至少要有上一页才执行
+            if (pages.length < 2) {
+                uni.navigateBack()
+                return
+            }
             // 上一页实例
             const prevPage = pages[pages.length - 2]
+            // 再校验页面实例是否存在
+            if (!prevPage) {
+                uni.navigateBack()
+                return
+            }
             // 直接修改上一页data里的字段
             prevPage.$data.baseInfo.introduceYourself = this.value
+            console.log(prevPage.$data.baseInfo, 'prevPage.$data.baseInfo.introduceYourself')
             uni.navigateBack()
         }
 

+ 164 - 10
src/pages/join/lifePhotosEdit.vue

@@ -2,7 +2,7 @@
     <view class="lifePhotosEdit">
         <view class="u-cell-group">
             <!-- <Upload :maxCount="1" @fileList="onUpload($event, 'cImgList')" /> -->
-            <Upload :accept="title == '宣传视频' ? 'video' : 'image'" :maxCount="maxCount" :width="78" :height="78"
+            <Upload v-if="title != '宣传视频'" :accept="title == '宣传视频' ? 'video' : 'image'" :maxCount="maxCount" :width="76" :height="76"
                 @fileList="onUpload" :fileList="fileList">
                 <view class="upload-block" slot="content">
 
@@ -15,6 +15,34 @@
 
                 </view>
             </Upload>
+            <view v-if="title == '宣传视频'" class="media-area">
+                    <view v-if="videoUrl">
+                        <view class="icon iconfont icon-cuo">
+                            <image src="/static/login/close2.png" mode="" style="width: 32rpx;height: 32rpx;"
+                                @tap="delectVideo">
+                            </image>
+                        </view>
+                        <video ref="myVideo" :src="videoUrl" class="video-container" controls></video>
+                    </view>
+                    <clUpload v-else :fileList="fileList" :action="uploadApi" :headers="headers" :count="maxCount"
+                        :listStyle="{
+                            columnGap: '20rpx',
+                            rowGap: '20rpx',
+                            width: '130rpx',
+                            radius: '12rpx',
+                        }" :imageFormData="{
+                            count: 9,
+                            size: 2,
+                        }" :videoFromData="{
+                            count: 1,
+                            size: 50,
+                        }" :maxVideo="1" :fileType="mediaType" addImg="/static/login/cameraIcon.png"
+                        deleteImg="/static/login/cameraIcon.png" @onSuccess="onSuccess"
+                        @onMediaTypeSelect="selectMediaType('video')" @onError="onCancel">
+
+
+                    </clUpload>
+                </view>
 
             <view class="tagText" v-if="title == '生活照'">简单介绍自己的生活照,可以说说自己的基本信息,工作场景,等等;
                 或者上传自己清晰露脸半身照/全身照/工作照。最多上传{{ maxCount }}张</view>
@@ -40,31 +68,49 @@
 </template>
 
 <script>
-
+import clUpload from '@/components/cl-upload/cl-upload/cl-upload.vue'
 import Upload from '@/components/upload/index.vue';
+import { baseUrl } from '@/common/config.js'
 
 export default {
-    components: { Upload },
+    components: { Upload,clUpload },
+    
     data() {
         return {
+            headers: {
+                Authorization: `tf: ${uni.getStorageSync('access-token')}`,
+            },
+            videoCoverUrl: '',
+            videoUrl: '',
             fileList: [],
             fieldName: '',
-            maxCount: 9,
             title: '',
-            img: '/static/login/cameraIcon.png'
+            img: '/static/login/cameraIcon.png',
+            mediaType: 'all', // 默认为图片模式,上传第一个文件后确定类型
+            uploadApi: baseUrl + '/common/upload', // 默认使用图片上传接口
         }
     },
+    computed: {
+        maxCount() {
+            return this.mediaType === 'video' ? 1 : 9
+        },
+    },
 
     onLoad(query) {
         console.log(query)
         if (query.fieldName) this.fieldName = query.fieldName
-        if (query.fieldVal) this.fileList = JSON.parse(query.fieldVal)
+        if (query.fieldVal) {
+            this.fileList = JSON.parse(query.fieldVal)
+            
+            if(this.fileList.length > 0 && this.fileList[0].type) {
+                if(this.fileList[0].type.includes('video')) {
+                    this.videoUrl = this.fileList[0].url
+                    this.videoCoverUrl =  this.fileList[0].coverUrl
+                } 
+            }
+        }
         if (query.maxlength) this.maxlength = Number(query.maxlength)
         if (query.title) this.title = query.title
-        // console.log(this.fileList, 'query')
-        // console.log(this.fileList, 'query')
-        // console.log(this.maxlength, 'query')
-        // console.log(this.title, 'query')
     },
     onReady() {
         // 页面渲染完成后再设置标题
@@ -75,15 +121,72 @@ export default {
     onShow() {
     },
     methods: {
+        onSuccess(reslut,tempFile) {
+            console.log(reslut,tempFile)
+            // 把服务端返回的图片地址添加到list中与组件数据同步
+            if (reslut.code === 200) {
+                const isVideo =
+                    reslut.url.endsWith('.mp4') ||
+                    reslut.url.endsWith('.mov') ||
+                    reslut.url.endsWith('.mkv') ||
+                    reslut.url.endsWith('.wmv')
+                if (isVideo) {
+                    this.videoUrl = baseUrl + reslut.url
+                    this.videoCoverUrl = baseUrl + reslut.coverUrl
+                    this.fileList=[{
+                       url: baseUrl + reslut.url,
+                       type: tempFile.tempFile.type,
+                       size: tempFile.size,
+                       coverUrl: baseUrl + reslut.coverUrl,
+                    }]
+                } else {
+                    this.fileList.push(baseUrl + reslut.url)
+                }
+            } else {
+                this.mediaType = 'all'
+            }
+        },
+        delectVideo() {
+            uni.showModal({
+                title: '提示',
+                content: '是否要删除此视频',
+                success: res => {
+                    if (res.confirm) {
+                        this.videoUrl = ''
+                        this.videoCoverUrl = ''
+                        // 重置媒体类型
+                        this.mediaType = 'all'
+                    }
+                },
+            })
+        },
+        // 确定媒体类型
+        selectMediaType(type) {
+            if (type === 'image') {
+                this.uploadApi = baseUrl + '/common/uploads'
+                this.mediaType = 'image'
+            } else if (type === 'video') {
+                this.uploadApi = baseUrl + '/common/uploadVi'
+                this.mediaType = 'video'
+            }
+            console.log(this.mediaType, 'mediaType')
+        },
+        // 处理媒体类型取消事件
+        onCancel() {
+            this.uploadApi = baseUrl + '/common/uploads'
+            this.mediaType = 'all'
+        },
 
         // upload事件
         onUpload(e) {
+            console.log(e,'6666')
             this.fileList = e
         },
         goBack() {
             uni.navigateBack()
         },
         onSubmit() {
+            console.log(this.fileList, 'fileList')
             // 获取页面栈
             const pages = getCurrentPages()
             // 至少要有上一页才执行
@@ -99,6 +202,8 @@ export default {
                 return
             }
             // 直接修改上一页data里的字段
+            console.log(this.fileList, 'fileList')
+            console.log(this.fieldName, 'fieldName')
             prevPage.$data.baseInfo[this.fieldName] = this.fileList
             uni.navigateBack()
         }
@@ -154,4 +259,53 @@ export default {
         }
     }
 }
+::v-deep .u-upload__success {
+    display: none;
+}
+
+::v-deep .u-upload__wrap__preview__image {
+    border-radius: 12rpx !important;
+}
+
+::v-deep .u-upload__deletable {
+    border-top-right-radius: 12rpx;
+    border-bottom-left-radius: 12rpx;
+    
+}
+
+::v-deep .u-upload__deletable__icon {
+    position: static !important;
+    -webkit-transform: scale(0.8) !important;
+
+}
+
+.media-area {
+    margin: 20rpx 0 20rpx;
+    justify-content: space-between;
+    position: relative;
+    width: 340upx;
+    height: 240upx;
+
+    .icon-cuo {
+        width: 40rpx;
+        height: 40rpx;
+        position: absolute;
+        right: 0;
+        top: 0;
+        color: #ffffff !important;
+        z-index: 999;
+        border-bottom-left-radius: 12rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+
+
+
+    .video-container {
+        width: 340upx;
+        height: 240upx;
+        border-radius: 12rpx;
+    }
+}
 </style>

+ 339 - 166
src/pages/join/staff.vue

@@ -3,15 +3,15 @@
 		<view class="banner">
 			<image src="/static/login/banner.png" mode=""></image>
 		</view>
-		<view class="top">
-			<view v-if="ShopInfo.merchant.auditStatus == 1 || ShopInfo.merchant.auditStatus == 2" class="checkBox"
+		<view class="top" v-if="ShopInfo.merchant">
+			<view v-if="ShopInfo.merchant.auditStatus == 1 || ShopInfo.merchant.auditStatus == 3" class="checkBox"
 				:style="{
-					borderColor: ShopInfo.merchant.auditStatus == 1 ? '#F76560' : '#FF7D00',
-					color: ShopInfo.merchant.auditStatus === 1 ? '#F53F3F' : '#FF7D00',
-					background: ShopInfo.merchant.auditStatus === 1 ? '#FFF5F5' : '#FFF8EC'
+					borderColor: ShopInfo.merchant.auditStatus == 3 ? '#F76560' : '#FF7D00',
+					color: ShopInfo.merchant.auditStatus === 3 ? '#F53F3F' : '#FF7D00',
+					background: ShopInfo.merchant.auditStatus === 3 ? '#FFF5F5' : '#FFF8EC'
 				}">
 				<view class="checkStatus">审核中</view>
-				<view class="text">入驻审核中,审核结果将会在9个工作日通知您</view>
+				<view class="text">入驻审核中,审核结果将会在X-X个工作日通知您</view>
 			</view>
 			<view class="title">
 				<view class="lineIcon">
@@ -34,7 +34,10 @@
 				</view>
 				<view class="input-box service">
 					<view class="label">性别</view>
-					<u-radio-group v-model="form.teSex" :disabled="ShopInfo.merchant.auditStatus == 1 ? true : false">
+					<view class="valueText" v-if="ShopInfo.merchant.auditStatus == 1">{{ form.teSex == '1' ? '男' : '女'
+					}}
+					</view>
+					<u-radio-group v-if="ShopInfo.merchant.auditStatus != 1" v-model="form.teSex">
 						<u-radio activeColor="#333335" v-for="(item, index) in sex" :key="index" :name="item.value"
 							:label="item.label" :customStyle="{ margin: '0 12rpx' }" />
 					</u-radio-group>
@@ -63,7 +66,12 @@
 							</view>
 						</template>
 					</u-input>
-					<view class="code-btn" :class="{ disabled: !canGetCode }" @click="getCode">
+					<!-- <view class="code-btn" :class="{ disabled: !canGetCode }">
+						<text v-if="startCountdownFlag">{{ countdown }}s</text>
+						<text @click="agginGetCode">重新获取</text>
+
+					</view> -->
+					<view class="code-btn" :class="{ disabled: !canGetCode }">
 						<text v-if="!CodeSendNum" @click="getCode">发送验证码</text>
 						<view v-else>
 							<text v-if="startCountdownFlag">{{ countdown }}s</text>
@@ -77,21 +85,29 @@
 				<view class="input-box">
 					<view class="label" style="width: 50%;">合作意向城市</view>
 					<view class="inp select" @click="ShopInfo.merchant.auditStatus == 1 ? show = false : show = true">
-						<view class="text" :style="{ color: form.provinceName ? '#4E5969' : '#C9CDD4' }">{{
-							form.provinceName || '选择城市' }}</view>
-						<img src="/static/login/arrowIcon.png" alt="" />
+						<view class="text" :style="{ color: form.partnerCities ? '#4E5969' : '#C9CDD4' }">{{
+							form.partnerCities || '选择城市' }}</view>
+						<img v-show="ShopInfo.merchant.auditStatus == 1 ? false : true"
+							src="/static/login/arrowIcon.png" alt="" />
 					</view>
 
 					<u-popup :show="show" mode="bottom" border-radius="16rpx 16rpx 0 0"
 						:style="{ height: '600rpx', zIndex: 9999, }">
 
-						<u-picker :show="show" confirmColor="#fff" title="合作意向城市" :columns="[cityList]" keyName="label"
-							:style="{ zIndex: 0, }" @confirm="onSelect" @cancel="cancel"></u-picker>
+						<!-- 省 / 市 二级联动 -->
+						<u-picker :key="pickerKey" :defaultIndex="defaultCityIndex" :show="show" ref="uPicker"
+							confirmColor="#fff" title="合作意向城市" keyName="name" :columns="cityColumns"
+							:style="{ zIndex: 0, }" @confirm="onSelect" @change="changeHandler"
+							@cancel="show = false"></u-picker>
+
 					</u-popup>
 				</view>
 				<view class="input-box service">
 					<view class="label">开通服务</view>
-					<u-radio-group v-model="form.openService" :disabled="ShopInfo.merchant.auditStatus == 1 ? true : false">
+					<view class="valueText" v-if="ShopInfo.merchant.auditStatus == 1">{{
+						serveArr.find(item => item.dictValue == form.serviceTag).dictLabel}}</view>
+					<u-radio-group v-if="ShopInfo.merchant.auditStatus != 1" v-model="form.serviceTag"
+						:disabled="ShopInfo.merchant.auditStatus == 1 ? true : false">
 						<u-radio activeColor="#333335" v-for="(item, index) in serveArr" :key="index"
 							:name="item.dictValue" :label="item.dictLabel" :customStyle="{ fontSize: '20rpx' }" />
 					</u-radio-group>
@@ -102,8 +118,7 @@
 
 					<view class="images">
 						<Upload :disabled="ShopInfo.merchant.auditStatus == 1 ? true : false" :maxCount="2"
-							:fileList="avatarList" @fileList="onUpload($event)"
-							 />
+							:fileList="avatarList" @fileList="onUpload($event)" />
 					</view>
 					<view class="title">
 						请上传本人2张近期照片,图片大小不超过2M(建议清晰正脸照)
@@ -142,7 +157,6 @@
 			</view>
 		</view>
 
-
 		<!-- 图形验证码弹窗 -->
 		<u-popup :show="showCaptcha" mode="center" border-radius="12">
 			<view class="captcha-box">
@@ -153,31 +167,34 @@
 				</view>
 				<view style="padding: 0 48rpx;margin-top: 48rpx;">
 					<view
-						style="display: flex;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
+						style="display: flex;align-items: center;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
 
 						<!-- 验证码输入框,唤起全字符键盘 -->
 						<u-input v-model="imgCode" placeholder="请输入图形验证码" :focus="showCaptcha" type="text" maxlength="4"
 							border="none"
 							placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;"></u-input>
 						<!-- 图形验证码图片,点击刷新 -->
+						<!-- <img :src="captchaImg" @click="getCode" class="register-code-img"/> -->
 						<image :src="captchaImg" @click="refreshCaptcha" class="captcha-img"></image>
 					</view>
-					<view class="text">看不清? 换一张</view>
+					<view class="text" @click="getCaptcha">看不清? 换一张</view>
 					<u-button class="submitImgCode" @click="submitImgCode" block>确定</u-button>
 
 				</view>
 			</view>
 		</u-popup>
+
+
 	</view>
 </template>
 
 <script>
 
 import {
-	getCityList, technicianApply, sendMsg, getServiceCategoryList, getTechnician
+	technicianApply, sendMsg, getServiceCategoryList
 } from '@/api/index';
 import {
-	captchaImage
+	captchaImage, getValidateCaptcha, provinceCityTree, regionList,
 } from '@/api/newLogin';
 
 import Upload from '@/components/upload/index.vue';
@@ -196,6 +213,7 @@ export default {
 	data() {
 		return {
 			//auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
+			defaultCityIndex: [0, 0],
 			status: 1,
 			imgCode: '',        // 用户填写的图形验证码
 			captchaImg: '',     // 图形验证码图片地址
@@ -212,11 +230,11 @@ export default {
 			isShow: false,
 			sex: [
 				{
-					value: 1,
+					value: '1',
 					label: '男'
 				},
 				{
-					value: 0,
+					value: '0',
 					label: '女'
 				}
 			],
@@ -233,41 +251,38 @@ export default {
 			avatarList: [],
 			CodeSendNum: 0,
 			form: {
+				partnerCities: '',
+				operationCenterId: '',
+				operationCenterName: '',
 				provinceCode: '',
 				provinceName: '',
 				cityCode: '',
 				cityName: '',
-				districtCode: '',
-				districtName: '',
 				cOpenid: uni.getStorageSync('wx_copenid'),
 				teName: '',
-				//cNickName: '',
-				//cPortrait: '',
 				tePhone: '',
 				phoneMsg: '',
-				//cJianjie: '',
 				teSex: null,
-				openService: null,
-				//cSfzImg: [],
+				serviceTag: null,
 				avatar: '',
-				//latitude: '',
-				//longitude: '',
-				//name: '0',
-				//cOpenId: '',
-				//cBhList: '',
-				//teAddress: ''
 			},
 			token: '',
 			uuid: '',
-			ShopInfo: {merchant:{auditStatus: 0}}
+			ShopInfo: { merchant: { auditStatus: 0 } },
+			cityColumns: [],
+			allCityList: [],
+			pickerKey: 1,
 		}
 	},
 	onLoad(options) {
-		console.log(options, '66666')
-		if (options.ShopInfo) this.ShopInfo = JSON.parse(options.ShopInfo)
-		console.log(this.ShopInfo, 'ShopInfo')
-		this.isLogin = !!uni.getStorageSync('access-token');
+		
+		if (options.merchantInfo) {
+			this.ShopInfo = JSON.parse(options.merchantInfo)
+			this.initForm()
+
+		}
 	},
+	
 	onShow() {
 		this.getServiceCategoryList()
 		this.getCity()
@@ -279,58 +294,171 @@ export default {
 		// this.form.city = uni.getStorageSync('selectCity')
 	},
 	methods: {
-		// upload事件
-		onUpload1(e, t) {
-			this.form[t] = e.map(item => item.url).join()
+		//赋值
+		initForm() {
+			Object.keys(this.form).forEach(key => {
+				if (this.ShopInfo.merchant.hasOwnProperty(key)) {
+					this.form[key] = this.ShopInfo.merchant[key].toString()
+				}
+			})
+			setTimeout(() => {
+				const provinceIndex = this.allCityList.findIndex(p => p.name === this.form.provinceName)
+				if (provinceIndex == -1) return
+				const cityIndex = this.allCityList[provinceIndex].children.findIndex(c => c.name === this.ShopInfo.merchant.cityName)
+				if (cityIndex == -1) return
+				const deptIndex = this.deptList.findIndex(c => c.name === this.ShopInfo.merchant.operationCenterName)
+				if (deptIndex == -1) return
+				this.defaultCityIndex = [provinceIndex, cityIndex, deptIndex]
+				this.form.partnerCities = this.ShopInfo.merchant.provinceName + '/' + this.ShopInfo.merchant.cityName + this.ShopInfo.merchant.operationCenterName
+
+			}, 300)
+
 		},
-		//查询商户信息 auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
-		getTechnicianFun() {
-			let openid = uni.getStorageSync('wx_copenid')
-			getTechnician({ openid: openid }).then(res => {
-				console.log(res)
-				if (res.data.code == 200) {
-					if (!res.data.result) return
-					this.ShopInfo = res.data.result
+		//获取城市
+		getCity() {
+			provinceCityTree().then(res => {
+				console.log(res, '获取城市')
+				this.allCityList = res.data.data
+				const provinces = res.data.data.map(p => ({ name: p.name, code: p.code }))
+				const cities = this.getCitiesByProvince(this.form.provinceName || provinces[0]?.name || '').map(c => ({ name: c.name, code: c.code }))
+
+				regionList({ parentCode: this.form.provinceCode || provinces[0].code, cityCode: this.form.cityCode || cities[0]?.code }).then(res => {
+					if (res.data.code == 200) {
+						this.deptList = res.data.data.map(c => ({ name: c.deptName, deptId: c.deptId, disabled: /^(0,)*0$/.test(c.ancestors) ? true : false }))
+						this.cityColumns = [provinces, cities, this.deptList]
 
-					if (res.data.result.auditStatus == -1) {
-						uni.navigateTo({
-							url: '/pages/join/staff'
-						})
-					} else if (res.data.result.auditStatus == 0) {
-						let str = uni.$u.queryParams(res.data.result)
-						uni.navigateTo({ url: `/pages/join/staff${str}` })
 					}
+				})
 
-				}
-			})
+
+			});
 		},
-		//图形验证码提交
-		submitImgCode() {
-			if (!this.imgCode) {
-				uni.showToast({
-					title: '请输入验证码',
-					icon: 'none'
+		getCitiesByProvince(provinceName) {
+			const province = this.allCityList.find(p => p.name === provinceName)
+			return province ? province.children : []
+		},
+		//滚动选择器
+		changeHandler(e) {
+			console.log(e, 'e')
+			const {
+				columnIndex,
+				value,
+				values, // values为当前变化列的数组内容
+				index,
+				// 微信小程序无法将picker实例传出来,只能通过ref操作
+				picker = this.$refs.uPicker
+			} = e
+			// 当第一列值发生变化时,变化第二列(后一列)对应的选项
+			if (columnIndex === 0) {
+				// picker为选择器this实例,变化第二列对应的选项
+				const provinceName = this.allCityList[index]?.name
+				const cities = this.getCitiesByProvince(provinceName).map(c => ({ name: c.name, code: c.code }))
+				picker.setColumnValues(1, cities)
+
+
+				const values = picker.getValues();
+				const parentCode = values[0]?.code
+				const cityCode = values[1]?.code
+				if (!parentCode || !cityCode) return
+				picker.setColumnValues(2, [])
+				regionList({ parentCode, cityCode }).then(res => {
+					if (res.data.code !== 200) return
+					// 给部门添加 disabled 禁用逻辑
+					const arr = res.data.data.map(c => ({
+						name: c.deptName,
+						deptId: c.deptId,
+						// 判断ancestors只有0则禁用
+						disabled: /^(0,)*0$/.test(c.ancestors) ? true : false
+					}))
+
+					picker.setColumnValues(2, arr)
+				}).catch(err => {
+					uni.showToast({ title: '加载部门失败', icon: 'none' })
 				})
-				return
+
 			}
-			sendMsg33333({ uuid: this.uuid, imgCode: this.imgCode }).then(res => {
-				console.log(res)
-				if (res.data.code == 200) {
-					this.showCaptcha = false
-					this.getCode()
+			// 2. 只有切换第二列时,才请求第三列部门数据
+			if (columnIndex === 1) {
+				const values = picker.getValues();
+				const parentCode = values[0]?.code
+				const cityCode = values[1]?.code
+				if (!parentCode || !cityCode) return
+				picker.setColumnValues(2, [])
+				regionList({ parentCode, cityCode }).then(res => {
+					if (res.data.code !== 200) return
+					// 给部门添加 disabled 禁用逻辑
+					const arr = res.data.data.map(c => ({
+						name: c.deptName,
+						deptId: c.deptId,
+						// 判断ancestors只有0则禁用
+						disabled: /^(0,)*0$/.test(c.ancestors) ? true : false
+					}))
+					picker.setColumnValues(2, arr)
+				}).catch(err => {
+					uni.showToast({ title: '加载部门失败', icon: 'none' })
+				})
+			}
+			// ==========关键:第三列滑动实时拦截==========
+			if (columnIndex === 2) {
+				const list = picker.getColumnValues(2)
+				const target = list[index]
+				// 如果当前项禁用,强制切回第0项
+				if (target.disabled) {
+					// 延迟回滚,防止滚动冲突
+					setTimeout(() => {
+						picker.setColumnIndex(2, 0)
+					}, 30)
+					uni.showToast({ title: '该部门不可选择', icon: 'none' })
 				}
+			}
 
 
-			})
+		},
+		// upload事件
+		onUpload1(e, t) {
+			this.form[t] = e.map(item => item.url).join()
+		},
+
+		//查询商户信息 auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
+		async checkMerchantStatus() {
+			const openid = uni.getStorageSync('wx_copenid')
+			const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+			if (!merchantInfo) return
+			this.ShopInfo = merchantInfo.merchant
+			if (merchantInfo.merchant.auditStatus == -1) {//未注册
+				this.initForm()
+				return
+
+			} else if (merchantInfo.merchant.auditStatus == 0 || merchantInfo.merchant.auditStatus == 1 || merchantInfo.merchant.auditStatus == 2 || merchantInfo.merchant.auditStatus == 3) {
+				if (merchantInfo.merchant.auditStatus == 0) { //待入驻
+					if (!this.$utils.checkLogin({ type: 'navigate' })) return;
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+					return
+				}
+				if (merchantInfo.merchantAuditFile.length) {//已有入驻信息
+					if (!this.$utils.checkLogin({ type: 'navigate' })) return;
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+					return
+
+				} else {//未入驻 注册阶段
+					this.initForm()
+				}
+			}
 
 		},
 
 
+
 		//查询开通服务接口
 		getServiceCategoryList() {
+			//console.log('查询开通服务接口')
 			getServiceCategoryList('service_tag').then(res => {
 				this.serveArr = res.data.data
-				console.log(this.serveArr)
+				//console.log(this.serveArr)
 			})
 		},
 		//重新获取验证码
@@ -350,48 +478,80 @@ export default {
 				})
 				return
 			}
+			this.getCaptcha()
+			this.imgCode = ''
+			this.showCaptcha = true
+
+		},
+		//获取图形验证码
+		getCaptcha() {
 			captchaImage().then(res => {
-				console.log(res)
+				if (this.showCaptcha) {
+					this.captchaImg = "data:image/gif;base64," + res.data.img;
+					this.uuid = res.data.uuid;
+				}
+			})
+		},
+		//图形验证码提交
+		submitImgCode() {
+			if (!this.imgCode) {
+				uni.showToast({
+					title: '请输入验证码',
+					icon: 'none'
+				})
+				return
+			}
+
+			getValidateCaptcha({ uuid: this.uuid, code: this.imgCode, phone: this.form.tePhone }).then(res => {
 				if (res.data.code == 200) {
-					this.uuid = res.data.uuid
+					this.showCaptcha = false
+					this.getCode()
+				} else {
+					this.imgCode = ''
+					uni.showToast({
+						title: res.data.message,
+						icon: 'none'
+					})
 				}
 			})
-			this.showCaptcha = true
+
 
 		},
-		//获取验证码
+		//获取手机验证码
 		getCode() {
+			if (!this.form.tePhone) {
+				uni.showToast({
+					title: '请输入手机号',
+					icon: 'none'
+				})
+				return
+			}
 
 			if (!/^1[3456789]\d{9}$/.test(this.form.tePhone)) {
 				uni.showToast({
 					title: '请输入正确的手机号',
 					icon: 'none'
-				});
-				return;
+				})
+				return
 			}
 			if (this.isSendingCode || this.countdown < 60) return
 
 			this.isSendingCode = true
 			sendMsg({ phone: this.form.tePhone }).then(res => {
-				console.log(res)
 				if (res.data.code == 200) {
 					uni.showToast({
 						title: '验证码已发送',
-						icon: 'none'
 					})
-					this.CodeSendNum = 1
-
 					this.startCountdown()
 					this.isSendingCode = false
+					this.CodeSendNum++
 				} else {
 					uni.showToast({
-						title: res.msg,
+						title: res.data.msg,
 						icon: 'none'
-					});
+					})
 				}
 
-
-
 			})
 
 
@@ -404,7 +564,7 @@ export default {
 				if (this.countdown <= 0) {
 					clearInterval(this.timer)
 					this.startCountdownFlag = false
-					//this.countdown = 60
+					this.countdown = 60
 					this.timer = null
 				}
 			}, 1000)
@@ -414,16 +574,11 @@ export default {
 		onUpload(e) {
 			this.avatarList = e;
 		},
-		
+
 		//提交
 		submit() {
 			console.log(this.avatarList, 'avatarList')
 			console.log(this.form)
-			// var openids = uni.getStorageSync('wx_copenid')
-			// this.form.cOpenId = openids
-			// this.form.cAddress =this.form.cAddress
-			// this.form.cSfzImg = this.idCard
-			// that.data.form.cBhList = that.data.form.cBhList.join(", ")
 			if (this.form.teName == '') {
 				uni.showToast({
 					title: '请输入您的姓名',
@@ -454,14 +609,14 @@ export default {
 				});
 				return
 			}
-			if (this.form.provinceName == '') {
+			if (this.form.partnerCities == '') {
 				uni.showToast({
 					title: '请选择城市',
 					icon: 'none'
 				});
 				return
 			}
-			if (!this.form.openService) {
+			if (!this.form.serviceTag) {
 				uni.showToast({
 					title: '请选择开通服务',
 					icon: 'none'
@@ -484,14 +639,14 @@ export default {
 					if (res.data.code == 200) {
 						uni.setStorageSync('wx_phone', this.form.tePhone)
 						uni.showToast({
-							title: res.data.message,
+							title: res.message,
 							icon: 'none'
 						})
-						this.getTechnicianFun()
+						this.checkMerchantStatus()
 
 					} else {
 						uni.showToast({
-							title: res.msg,
+							title: res.msg || res.message,
 							icon: 'none'
 						});
 					}
@@ -499,19 +654,7 @@ export default {
 
 			}
 		},
-		//获取城市
-		getCity() {
-			getCityList().then(res => {
-				console.log(res)
-				this.cityList = res.data.data.records.map(({
-					deptId,
-					deptName
-				}) => ({
-					value: deptId,
-					label: deptName
-				}))
-			});
-		},
+
 		selectCity() {
 			this.show = true
 		},
@@ -519,12 +662,24 @@ export default {
 			console.log('cancel')
 			this.show = false
 		},
+		//选择城市
 		onSelect(e) {
-			console.log(e)
 			if (!e.value[0]) return
-			this.form.provinceName = e.value[0].label
-			this.form.provinceCode = e.value[0].value
-			//this.form.deptId = e.value[0].value
+			const deptItem = e.value[2]
+			if (deptItem && deptItem.disabled) {
+				uni.showToast({
+					title: '该部门不可选,请选择其他部门',
+					icon: 'none'
+				})
+				return
+			}
+			this.form.partnerCities = e.value[0].name + '/' + e.value[1].name + deptItem.name
+			this.form.provinceName = e.value[0].name
+			this.form.provinceCode = e.value[0].code
+			this.form.cityName = e.value[1].name
+			this.form.cityCode = e.value[1].code
+			this.form.operationCenterId = deptItem.deptId
+			this.form.operationCenterName = deptItem.name
 			this.show = false
 		},
 		// goCity() {
@@ -557,6 +712,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+::v-deep .u-toolbar__title {
+	font-weight: 500;
+	font-size: 36rpx;
+	color: #1D2129;
+}
+
+::v-deep .u-picker__view__column__item {
+	font-weight: 400 !important;
+	font-size: 28rpx;
+	color: #1D2129
+}
+
 ::v-deep .u-upload__success {
 	display: none;
 }
@@ -622,53 +789,52 @@ export default {
 }
 
 .captcha-box {
-	width: 622rpx;
-	background: #FFFFFF;
-	border-radius: 32rpx 32rpx 32rpx 32rpx;
-
-	.captcha-title {
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		font-weight: 500;
-		font-size: 32rpx;
-		color: #333333;
-		text-align: center;
-		padding: 32rpx 0;
-		border-bottom: 1rpx solid #E7E7E7;
-
-	}
-
-	.captcha-img {
-		//width: 100%;
-		width: 200rpx;
-		height: 106rpx;
-	}
-
-	.submitImgCode {
-		width: 526rpx;
-		height: 80rpx;
-		background: linear-gradient(263deg, #45FFD7 0%, #7FFFBD 100%);
-		border-radius: 60rpx 60rpx 60rpx 60rpx;
-		margin-top: 48rpx;
-
-		font-weight: 500;
-		font-size: 32rpx;
-		color: #1D2129;
-		text-align: center;
-		margin-bottom: 48rpx;
-	}
-
-	.text {
-		margin-top: 12rpx;
-		font-weight: 400;
-		font-size: 28rpx;
-		color: #86909C;
-		text-align: right;
-
-	}
-
-	.u-input {}
+  width: 622rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+
+  .captcha-title {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #333333;
+    text-align: center;
+    padding: 32rpx 0;
+    border-bottom: 1rpx solid #E7E7E7;
+
+  }
+
+  .captcha-img {
+    //width: 100%;
+    width: 146rpx;
+    height: 60rpx;
+  }
+
+  .submitImgCode {
+    width: 526rpx;
+    height: 88rpx;
+    background: #333335;
+    border-radius: 60rpx 60rpx 60rpx 60rpx;
+    margin: 48rpx 0;
+
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #FFFFFF;
+    text-align: center;
+  }
+
+  .text {
+    margin-top: 12rpx;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #86909C;
+    text-align: right;
+
+  }
+
+  .u-input {}
 }
 
 .join {
@@ -765,7 +931,7 @@ export default {
 				.label {
 					font-weight: 400;
 					font-size: 30rpx;
-					color: #1D2129;
+					color: #291d1d;
 					text-align: left;
 				}
 
@@ -785,6 +951,13 @@ export default {
 					text-align: right;
 				}
 
+				.valueText {
+					font-weight: 400;
+					font-size: 30rpx;
+					color: #4E5969;
+					text-align: right;
+				}
+
 				.code-input {
 					margin-right: 42rpx;
 					border: 1px solid re;

+ 76 - 23
src/pages/my/dynamic/add_dynamic.vue

@@ -21,9 +21,9 @@
           width: '130rpx',
           radius: '12rpx',
         }" :imageFormData="{
-            count: 9,
-            size: 2,
-          }" :videoFromData="{
+          count: 9,
+          size: 2,
+        }" :videoFromData="{
             count: 1,
             size: 50,
           }" :maxVideo="1" :fileType="mediaType" addImg="/static/discover/ic_upload.png"
@@ -50,7 +50,7 @@
     </view>
     <view class="footer-bar">
       <u-button text="存为草稿" shape="circle" customStyle="height: 38px; font-size: 18px; margin-right: 20rpx;"
-        @click="cancel"></u-button>
+        @click="submit('draft')"></u-button>
       <u-button text="发布动态" color="linear-gradient(80deg,#02f6c1 0%,#07cdc4 100%)" shape="circle"
         customStyle="height: 38px; font-size: 18px;" @click="submit('publish')"></u-button>
     </view>
@@ -100,13 +100,14 @@
 
 <script>
 import { baseUrl } from '@/common/config.js'
-import { dynamicPublish, dynamicEdit, dynamicDetail } from '@/api/dynamic'
+import { dynamicPublish, dynamicDetail, draftList, dynamicEdit } from '@/api/dynamic'
 import clUpload from '@/components/cl-upload/cl-upload/cl-upload.vue'
 export default {
   components: { clUpload },
   data() {
     return {
-      popShow1: true,
+      draftObj: {},
+      popShow1: false,
       loading: false,
       showScopePicker: false,
       popShow: false,
@@ -118,10 +119,9 @@ export default {
         address: '',
         latitude: '',
         longitude: '',
-        visibleRange: '',
+        //visibleRange: '',
         videoUrl: '',
         videoCoverUrl: '',
-        imageUrls: [],
       },
       headers: {
         Authorization: `tf: ${uni.getStorageSync('access-token')}`,
@@ -140,19 +140,40 @@ export default {
   onLoad(options) {
     const { momentId, type } = options
     this.type = type
-    if (momentId) {
+    if (momentId) {//编辑
       this.getDynamicDetail(momentId)
+    } else {
+      this.draftDynamicListFun()
     }
+
   },
   methods: {
+    //获取草稿箱列表
+    draftDynamicListFun() {
+      draftList({
+        pageNum: 1,
+        pageSize: 10,
+      }).then(res => {
+        if (res.data.code === 200) {
+          if (res.data.data.records.length > 0) {
+            this.popShow1 = true
+          }
+          const data = res.data.data.records
+          this.draftObj = data
+        } else {
+          uni.showToast({ title: res.message || '获取草稿箱失败', icon: 'none' })
+        }
+      })
+
+    },
     // 获取动态详情
     async getDynamicDetail(id) {
       this.loading = true
       try {
         const params = {
           momentId: id,
-          latitude: uni.getStorageSync('latitude'),
-          longitude: uni.getStorageSync('longitude'),
+          // latitude: uni.getStorageSync('latitude'),
+          // longitude: uni.getStorageSync('longitude'),
         }
         const res = await dynamicDetail(params)
         if (res.data.code === 200) {
@@ -166,7 +187,6 @@ export default {
             address: data.address || '',
             latitude: data.latitude || '',
             longitude: data.longitude || '',
-            visibleRange: data.visibleRange === 1 ? '公开' : '',
           }
           this.formData = { ...this.formData, ...resData }
           // 回显媒体文件
@@ -234,7 +254,7 @@ export default {
         success: res => {
           if (res.confirm) {
             this.formData.videoUrl = ''
-            this.formData.videoCoverUrl = ''
+            //this.formData.videoCoverUrl = ''
             // 重置媒体类型
             this.mediaType = 'all'
           }
@@ -285,18 +305,53 @@ export default {
       }
     },
     //继续写
-    goOnFun(){
+    goOnFun() {
+      console.log(this.draftObj)
+      const data = this.draftObj[0]
+      // 回显表单数据
+      const resData = {
+        momentId: data.id,
+        title: data.title || '',
+        content: data.content || '',
+        location: data.location || '',
+        address: data.address || '',
+        latitude: data.latitude || '',
+        longitude: data.longitude || '',
+      }
+      this.formData = { ...this.formData, ...resData }
+      // 回显媒体文件
+      if (data.mediaList && data.mediaList.length > 0) {
+        const mediaType = data.mediaList[0].mediaType
+        if (mediaType === 1) {
+          // 图片类型
+          this.mediaType = 'image'
+          this.uploadApi = baseUrl + '/common/uploads'
+          this.fileList = data.mediaList.map(item => item.mediaUrl)
+        } else if (mediaType === 2) {
+          // 视频类型
+          this.mediaType = 'video'
+          this.uploadApi = baseUrl + '/common/uploadVi'
+          this.formData.videoUrl = data.mediaList[0].mediaUrl
+          this.formData.videoCoverUrl = data.coverUrl
+        }
+      }
+      this.popShow1 = false
 
     },
     //重新写
     popClose() {
-      this.popShow = false
+      this.popShow1 = false
+      this.draftObj = {}
     },
     //删除草稿
-    deleteFun(){
+    deleteFun() {
+
+      this.popShow1 = false
       uni.showToast({ title: '草稿已删除', icon: 'none' })
     },
+    // 提交动态
     async submit(type) {
+      console.log(type)
       if (
         type == 'publish' &&
         (!this.formData.title ||
@@ -313,10 +368,6 @@ export default {
           uni.showToast({ title: '动态标题不能为空', icon: 'none' })
           return
         }
-        // if (!this.formData.visibleRange) {
-        //   uni.showToast({ title: '请选择可见范围', icon: 'none' })
-        //   return
-        // }
       }
 
       // 检查是否有文件正在上传
@@ -337,19 +388,21 @@ export default {
           isDraft: type == 'draft' ? 1 : 0,
           mediaType: this.formData.videoUrl ? 2 : 1,
           imageUrls: this.fileList,
-          visibleRange: this.formData.visibleRange ? 1 : '',
         }
 
         console.log('提交数据:', postData)
 
         // 调用发布接口
-        const api = this.type === 'edit' ? dynamicEdit : dynamicPublish
+        let api = dynamicPublish
+        if (this.formData.momentId) {
+          api = dynamicEdit
+        }
         const res = await api(postData)
 
         // 接口调用成功
         if (res.data.code == 200) {
           uni.showToast({
-            title: '动态已发布',
+            title: res.data.msg,
             icon: 'none',
           })
 

+ 24 - 21
src/pages/my/dynamic/components/my_list.vue

@@ -1,8 +1,8 @@
 <template>
   <view class="list-box" v-if="dataList && dataList.length > 0">
-    <view class="item" v-for="(item, index) in dataList" :key="index" @click="goDetails(item)">
+    <view class="item" v-for="(item, index) in dataList" :key="index">
 
-      <view class="item-content" @click.stop="goToDateil">
+      <view class="item-content" @click.stop="goToDateil(item)">
         <view style="display: flex;justify-content: space-between;">
           <view>
             <view class="title">{{ item.title }}</view>
@@ -12,8 +12,9 @@
             <text>已读{{ item.viewCount }}</text>
           </view>
           <view class="reserve-status" v-if="item.auditStatus == 1">审核中</view>
+          <view class="reserve-status" v-if="item.auditStatus == 3">审核驳回</view>
 
-          <view class="moreClass" @click.stop="editFun(item.auditStatus)">
+          <view class="moreClass" @click.stop="editFun(item)">
 
           </view>
         </view>
@@ -72,7 +73,9 @@ export default {
       actionList: [
         { name: '编辑' },
         { name: '删除', color: '#f56c6c' } // 删除红色字体
-      ]
+      ],
+      currentObj: {},
+
     }
 
   },
@@ -80,11 +83,12 @@ export default {
 
   },
   methods: {
-    goToDateil(){
+    goToDateil(item) {
       uni.navigateTo({
-          url: `/pages/my/dynamic/dynamicDetail`,
-        })
+        url: `/pages/my/dynamic/dynamicDetail?momentId=${item.id}`,
+      })
     },
+    //删除
     sure() {
       this.showModal = false
       uni.showToast({
@@ -102,12 +106,19 @@ export default {
       uni.showTabBar()
     },
     selectItem(item) {
-      console.log('8888')
       this.sheetShow = false
       uni.showTabBar()
       if (item.name === '编辑') {
+        if (this.currentAuditStatus == 1 || this.currentAuditStatus == 2) {
+          uni.showToast({
+            title: this.currentAuditStatus == 1 ? '审核中':'已发布'+'的动态不支持编辑',
+            icon: 'none'
+          })
+          return
+        }
         let str = uni.$u.queryParams({
-          item: item,
+          momentId: this.currentObj.id,
+          type: 'edit',
         })
         uni.navigateTo({
           url: `/pages/my/dynamic/add_dynamic${str}`,
@@ -125,23 +136,15 @@ export default {
       }
 
     },
-    editFun(auditStatus) {
-      this.currentAuditStatus = auditStatus
+    editFun(item) {
+      this.currentObj = item
+      this.currentAuditStatus = item.auditStatus
       this.sheetShow = true
       //隐藏tabbar
       uni.hideTabBar()
       //uni.showTabBar()
 
     },
-    goDetails(item) {
-      return
-      let str = uni.$u.queryParams({
-        momentId: item.id,
-      })
-      uni.navigateTo({
-        url: `/pages/discover/details${str}`,
-      })
-    },
   },
 }
 </script>
@@ -175,7 +178,7 @@ export default {
     .title {
       font-size: 28rpx;
       width: 520rpx;
-      border: 1px solid red;
+      //border: 1px solid red;
       white-space: nowrap;
       /* 禁止换行 单行 */
       overflow: hidden;

+ 57 - 17
src/pages/my/dynamic/dynamicDetail.vue

@@ -4,11 +4,11 @@
     <scroll-view scroll-y class="scroll-wrap">
       <view class="page-content">
         <!-- 审核驳回区域 -->
-        <view class="reject-card">
+        <view class="reject-card" v-if="detail.auditStatus != 2">
           <view class="reject-head">
             <u-icon name="close-circle" size="38" color="#999"></u-icon>
-            <text class="reject-title">审核驳回</text>
-            <text>审核中</text>
+            <text v-if="detail.auditStatus == 3" class="reject-title">审核驳回</text>
+            <text v-if="detail.auditStatus == 1" class="reject-title">审核中</text>
           </view>
           <view class="reject-text">
             审核结果将会在X-X个工作日通知您
@@ -17,24 +17,31 @@
 
         <!-- 文章标题 -->
         <view class="article-title">
-          业财对账总对不平?先搞清楚你对的是「业务账」还是「资金账」
+          {{ detail.title || '无标题' }}
         </view>
 
         <!-- 发布信息 -->
         <view class="info-bar">
-          <text>娜娜</text>
-          <text>2025.12.25 16:23:25</text>
-          <text>252已读</text>
+          <text>{{ detail.technicianNickName || '--' }}</text>
+          <text>{{ detail.publishTime || '--' }}</text>
+          <text>{{ detail.viewCount || '--' }}已读</text>
+          <text>252点赞</text>
         </view>
 
         <!-- 正文内容 -->
         <view class="article-body">
-          「业务账」是什么:业务账是从业务视角算出来的「该收多少、该付多少」,订单、支付、退款、手续费、调账,按业务规则轧差后的结果。例如:某商户今日订单100万、退款5万、手续费2万,业务上净应收93万。数据来源是业务系统:交易、清结算、账务等,不涉及「银行/渠道实际到没到账」。「资金账」是什么:资金账是从资金视角看到的「实际到账多少、实际划出多少」,渠道给我们的到账、我们给商户的划付、银行流水。例如:某日渠道实际到账92万、我们实际划给商户90万,资金上就是这两笔数。数据来源是渠道对账文件、银行流水、划付记录,是「钱真的动了」的那部分。
+          {{ detail.content || '--' }}
+
         </view>
 
         <!-- 图片/视频占位 -->
         <view class="media-placeholder">
-          <text>视频/图片</text>
+          <view v-for="(item, index) in detail.mediaList" :key="index" style="border: 1rpx solid #eeeeee;">
+            <image v-if="item.mediaType == '1'" style=" width: 200rpx;" mode="widthFix" :src="item.mediaUrl"
+                        @error="imageError"></image>
+            <video v-if="item.mediaType == '2'" id="myVideo" :src="item.mediaUrl"
+              @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>
+          </view>
         </view>
       </view>
     </scroll-view>
@@ -42,23 +49,54 @@
 </template>
 
 <script>
+
+import { dynamicDetail } from '@/api/dynamic'
 export default {
   name: 'DynamicDetail',
   data() {
-    return {}
+    return {
+      momentId: '',
+      detail: {},
+    }
+  },
+  onLoad(options) {
+    this.momentId = options.momentId
+    this.getDetail()
+  },
+  methods: {
+    getDetail() {
+      dynamicDetail({
+        momentId: this.momentId
+      }).then(res => {
+        if (res.data.code === 200) {
+          this.detail = res.data.data
+        } else {
+          this.detail = {}
+        }
+      })
+    }
   }
+
 }
 </script>
 
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
+.dynamic-detail{
+  
+}
 /* 滚动区域高度:扣除导航栏高度 */
 .scroll-wrap {
   height: calc(100vh - var(--u-navbar-height));
 }
+
 /* 页面整体内边距 */
 .page-content {
-  padding: 32rpx;
+  margin: 0 32rpx;
+  padding: 24rpx;
+  background-color: #ffffff;
+  border-radius: 12rpx;
 }
+
 /* 驳回卡片样式 */
 .reject-card {
   border: 1rpx solid #eeeeee;
@@ -66,22 +104,26 @@ export default {
   padding: 28rpx;
   margin-bottom: 36rpx;
 }
+
 .reject-head {
   display: flex;
   align-items: center;
   gap: 18rpx;
   margin-bottom: 16rpx;
 }
+
 .reject-title {
   font-size: 32rpx;
   font-weight: 500;
   color: #333333;
 }
+
 .reject-text {
   font-size: 28rpx;
   color: #666666;
   line-height: 1.6;
 }
+
 /* 文章标题 */
 .article-title {
   font-size: 34rpx;
@@ -90,6 +132,7 @@ export default {
   color: #222;
   margin-bottom: 22rpx;
 }
+
 /* 发布信息栏 */
 .info-bar {
   display: flex;
@@ -98,6 +141,7 @@ export default {
   color: #888888;
   margin-bottom: 32rpx;
 }
+
 /* 正文 */
 .article-body {
   font-size: 30rpx;
@@ -105,16 +149,12 @@ export default {
   line-height: 1.7;
   margin-bottom: 42rpx;
 }
+
 /* 媒体占位框 */
 .media-placeholder {
-  width: 300rpx;
-  height: 300rpx;
-  background-color: #eeeeee;
   display: flex;
   align-items: center;
-  justify-content: center;
   font-size: 30rpx;
   color: #666666;
 }
 </style>
-

+ 70 - 26
src/pages/my/dynamic/index.vue

@@ -1,33 +1,17 @@
 <template>
   <view class="page-container">
-    <z-paging
-      ref="paging"
-      v-model="dynamicList"
-      :paging-style="{
-        background: '#F7FFFF',
-      }"
-      @query="queryList"
-    >
+    <z-paging ref="paging" v-model="dynamicList" :paging-style="{
+      background: '#F7FFFF',
+    }" @query="queryList">
 
       <!-- 我的动态 -->
-      <my-dynamic-list
-        :data-list="dynamicList"
-      ></my-dynamic-list>
+      <my-dynamic-list :data-list="dynamicList"></my-dynamic-list>
 
 
       <template v-slot:empty>
-        <u-empty
-          :text="!isLogin ? '您还没有登录' : '暂无相关动态~'"
-          icon="/static/common/logo1.png"
-        >
-          <u-button
-            size="small"
-            text="去登录"
-            color="linear-gradient(to right, #35c99d, #27aea7)"
-            :customStyle="{ marginTop: '20rpx' }"
-            v-if="!isLogin"
-            @click="goLogin"
-          >
+        <u-empty :text="!isLogin ? '您还没有登录' : '暂无相关动态~'" icon="/static/common/logo1.png">
+          <u-button size="small" text="去登录" color="linear-gradient(to right, #35c99d, #27aea7)"
+            :customStyle="{ marginTop: '20rpx' }" v-if="!isLogin" @click="goLogin">
           </u-button>
         </u-empty>
       </template>
@@ -37,6 +21,25 @@
     <view v-if="isLogin && current === 0" class="add-btn" @click="goPublish">
       <image src="/static/discover/subtract.png" mode="" />
     </view>
+
+
+    <!-- 未入驻提示 -->
+    <u-popup :show="showModal" mode="center" :round="16" :mask-close-able="false">
+      <view class="modal-wrap">
+        <!-- 标题居中 -->
+        <view class="title">{{ auditStatus == 0 ? '提示' : '入驻审核驳回' }}</view>
+        <!-- 正文 -->
+        <view class="content">
+          请提交入驻资料并由后台人员审核通过后,即可开通操作权限
+        </view>
+        <!-- 底部双按钮(必显示) -->
+        <view class="btn-box">
+          <view v-if="auditStatus == 3" class="btn">修改入驻信息</view>
+          <view v-if="auditStatus == 0" class="btn left" @click="cancel">我在想想</view>
+          <view v-if="auditStatus == 0" class="btn right" @click="goEnter">立即入驻</view>
+        </view>
+      </view>
+    </u-popup>
   </view>
 </template>
 
@@ -52,6 +55,7 @@ export default {
   },
   data() {
     return {
+      showModal: false,
       isLogin: false,
       dynamicList: [],
       current: 0,
@@ -65,16 +69,43 @@ export default {
           value: 0,
         },
       ],
+      auditStatus: 0,
     }
   },
   onLoad() {
     this.isLogin = !!uni.getStorageSync('wx_copenid')
-    console.log(this.isLogin,'this.isLogin')
+    console.log(this.isLogin, 'this.isLogin')
   },
   onShow() {
     this.queryList(1, 10)
   },
   methods: {
+    //查询商户状态  auditStatus 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回"
+    async checkMerchantStatus() {
+      const openid = uni.getStorageSync('wx_copenid')
+      const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+      if (!merchantInfo) return
+      this.cJsId = merchantInfo.merchant.id; //用户id
+      /**
+       * 服务标签(1:按摩推拿 2:陪玩)
+       */
+      this.serviceTag = merchantInfo.merchant.serviceTag
+      uni.setStorageSync('serviceTag', merchantInfo.merchant.serviceTag)
+      uni.setStorageSync('userId', merchantInfo.merchant.id)
+      return merchantInfo.merchant.auditStatus//用户状态
+
+    },
+    // 我在想想:关闭弹窗
+    cancel() {
+      this.showModal = false
+    },
+    // 立即入驻:跳转入驻页
+    goEnter() {
+      this.showModal = false
+      uni.navigateTo({
+        url: '/pages/join/applyJoin' // 替换你的入驻页面路径
+      })
+    },
     queryList(pageNo, pageSize) {
       let params = {
         pageNum: pageNo,
@@ -133,7 +164,7 @@ export default {
       this.$refs.paging.reload()
     },
     goLogin() {
-      
+
       uni.navigateTo({
         url: '/setting/myNew/phone',
       })
@@ -141,7 +172,20 @@ export default {
       //   url: '/pages/login/wxLogin',
       // })
     },
-    goPublish() {
+    async goPublish() {
+      this.auditStatus = await this.checkMerchantStatus()
+      if (this.auditStatus == 0 || this.auditStatus == 3) {
+        this.showModal = true
+        return
+      }
+      if (this.auditStatus == 1) {
+        uni.showToast({
+          title: '入驻审核中,暂无操作权限',
+          icon: 'none'
+        })
+        return
+
+      }
       uni.navigateTo({
         url: '/pages/my/dynamic/add_dynamic',
       })

+ 133 - 59
src/setting/myNew/forgetPassword.vue

@@ -1,9 +1,9 @@
 <script>
-import { resetPassword, sendMsg,captchaImage } from '@/api/newLogin.js'
+import { resetPassword, sendMsg, captchaImage, getValidateCaptcha } from '@/api/newLogin.js'
 export default {
   data() {
     return {
-      phone: '18434361582', phoneMsg: '',
+      phone: '', phoneMsg: '',
       countdown: 60,
       // 整体8-20位,只能大小写+数字
       regPwd: /^[A-Za-z0-9]{8,20}$/,
@@ -14,8 +14,9 @@ export default {
       isSendingCode: false,
       showCaptcha: false,
       startCountdownFlag: false,
-      uuid:'',
-      imgCode:''
+      uuid: '',
+      imgCode: '',
+      captchaImg: '',
     }
   },
   computed: {
@@ -26,11 +27,8 @@ export default {
     //   return this.code && this.code.length === 6 && !this.isBinding
     // }
   },
-  onLoad(options) {
-    if (options.phone) {
-      this.phone = options.phone;
-
-    }
+  onLoad() {
+    this.checkMerchantStatus()
 
   },
   watch: {
@@ -49,11 +47,19 @@ export default {
     }
   },
   methods: {
+    //查询商户状态
+    async checkMerchantStatus() {
+      const openid = uni.getStorageSync('wx_copenid')
+      const merchantInfo = await this.$utils.checkMerchantStatus(openid)
+      if (!merchantInfo) return
+      this.phone = merchantInfo.merchant.tePhone
+
+    },
     validatePhone(phone) {
       const reg = /^1[3-9]\d{9}$/
       return reg.test(phone)
     },
-      //图形验证码提交
+    //图形验证码提交
     submitImgCode() {
       if (!this.imgCode) {
         uni.showToast({
@@ -62,59 +68,70 @@ export default {
         })
         return
       }
-      sendMsg33333({ uuid:this.uuid,imgCode:this.imgCode}).then(res => {
-        console.log(res)
+
+      getValidateCaptcha({ uuid: this.uuid, code: this.imgCode, phone: this.phone }).then(res => {
         if (res.data.code == 200) {
           this.showCaptcha = false
-            this.getCode()
+          this.getCode()
+        } else {
+          this.imgCode = ''
+          uni.showToast({
+            title: res.data.message,
+            icon: 'none'
+          })
         }
-        
-
       })
 
     },
     //重新获取验证码
-		agginGetCode() {
-			if (!this.phone) {
-				uni.showToast({
-					title: '请输入手机号',
-					icon: 'none'
-				})
-				return
-			}
-
-			if (!/^1[3456789]\d{9}$/.test(this.phone)) {
-				uni.showToast({
-					title: '手机号不正确',
-					icon: 'none'
-				})
-				return
-			}
-			captchaImage().then(res=>{
-				console.log(res)
-				if (res.data.code == 200) {
-					this.uuid=res.data.uuid
-				}
-			})
-      this.imgCode=''
-			this.showCaptcha = true
-
-		},
+    agginGetCode() {
+      if (!this.phone) {
+        uni.showToast({
+          title: '请输入手机号',
+          icon: 'none'
+        })
+        return
+      }
+
+      if (!/^1[3456789]\d{9}$/.test(this.phone)) {
+        uni.showToast({
+          title: '手机号不正确',
+          icon: 'none'
+        })
+        return
+      }
+      this.getCaptcha()
+      this.imgCode = ''
+      this.showCaptcha = true
+
+    },
+    //获取图形验证码
+    getCaptcha() {
+      captchaImage().then(res => {
+        if (this.showCaptcha) {
+          this.captchaImg = "data:image/gif;base64," + res.data.img;
+          this.uuid = res.data.uuid;
+        }
+      })
+    },
     //获取验证码
     getCode() {
       if (this.isSendingCode || this.countdown < 60) return
 
       this.isSendingCode = true
       sendMsg({ phone: this.phone }).then(res => {
-        console.log(res)
-
-        uni.showToast({
-          title: '验证码已发送',
-          icon: 'success'
-        })
-
-        this.startCountdown()
-        this.isSendingCode = false
+        if (res.data.code == 200) {
+          uni.showToast({
+            title: '验证码已发送',
+          })
+          this.startCountdown()
+          this.isSendingCode = false
+        } else {
+          uni.showToast({
+            title: res.data.msg,
+            icon: 'none'
+          })
+        }
 
       })
 
@@ -169,16 +186,22 @@ export default {
         //openId: uni.getStorageSync('wx_copenid'),
         userType: '2',
         phone: this.phone,
-        codeSwitch: 'false',//是否开启验证码登录 true-是 false-否
+        codeSwitch: 'true',//是否开启验证码登录 true-是 false-否
         phoneMsg: this.phoneMsg,
         passWord: this.password
       }).then(res => {
         if (res.data.code == 200) {
-          // uni.showToast({
-          //   title: '登录成功',
-          //   icon: 'success'
-          // })
-          this.back()
+          uni.showToast({
+            title: res.data.message,
+          })
+          setTimeout(() => {
+            this.back()
+          }, 400)
+        } else {
+          uni.showToast({
+            title: res.data.message,
+            icon: 'none'
+          })
         }
       })
 
@@ -235,7 +258,7 @@ export default {
     <view class="greeting-area1"></view>
     <view class="content">
       <view class="input-box">
-        <u-input v-model="phone" disabled="true" border="none" placeholder="" class="input-item">
+        <u-input v-model="phone" :disabled="true" border="none" placeholder="" class="input-item">
           <template slot="prefix">
             <view class="label">
               <text>手机号</text>
@@ -296,15 +319,17 @@ export default {
             @click="showCaptcha = false"></u-icon>
         </view>
         <view style="padding: 0 48rpx;margin-top: 48rpx;">
-          <view style="display: flex;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
+          <view
+            style="display: flex;align-items: center;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
 
             <!-- 验证码输入框,唤起全字符键盘 -->
             <u-input v-model="imgCode" placeholder="请输入图形验证码" :focus="showCaptcha" type="text" maxlength="4"
               border="none" placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;"></u-input>
             <!-- 图形验证码图片,点击刷新 -->
+            <!-- <img :src="captchaImg" @click="getCode" class="register-code-img"/> -->
             <image :src="captchaImg" @click="refreshCaptcha" class="captcha-img"></image>
           </view>
-          <view class="text" @click="submitImgCode">看不清? 换一张</view>
+          <view class="text" @click="getCaptcha">看不清? 换一张</view>
           <u-button class="submitImgCode" @click="submitImgCode" block>确定</u-button>
 
         </view>
@@ -322,6 +347,55 @@ export default {
   background-color: #ffffff00 !important;
 }
 
+.captcha-box {
+  width: 622rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+
+  .captcha-title {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #333333;
+    text-align: center;
+    padding: 32rpx 0;
+    border-bottom: 1rpx solid #E7E7E7;
+
+  }
+
+  .captcha-img {
+    //width: 100%;
+    width: 146rpx;
+    height: 60rpx;
+  }
+
+  .submitImgCode {
+    width: 526rpx;
+    height: 88rpx;
+    background: #333335;
+    border-radius: 60rpx 60rpx 60rpx 60rpx;
+    margin: 48rpx 0;
+
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #FFFFFF;
+    text-align: center;
+  }
+
+  .text {
+    margin-top: 12rpx;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #86909C;
+    text-align: right;
+
+  }
+
+  .u-input {}
+}
+
 .sett-box {
   background: #ffffff;
   width: 100%;

+ 57 - 30
src/setting/myNew/phone.vue

@@ -1,8 +1,9 @@
 <script>
-import { clientLogin, sendMsg } from '@/api/newLogin.js'
+import { clientLogin, sendMsg, captchaImage, getValidateCaptcha } from '@/api/newLogin.js'
 export default {
   data() {
     return {
+      uuid: '',
       phone: '',
       password: '',
       countdown: 60,
@@ -36,6 +37,7 @@ export default {
       const reg = /^1[3-9]\d{9}$/
       return reg.test(phone)
     },
+    //下一步
     nextStep() {
       if (!this.phone) {
         uni.showToast({
@@ -53,13 +55,14 @@ export default {
         return
       }
       if (!this.isPasswordLogin) {
+        this.getCaptcha()
         this.showCaptcha = true
       }
 
     },
     //登录
     loginPhoneFun() {
-		
+
       var _this = this;
       if (this.isBinding) return
 
@@ -88,31 +91,49 @@ export default {
       }
 
       this.isBinding = true
-	  
+
       clientLogin({
         //openId: uni.getStorageSync('wx_copenid'),
-        userType: '2',
+        userType: '2',//1-用户,2-商户
         phone: _this.phone,
         codeSwitch: 'false',//是否开启验证码登录 true-是 false-否
         passWord: _this.password
       }).then(res => {
-		  console.log('-----',res);
+        console.log('-----', res);
         if (res.data.code == 200) {
           uni.showToast({
             title: '登录成功',
             icon: 'success'
           })
-          uni.setStorageSync('wx_phone', _this.phone)
-		  uni.setStorageSync('wx_copenid', res.data.result.copenid || '')
-		  uni.setStorageSync('access-token', res.data.result.token)
-		  uni.setStorageSync('phone', res.data.result.cphone)
-		  uni.setStorageSync('wx_phone', res.data.result.cphone)
-		 
-		  _this.isBinding = false;
-          _this.back();
+          uni.setStorageSync('wx_copenid', res.data.data.copenid || '')
+          uni.setStorageSync('access-token', res.data.data.token)
+          uni.setStorageSync('phone', res.data.data.cphone)
+          uni.setStorageSync('wx_phone', res.data.data.cphone)
+
+          _this.isBinding = false;
+           this.back()
+          // uni.navigateTo({
+          //   url: '/pages/index/index'
+          // })
+        } else {
+          uni.showToast({
+            title: res.data.msg || '登录失败',
+            icon: 'none'
+          })
+          _this.isBinding = false;
+        }
+      })
+    },
+    //获取图形验证码
+    getCaptcha() {
+      captchaImage().then(res => {
+        if (this.showCaptcha) {
+          this.captchaImg = "data:image/gif;base64," + res.data.img;
+          this.uuid = res.data.uuid;
         }
       })
     },
+    //返回
     back() {
       let pages = getCurrentPages();
       if (pages.length >= 2) {
@@ -151,20 +172,25 @@ export default {
           title: '请输入验证码',
           icon: 'none'
         })
-        return
+        return 
       }
-      sendMsg33333({ uuid:this.uuid,imgCode:this.imgCode}).then(res => {
+      
+      getValidateCaptcha({ uuid: this.uuid, code: this.imgCode,phone:this.phone }).then(res => {
         console.log(res)
         if (res.data.code == 200) {
-            uni.navigateTo({
+          uni.navigateTo({
             url: `/setting/myNew/useCodeLogin?phone=` + this.phone
           })
         }
-        
-
       })
 
     },
+    //验证码登录
+    useCodeLoginFun() {
+      this.phone = ''
+      this.password = ''
+      this.isPasswordLogin = false
+    },
     //忘记密码
     forgetPassword() {
       uni.navigateTo({
@@ -224,7 +250,7 @@ export default {
         <u-button v-if="!isPasswordLogin" :loading="isBinding" type="primary" @click="nextStep">下一步</u-button>
       </view>
       <view class="textBox">
-        <view class="text1" v-if="isPasswordLogin" @click="isPasswordLogin = false">验证码登录</view>
+        <view class="text1" v-if="isPasswordLogin" @click="useCodeLoginFun">验证码登录</view>
         <view class="text1" v-if="!isPasswordLogin" @click="isPasswordLogin = true">密码登录</view>
         <view class="text2" v-if="isPasswordLogin" @click="forgetPassword">忘记密码</view>
       </view>
@@ -243,15 +269,16 @@ export default {
             @click="showCaptcha = false"></u-icon>
         </view>
         <view style="padding: 0 48rpx;margin-top: 48rpx;">
-          <view style="display: flex;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
+          <view style="display: flex;align-items: center;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
 
             <!-- 验证码输入框,唤起全字符键盘 -->
             <u-input v-model="imgCode" placeholder="请输入图形验证码" :focus="showCaptcha" type="text" maxlength="4"
               border="none" placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;"></u-input>
             <!-- 图形验证码图片,点击刷新 -->
+             <!-- <img :src="captchaImg" @click="getCode" class="register-code-img"/> -->
             <image :src="captchaImg" @click="refreshCaptcha" class="captcha-img"></image>
           </view>
-          <view class="text" @click="submitImgCode">看不清? 换一张</view>
+          <view class="text" @click="getCaptcha">看不清? 换一张</view>
           <u-button class="submitImgCode" @click="submitImgCode" block>确定</u-button>
 
         </view>
@@ -288,22 +315,21 @@ export default {
 
   .captcha-img {
     //width: 100%;
-    width: 200rpx;
-    height: 106rpx;
+    width: 146rpx;
+    height: 60rpx;
   }
 
   .submitImgCode {
     width: 526rpx;
-    height: 80rpx;
-    background: linear-gradient(263deg, #45FFD7 0%, #7FFFBD 100%);
+    height: 88rpx;
+    background: #333335;
     border-radius: 60rpx 60rpx 60rpx 60rpx;
-    margin-top: 48rpx;
+    margin: 48rpx 0;
 
     font-weight: 500;
     font-size: 32rpx;
-    color: #1D2129;
+    color: #FFFFFF;
     text-align: center;
-    margin-bottom: 48rpx;
   }
 
   .text {
@@ -404,7 +430,8 @@ export default {
     font-size: 30rpx;
     color: #1D2129;
   }
-  .captcha-img{
+
+  .captcha-img {
     width: 30rpx;
     height: 30rpx;
   }
@@ -434,7 +461,7 @@ export default {
   ::v-deep .u-button {
     width: 622rpx;
     height: 88rpx;
-    background:  #333335;
+    background: #333335;
     border-radius: 60rpx 60rpx 60rpx 60rpx;
     border: none;
 

+ 88 - 27
src/setting/myNew/useCodeLogin.vue

@@ -1,5 +1,5 @@
 <script>
-import { loginPhone, sendMsg } from '@/api/newLogin.js'
+import { clientLogin, sendMsg,captchaImage,getValidateCaptcha } from '@/api/newLogin.js'
 export default {
   data() {
     return {
@@ -10,6 +10,7 @@ export default {
       imgCode: '',
       captchaImg: '',
       uuid: '',
+      isSendingCode: false,
     }
   },
   computed: {
@@ -22,10 +23,8 @@ export default {
   },
   onLoad(options) {
     if (options.phone) {
-      this.phone = options.phone;
-      clearInterval(this.timer)
-      this.timer = null
-      this.startCountdown()
+      this.phone = options.phone
+      this.getCode()
     }
 
   },
@@ -37,18 +36,23 @@ export default {
           title: '请输入验证码',
           icon: 'none'
         })
-        return
+        return 
       }
-      sendMsg33333({ uuid:this.uuid,imgCode:this.imgCode}).then(res => {
-        console.log(res)
+      
+      getValidateCaptcha({ uuid: this.uuid, code: this.imgCode,phone:this.phone }).then(res => {
         if (res.data.code == 200) {
           this.showCaptcha = false
-            this.getCode()
-        }
-        
-
+          this.getCode()
+        }else{
+            this.imgCode=''
+            uni.showToast({
+              title: res.data.message,
+              icon: 'none'
+            })
+          }
       })
 
+
     },
     validatePhone(phone) {
       const reg = /^1[3-9]\d{9}$/
@@ -56,17 +60,21 @@ export default {
     },
     //重新获取验证码
 		agginGetCode() {
-			captchaImage().then(res=>{
-				console.log(res)
-				if (res.data.code == 200) {
-					this.uuid=res.data.uuid
-				}
-			})
+      this.getCaptcha()
       this.imgCode=''
-			this.showCaptcha = true
+      this.showCaptcha = true
 
 		},
-    //获取验证码
+    //获取图形验证码
+    getCaptcha() {
+      captchaImage().then(res => {
+        if (this.showCaptcha) {
+          this.captchaImg = "data:image/gif;base64," + res.data.img;
+          this.uuid = res.data.uuid;
+        }
+      })
+    },
+    //获取手机验证码
     getCode() {
       if (this.isSendingCode || this.countdown < 60) return
 
@@ -76,7 +84,6 @@ export default {
 
         uni.showToast({
           title: '验证码已发送',
-          icon: 'success'
         })
 
         this.startCountdown()
@@ -102,9 +109,9 @@ export default {
     // 满6位自动校验
     autoCheckCode(val) {
       // 输入刚好6位时自动提交
-      if (val.length === 6) {
+      if (val.length === 4) {
 
-        loginPhone({
+        clientLogin({
           //openId: uni.getStorageSync('wx_copenid'),
           userType: '2',
           phone: this.phone,
@@ -118,6 +125,11 @@ export default {
             // })
             uni.setStorageSync('wx_phone', this.phone)
             this.back()
+          }else{
+            uni.showToast({
+              title: res.data.message,
+              icon: 'none'
+            })
           }
         })
       }
@@ -169,7 +181,7 @@ export default {
     <view class="greeting-area">
       <view class="bubble-box">
         <view class="bubble-text">请输入验证码</view>
-        <view class="sendTag">验证码已发送至:+86 {{ phone }}</view>
+        <view class="sendTag">验证码已发送至:{{ phone }}</view>
       </view>
     </view>
     <view class="greeting-area1"></view>
@@ -178,7 +190,7 @@ export default {
         <u-input v-model="phoneMsg" type="number" border="none" maxlength="6" placeholder="请输入手机验证码"
           placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;" class="input-item code-input"
           @input="autoCheckCode"></u-input>
-        <view class="code-btn" :class="{ disabled: !canGetCode }" @click="getCode">
+        <view class="code-btn" :class="{ disabled: !canGetCode }">
             <text v-if="startCountdownFlag">{{ countdown }}s</text>
             <text @click="agginGetCode">重新获取</text>
           
@@ -196,15 +208,16 @@ export default {
             @click="showCaptcha = false"></u-icon>
         </view>
         <view style="padding: 0 48rpx;margin-top: 48rpx;">
-          <view style="display: flex;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
+          <view style="display: flex;align-items: center;justify-content: space-between;height: 106rpx;border-bottom: 1rpx solid #E7E7E7;">
 
             <!-- 验证码输入框,唤起全字符键盘 -->
             <u-input v-model="imgCode" placeholder="请输入图形验证码" :focus="showCaptcha" type="text" maxlength="4"
               border="none" placeholder-style="font-weight: 400;font-size: 30rpx;color: #C9CDD4;"></u-input>
             <!-- 图形验证码图片,点击刷新 -->
+             <!-- <img :src="captchaImg" @click="getCode" class="register-code-img"/> -->
             <image :src="captchaImg" @click="refreshCaptcha" class="captcha-img"></image>
           </view>
-          <view class="text"@click="submitImgCode">看不清? 换一张</view>
+          <view class="text" @click="getCaptcha">看不清? 换一张</view>
           <u-button class="submitImgCode" @click="submitImgCode" block>确定</u-button>
 
         </view>
@@ -219,6 +232,54 @@ export default {
 </template>
 
 <style scoped lang="scss">
+.captcha-box {
+  width: 622rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+
+  .captcha-title {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #333333;
+    text-align: center;
+    padding: 32rpx 0;
+    border-bottom: 1rpx solid #E7E7E7;
+
+  }
+
+  .captcha-img {
+    //width: 100%;
+    width: 146rpx;
+    height: 60rpx;
+  }
+
+  .submitImgCode {
+    width: 526rpx;
+    height: 88rpx;
+    background: #333335;
+    border-radius: 60rpx 60rpx 60rpx 60rpx;
+    margin: 48rpx 0;
+
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #FFFFFF;
+    text-align: center;
+  }
+
+  .text {
+    margin-top: 12rpx;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #86909C;
+    text-align: right;
+
+  }
+
+  .u-input {}
+}
 .sett-box {
   background: #ffffff;
   width: 100%;

BIN
src/static/login/close2.png


+ 16 - 1
src/utils/index.js

@@ -1,5 +1,6 @@
 import statusManager from '@/utils/statusManager.js';
 import addressService from '@/utils/address.js';
+import {getTechnicianInfo} from '@/api/index';
 
 // 日期格式化原型扩展(单独维护)
 Date.prototype.Format = function (fmt) {
@@ -102,7 +103,6 @@ const otherUtil = {
 		} = options;
 		
 		const token = uni.getStorageSync('access-token') || '';
-		//const token = (uni.getStorageSync('wx_phone') && uni.getStorageSync('access-token')) || '';
 		const isLogin = !!token;
 
 		// 后退参数
@@ -199,6 +199,21 @@ const otherUtil = {
 			uni.makePhoneCall({ phoneNumber: e });
 		}
 	},
+	//查询商户状态
+	async checkMerchantStatus(openid) {
+		try {
+			const response = await getTechnicianInfo({ openid });
+			if (response.data.code === 200) {
+			return response.data.data;
+			}
+			// 接口非200返回null
+			return null;
+		} catch (err) {
+			console.log(err, 'err')
+			// 请求报错也返回null
+			return null;
+		}
+	},
 	// 全局状态管理
 	statusManager,
 	// 微信 JSSDK 地址