USER-20230908AJ\Administrator il y a 1 an
Parent
commit
1128243fee

+ 44 - 25
page_task/identity/identity.vue

@@ -45,18 +45,18 @@
 					</view>
 					<view class="p-t20">
 						<WhInput :value="formData.name" name="姓名" placeholder="待自动录入" disabled></WhInput>
-						<WhInput :value="formData.gender" name="性别" placeholder="待自动录入" disabled></WhInput>
+						<WhInput :value="formData.sex===1?'男':'女'" name="性别" placeholder="待自动录入" disabled></WhInput>
 						<WhInput :value="formData.id_number" :is_border="false" :name="'身份证号'" placeholder="待自动录入"
 							disabled>
 						</WhInput>
 					</view>
 				</view>
 				<view class="sys-background-fff r-20 m-t20 p-lr30">
-					<WhInput :name="'联系方式'"></WhInput>
+					<WhInput :value="formData.phone"  :name="'联系方式'"></WhInput>
 					<EnDataPicker title="请选择常居城市" @onChange="onChange">
-						<WhInput :value="formData.firm_address" name="常居城市" disabled is_select></WhInput>
+						<WhInput :value="formData.resident_city" name="常居城市" disabled is_select></WhInput>
 					</EnDataPicker>
-					<WhInput :name="'详细地址'"></WhInput>
+					<WhInput :name="'详细地址'" :value="formData.resident_address"></WhInput>
 					<view @click="onMarriage">
 						<WhInput :is_border="false" name="婚姻状态" disabled is_select></WhInput>
 					</view>
@@ -69,7 +69,7 @@
 				<view class="sys-background-fff r-20 m-t20 p-lr30 p-t30">
 					<view class="size-30 sys-weight-600 p-b30">教育职业背景</view>
 					<WhInput name="学历" disabled is_select></WhInput>
-					<EnRadio :value="formData.is_farming" name="雇佣类型" :list="farming" @onSelect="onFarming">
+					<EnRadio :value="formData.is_farming" name="雇佣类型" :list="employTypeData" @onSelect="onFarming">
 					</EnRadio>
 					<WhInput name="企业名称"></WhInput>
 					<WhInput name="企业城市" disabled is_select></WhInput>
@@ -93,8 +93,7 @@
 			@onSubmit="onSubmit" />
 		<EnButton v-else is_both :leftText="'保存'" :rightText="'下一步'" @onLeftSubmit="onLeftSubmit" @onSubmit="onStep(1)">
 		</EnButton>
-		<uv-action-sheet ref="actionSheet" round="10" :actions="list" title="请选择婚姻状态" @select="onSelect">
-		</uv-action-sheet>
+		<uv-action-sheet ref="marriageSheet" round="10" :actions="marriageData" title="请选择婚姻状态" @select="onSelectMarriage"></uv-action-sheet>
 	</view>
 </template>
 <!-- correct -->
@@ -111,20 +110,19 @@
 		},
 		data() {
 			return {
-				list: [{
-					name: '单身',
-					value: 1
-				}, {
-					name: '已婚',
-					value: 2
-				}],
-				farming: [{
-					text: '受薪',
-					value: 1
-				}, {
-					text: '自雇',
-					value: 2
-				}],
+        marriageData: [{'value': 1, 'name': '单身'}, {'value': 2, 'name': '已婚'}, {'value': 3, 'name': '离异'}, {'value': 4, 'name': '丧偶'},],
+        employTypeData: [{'value': 1, 'name': '受薪'}, {'value': 2, 'name': '自雇'}],
+        educationData: [
+          {name: "初中", value: 1,},
+          {name: "高中", value: 2,},
+          {name: "中专", value: 3,},
+          {name: "大专", value: 4,},
+          {name: "本科", value: 5,},
+          {name: "研究生", value: 6,},
+          {name: "硕士", value: 7,},
+          {name: "博士", value: 8,},
+          {name: "博士后", value: 9,},
+        ],
 				title: '',
 				step: 1,
 				scrollTop: 0,
@@ -161,9 +159,18 @@
 					"reserved_money": "",
 					"marriage_img": [],
 					"credit_img": []
-				}
+				},
+        clientInfoKey:[]
 			}
 		},
+    watch: {
+      'formData': {
+        handler() {
+          uni.$emit("putClientInfo", this.formData);
+        },
+        deep: true
+      },
+    },
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop / 120
 		},
@@ -171,7 +178,20 @@
 			this.title = options.title
 			let clientInfoData = uni.getStorageSync('clientInfoData')
 			let clientInfoKey = uni.getStorageSync('clientInfoKey')
+      this.formData=clientInfoData
+      this.clientInfoKey=clientInfoKey
 			console.log(clientInfoData, clientInfoKey)
+      uni.$on('discernMember',data=>{
+        this.formData.identity_one=data.identity_one
+        this.formData.identity_two=data.identity_two
+        this.formData.name=data.name
+        this.formData.id_number=data.id_number
+        this.formData.sex=data.sex
+        this.formData.identity_validity=data.identity_validity
+      })
+      uni.$on('setClientData',clientInfo=>{
+        this.formData=clientInfo
+      })
 		},
 		methods: {
 			setNum(step) {
@@ -211,10 +231,9 @@
 				this.formData.firm_address = address
 			},
 			onMarriage() {
-				console.log(11111);
-				this.$refs.actionSheet.open();
+				this.$refs.marriageSheet.open();
 			},
-			onSelect(e) {
+			onSelectMarriage(e) {
 				console.log(e);
 			},
 			onFarming(e) {

+ 117 - 7
page_task/identity_upload/identity_upload.vue

@@ -6,14 +6,16 @@
 					<text class="size-30 sys-weight-600">身份证上传认证照片</text>
 					<view class="size-26 m-t10 text-color-999">仅用于公安网核实身份</view>
 					<view class="row-justify-sb center size-28 p-b10 m-t40">
-						<view class="picture-item">
-							<image src="/static/img/information/identity-front.png" mode="aspectFill"></image>
+						<view class="picture-item"  @click="showUploadingImg(true,1)">
+							<image :src="memberData.identity_one" v-if="memberData.identity_one" mode="aspectFill"></image>
+							<image src="/static/img/information/identity-front.png" v-else mode="aspectFill"></image>
 							<view class="picture-text  button-background text-color-fff">
 								拍摄人像面
 							</view>
 						</view>
-						<view class="picture-item">
-							<image src="/static/img/information/identity-verso.png" mode="aspectFill"></image>
+						<view class="picture-item"  @click="showUploadingImg(true,2)">
+              <image :src="memberData.identity_two" v-if="memberData.identity_two" mode="aspectFill"></image>
+              <image src="/static/img/information/identity-verso.png" v-else mode="aspectFill"></image>
 							<view class="picture-text button-background text-color-fff">
 								拍摄国徽面
 							</view>
@@ -43,12 +45,23 @@
 				</EnButton>
 			</view>
 		</Nav>
+    <uni-popup ref="popup" :safeArea="false" type="bottom" >
+      <view class="popup-block">
+        <view class="popup-row" @click="uploadingImg(1)">拍照</view>
+        <view class="popup-row" @click="uploadingImg(2)">从手机里面选择</view>
+        <view class="popup-row" @click="showUploadingImg(false,0)">取消</view>
+      </view>
+    </uni-popup>
 
 	</view>
 </template>
 <!-- correct -->
 <script>
-	export default {
+	import tools from "@/service/tools";
+  import {getBaiDuImgRecognition} from "@/api/common";
+  import txUploadFile from "@/service/txOssSts";
+
+  export default {
 		components: {},
 		data() {
 			return {
@@ -68,20 +81,117 @@
 					name: '闪光强烈',
 					image: 'hint-four',
 					is_correct: false
-				}, ]
+				}, ],
+       memberData:{
+         identity_one:'',
+         identity_two:'',
+         name:'',
+         id_number:'',
+         sex:'',
+         identity_validity:'',
+       },
+        isUploading:false,
 			}
 		},
 		onLoad() {},
 		methods: {
+      showUploadingImg(showImg, uploadingType) {
+        if (showImg) {
+          if(this.isUploading){
+            return
+          }
+          this.isUploading=true
+          this.uploadingType = uploadingType;
+          this.$refs.popup.open("bottom");
+        } else {
+          this.$refs.popup.close();
+          this.isUploading=false
+        }
+      },
+      uploadingImg(sourceType) {
+        console.log('sourceType:'+sourceType)
+        uni.chooseMedia({
+          mediaType: 'image',
+          count: 1, //默认9
+          sizeType: "compressed",
+          sourceType: [sourceType === 1 ? 'camera' : 'album'],
+          fail:(e)=>{
+            console.log(e)
+          },
+          success: (res) => {
+            if (res.tempFiles.length > 0) {
+              res.tempFiles.forEach((tempFile) => {
+                txUploadFile(tempFile.tempFilePath).then((data) => {
+                  if (!data) {
+                    tools.error('图片上传失败')
+                    tools.hideLoading()
+                  } else {
+                    if (this.uploadingType === 1) {
+                      tools.showLoading()
+                      //开启身份证照片识别
+                      getBaiDuImgRecognition({
+                        'imgUrl': data.Location,
+                        'imgType': '1'
+                      }).then((res) => {
+                        tools.hideLoading()
+                        if (res.code === 1) {
+                          this.memberData.identity_one = data.Location;
+                          this.memberData.name = res.data.name;
+                          this.memberData.id_number = res.data.id_number;
+                          this.memberData.sex = res.data.sex;
+                          this.memberData.birthday = res.data.birthday;
+                        } else {
+                          tools.error('身份证照片识别失败')
+                        }
+                      })
+                    } else  {
+                      tools.showLoading()
+                      //开启身份证照片背面识别
+                      getBaiDuImgRecognition({
+                        'imgUrl': data.Location,
+                        'imgType': '4'
+                      }).then((res) => {
+                        tools.hideLoading()
+                        if (res.code === 1) {
+                          this.memberData.identity_two = data.Location;
+                          this.memberData.identity_validity =  res.data.identity_validity;
+                        } else {
+                          tools.error('身份证照片识别失败')
+                        }
+                      })
+                    }
+                  }
+                })
+              })
+              this.showUploadingImg(false, 0);
+            } else {
+              tools.error("请选择上传的图片")
+            }
+          },
+        });
+      },
 			// 完成
 			onSubmit() {
-				this.step = 4
+        if(this.memberData.name===''){
+          tools.error('请上传人像面照片')
+          return
+        }
+        if(this.memberData.identity_validity===''){
+          tools.error('请上传国徽面照片')
+          return
+        }
+        uni.$emit('discernMember',this.memberData)
+        tools.success('认证成功')
+				setTimeout(()=>{
+          tools.leftClick()
+        },100)
 			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
+@import "@/static/css/wh-common";
 	.picture-box {
 		position: relative;
 	}

+ 9 - 2
page_task/information/information.vue

@@ -209,6 +209,14 @@
 					this.getTaskTypeInfo(data.productId)
 				}
 			}
+      uni.$on('putClientInfo',clientInfo=>{
+        if(this.taskData.clientInfo.id_number!==clientInfo.id_number){
+          this.taskData.clientInfo=clientInfo
+          this.getClientInfo()
+        }else {
+          this.taskData.clientInfo=clientInfo
+        }
+      })
 		},
 		methods: {
 			addTask() {
@@ -301,6 +309,7 @@
 						if (res.data.business) {
 							res.data.business.id = ''
 							this.taskData.clientInfo = res.data.business
+              uni.$emit('setClientData',this.taskData.clientInfo)
 						}
 						if (res.data.propertyList) {
 							this.taskData.property = res.data.propertyList
@@ -310,7 +319,6 @@
 								})
 							}
 						}
-
 						if (res.data.applyFor) {
 							res.data.applyFor.id = ''
 							this.taskData.applies = res.data.applyFor
@@ -347,7 +355,6 @@
 						if (res.data.postLoan) {
 							this.taskData.post_loan = res.data.postLoan
 						}
-						console.log('-----------this.taskData-------------', this.taskData)
 					}
 				})
 			},

+ 26 - 0
static/css/wh-common.scss

@@ -0,0 +1,26 @@
+.popup-block {
+  border-radius: 20rpx 20rpx 0rpx 0rpx;
+  overflow: hidden;
+  background-color: #f5f5f5;
+  padding-bottom: 0;
+  .popup-row {
+    height: 100rpx;
+    background-color: #fff;
+    text-align: center;
+    line-height: 100rpx;
+    border-bottom: 2rpx solid #f5f5f5;
+    &:nth-last-child(2) {
+      margin-bottom: 20rpx;
+    }
+    &:last-child {
+      height: 112rpx;
+      border: none;
+      line-height: 112rpx;
+      //padding-bottom:constant(safe-area-inset-bottom);
+      padding-bottom:calc(env(safe-area-inset-bottom) - 40rpx);
+    }
+    &:active {
+      background-color: rgb(244, 244, 244);
+    }
+  }
+}