Przeglądaj źródła

修复了一些问题

zyh 2 miesięcy temu
rodzic
commit
5bb02e0f24

+ 18 - 10
components/customField/customField.js

@@ -39,16 +39,23 @@ Component({
 			}
 			//判断是否有未填写的
 			let data = this.data.customField.some(i => {
-				return i.customNameVal === null && i.isShow == 1 && i.isEditable === 1
-			})
-			if (data) {
-				this.setData({
-					list: this.data.customField
-				})
-				this.triggerEvent('isFillFields', false)
-			} else {
-				this.triggerEvent('isFillFields', true)
+				return i.customNameVal === null && i.isShow == 1
+			});
+			//没有未填写过&展示的
+			if (!data) {
+				this.triggerEvent('isFillFields', this.data.customField);
+				return;
 			}
+			//有未填写过&展示的
+			this.setData({
+				list: this.data.customField
+			});
+			//判断是否有可编辑的
+			let result = this.data.customField.some(j => {
+				return j.customNameVal === null && j.isShow == 1 && j.isEditable == 1
+			})
+
+			this.triggerEvent('isFillFields', !result?this.data.customField:false)
 		},
 		// 下拉
 		getSelect(e) {
@@ -139,8 +146,9 @@ Component({
 		setList() {
 			let canSubmit = true;
 			let list = this.data.list
+			console.log(list);
 			for (let index = 0; index < list.length; index++) {
-				if ((list[index].customNameVal == null || list[index].customNameVal == '') && list[index].isShow === 1) {
+				if ((list[index].customNameVal == null || list[index].customNameVal == '') && list[index].isShow === 1 && list[index].isEditable == 1) {
 					canSubmit = false;
 					break;
 				}

+ 6 - 6
components/customField/customField.wxml

@@ -4,7 +4,7 @@
             <view wx:for="{{list}}" wx:key="index" class="border" wx:if="{{item.isShow===1}}">
                 <view class="cu-form-group" wx:if="{{item.customType==='下拉选择'&&item.isShow===1}}">
                     <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text>
-                        <text>{{item.customName}}</text>
+                        <text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                     </view>
                     <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" bindchange="getSelect" value="{{item.customNameVal}}" range="{{item.configurationOption}}" range-key="{{'name'}}" data-index="{{index}}">
                         <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
@@ -14,12 +14,12 @@
                     </picker>
                 </view>
                 <view class="cu-form-group" wx:if="{{item.customType==='文本' &&item.isShow===1}}">
-                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}</text>
+                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                     </view>
                     <input disabled="{{item.isEditable === 0}}" type="text" bindinput="getValue" value="{{item.customNameVal}}" placeholder="{{item.prompt || '请填写内容'}}" data-index="{{index}}" placeholder-style="color: #C8C9CC"></input>
                 </view>
                 <view class="cu-form-group" wx:if="{{item.customType==='日期'&&item.isShow===1}}">
-                    <view class="title"><text class="{{item.customNameVal ?'text-green':'text-red'}}">*</text><text>{{item.customName}}</text>
+                    <view class="title"><text class="{{item.customNameVal ?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                     </view>
                     <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" class="picker" mode="date" value="{{item.customNameVal}}" start="2015-01-01" end="2100-01-01" bindchange="getValue">
                         <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
@@ -28,7 +28,7 @@
                     </picker>
                 </view>
                 <view class="cu-form-group" wx:if="{{item.customType==='时间'&&item.isShow===1}}">
-                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}</text>
+                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                     </view>
                     <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" class="picker" mode="time" value="{{item.customNameVal}}" start="00:00" end="23:59" bindchange="getValue">
                         <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
@@ -38,7 +38,7 @@
                 </view>
                 <!-- 图片 -->
                 <view class="cu-form-group height" wx:if="{{item.customType==='图片'&&item.isShow===1}}">
-                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}</text>
+                    <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                     </view>
                     <view wx:if="{{item.customNameVal}}" class="img_box">
                         <image src="{{item.customNameVal}}" class="img" bindtap="previewImg" data-src="{{item.customNameVal}}"></image>
@@ -51,7 +51,7 @@
                     <!-- 标题 -->
                     <view class="cu-form-group">
                         <view class="title">
-                            <text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}</text>
+                            <text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
                         </view>
                         <area-picker bind:value="getAddress" content="{{item.customNameVal}}" hasStreet="{{item.customType==='省市区街道'}}" data-index="{{index}}"></area-picker>
                     </view>

+ 1 - 2
components/face_verify/face_verify.js

@@ -285,7 +285,6 @@ Component({
 		},
 		// 无需实名认证&需抓拍人脸照片 注册信息 1-不需要照片 2-需要照片
 		doConfirmFaceNotifyNew(type) {
-			this.data.flag = null;
 			let img = '';
 			if (type == 2) {
 				img = app.data.catchFaceUrl || '';
@@ -545,10 +544,10 @@ Component({
 				case 3:
 					this.doConfirmFaceNotifyNew(2)
 					break;
-
 				default:
 					break;
 			}
+			this.data.flag = null;
 		}
 	}
 })