Просмотр исходного кода

Merge branch 'master' of https://gitee.com/he2802/saas_applet

chenxiong 3 лет назад
Родитель
Сommit
c899df26bf
3 измененных файлов с 29 добавлено и 19 удалено
  1. 5 5
      pages2/plan/index.vue
  2. 24 14
      pages2/verify/input.vue
  3. BIN
      static/icon/openSwith.png

+ 5 - 5
pages2/plan/index.vue

@@ -60,7 +60,7 @@
 										}}截止
 									</text>
 								</u-col>
-								<u-col span="1"><image src="/static/more.png" class="img_more" @click.stop="openShow(item)"></image></u-col>
+								<u-col span="1"><image src="/static/icon/openSwith.png" class="img_more" @click.stop="openShow(item)"></image></u-col>
 							</u-row>
 							<scroll-view style="white-space: nowrap" class="scroll-view_H" scroll-x="true">
 								<view style="margin-top: 30rpx;display: inline-block;width:296rpx;margin-right: 30rpx;" v-for="(items, indexs) in item.goodsVos" :key="indexs">
@@ -212,7 +212,7 @@ export default {
 			};
 			let self = this;
 			this.$api.editsystemplan(data).then(res => {
-				uni.setStorageSync('updateHome',1)
+				uni.setStorageSync('updateHome', 1);
 				self.getList();
 			});
 		},
@@ -328,7 +328,7 @@ export default {
 		},
 		getList() {
 			let self = this;
-			this.$api.getsystemplanlist({status:1}).then(result => {
+			this.$api.getsystemplanlist({ status: 1 }).then(result => {
 				result.data.rows.forEach((item, index) => {
 					item.show = 'none';
 				});
@@ -370,10 +370,10 @@ export default {
 				item.show = 'none';
 			}
 		},
-		updateHomePlan(){
+		updateHomePlan() {
 			const pages = getCurrentPages(); //获取页面栈
 			const beforePage = pages[pages.length - 2]; //前一个页面
-		//	beforePage.$vm.updateHomePlan();
+			//	beforePage.$vm.updateHomePlan();
 		},
 		close_calendar() {
 			this.isOpen = false;

+ 24 - 14
pages2/verify/input.vue

@@ -349,8 +349,8 @@ export default {
 							var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
 							if (this.$u.test.mobile(value) || vartest.test(value)) {
 								return true;
-							}else{
-								return false
+							} else {
+								return false;
 							}
 						},
 						message: '手机号码不正确',
@@ -401,10 +401,11 @@ export default {
 					{
 						validator: (rule, value, callback) => {
 							var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
-							if (this.$u.test.mobile(value) || vartest.test(value)) {
+							var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
+							if (this.$u.test.mobile(value) || vartest.test(value) || vartest1.test(value)) {
 								return true;
-							}else{
-								return false
+							} else {
+								return false;
 							}
 						},
 						message: '单位联系电话不正确',
@@ -460,7 +461,8 @@ export default {
 						trigger: ['change', 'blur']
 					}
 				]
-			}
+			},
+			isRequired: false
 		};
 	},
 	created() {
@@ -592,15 +594,19 @@ export default {
 		//验证表单
 		resultForm(int) {
 			if (this.openVerify) {
-				this.$refs.uForm.validate(valid => {
-					if (valid) {
-						if (int === 1) {
-							this.submitApi();
+				if (this.isRequired) {
+					this.submitApi();
+				} else {
+					this.$refs.uForm.validate(valid => {
+						if (valid) {
+							if (int === 1) {
+								this.submitApi();
+							}
+						} else {
+							console.log('验证失败');
 						}
-					} else {
-						console.log('验证失败');
-					}
-				});
+					});
+				}
 			}
 		},
 		async submits() {
@@ -703,6 +709,10 @@ export default {
 			var self = this;
 			this.$api.getbaseprofiletpId(this.goodsId).then(res => {
 				self.listData = JSON.parse(res.data.data.keyValue);
+				self.isRequired = self.listData.every(ims => {
+					return ims.required === false;
+				});
+				console.log(self.isRequired);
 				self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
 					if (result.data.code === 200) {
 						if (result.data.data && result.data.data.status === 3) {

BIN
static/icon/openSwith.png