Переглянути джерело

Merge remote-tracking branch 'origin/2025北京诚祥' into 2025北京诚祥

wangxy 2 місяців тому
батько
коміт
8471cee96b

+ 12 - 0
api/jiazheng.js

@@ -155,3 +155,15 @@ export function getJiazhengShuxiang(data = {}) {
     timeout: 20000
   })
 }
+
+export function getJiazhengJiguan(data = {}) {
+  return request({
+    url: '/app/user/jiazheng/tree/city',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 40 - 4
common/styles/global/components.scss

@@ -50,8 +50,41 @@ view{box-sizing: border-box;}
 
 /***** 富文本处理  *****/
 @mixin ezy-rich-text() {
+	white-space: pre-wrap;
 	div,p,span{margin: 0;padding: 0;}
 	img{max-width: 100%;}
+	
+	.ql-align-center{text-align: center}
+	.ql-align-right{text-align: right}
+	// 9号字
+	.ql-size-9px{font-size: 18rpx;}
+	// 12号字
+	.ql-size-12px{font-size: 24rpx;}
+	// 14号字
+	.ql-size-14px{font-size: 28rpx;}
+	// 16号字
+	.ql-size-16px{font-size: 32rpx;}
+	// 18号字
+	.ql-size-18px{font-size: 36rpx;}
+	// 24号字
+	.ql-size-24px{font-size: 48rpx;}
+	// 32号字
+	.ql-size-32px{font-size: 64rpx;}
+
+	// 单倍行距
+	.line-height-lineHeight1{line-height: 1;}
+
+	// 1.5倍行距
+	.line-height-lineHeight1-5{line-height: 1.5;}
+
+	// 2倍行距
+	.line-height-lineHeight2{line-height: 2;}
+
+	// 2.5倍行距
+	.line-height-lineHeight2-5{line-height: 2.5;}
+
+	// 3倍行距
+	.line-height-lineHeight3{line-height: 3;}
 }
 
 /***** 按钮  *****/
@@ -89,7 +122,7 @@ view{box-sizing: border-box;}
 	display: flex;align-items: center;justify-content: center;background-color: #fff;
 	padding: var(--status-bar-height) 20rpx 20rpx;box-sizing: border-box;position: relative;
 	.nav-bar-title{
-		font-size: 36rpx;height: 63rpx;line-height: 63rpx;color: #333;max-width: 70%;
+		font-size: 32rpx;height: 63rpx;line-height: 63rpx;color: #333;max-width: 70%;
 	}
 	.nav-bar-icon{
 		width: 24rpx;height: 38rpx;position: absolute;left: 24rpx;top: calc(12rpx + var(--status-bar-height));;
@@ -98,9 +131,12 @@ view{box-sizing: border-box;}
 }
 // 带背景色client使用
 .icon-title-bjcolor-navBar-box{
-	background-color: #3fd2a1;padding: 10rpx;
-	.nav-bar-title{color: #fff;}
-	.nav-bar-icon{background-image: url("@/static/images/common/nav-white-bar-jt.svg");top:22rpx;}
+	background-color: #fff;padding: 10rpx;border-bottom: 1rpx solid #e0e0e0;
+	.nav-bar-title{color: #3fd2a1;}
+	.nav-bar-icon{width: 100rpx;height: 63rpx;background-image:unset;}
+	.nav-bar-icon::before{content:'';width:50rpx;height: 50rpx;display: inline-block;margin-top: 6rpx;
+	@include ezy-no-repeat-cover();
+	background-image: url("@/static/images/common/return-icon.png");}
 }
 // 仅一个返回按钮
 .phone-nav-bar-icon{width: 24rpx;height: 38rpx;position: absolute;left: 24rpx;top: var(--status-bar-height);

+ 1 - 0
common/styles/global/pages.scss

@@ -258,6 +258,7 @@
 		display: block;box-sizing: border-box;padding: 24rpx;font-size: 30rpx;color: #666;
 		word-break: break-all;line-height: 1.6;
 		img{max-width: 100%;margin: 0 auto;}
+		@include ezy-rich-text();
 	}
 }	
 

+ 147 - 48
pages/admin/Jiazheng/gerenZiliao.vue

@@ -31,9 +31,11 @@
 
 		<view class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>籍贯</view>
-			<uni-data-picker v-model="formData.hometown" placeholder="请选择籍贯" :localdata="hometownData">
-				{{formData.hometown}}
-			</uni-data-picker>
+			<picker mode="multiSelector" :range="pickerData" :range-key="'label'" @change="onPickerChange">
+				<view class="picker">
+					当前选择:{{ selectedProvince }} - {{ selectedCity }}
+				</view>
+			</picker>
 		</view>
 		<view class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>身份证地址</view>
@@ -63,17 +65,17 @@
 			<dataChecked :list="xueliList" mode="single" :showAdd="false" @change="selectChangeXueliList" />
 		</view>
 		<view class="form-label-radio flex-start-row">
-			<view class="phone-form-label"><text class="form-label-require"></text>婚姻 </view>
+			<view class="phone-form-label"><text></text>婚姻 </view>
 			<dataChecked :list="hunyinList" mode="single" :showAdd="false" @change="selectChangeHunyinList" />
 		</view>
 
 		<view class="form-label-input form-top-margin flex-start-row">
-			<view class="phone-form-label"><text class="form-label-require">*</text>通讯地址</view>
+			<view class="phone-form-label"><text></text>通讯地址</view>
 			<textarea v-model="formData.juzhuDizhi" placeholder="请输入通讯地址" class="form-textarea-box" />
 		</view>
 
 		<view class="form-label-select">
-			<view class="phone-form-label"><text class="form-label-require"></text>星座</view>
+			<view class="phone-form-label"><text></text>星座</view>
 			<picker :range="xingzuoList" mode='selector' :value="formData.xingzuoIndex" range-key="name"
 				@change="xingzuoChange" @cancel="xingzuoCancel">
 				<view class="form-radio-select">
@@ -83,7 +85,7 @@
 			</picker>
 		</view>
 		<view class="form-label-select">
-			<view class="phone-form-label"><text class="form-label-require"></text>属相</view>
+			<view class="phone-form-label"><text></text>属相</view>
 			<picker :range="shuxiangList" mode='selector' :value="formData.shuxiangIndex" range-key="name"
 				@change="shuxiangChange" @cancel="shuxiangCancel">
 				<view class="form-radio-select">
@@ -96,7 +98,8 @@
 		<view class="form-label-switch">
 			<view class="phone-form-label"> <text class="form-label-require"></text>星座属相展示到简历 </view>
 			<view>展示
-				<switch @change="switchXingzuoChange"  :checked="formData.xingzuoFlag"  color="#3fd2a1" style="transform:scale(0.7)" />
+				<switch @change="switchXingzuoChange" :checked="formData.xingzuoFlag" color="#3fd2a1"
+					style="transform:scale(0.7)" />
 			</view>
 		</view>
 		<view class="agree-section-box form-top-margin">
@@ -119,7 +122,8 @@
 		getJiazhengHunyin,
 		getJiazhengMinzu,
 		getJiazhengShuxiang,
-		getJiazhengXingzuo
+		getJiazhengXingzuo,
+		getJiazhengJiguan
 	} from "@/api/jiazheng.js";
 	export default {
 		components: {
@@ -146,7 +150,7 @@
 					xingzuoIndex: 0,
 					minzuIndex: 0,
 					shuxiangIndex: 0,
-					xingzuoFlag:false
+					xingzuoFlag: false
 
 				},
 				xueliList: [],
@@ -154,24 +158,10 @@
 				shuxiangList: [],
 				xingzuoList: [],
 				minzuList: [],
-
-
-				hometownData: [{
-						text: '辽宁省',
-						value: '210000',
-						children: [{
-							text: '大连市',
-							value: '210200',
-							children: [{
-									text: '西岗区',
-									value: '210203'
-								},
-								// 其他区县...
-							]
-						}]
-					}
-					// 其他省份...
-				],
+				//	areaTree: [],
+				pickerData: [],
+				selectedProvince: '',
+				selectedCity: ''
 
 			}
 		},
@@ -181,25 +171,133 @@
 			this.getMinzu()
 			this.getXingzuo()
 			this.getShuxiang()
+			this.getJiguan()
 
 		},
 		methods: {
-			 validate() {
-			      return new Promise((resolve) => {
-			        // 实际验证逻辑
-			        const isValid = this.formData.realName 
-			        if (!isValid) {
-			          this.showError = true
-			          resolve(false)
-			        } else {
-			          resolve(true)
-			        }
-			      })
-			    },
+
+			formatData(data) {
+				const provinces = data.map(province => {
+					return {
+						label: province.lable,
+						value: province.id,
+						children: province.children.map(city => {
+							return {
+								label: city.lable,
+								value: city.id
+							};
+						})
+					};
+				});
+
+				return provinces;
+			},
+			onPickerChange(e) {
+				const [provinceIndex, cityIndex] = e.detail.value;
+				const selectedProvince = this.pickerData[provinceIndex];
+				const selectedCity = selectedProvince.children[cityIndex];
+
+				this.selectedProvince = selectedProvince.label;
+				this.selectedCity = selectedCity.label;
+			},
+
+
+
+			checkAllFields() {
+				const requiredFields = [{
+						key: 'userName',
+						name: '手机号'
+					},
+					{
+						key: 'realName',
+						name: '姓名'
+					},
+					{
+						key: 'idCard',
+						name: '身份证号'
+					},
+					{
+						key: 'birthday',
+						name: '生日'
+					},
+					// {
+					// 	key: 'hometown',
+					// 	name: '家乡',
+					// 	type: 'array'
+					// },
+					{
+						key: 'hujiDizhi',
+						name: '身份证地址'
+					},
+					{
+						key: 'gender',
+						name: '性别'
+					},
+					{
+						key: 'juzhuDizhi',
+						name: '通讯地址'
+					},
+					{
+						key: 'minzu',
+						name: '民族',
+						type: 'object'
+					},
+					{
+						key: 'shuxiang',
+						name: '属相',
+						type: 'object'
+					},
+					{
+						key: 'xingzuo',
+						name: '星座',
+						type: 'object'
+					},
+				]
+
+				for (const field of requiredFields) {
+					const value = this.formData[field.key]
+
+					// 根据不同类型进行存在验证
+					if (field.type === 'array' && !value?.length) {
+						this.showAlert(field.name)
+						return false
+					}
+					if (field.type === 'object' && !Object.keys(value).length) {
+						this.showAlert(field.name)
+						return false
+					}
+					if (field.type === 'boolean' && value !== true) {
+						this.showAlert(field.name)
+						return false
+					}
+					if (!field.type && !value?.toString().trim()) {
+						this.showAlert(field.name)
+						return false
+					}
+				}
+				return true
+			},
+			showAlert(fieldName) {
+				uni.showToast({
+					title: `${fieldName}不能为空`,
+					icon: 'none',
+					duration: 2000
+				})
+			},
+			getJiguan() {
+				getJiazhengJiguan({}).then(res => {
+					//	this.areaTree = res.data
+					this.pickerData = this.formatData(res.data);
+					
+					console.log('this.pickerData',this.pickerData);
+				}).catch(error => {
+					console.error('获取技能类型失败:', error);
+				});
+			},
 			getXueli() {
 				getJiazhengXueli({}).then(res => {
 					this.xueliList = res.data
-				//	console.log('xueliList', this.xueliList);
+					//	console.log('xueliList', this.xueliList);
 				}).catch(error => {
 					console.error('获取技能类型失败:', error);
 				});
@@ -207,7 +305,7 @@
 			getXingzuo() {
 				getJiazhengXingzuo({}).then(res => {
 					this.xingzuoList = res.data
-		//			console.log('xingzuoList', this.xingzuoList);
+					//			console.log('xingzuoList', this.xingzuoList);
 				}).catch(error => {
 					console.error('获取技能类型失败:', error);
 				});
@@ -215,7 +313,7 @@
 			getShuxiang() {
 				getJiazhengShuxiang({}).then(res => {
 					this.shuxiangList = res.data
-			//		console.log('shuxiangList', this.shuxiangList);
+					//		console.log('shuxiangList', this.shuxiangList);
 				}).catch(error => {
 					console.error('获取技能类型失败:', error);
 				});
@@ -223,7 +321,7 @@
 			getHunyin() {
 				getJiazhengHunyin({}).then(res => {
 					this.hunyinList = res.data
-				//	console.log('hunyinList', this.hunyinList);
+					//	console.log('hunyinList', this.hunyinList);
 				}).catch(error => {
 					console.error('获取技能类型失败:', error);
 				});
@@ -231,7 +329,7 @@
 			getMinzu() {
 				getJiazhengMinzu({}).then(res => {
 					this.minzuList = res.data
-			//		console.log('minzuList', this.minzuList);
+					//		console.log('minzuList', this.minzuList);
 				}).catch(error => {
 					console.error('获取技能类型失败:', error);
 				});
@@ -252,7 +350,7 @@
 			xingzuoChange(e) {
 				const index = e.detail.value
 				this.formData.xingzuo = this.xingzuoList[index]
-			//	console.log('this.formData.xingzuo', this.formData.xingzuo);
+				//	console.log('this.formData.xingzuo', this.formData.xingzuo);
 
 			},
 			xingzuoCancel() {
@@ -277,11 +375,12 @@
 				this.formData.hunyin = data
 			},
 			switchXingzuoChange(e) {
-				this.formData.xingzuoFlag  =  e.detail.value
+				this.formData.xingzuoFlag = e.detail.value
 			},
 			goNext() {
 				console.log('formData', this.formData);
-				//this.$emit('goNext',0);
+				if (!this.checkAllFields()) return
+				this.$emit('goNext', 0);
 			},
 
 			handleAgree(e) {