wangxy 2 ヶ月 前
コミット
dfce1a6492
2 ファイル変更34 行追加6 行削除
  1. 33 6
      components/identification/identification.vue
  2. 1 0
      pages/client/Kaoshi/list.vue

+ 33 - 6
components/identification/identification.vue

@@ -4,6 +4,7 @@
 			mask-background-color="rgba(0, 0, 0, 0.4);">
 			<uni-popup-dialog mode="input" class="phone-ksxz-dialog" title="身份确认" :duration="2000" :before-close="true"
 				cancelText="修改" @close="handleClose" @confirm="handleConfirm">
+				<view @click="handleCloseOnly" class="closeIcon">x</view>
 				<view class="ksxz-content-box">
 					<view class="phone-name-box">
 						<!-- #ifdef H5 -->
@@ -11,12 +12,11 @@
 						<!-- <image :src="data.icon" /> -->
 						<!-- #endif -->
 					</view>
-					<view>姓名:{{data.realName}}</view>
-					<view>电话:{{data.userName}}</view>
+					<view :class="{isEmpty: data.realName}">姓名:{{data.realName}}</view>
+					<view :class="{isEmpty: !data.realName}">电话:{{data.userName}}</view>
 					<view>职业:{{data.zyName}}</view>
 					<view>等级:{{data.zyLevelName}}</view>
-					<view>身份证号(护照号):{{data.idcard}}</view>
-					<view>性别:{{data.gender == 0?'未知': data.gender == '2' ? '女': '男'}}</view>
+					<view :class="{isEmpty: !data.realName}">证件号:{{data.idcard}}</view>
 				</view>
 			</uni-popup-dialog>
 		</uni-popup>
@@ -42,6 +42,10 @@
 
 	const emits = defineEmits(['confirm', 'changeData'])
 
+	function handleCloseOnly() {
+		popupRef.value.close()
+	}
+
 	function showDialog(options) {
 		data.realName = options.realName;
 		data.userName = options.userName;
@@ -61,6 +65,27 @@
 	}
 
 	function handleConfirm() {
+		let arr = [];
+		if (data.realName) {
+			arr.push('姓名');
+		}
+		if (data.userName) {
+			arr.push('电话');
+		}
+		if (data.icon) {
+			arr.push('头像');
+		}
+		if (data.idcard) {
+			arr.push('证件号');
+		}
+		if (data.realName || !data.userName||!data.icon||!data.idcard) {
+			uni.showToast({
+				icon: 'none',
+				title: `请完善${arr.join('、')}信息!`
+			})
+			return;
+		}
+		
 		emits('confirm', data);
 		popupRef.value.close()
 	}
@@ -70,6 +95,8 @@
 	})
 </script>
 
-<style lang="scss">
-
+<style scoped lang="scss">
+.isEmpty {
+	color: #ff0101;
+}
 </style>

+ 1 - 0
pages/client/Kaoshi/list.vue

@@ -118,6 +118,7 @@
 	}
 
 	function handleConfirmIdent(data) {
+		
 		saveIdentCache(activeks.value.ksId, true);
 		ksxzRef.value.showDialog(activeks.value)
 	}