ソースを参照

perf: 优化必填项显示和校验

lizhaocai 3 ヶ月 前
コミット
fafd726099

+ 84 - 33
circlePages/addShare.vue

@@ -34,15 +34,15 @@
 				<view v-if="selectValue=='个人'" style="padding: 16px">
 					<uni-forms :modelValue="formData" label-width="0">
 
-						<text v-if="formInfo.contactNickName">用户昵称:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>用户昵称:</text>
 						<uni-forms-item label="用户昵称" name="realName" label-width="0">
 							<uni-easyinput type="text" disabled v-model="formInfo.contactNickName" placeholder="请输入您的昵称" />
 						</uni-forms-item>
-						<text v-if="formInfo.userRealName">真实姓名:</text>
+						<text style="line-height: 30px;vertical-align: middle;">真实姓名:</text>
 						<uni-forms-item label="真实姓名" name="contactMethod" v-if="formInfo.userRealName">
 							<uni-easyinput type="text" disabled="" v-model="formInfo.userRealName" placeholder="请输入真实姓名" />
 						</uni-forms-item>
-						<text v-if="formInfo.contactMethod">联系方式:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>联系方式:</text>
 						<uni-forms-item label="联系方式" name="phone">
 							<uni-easyinput type="text" disabled v-model="formInfo.contactMethod" placeholder="请输入联系手机/微信/邮箱" />
 						</uni-forms-item>
@@ -53,7 +53,7 @@
 				<view v-if="selectValue=='公司'" style="padding: 16px">
 					<uni-forms :modelValue="formData" label-width="0">
 						<view style="margin-bottom:16px">
-							<text v-if="searchValue">公司名称:</text>
+							<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>公司名称:</text>
 							<w-select style="width: 100%;" v-model='searchValue' :list='items' valueName='name'
 								keyName="regNumber" @change='selectChange' :filterable="true">
 							</w-select>
@@ -61,15 +61,15 @@
 						<!-- <uni-forms-item label="公司名称" name="name">
 					<uni-easyinput type="text" v-model="userInfo.company" placeholder="请输入所在公司名称" />
 				</uni-forms-item> -->
-						<text v-if="formInfo.jobTitle">您的职称:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>您的职称:</text>
 						<uni-forms-item label="" name="realName" label-width="0">
 							<uni-easyinput type="text" :clearable="false" v-model="formInfo.jobTitle" placeholder="请输入您的职称" />
 						</uni-forms-item>
-						<text v-if="formInfo.contactPerson">联系姓名:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>联系姓名:</text>
 						<uni-forms-item label="联系人姓名" name="contactMethod">
 							<uni-easyinput type="text" :clearable="false" v-model="formInfo.contactPerson" placeholder="请输入联系人姓名" />
 						</uni-forms-item>
-						<text v-if="formInfo.contactMethod">联系方式:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>联系方式:</text>
 						<uni-forms-item label="联系方式" name="phone">
 							<uni-easyinput type="text" :clearable="false" v-model="formInfo.contactMethod" placeholder="请输入联系手机/微信/邮箱" />
 						</uni-forms-item>
@@ -119,26 +119,26 @@
 			</view>
 			<view v-if="stepIndex!=1">
 
-				<view style="padding: 16px" v-if="(selectValue=='公司'&&stepIndex==2)||(selectValue=='个人'&&stepIndex==2)">
+				<view style="padding: 16px;padding-bottom: 0;" v-if="(selectValue=='公司'&&stepIndex==2)||(selectValue=='个人'&&stepIndex==2)">
 					
-					<text>发布种类:</text>
+					<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>发布种类:</text>
 					<uni-data-select v-model="selectValue2" :localdata="selectList2" @change="changeSelect2"
 						:clear="false"></uni-data-select>
 				</view>
 
 				<view v-if="selectValue2=='产品'" >
 					<view style="padding: 16px" v-if="(selectValue=='公司'&&stepIndex==2)||(selectValue=='个人'&&stepIndex==2)">
-						<text v-if="selectValue4">产品种类:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>产品种类:</text>
 						<uni-data-select v-model="selectValue4" :localdata="selectList4" @change="changeSelect4"
 							placeholder="产品种类" :clear="false" style="margin-bottom:16px"></uni-data-select>
 						
 						
 						<view style="margin-top: 16px;">
-						   <text>品牌:</text>
-						   <uni-easyinput type="text"  required v-model="brand" placeholder="请输入产品品牌" />
+						   <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>产品品牌:</text>
+						   <uni-easyinput type="text" :clearable="false" required v-model="brand" placeholder="请输入产品品牌" />
 						</view>
 						<view style="margin-top: 16px;line-height: 30px;margin-bottom: 16px;">
-							发布的产品是否属于医疗器械?
+							<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text>发布的产品是否属于医疗器械?
 							<uni-data-checkbox :multiple="false" v-model="isMedical" selectedColor="#01BEFF"
 								:localdata="[{text: '是',value: '1'},{text: '否',value: '0'}]" />
 						</view>
@@ -166,18 +166,20 @@
 										<uni-forms :modelValue="formData" label-width="0">
 											 
 											<uni-forms-item label="" name="prodName" label-width="0">
+												<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>产品名称:</text>
 												<uni-easyinput maxlength="50" type="text" :clearable="false" v-model="item.prodName"
 													placeholder="*请输入产品名称" />
 											</uni-forms-item>
-											<uni-forms-item label="" name="contactMethod">
+											<uni-forms-item label="" name="prodSpec" label-width="0">
+												<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>产品型号:</text>
 												<uni-easyinput maxlength="100" type="text" :clearable="false" v-model="item.prodSpec"
 													placeholder="*请输入产品型号" />
 											</uni-forms-item>
-											<uni-forms-item label="" name="phone">
+											<uni-forms-item label="" name="prodDesc">
+												<text style="line-height: 30px;vertical-align: middle;">产品介绍:</text>
 												<uni-easyinput maxlength="500" type="textarea" v-model="item.prodDesc" placeholder="请输入产品介绍" />
 											</uni-forms-item>
-										
-										
+
 										</uni-forms>
 										<template v-slot:actions v-if="itemIndex==extList.length-1" >
 											<view style="margin: 12px;margin-top: -12px;">
@@ -220,7 +222,7 @@
 				</view>
 				<view v-if="selectValue2=='服务'&&stepIndex==2">
 					<view style="padding: 16px">
-						<text>服务类型:</text>
+						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>服务类型:</text>
 						<uni-data-select v-model="selectValue3" :localdata="selectList3" @change="changeSelect3"
 							:clear="false"></uni-data-select>
 					</view>
@@ -228,8 +230,8 @@
 				
 				<view v-if="selectValue2=='服务'&&stepIndex==2">
 					<view style="padding: 16px">
-					   <text>品牌:</text>
-					   <uni-easyinput type="text"  required v-model="brand" placeholder="请输入服务品牌" />
+					   <text style="line-height: 30px;vertical-align: middle;">服务品牌:</text>
+					   <uni-easyinput type="text" :clearable="false" v-model="brand" placeholder="请输入服务品牌" />
 					</view>
 				</view>
 					
@@ -240,7 +242,7 @@
 					 	<input placeholder="写下一句简短的标题" name="input" placeholder-style="color:#AAAAAA" ></input>
 					 </view> -->
 					 <view v-if="selectValue2=='服务'&&stepIndex==2" style="padding: 16px;padding-bottom: 0;margin-bottom: -30rpx;">
-					    <text>服务介绍:</text>
+					    <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>服务介绍:</text>
 					 </view>
 					<view v-if="selectValue2=='服务'&&stepIndex==2" class="tn-margin tn-bg-gray--light tn-padding"
 						style="border-radius: 10rpx;">
@@ -592,12 +594,58 @@
 					 	prodName: "",
 					 	prodSpec: "",
 					 })
+				 }
+				 if(that.selectValue=='公司'){
+					 console.error(this.org);
+					 //判断必填项
+					 // 公司
+					 if(!this.org.name){
+					 	uni.showToast({
+					 		title: '请输入公司名称',
+					 		duration: 2000,
+					 		icon:'none'
+					 	});
+					 	return false;
+					 }
+					 
+					 if(this.formInfo.jobTitle.length<1){
+					 	uni.showToast({
+					 		title: '请输入您的职称',
+					 		duration: 2000,
+					 		icon:'none'
+					 	});
+					 	return false;
+					 }
+					 if(this.formInfo.contactPerson.length<1){
+					 	uni.showToast({
+					 		title: '请输入联系人姓名',
+					 		duration: 2000,
+					 		icon:'none'
+					 	});
+					 	return false;
+					 }
+					 if(this.formInfo.contactMethod.length<1){
+					 	uni.showToast({
+					 		title: '请输入联系手机/微信/邮箱',
+					 		duration: 2000,
+					 		icon:'none'
+					 	});
+					 	return false;
+					 }
 				 }
 					if(this.stepIndex==2&&that.selectValue2=='产品'){
+						if(this.brand.length<1){
+							uni.showToast({
+								title: '请输入产品品牌',
+								duration: 2000,
+								icon:'none'
+							});
+							return false;
+						}
 						for(let i=0;i<this.extList.length;i++){
 							if(!this.extList[i].prodName||!this.extList[i].prodSpec){
 								uni.showToast({
-									title: !this.extList[i].prodName?'产品'+(i+1)+'的产品名称必填':'产品'+(i+1)+'的产品型号必填',
+									title: !this.extList[i].prodName?'请输入产品'+(i+1)+'的产品名称':'请输入产品'+(i+1)+'的产品型号',
 									duration: 2000,
 									icon:'none'
 								});
@@ -610,7 +658,7 @@
 						 
 							if(!this.content){
 								uni.showToast({
-									title: '服务介绍必填',
+									title: '请输入服务介绍',
 									duration: 2000,
 									icon:'none'
 								});
@@ -620,13 +668,9 @@
 					}
 				 
 				this.stepIndex = this.stepIndex+1;
-				
-				console.error(this.stepIndex);
 			},
 			getCompany(){
 				let that = this;
-				
-				 
 					request.post('/slbUserCompanyRel/show/my', {
 						userNo: uni.getStorageSync('userNo')
 					}).then(res => {
@@ -635,7 +679,15 @@
 							for(let i=0;i<list.length;i++){
 								list[i].name = list[i].company;
 								list[i].regNumber= list[i].company;
-								if(list[i].isDefault=='1'){
+								if(!that.isEdit&&list[i].isDefault=='1'){
+									that.searchValue = list[i].name
+									that.current = list[i].name;
+									that.formInfo.jobTitle = list[i].jobTitle;
+									that.formInfo.contactPerson = list[i].contactPerson;
+									that.formInfo.contactMethod = list[i].contactMethod;
+									that.org = list[i];
+								}
+								if(that.isEdit&&list[i].name==that.editItem.company){
 									that.searchValue = list[i].name
 									that.current = list[i].name;
 									that.formInfo.jobTitle = list[i].jobTitle;
@@ -649,9 +701,6 @@
 							console.warn(that.items);
 						}  
 					})
-				
-				 
-				 
 			},
 			changeSelect(e) {
 				this.selectValue = e;
@@ -697,7 +746,7 @@
 					for(let i=0;i<this.extList.length;i++){
 						if(!this.extList[i].prodName||!this.extList[i].prodSpec){
 							uni.showToast({
-								title: !this.extList[i].prodName?'产品'+(i+1)+'的产品名称必填':'产品'+(i+1)+'的产品型号必填',
+								title: !this.extList[i].prodName?'请输入产品'+(i+1)+'的产品名称':'请输入产品'+(i+1)+'的产品型号',
 								duration: 2000,
 								icon:'none'
 							});
@@ -740,6 +789,8 @@
 					postData.companyEntity.company = postData.company;
 					postData.companyEntity.jobTitle = postData.jobTitle;
 					postData.companyEntity.creditCode = this.org.creditCode;
+					postData.companyEntity.address = this.org.base;
+					postData.companyEntity.regStatus = this.org.regStatus;
 					
 					postData.companyEntity.contactPerson = postData.contactPerson;
 					postData.companyEntity.contactMethod = postData.contactMethod;
@@ -888,7 +939,7 @@
 
 				} else {
 					that.items = [];
-
+					that.org = {};
 				}
 			},
 		}

+ 19 - 9
circlePages/circle.vue

@@ -113,7 +113,7 @@
 				    :localdata="selectList"
 				    @change="changeSelect"
 					placement="top"
-					placeholder="需求有效期"
+					placeholder="请选择"
 				  ></uni-data-select>
 			</view>
 
@@ -147,7 +147,7 @@
 	<view style="padding:16px">
 		<uni-forms :modelValue="formData" label-width="0">
 			<view style="margin:16px 0">
-				<text v-if="searchValue">公司名称:</text>
+				<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>公司名称:</text>
 			<w-select
 			     style="width: 100%;" 
 			     v-model='searchValue' 
@@ -162,15 +162,15 @@
 			<!-- <uni-forms-item label="公司名称" name="name">
 				<uni-easyinput type="text" v-model="userInfo.company" placeholder="请输入所在公司名称" />
 			</uni-forms-item> -->
-			<text v-if="formInfo.jobTitle">您的职称:</text>
+			<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>您的职称:</text>
 			<uni-forms-item label="" name="realName" label-width="0">
 				 <uni-easyinput type="text" v-model="formInfo.jobTitle" :clearable="false" placeholder="请输入您的职称" />
 			</uni-forms-item>
-			<text v-if="formInfo.contactPerson">联系姓名:</text>
+			<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>联系姓名:</text>
 			<uni-forms-item label="联系人姓名" name="contactMethod">
 				 <uni-easyinput type="text" v-model="formInfo.contactPerson" :clearable="false" placeholder="请输入联系人姓名" />
 			</uni-forms-item>
-			<text v-if="formInfo.contactMethod">联系方式:</text>
+			<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>联系方式:</text>
 			<uni-forms-item label="联系方式" name="phone">
 				 <uni-easyinput type="text"  v-model="formInfo.contactMethod" :clearable="false" placeholder="请输入联系手机/微信/邮箱" />
 			</uni-forms-item>
@@ -335,7 +335,7 @@
 			 				for(let i=0;i<list.length;i++){
 			 					list[i].name = list[i].company;
 			 					list[i].regNumber= list[i].company;
-								if(list[i].isDefault=='1'){
+								if(!that.isEdit&&list[i].isDefault=='1'){
 									that.searchValue = list[i].name
 									that.current = list[i].name;
 									that.org = list[i];
@@ -343,6 +343,14 @@
 										that.formInfo.jobTitle = list[i].jobTitle
 									}
 								}
+								if(that.isEdit&&list[i].name==that.editItem.company){
+									that.searchValue = list[i].name
+									that.current = list[i].name;
+									that.formInfo.jobTitle = list[i].jobTitle;
+									that.formInfo.contactPerson = list[i].contactPerson;
+									that.formInfo.contactMethod = list[i].contactMethod;
+									that.org = list[i];
+								}
 			 					 
 			 				}
 			 				that.items = list;
@@ -356,7 +364,7 @@
 				
 				if(this.content==''&&this.fileDetailList.length===0){
 					 uni.showToast({
-						title:'请填写需求或上传图片/文件',
+						title:'请输入您的需求或上传图片/文件',
 						icon:'none'
 					 })
 					 this.stepIndex = 1;
@@ -381,7 +389,7 @@
 				
 				if(status!=1&&!this.org.name){
 					uni.showToast({
-						title: '请检查公司名称是否准确',
+						title: '请输入公司名称',
 						duration: 2000,
 						icon:'none'
 					});
@@ -449,6 +457,8 @@
 				params.slbResourceDemand.companyEntity.company = params.slbResourceDemand.company;
 				params.slbResourceDemand.companyEntity.jobTitle = params.slbResourceDemand.jobTitle;
 				params.slbResourceDemand.companyEntity.creditCode = this.org.creditCode;
+				params.slbResourceDemand.companyEntity.address = this.org.base;
+				params.slbResourceDemand.companyEntity.regStatus = this.org.regStatus;
 				
 				params.slbResourceDemand.companyEntity.contactPerson = params.slbResourceDemand.contactPerson;
 				params.slbResourceDemand.companyEntity.contactMethod = params.slbResourceDemand.contactMethod;
@@ -583,7 +593,7 @@
 					 
 				}else{
 					that.items = [];
-					 
+					that.org = {}; 
 				}
 			},
 		}

ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/addShare.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/circle.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.js


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.wxml


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/circle.js


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/circle.wxml