瀏覽代碼

老人自助注册

XhuiCoder 1 年之前
父節點
當前提交
398cf07656
共有 8 個文件被更改,包括 1228 次插入55 次删除
  1. 37 34
      App.vue
  2. 23 14
      api/dict.js
  3. 8 0
      api/kh.js
  4. 195 0
      components/lazyPicker/lazyPicker.vue
  5. 8 0
      pages.json
  6. 954 0
      pages/createInfo/createInfo.vue
  7. 0 2
      pages/index/index.vue
  8. 3 5
      pages/lr/list.vue

+ 37 - 34
App.vue

@@ -1,45 +1,48 @@
 <script>
-	// import routingIntercept  from '@/common/permission.js'
-	import {
-		getToken
-	} from '@/common/auth.js'
-	export default {
-		onLoad(e) {},
-		onLaunch: function() {
-			if (getToken()) {
-				// uni.reLaunch({
-				// 	url: '/pages/index/index'
-				// })
+  // import routingIntercept  from '@/common/permission.js'
+  import {
+    getToken
+  } from '@/common/auth.js'
+  export default {
+    onLaunch(e) {
+      // 限制必须在微信中打开H5连接,即公众号中打开
+      // var ua = navigator.userAgent.toLowerCase();
+      // var isWeixin = ua.indexOf('micromessenger') != -1;
+      // if (!isWeixin) {
+      //   window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=888"
+      // }
+      const { path } = e
+      if (!getToken()) {
+        // 非老人自主注册页面, 不允许直接进入
+        if (path !== 'pages/createInfo/createInfo') {
+          uni.reLaunch({
+            url: '/pages/login/index'
+          })
+        }
 
-			} else {
-				uni.reLaunch({
-					url: '/pages/login/index'
-				})
-			}
-			// routingIntercept()
-			console.log('App Launch')
-		},
-		onShow: function() {},
-		onHide: function() {	}
-	}
+      }
+    },
+    onShow: function() {},
+    onHide: function() {}
+  }
 </script>
 
 <style>
-	/*每个页面公共css */
-	@font-face {
-		/* 	font-family: 'puhui';
+  /*每个页面公共css */
+  @font-face {
+    /* 	font-family: 'puhui';
 		src: url('./static/fonts/AlibabaPuHuiTi-3-65-Medium.ttf'); */
-	}
+  }
 
-	.global-font {
-		/* font-family: 'puhui';
+  .global-font {
+    /* font-family: 'puhui';
 		font-size: 16px;
 		color: #333; */
-	}
+  }
 
-	uni-page-body,
-	html,
-	body {
-		height: 100%;
-	}
+  uni-page-body,
+  html,
+  body {
+    height: 100%;
+  }
 </style>

+ 23 - 14
api/dict.js

@@ -2,27 +2,36 @@ import request from '@/common/request.js'
 
 // 根据字典类型查询字典数据信息
 export const getDicts = (dictType) => {
-	return request({
-		url: '/api/system/dict/data/common/type/' + dictType,
-		method: 'get',
-	})
+  return request({
+    url: '/api/system/dict/data/common/type/' + dictType,
+    method: 'get',
+  })
 }
 
 // 业务字典查询
 export const ObjdictList = (query) => {
-	return request({
-		url: '/api/system/dict/type/objdict',
-		method: 'get',
-		data: query
-	})
+  return request({
+    url: '/api/system/dict/type/objdict',
+    method: 'get',
+    data: query
+  })
 }
 
 
 // 地区查询
 export const GetChildListByCode = (query) => {
-	return request({
-		url: '/api/system/jlDept/getChildListByCode',
-		method: 'get',
-		data: query
-	})
+  return request({
+    url: '/api/system/jlDept/getChildListByCode',
+    method: 'get',
+    data: query
+  })
+}
+
+// 通过园区mchnt查询地区
+export const getChildListByMchnt = (data) => {
+  return request({
+    url: '/api/system/jlDept/getChildListByMchnt',
+    method: 'get',
+    data: data
+  })
 }

+ 8 - 0
api/kh.js

@@ -1,5 +1,13 @@
 import request from '@/common/request.js'
 
+// 获取园区数据
+export function getMchntList() {
+	return request({
+		url: '/api/lnst/mchnt/commonlist',
+		method: 'get',
+	})
+}
+
 // 老人信息修改
 export function updateKhjbxx(data) {
 	return request({

+ 195 - 0
components/lazyPicker/lazyPicker.vue

@@ -0,0 +1,195 @@
+<template>
+	<view>
+		<uni-popup ref="popup" type="bottom" @change="handleChange">
+			<view class="wrap">
+				<view class="title">请选择社区</view>
+				<image class="close" src="@/static/images/icons/close.png" @click="close"></image>
+				<scroll-view class="select-scroll" scroll-x show-scrollbar>
+					<view class="select-tab" :class="{active:idx === curTab}" v-for="(tab,idx) in tabList" :key="tab.id"
+						@click="tabClick(tab,idx)">
+						{{tab.label}}
+					</view>
+				</scroll-view>
+				<view class="cont-wrap">
+					<scroll-view class="content" :class="{active:listIdx === curTab}" scroll-y v-for="(list,listIdx) in levels"
+						:key="list">
+						<view class="list-item" v-for="(item,index) in contList[listIdx]" :key="item.id"
+							@click="itemClick(item,index)">
+							<view class="item-text">{{item.label}}</view>
+							<view class="check" :class="{checked:listIdx === lastTab && curItem === index}"></view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import { getUnitTree } from '@/api/business'
+	export default {
+		name: "LazyPicker",
+		props: {
+			open: {
+				type: Boolean,
+				required: true,
+				default: false,
+			}
+		},
+		data() {
+			return {
+				parentId: null,
+				levels: 5,
+
+				curTab: 0,
+				lastTab: null,
+				tabList: [
+					{ id: 0, label: '请选择' },
+				],
+
+				curItem: null,
+				contList: [],
+			};
+		},
+		created() {
+			getUnitTree().then(res => {
+				if (res.code !== 200) return
+				this.contList.push(res.data)
+				this.levels = Number(res.level)
+			})
+		},
+		watch: {
+			open(value) {
+				value ? this.$refs.popup.open() : this.$refs.popup.close()
+			},
+		},
+		methods: {
+			handleChange(e) {
+				this.$emit('change', e.show)
+			},
+			close() {
+				this.$refs.popup.close()
+			},
+			tabClick(tab, index) {
+				this.curTab = index
+			},
+			itemClick(item, index) {
+				this.curItem = index
+				this.tabList[this.curTab] = item
+				this.$emit('selected', item)
+
+				this.parentId = item.id
+				getUnitTree(this.parentId).then(({ code, data }) => {
+					if (code !== 200) return
+					this.lastTab = this.curTab
+					if (data.length > 0) {
+						// this.curItem = null	//重置
+						let nextTab = this.curTab + 1
+						if (this.tabList[nextTab]) {
+							this.tabList[nextTab] = { id: index, label: '请选择' }
+							this.tabList.splice(nextTab + 1)
+							this.curTab += 1
+							this.contList[this.curTab] = data
+						} else {
+							this.tabList.push({ id: index, label: '请选择' })
+							this.curTab += 1
+							this.contList[this.curTab] = data
+						}
+					} else {
+						this.tabList.splice(this.curTab + 1)
+					}
+				})
+
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.wrap {
+		font-size: 14px;
+		width: 100%;
+		background-color: #FFFFFF;
+		border-top-left-radius: 10px;
+		border-top-right-radius: 10px;
+		position: relative;
+
+		.close {
+			height: 20px;
+			width: 20px;
+			position: absolute;
+			top: 12px;
+			right: 8px;
+		}
+
+		.title {
+			font-size: 16px;
+			height: 44px;
+			line-height: 44px;
+			text-align: center;
+		}
+
+		.select-scroll {
+			white-space: nowrap;
+			border-bottom: 1px solid #f8f8f8;
+			padding: 0 5px;
+		}
+
+		.select-tab {
+			display: inline-block;
+			margin-left: 10px;
+			margin-right: 10px;
+			padding: 12px 0;
+			text-align: center;
+			white-space: nowrap;
+			position: relative;
+
+			&::after {
+				content: '';
+				height: 2px;
+				width: 100%;
+
+				position: absolute;
+				left: 0%;
+				bottom: 0;
+			}
+		}
+
+		.active::after {
+			background-color: #2979ff;
+		}
+
+		.content {
+			height: 460px;
+			display: none;
+
+			&.active {
+				display: block;
+			}
+
+			.list-item {
+				padding: 12px 15px;
+				display: flex;
+				flex-direction: row;
+				justify-content: space-between;
+			}
+
+			.check {
+				margin-right: 5px;
+				border: 2px solid #2979ff;
+				border-left: 0;
+				border-top: 0;
+				height: 12px;
+				width: 6px;
+				transform-origin: center;
+				transition: all 0.3s;
+				transform: rotate(45deg);
+				display: none;
+
+				&.checked {
+					display: block;
+				}
+			}
+		}
+	}
+</style>

+ 8 - 0
pages.json

@@ -171,6 +171,14 @@
 		    "navigationBarTitleText" : "跳转倒计时",
 		    "enablePullDownRefresh" : false
 		  }
+		},
+		{
+		  "path" : "pages/createInfo/createInfo",
+		  "style" : 
+		  {
+		    "navigationBarTitleText" : "老人自主注册",
+		    "enablePullDownRefresh" : false
+		  }
 		}
 	],
 

+ 954 - 0
pages/createInfo/createInfo.vue

@@ -0,0 +1,954 @@
+<template>
+  <view class="content">
+    <uni-card class="card">
+      <uni-section title="基本信息" type="line">
+        <view>
+          <view class="lzcOCR">
+            <view class="imgBox">
+              <image :src="zjcaijianSrc" style="width: 40vw;" mode="widthFix" @click="paizhao('front')">
+              </image>
+              <view class="text">拍摄人像面</view>
+            </view>
+            <view class="imgBox">
+              <image :src="zjcaijianSrcFan" style="width: 40vw;" mode="widthFix" @click="paizhao('back')">
+              </image>
+              <view class="text">拍摄国徽面</view>
+            </view>
+          </view>
+
+          <view class="miaoshu">
+            身份信息会跟进拍照的证件照片白动识别,不支持手动输入。如果识别错误,可尝试再次拍照.
+          </view>
+        </view>
+
+        <uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules" label-width="108px" style="margin-top: 3vh;">
+          <uni-forms-item label="姓名" required name="lrXm">
+            <uni-easyinput ref="xm" type="text" :disabled="disabled" v-model="baseFormData.lrXm" placeholder="请输入姓名"
+              :inputBorder="true"></uni-easyinput>
+          </uni-forms-item>
+          <uni-forms-item label="手机号" required name="lrCydh">
+            <uni-easyinput type="text" v-model="baseFormData.lrCydh" :disabled="disabled" placeholder="请输入手机号" :inputBorder="true"></uni-easyinput>
+          </uni-forms-item>
+          <uni-forms-item label="监护人姓名">
+            <uni-easyinput ref="xm" type="text" :disabled="disabled" v-model="baseFormData.jhrxm" placeholder="请输入监护人姓名"
+              :inputBorder="true"></uni-easyinput>
+          </uni-forms-item>
+          <uni-forms-item label="监护人联系电话" name="jhrlxdh">
+            <uni-easyinput type="text" v-model="baseFormData.jhrlxdh" :disabled="disabled" placeholder="请输入监护人联系电话"
+              :inputBorder="true"></uni-easyinput>
+          </uni-forms-item>
+          <uni-forms-item label="所属园区" name="ssyq" required>
+            <uni-data-select v-model="baseFormData.mchnt" :localdata="mchntList" @change="mchntChange"></uni-data-select>
+          </uni-forms-item>
+          <uni-forms-item label="所属社区" required>
+            <uni-data-picker ref="lrhjdz" v-model="baseFormData.lrHjdz" :localdata="lrhjdzList" popup-title="请选择社区" @change="lrhjdzChange"
+              @nodeclick="lrhjdzNodeClick" :readonly="lrhjdzList.length === 0"></uni-data-picker>
+          </uni-forms-item>
+          <uni-forms-item label="住址" required name="jzdz">
+            <uni-easyinput type="text" v-model="baseFormData.jzdz" :disabled="disabled" placeholder="请输入住址" :inputBorder="true"></uni-easyinput>
+          </uni-forms-item>
+
+          <uni-forms-item label="是否特困">
+            <uni-data-checkbox v-model="baseFormData.istk" :localdata="radioData"></uni-data-checkbox>
+          </uni-forms-item>
+
+          <uni-forms-item label="特困证明" v-if="baseFormData.istk == 1">
+            <myfile :zczmList="tkzmList" @recordsChange="tkChange"></myfile>
+          </uni-forms-item>
+
+          <uni-forms-item label="是否低保">
+            <uni-data-checkbox v-model="baseFormData.isdb" :localdata="radioData"></uni-data-checkbox>
+          </uni-forms-item>
+
+          <uni-forms-item label="低保证明" v-if="baseFormData.isdb == 1">
+            <myfile :zczmList="dbzmList" @recordsChange="dbChange"></myfile>
+          </uni-forms-item>
+
+          <uni-forms-item label="是否重残">
+            <uni-data-checkbox v-model="baseFormData.iszc" :localdata="radioData"></uni-data-checkbox>
+          </uni-forms-item>
+
+          <uni-forms-item label="重残证明" v-if="baseFormData.iszc == 1">
+            <!-- <uni-file-picker v-model="zczm" @select="imgSelect3" @delete="imgDelete3"></uni-file-picker> -->
+            <myfile :zczmList="zczmList" @recordsChange="zcChange"></myfile>
+          </uni-forms-item>
+
+          <view v-if="show">
+            <uni-forms-item label="直接上传">
+              <uni-data-checkbox v-model="radio" :localdata="radioData"></uni-data-checkbox>
+            </uni-forms-item>
+            <text>注意:人证比对不成功可以直接注册人工审核!</text>
+          </view>
+
+          <view class="miaoshu" v-if="isCheck">
+            该人员存在未审核信息,请先审核!
+          </view>
+
+          <view>
+            <view v-if="isCheck">
+              <button cursor-spacing="22px" :disabled="isCheck" class="buttonClass" @click="preSave()">认证</button>
+            </view>
+            <view v-else>
+              <button v-if="faceBase64 && ((show && radio == '1') || (!show && radio == '0'))" cursor-spacing="22px" class="buttonClass"
+                @click="save()">保存</button>
+              <button v-else cursor-spacing="22px" class="buttonClass" @click="preSave()">认证</button>
+            </view>
+
+          </view>
+        </uni-forms>
+      </uni-section>
+    </uni-card>
+
+
+    <view>
+      <!-- 普通弹窗 -->
+      <uni-popup ref="popup" background-color="#fff">
+        <picker-view :indicator-style="indicatorStyle" @change="bindChange" class="picker-view">
+          <picker-view-column v-if="jiedaoData.length > 0">
+            <view class="item" v-for="(item,index) in jiedaoData" :key="index">{{item.label}}</view>
+          </picker-view-column>
+          <picker-view-column v-if="shequData.length > 0">
+            <view class="item" v-for="(item,index) in shequData" :key="index">{{item.label}}</view>
+          </picker-view-column>
+        </picker-view>
+      </uni-popup>
+    </view>
+  </view>
+</template>
+
+<script>
+  import myfile from '@/components/my-file/my-file.vue';
+  // let jl = require('../../static/bufen.json')
+
+  import { decryptRowData_ECB, decryptData_ECB } from '@/common/sm4.js'
+  import { GetChildListByCode, getChildListByMchnt } from '@/api/dict.js'
+  import { showConfirm, getDictInfo, toast, toBase64 } from '@/common/common.js'
+  import { UploadOne, UploadSome, UploadSomeFile } from '@/api/upload.js'
+  import { Register } from '@/api/login.js'
+  import { getUser } from '@/common/auth.js'
+  import CryptoJS from 'crypto-js';
+  import config from '@/config.js';
+  import idCardNoUtil from '@/common/idcard.js'
+  import { translate, base64ToUrl, blobToDataURI, translateAll, base64toFilen, fileToBlob } from '@/common/image.js'
+  import { setToken, setOpenid, getOpenid, setUser } from '@/common/auth.js'
+  import { getAccessToken, idcard, match } from '@/common/baiduUtil.js'
+  import { updateKhjbxx, infoKhjbxx, GetLrByZjhm, SaveKhjbxx, YlhtUpdate, CheckReturn, GetUrl, getMchntList } from '@/api/kh.js'
+  // import lazyPicker from '@/components/lazyPicker/lazyPicker.vue'
+
+  export default {
+    components: {
+      myfile,
+      // lazyPicker
+    },
+    data() {
+      return {
+        mchntList: [],
+        lrhjdzList: [],
+
+        level: 3,
+        diqu: '',
+        tkzmList: [],
+        dbzmList: [],
+        zczmList: [],
+        isCheck: false,
+        indicatorStyle: `height: 50px;`,
+        jiedaoData: [],
+        shequData: [],
+        jiedaoValue: {},
+        shequValue: {},
+        disabled: true,
+        show: false,
+        radio: "0",
+        radioData: [{
+          text: '否',
+          value: "0"
+				}, {
+          text: '是',
+          value: "1"
+				}],
+        // 字典
+        dicts: {
+          // 民族
+          C0009: [],
+          // 性别
+          C0007: [],
+        },
+        // 百度云access_token
+        token: '',
+        // 人像地址
+        src: "/static/images/head.png",
+        // 身份拍摄地址
+        zjSrc: "",
+        // 身份证裁剪地址
+        zjcaijianSrc: '/static/images/zhengmian.png',
+        zjcaijianSrcFan: '/static/images/fanmian.png',
+        cardType: 'front',
+        frontBase64: '',
+        backBase64: '',
+        file1: "",
+        file2: "",
+        file3: "",
+        file4: "",
+        file5: "",
+        file6: "",
+        showSrc: "",
+        // 人员信息
+        userInfo: {},
+
+        // 身份证号加密
+        idcardMD5: '',
+        // 人像base64
+        faceBase64: '',
+        // 身份证base64
+        idcardFace: '',
+        idcardFaceUrl: '',
+        // 对比份数
+        score: 0,
+        // ocrXm
+        ocrXm: '',
+        isSearch: false,
+        baseFormData: {
+          lrXm: '',
+          lrZjhm: '',
+          lrHjbcxx: '',
+          lrCydh: '',
+          code: '',
+          diqu: '',
+          lrHjdz: '',
+          istk: "0",
+          isdb: "0",
+          iszc: "0",
+          lzzt: 0,
+          lrZjz: ""
+        },
+        rules: {
+          jzdz: {
+            rules: [{
+              required: true,
+              errorMessage: '住址不能为空'
+						}]
+          },
+          lrXm: {
+            rules: [{
+              required: true,
+              errorMessage: '姓名不能为空'
+						}]
+          },
+          diqu: {
+            rules: [{
+              required: true,
+              errorMessage: '请选择地区'
+						}]
+          },
+          photo: {
+            rules: [{
+              required: true,
+              errorMessage: '请上传人像'
+						}]
+          },
+          lrCydh: {
+            rules: [{
+                required: true,
+                errorMessage: '手机号不能为空'
+							},
+              {
+                format: 'number',
+                errorMessage: '请输入正确的手机号',
+							},
+              {
+                pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
+                errorMessage: '请输入正确的手机号',
+							}
+						]
+          },
+          jhrlxdh: {
+            rules: [{
+                required: false,
+                errorMessage: '监护人联系电话不能为空'
+							},
+              {
+                format: 'number',
+                errorMessage: '请输入正确的手机号',
+							},
+              {
+                pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
+                errorMessage: '请输入正确的手机号',
+							}
+						]
+          }
+        },
+      }
+    },
+    watch: {
+
+    },
+    onLoad(o) {
+      // 获取所属园区数据
+      getMchntList().then(res => {
+        if (res.code !== 200) return
+        const { rows } = res
+        this.mchntList = []
+        rows.forEach(item => {
+          this.mchntList.push({ text: item.name, value: item.mchnt })
+        })
+      })
+
+      // getAccessToken(this.callbackToken)
+      // window.addEventListener("message", e => {
+      //   if (e.data.data && e.data.data.arg.base64) {
+      //     setTimeout(() => {
+      //       uni.showLoading({
+      //         title: '正在识别中...'
+      //       })
+
+      //       this.faceBase64 = ''
+      //       this.cardType = uni.getStorageSync("cardType")
+
+      //       // if (this.cardType == 'front') e.data.data.arg.base64 = jl.front
+      //       // if (this.cardType == 'back') e.data.data.arg.base64 = jl.back
+
+      //       // 压缩	
+      //       translateAll(base64ToUrl(e.data.data.arg.base64), (base64, blobUrl) => {
+      //         idcard(base64, this.token, this.cardType, this.callbackIdcard)
+      //       })
+
+      //       uni.removeStorageSync('cardType')
+      //     }, 1000);
+
+      //   }
+
+      //   if (e.data.data && e.data.data.arg.faceBase64) {
+      //     setTimeout(() => {
+      //       uni.showLoading({
+      //         title: '正在识别中...'
+      //       })
+
+      //       this.faceBase64 = e.data.data.arg.faceBase64
+
+      //       // 压缩
+      //       translateAll(base64ToUrl(this.faceBase64), (base64, blobUrl) => {
+      //         this.src = this.faceBase64
+      //         match(this.token, base64.split(",")[1], this.idcardFace, this.callbackFace)
+      //       })
+      //     }, 1000);
+
+      //   }
+      // }, false)
+
+      // this.getDictList(Object.keys(this.dicts), this.dicts)
+      // this.baseFormData.code = getOpenid()
+
+      // this.userInfo = getUser()
+      // this.baseFormData.lrHjdz = this.userInfo.dept.locationCode
+
+      // let unitFilter = this.userInfo.dept.unitFilter.split(',')
+      // this.level = unitFilter.length
+      // if (this.userInfo.userType === '07') {
+      //   this.updateFlag = true
+      //   this.baseFormData.lrHjdz = this.userInfo.dept.locationCode.substring(0, 6) + '000000'
+      // }
+      // //  查询街道和社区
+      // this.getAddressList(this.baseFormData.lrHjdz)
+
+    },
+    methods: {
+      mchntChange(mchnt) {
+        if (mchnt) {
+          getChildListByMchnt({ mchnt }).then(res => {
+            if (res.code !== 200) return
+            const { data } = res
+            this.lrhjdzList = []
+            data.forEach(item => {
+              this.lrhjdzList.push({ text: item.label, value: item.code, level: 1 })
+            })
+          })
+        } else {
+          this.lrhjdzList = []
+          this.baseFormData.lrHjdz = ''
+        }
+      },
+      lrhjdzChange(e) {
+        // console.log(e);
+        // this.$refs.lrhjdz.show()
+      },
+      lrhjdzNodeClick(e) {
+        console.log(e);
+        this.$refs.lrhjdz.show()
+      },
+
+      tkChange(e) {
+        this.tkzmList = e
+      },
+      dbChange(e) {
+        this.dbzmList = e
+      },
+      zcChange(e) {
+        this.zczmList = e
+      },
+      getAddressList(code) {
+        GetChildListByCode({
+          code: code
+        }).then(res => {
+          if (res.data) {
+            if (this.level === 3) { //区县级用户
+              this.jiedaoData = res.data
+              this.shequData = res.data[0].children
+              this.jiedaoValue = this.jiedaoData[0]
+              this.shequValue = this.shequData[0]
+              this.diqu = this.jiedaoValue.label + '/' + this.shequValue.label
+              this.baseFormData.lrHjdz = this.shequValue.code
+            } else if (this.level === 4) { //街道级用户
+              this.shequData = res.data
+              this.shequValue = this.shequData[0]
+              this.diqu = this.shequValue.label
+              this.baseFormData.lrHjdz = this.shequValue.code
+            } else if (this.level === 5) { //社区级用户
+              this.baseFormData.lrHjdz = this.userInfo.dept.locationCode
+            }
+          }
+        })
+      },
+      callbackFace(res) {
+        uni.hideLoading()
+        if (res.data.error_msg == 'SUCCESS') {
+          this.score = res.data.result.score;
+
+          this.baseFormData.lrTxdb = JSON.stringify({
+            "lrJmzjhm": this.idcardMD5,
+            "xsfs": this.score
+          })
+          if (this.score >= config.score) {
+            this.show = false
+            // this.baseFormData.lzzt = 3
+            this.baseFormData.lzzt = 0
+            // this.baseFormData.lrSpyj = '同意'
+            this.baseFormData.lrSpyj = ''
+          } else {
+            // 低于80选项是否人工审核,是的话进记录表
+            // 身份证头像保存后端
+            // 人脸库注册人脸、身份证md5
+            // 修改的时候去人脸库搜索,搜索不到不允许修改
+            // 修改成功替换原始人脸库照片
+            // 首次修改搜索身份证
+            // 后端没入库,人脸库相应删除
+            // ocr失败身份证原版入库,ocr成功人脸入库
+            // showConfirm('人像与身份证不符,请重新上传')
+
+            // this.baseFormData.lzzt = 1
+            // this.baseFormData.lrSpyj = ''
+            this.baseFormData.lzzt = 0
+            this.baseFormData.lrSpyj = ''
+            this.show = true
+          }
+          // this.baseFormData.prelrZjz = this.zjcaijianSrc
+
+        } else {
+          showConfirm(res.data.error_msg)
+          this.faceBase64 = ''
+        }
+      },
+      callbackToken(e) {
+        this.token = e
+      },
+      callbackIdcard(words) {
+        uni.hideLoading()
+        if (!this.cardType) {
+          this.cardType = uni.getStorageSync("cardType")
+        }
+        if (this.cardType == 'front') {
+          if (!words) {
+            showConfirm('请上传正确的身份证人像面')
+            return
+          }
+          if (words.image_status == "other_type_card") {
+            showConfirm('请上传正确的身份证人像面')
+            return
+          }
+
+          let id = words.words_result['公民身份号码'].words
+          let csrq = words.words_result['出生'].words
+          let sex = words.words_result['性别'].words
+          let zz = words.words_result['住址'].words
+          let info = idCardNoUtil.getIdCardInfo(id)
+          if (!idCardNoUtil.checkIdCardNo(id)) {
+            showConfirm('身份证号识别有误,请重新上传')
+            return
+          }
+          if (info.birthday != csrq) {
+            showConfirm('身份证出生日期识别有误,请重新上传')
+            return
+          }
+          if (info.gender != sex) {
+            showConfirm('身份证性别识别有误,请重新上传')
+            return
+          }
+          if (words.image_status == "reversed_side") {
+            showConfirm('请上传身份证人像面')
+            return
+          }
+          if (words.risk_type != "normal") {
+            // normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况
+            showConfirm('请上传正确的身份证人像面')
+            return
+          }
+          // todo 根据身份证号查询此人信息是否可修改。this.isCheck = true
+
+
+
+          this.frontBase64 = words.card_image
+          this.zjcaijianSrc = 'data:image/jpeg;base64,' + words.card_image
+          this.disabled = false
+
+          // this.baseFormData.lrXb = getDictInfo(this.dicts.C0007, words.words_result['性别'].words)[0].value
+          // this.baseFormData.lrMz = getDictInfo(this.dicts.C0009, words.words_result['民族'].words)[0].value
+
+          this.baseFormData.lrXb = sex
+          this.baseFormData.lrMz = words.words_result['民族'].words
+
+
+          this.idcardFace = words.photo
+          this.idcardFaceUrl = base64ToUrl(words.photo);
+          this.baseFormData.lrZjhm = id
+          this.baseFormData.lrCsrq = csrq
+          this.idcardMD5 = CryptoJS.MD5(this.baseFormData.lrZjhm).toString()
+          this.baseFormData.lrXm = words.words_result['姓名'].words
+          this.baseFormData.lrHjbcxx = zz
+          this.ocrXm = words.words_result['姓名'].words
+
+
+
+          if (this.userInfo.userType != '07') {
+            GetLrByZjhm({
+              lrJmzjhm: this.idcardMD5
+            }).then(res => {
+              if (res.data) this.baseFormData = decryptData_ECB(res.data, ["lrZjhm", "lrXm",
+								"lrHjbcxx",
+								"lrXjdzBcxx",
+								"lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh",
+								"cjzh",
+								"yhzh", "khmc", "jhrxm", "jhrlxdh"
+							], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
+
+
+              if (this.baseFormData.lrTx) this.src = config.baseUrl + this.baseFormData.lrTx
+              if (this.baseFormData.lrHjdz) {
+                this.jiedaoData.forEach(e => {
+                  if (e.children.length > 0) {
+                    e.children.forEach(ee => {
+                      if (ee) {
+                        if (ee.code == this.baseFormData.lrHjdz) {
+                          this.shequValue = ee
+                          this.jiedaoValue = e
+                          this.diqu = this.jiedaoValue
+                            .label +
+                            '/' + this.shequValue.label
+                        }
+                      } else {
+                        if (e.code == this.baseFormData.lrHjdz) {
+                          this.jiedaoValue = e
+                          this.diqu = this.jiedaoValue.label
+                        }
+                      }
+
+                    })
+                  }
+                })
+              } else {
+                // 地区回显
+                this.getAddressList()
+              }
+              if (res.data && res.data.sfzzpb) this.zjcaijianSrcFan = res.data.sfzzpb
+              if (res.data && res.data.tkzm) this.tkzmList = [res.data.tkzm]
+              if (res.data && res.data.dbzm) this.dbzmList = [res.data.dbzm]
+              if (res.data && res.data.zczm) this.zczmList = [res.data.zczm]
+              if (res.data) this.updateFlag = true
+
+            })
+          }
+
+          // if (id) {
+          // 	GetLrByZjhm({
+          // 		lrJmzjhm: this.idcardMD5
+          // 	}).then(res => {
+          // 		if (res.data) {
+          // 			showConfirm('该信息已存在,请登录').then(res => {
+          // 				if (res.confirm == true) {
+          // 					uni.reLaunch({
+          // 						url: '/pages/login/index'
+          // 					})
+          // 				}
+          // 			})
+          // 		} else {
+          // 			this.disabled = false
+          // 		}
+          // 	})
+          // }
+        } else if (this.cardType == 'back') {
+          if (!words) {
+            showConfirm('请上传正确的身份证国徽面')
+            return
+          }
+          if (words.image_status == "other_type_card") {
+            showConfirm('请上传正确的身份证国徽面')
+            return
+          }
+          if (words.risk_type != "normal") {
+            // normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况
+            showConfirm('请上传正确的身份证国徽面')
+            return
+          }
+          // words.words_result['失效日期'].words
+          // words.words_result['签发日期'].words
+          // words.words_result['签发机关'].words
+          if (words && words.words_result) {
+            this.baseFormData.sfzqfjg = words.words_result['签发机关'].words
+            this.baseFormData.sfzyxqxs = words.words_result['签发日期'].words
+            this.baseFormData.sfzyxqxz = words.words_result['失效日期'].words
+            this.backBase64 = words.card_image
+            this.zjcaijianSrcFan = 'data:image/jpeg;base64,' + words.card_image
+          }
+
+        }
+      },
+      toggle(type) {
+        uni.hideKeyboard()
+        if (this.level === 3) {
+          this.shequData = this.jiedaoData[0].children
+        }
+
+        // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
+        this.$refs.popup.open(type)
+      },
+      bindChange(e) {
+        if (this.level === 3) { // 区县级用户
+          if (e.detail.value.length == 1) {
+            this.jiedaoValue = this.jiedaoData[e.detail.value[0]]
+            this.shequData = this.jiedaoData[e.detail.value[0]].children
+            if (this.shequData.length > 0 && this.shequData[0] != null) {
+              this.shequValue = this.shequData[0]
+              this.diqu = this.jiedaoValue.label + '/' + this.shequValue.label
+              this.baseFormData.lrHjdz = this.shequValue.code
+            } else {
+              this.shequData = []
+              this.shequValue = ''
+              this.diqu = this.jiedaoValue.label
+              this.baseFormData.lrHjdz = this.jiedaoValue.code
+            }
+          } else {
+            let index = e.detail.value[0] ? e.detail.value[0] : 0
+            this.jiedaoValue = this.jiedaoData[index]
+            this.shequValue = this.shequData[e.detail.value[1]]
+            this.diqu = this.jiedaoValue.label + '/' + this.shequValue.label
+            this.baseFormData.lrHjdz = this.shequValue.code
+          }
+        } else if (this.level === 4) { // 街道级用户
+          this.shequValue = this.shequData[e.detail.value[0]]
+          this.diqu = this.shequValue.label
+          this.baseFormData.lrHjdz = this.shequValue.code
+        }
+
+      },
+      buildDataByLevel(data, pid) {
+        let result = [];
+        data.filter(e => {
+          return e.parent_id === pid
+        }).forEach(e => {
+          result.push({
+            value: e.code,
+            text: e.name,
+            id: e.id,
+            children: this.buildDataByLevel(data, e.id)
+          })
+        })
+        return result.length > 0 ? result : []
+      },
+      paizhao(type) {
+        this.type = type
+        if (this.type == 'back' && !this.ocrXm) {
+          showConfirm('请先拍摄身份证人像面')
+          return
+        }
+        uni.setStorageSync("cardType", type)
+        uni.navigateTo({
+          url: '/pages/info/card'
+        })
+      },
+
+      preSave() {
+        if (this.baseFormData.lzzt != 0 && this.baseFormData.lzzt != 3 && this.baseFormData.lzzt != 6) {
+          showConfirm('信息正在审核,请审核后重试')
+          return
+        }
+        if (!this.ocrXm) {
+          showConfirm('请先拍摄身份证人像面')
+          return
+        }
+        if (this.zjcaijianSrcFan == '/static/images/fanmian.png') {
+          showConfirm('请先拍摄身份证国徽面')
+          return
+        }
+        if (this.baseFormData.istk == 1 && this.tkzmList.length == 0) {
+          showConfirm('请先上传特困证明')
+          return
+        }
+        if (this.baseFormData.isdb == 1 && this.dbzmList.length == 0) {
+          showConfirm('请先上传低保证明')
+          return
+        }
+        if (this.baseFormData.iszc == 1 && this.zczmList.length == 0) {
+          showConfirm('请先上传重残证明')
+          return
+        }
+
+
+        this.$refs['baseForm'].validate().then(res => {
+          if (this.ocrXm != this.baseFormData.lrXm) {
+            showConfirm('姓名与真实姓名不符,请重新上传身份证')
+            return
+          }
+          uni.navigateTo({
+            url: '/pages/info/face'
+          })
+        })
+      },
+      save() {
+
+        if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
+          uni.showLoading({
+            title: '正在保存中...'
+          })
+          let paramFiles = []
+
+
+          fileToBlob(base64toFilen('data:image/jpeg;base64,' + this.frontBase64), (e) => {
+            this.file1 = e
+            paramFiles.push({
+              name: "file1",
+              uri: this.file1
+            })
+          })
+          if (this.backBase64) {
+            fileToBlob(base64toFilen('data:image/jpeg;base64,' + this.backBase64), (e) => {
+              this.file2 = e
+              paramFiles.push({
+                name: "file2",
+                uri: this.file2
+              })
+            })
+          }
+
+          fileToBlob(base64toFilen(this.src), (e) => {
+            this.file3 = e
+            paramFiles.push({
+              name: "file3",
+              uri: this.file3
+            })
+          })
+
+
+          if (this.baseFormData.istk == 1 && this.tkzmList.length == 1 && this.tkzmList[0].indexOf(
+              'data:image') > -1) {
+            fileToBlob(base64toFilen(this.tkzmList[0]), (e) => {
+              this.file4 = e
+              paramFiles.push({
+                name: "file4",
+                uri: this.file4
+              })
+            })
+
+            if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
+              // 特殊材料待审核
+              // this.baseFormData.lzzt = 5
+              this.baseFormData.lzzt = 0
+              this.baseFormData.lrSpyj = '无'
+            }
+
+          }
+          if (this.baseFormData.isdb == 1 && this.dbzmList.length == 1 && this.dbzmList[0].indexOf(
+              'data:image') > -1) {
+            fileToBlob(base64toFilen(this.dbzmList[0]), (e) => {
+              this.file5 = e
+              paramFiles.push({
+                name: "file5",
+                uri: this.file5
+              })
+            })
+            if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
+              // 特殊材料待审核
+              // this.baseFormData.lzzt = 5
+              this.baseFormData.lzzt = 0
+              this.baseFormData.lrSpyj = '无'
+            }
+          }
+          if (this.baseFormData.iszc == 1 && this.zczmList.length == 1 && this.zczmList[0].indexOf(
+              'data:image') > -1) {
+            fileToBlob(base64toFilen(this.zczmList[0]), (e) => {
+              this.file6 = e
+              paramFiles.push({
+                name: "file6",
+                uri: this.file6
+              })
+            })
+            if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
+              // 特殊材料待审核
+              // this.baseFormData.lzzt = 5
+              this.baseFormData.lzzt = 0
+              this.baseFormData.lrSpyj = '无'
+            }
+          }
+
+          let that = this
+          setTimeout(function() {
+            UploadSomeFile(paramFiles).then(res => {
+              that.baseFormData.lrZjz = res.data.url1
+              if (that.backBase64) {
+                that.baseFormData.sfzzpb = res.data.url2
+              }
+              that.baseFormData.lrTx = res.data.url3
+              if (that.baseFormData.istk == 1 && that.tkzmList.length == 1) {
+                that.baseFormData.tkzm = res.data.url4
+              }
+              if (that.baseFormData.isdb == 1 && that.dbzmList.length == 1) {
+                that.baseFormData.dbzm = res.data.url5
+              }
+              if (that.baseFormData.iszc == 1 && that.zczmList.length == 1) {
+                that.baseFormData.zczm = res.data.url6
+              }
+
+              that.$refs['baseForm'].validate().then(res => {
+                if (that.updateFlag) {
+                  // todo 
+                  // that.baseFormData.lzzt = 1
+                  updateKhjbxx(that.baseFormData).then(r => {
+                    uni.hideLoading()
+                    if (r.code == 200) {
+                      toast('保存成功,正在前往刷脸激活')
+
+                      // todo 跳转刷脸激活
+                      setTimeout(function() {
+                        let param = {
+                          id: that.baseFormData.id,
+                          url: config.redirectUrl + that.baseFormData.id
+                        }
+                        GetUrl(param).then(res => {
+                          if (res.code == 200) {
+                            window.open(res.data.url, '_self');
+                          } else {
+                            toast('该功能暂未开放')
+                            // uni.navigateBack()
+                          }
+                        })
+                      }, 1000)
+                    }
+                  })
+                } else {
+                  // that.baseFormData.lzzt = 1
+                  SaveKhjbxx(that.baseFormData).then(r => {
+                    uni.hideLoading()
+                    if (r.code == 200) {
+                      toast('保存成功,正在前往刷脸激活')
+                      that.baseFormData.id = r.data
+                      setTimeout(function() {
+
+                        let param = {
+                          id: that.baseFormData.id,
+                          url: config.redirectUrl + that.baseFormData.id
+                        }
+                        GetUrl(param).then(res => {
+                          if (res.code == 200) {
+                            window.open(res.data.url, '_self');
+                          } else {
+                            toast('该功能暂未开放')
+                            // uni.navigateBack()
+                          }
+                        })
+                      }, 1000)
+                    }
+                  })
+                }
+
+              }).catch(err => {
+                uni.hideLoading()
+              })
+
+            })
+          }, 500)
+        } else {
+          showConfirm('请重新上传人像')
+          return
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .card {
+    margin: 0 !important;
+    padding: 0 !important;
+  }
+
+  ::v-deep .uni-forms-item__label {
+    justify-content: flex-end !important;
+    padding-right: 8px;
+  }
+
+  ::v-deep .uni-data-checklist {
+    margin-top: 5px !important;
+  }
+
+
+
+  .content {
+    padding: 1vh;
+  }
+
+
+  .lzcOCR {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 3vh;
+  }
+
+  .miaoshu {
+    margin-top: 3vh;
+    font-size: 14px;
+  }
+
+  .imgBox {
+    width: 47%;
+    text-align: center;
+
+    image {
+      width: 100%;
+    }
+
+    .text {
+      width: 100%;
+      /* background-color: red; */
+    }
+  }
+
+  .buttonClass {
+    width: 55vw;
+    border-radius: 25px;
+    background: #28d87d;
+    color: white;
+    height: 5vh;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-shadow: 0rpx 4rpx 10rpx 1rpx rgba(40, 216, 125, 0.4);
+  }
+
+  .picker-view {
+    width: 750rpx;
+    height: 600rpx;
+    margin-top: 20rpx;
+  }
+
+  .item {
+    line-height: 100rpx;
+    text-align: center;
+  }
+</style>

+ 0 - 2
pages/index/index.vue

@@ -79,10 +79,8 @@
       // 老人07、员工04、监管00
       this.userInfo = getUser()
       this.userType = this.userInfo.userType
-      console.log(this.userInfo);
     },
     onShow() {
-
       if (this.userType == '07') {
         this.info(this.userInfo.userId)
       } else {

+ 3 - 5
pages/lr/list.vue

@@ -60,7 +60,6 @@
         form: {
           pageNum: 1,
           pageSize: 8,
-          // createUserId: ''
         },
         dataList: [],
         options: [
@@ -81,11 +80,9 @@
         this.form.id = options.id
       }
       this.userInfo = getUser()
-      if (this.userInfo.userType != '07') {
+      if (['04', '07'].includes(this.userInfo.userType)) {
         this.form.createUserId = this.userInfo.userId
-      } else {
-        this.form.id = this.userInfo.userId
-      }
+      } 
       this.getList()
     },
     onPullDownRefresh() {
@@ -136,6 +133,7 @@
         }
       },
       getList() {
+        console.log(this.form);
         ListKhjbxx(this.form).then(res => {
           if (res.code == 200) {
             this.total = res.total