From b9ebc3c70a2f1c0c40b0d71b497e19ca764ac15f Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Sun, 07 Apr 2024 17:31:23 +0800
Subject: [PATCH] 更新
---
subPackage/counterfraud/add.vue | 102 +++++---
subPackage/house/member/add.vue | 142 +++++++++++-
pages/user/center.vue | 20 +
subPackage/grid/comprehensive.vue | 7
common/common.js | 48 ++--
pages/statistics/index.vue | 12
api/system/region.js | 7
pages.json | 58 ++--
subPackage/house/member/index.vue | 169 ++++++++++++++-
subPackage/counterfraud/propagateDetail.vue | 81 +++++-
10 files changed, 501 insertions(+), 145 deletions(-)
diff --git a/api/system/region.js b/api/system/region.js
index 4c289d0..8353c7c 100644
--- a/api/system/region.js
+++ b/api/system/region.js
@@ -18,4 +18,11 @@
parentCode
}
})
+}
+
+export const regionTree = () => {
+ return http.request({
+ url: '/blade-system/region/getBaseTree',
+ method: 'GET'
+ })
}
\ No newline at end of file
diff --git a/common/common.js b/common/common.js
index 96e5365..e4db5b0 100644
--- a/common/common.js
+++ b/common/common.js
@@ -104,12 +104,12 @@
iconPath: '/static/img/tabbar-01.png',
url: '/pages/home/index'
},
- // {
- // name: '圈子',
- // iconPathSelected: '/static/img/tabbar-02-selected.png',
- // iconPath: '/static/img/tabbar-02.png',
- // url: '/pages/circle/index'
- // },
+ {
+ name: '圈子',
+ iconPathSelected: '/static/img/tabbar-02-selected.png',
+ iconPath: '/static/img/tabbar-02.png',
+ url: '/pages/circle/index'
+ },
{
name: '我的',
iconPathSelected: '/static/img/tabbar-03-selected.png',
@@ -124,12 +124,12 @@
iconPath: '/static/img/tabbar-04.png',
url: '/pages/home/index'
},
- // {
- // name: '圈子',
- // iconPathSelected: '/static/img/tabbar-08-selected.png',
- // iconPath: '/static/img/tabbar-08.png',
- // url: '/pages/circle/index'
- // },
+ {
+ name: '圈子',
+ iconPathSelected: '/static/img/tabbar-08-selected.png',
+ iconPath: '/static/img/tabbar-08.png',
+ url: '/pages/circle/index'
+ },
{
name: '驾驶舱',
iconPathSelected: '/static/img/tabbar-05-selected.png',
@@ -152,12 +152,12 @@
iconPath: '/static/img/tabbar-01.png',
url: '/pages/home/index'
},
- // {
- // name: '圈子',
- // iconPathSelected: '/static/img/tabbar-02-selected.png',
- // iconPath: '/static/img/tabbar-02.png',
- // url: '/pages/circle/index'
- // },
+ {
+ name: '圈子',
+ iconPathSelected: '/static/img/tabbar-02-selected.png',
+ iconPath: '/static/img/tabbar-02.png',
+ url: '/pages/circle/index'
+ },
{
name: '驾驶舱',
iconPathSelected: '/static/img/tabbar-07-selected.png',
@@ -179,12 +179,12 @@
iconPath: '/static/img/tabbar-01.png',
url: '/pages/home/index'
},
- // {
- // name: '圈子',
- // iconPathSelected: '/static/img/tabbar-02-selected.png',
- // iconPath: '/static/img/tabbar-02.png',
- // url: '/pages/circle/index'
- // },
+ {
+ name: '圈子',
+ iconPathSelected: '/static/img/tabbar-02-selected.png',
+ iconPath: '/static/img/tabbar-02.png',
+ url: '/pages/circle/index'
+ },
{
name: '驾驶舱',
iconPathSelected: '/static/img/tabbar-07-selected.png',
diff --git a/pages.json b/pages.json
index 746f990..544756e 100644
--- a/pages.json
+++ b/pages.json
@@ -45,21 +45,21 @@
"navigationStyle": "custom"
}
},
- // {
- // "path": "pages/circle/index",
- // "style": {
- // "enablePullDownRefresh": false,
- // "navigationStyle": "custom"
- // }
- // },
- // {
- // "path": "pages/circle/publish",
- // "style": {
- // "navigationBarTitleText": "发布",
- // "navigationBarBackgroundColor": "#fff",
- // "navigationBarTextStyle": "black"
- // }
- // },
+ {
+ "path": "pages/circle/index",
+ "style": {
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/circle/publish",
+ "style": {
+ "navigationBarTitleText": "发布",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black"
+ }
+ },
{
"path": "pages/home/selectSite",
"style": {
@@ -834,7 +834,10 @@
"navigationBarTitleText": "资料管理",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "ocr-navigator": "plugin://ocr-plugin/ocr-navigator"
+ }
}
},
{
@@ -852,7 +855,10 @@
"navigationBarTitleText": "人口采集",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "ocr-navigator": "plugin://ocr-plugin/ocr-navigator"
+ }
}
},
{
@@ -1045,7 +1051,7 @@
"pages": [{
"path": "add",
"style": {
- "navigationBarTitleText": "反诈宣传",
+ "navigationBarTitleText": "反诈宣防",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
@@ -1066,7 +1072,7 @@
}, {
"path": "propagateRecord",
"style": {
- "navigationBarTitleText": "反诈宣传记录",
+ "navigationBarTitleText": "反诈宣防记录",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false
@@ -1075,7 +1081,7 @@
{
"path": "propagateDetail",
"style": {
- "navigationBarTitleText": "反诈宣传详情",
+ "navigationBarTitleText": "反诈宣防详情",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false
@@ -1186,12 +1192,12 @@
"iconPath": "static/img/tabbar-01.png",
"text": "首页"
},
- // {
- // "pagePath": "pages/circle/index",
- // "iconPath": "static/img/tabbar-02.png",
- // "selectedIconPath": "static/img/tabbar-02-selected.png",
- // "text": "圈子"
- // },
+ {
+ "pagePath": "pages/circle/index",
+ "iconPath": "static/img/tabbar-02.png",
+ "selectedIconPath": "static/img/tabbar-02-selected.png",
+ "text": "圈子"
+ },
{
"pagePath": "pages/statistics/index",
"iconPath": "static/img/tabbar-02.png",
diff --git a/pages/statistics/index.vue b/pages/statistics/index.vue
index d245b55..52f3dca 100644
--- a/pages/statistics/index.vue
+++ b/pages/statistics/index.vue
@@ -327,19 +327,19 @@
} = uni.getStorageSync("activeRole");
if (roleName == "网格员") {
this.tabList = getTabbarList(3);
- this.tabbarIndex = 1;
- // this.tabbarIndex = 2;
+ // this.tabbarIndex = 1;
+ this.tabbarIndex = 2;
}
if (roleName == "民警") {
this.tabList = getTabbarList(2);
- this.tabbarIndex = 1;
- // this.tabbarIndex = 2;
+ // this.tabbarIndex = 1;
+ this.tabbarIndex = 2;
}
if (roleName == "系统管理员") {
this.tabList = getTabbarList(4);
- this.tabbarIndex = 1;
- // this.tabbarIndex = 2;
+ // this.tabbarIndex = 1;
+ this.tabbarIndex = 2;
}
this.refreshData();
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 2a5c1f9..ca23364 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -45,6 +45,10 @@
<u-cell v-if="roleType == 2" title="切换角色" isLink url="/subPackage/user/role/index">
<image slot="icon" src="/static/icon/menu-center-05.png" class="icon" mode=""></image>
</u-cell>
+ <u-cell v-if="siteInfo.addressType == 1" title="我的网格" isLink
+ url="/subPackage/grid/comprehensive?from=center">
+ <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
+ </u-cell>
<u-cell v-if="siteInfo.addressType == 1" title="我的事件" isLink
url="/subPackage/bs/views/repairList?from=center">
<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
@@ -129,26 +133,26 @@
this.tabbarList = getTabbarList(1)
this.roleType = 1
this.color = "#017BFC"
- this.tabbarIndex = 1;
- // this.tabbarIndex = 2
+ // this.tabbarIndex = 1;
+ this.tabbarIndex = 2
} else if (role.roleName == "民警") {
this.tabbarList = getTabbarList(2)
this.roleType = 2;
this.color = "#003399"
- this.tabbarIndex = 2;
- // this.tabbarIndex = 3;
+ // this.tabbarIndex = 2;
+ this.tabbarIndex = 3;
} else if (role.roleName == "系统管理员") {
this.tabbarList = getTabbarList(4)
this.roleType = 1
this.color = "#017BFC";
- this.tabbarIndex = 2;
- // this.tabbarIndex = 3;
+ // this.tabbarIndex = 2;
+ this.tabbarIndex = 3;
} else if (role.roleName == "网格员") {
this.tabbarList = getTabbarList(3)
this.roleType = 1
this.color = "#017BFC";
- this.tabbarIndex = 2;
- // this.tabbarIndex = 3;
+ // this.tabbarIndex = 2;
+ this.tabbarIndex = 3;
}
this.addressType = uni.getStorageSync("siteInfo").addressType;
},
diff --git a/subPackage/counterfraud/add.vue b/subPackage/counterfraud/add.vue
index 07990ad..52da27d 100644
--- a/subPackage/counterfraud/add.vue
+++ b/subPackage/counterfraud/add.vue
@@ -31,13 +31,13 @@
placeholderClass="f-28 c-99" inputAlign="right"></u-textarea>
</u-form-item>
- <u-form-item label="宣传内容" borderBottom prop="pubContent">
+ <u-form-item label="宣防内容" borderBottom prop="pubContent">
<u-textarea type="textarea" v-model="info.pubContent" border="none" placeholderClass="f-28 c-99"
- inputAlign="right" placeholder="请输入宣传内容">
+ inputAlign="right" placeholder="请输入宣防内容">
</u-textarea>
</u-form-item>
- <!-- <u-form-item label="是否下载国家反诈app" labelWidth="120" prop="isFzApp">
+ <u-form-item label="是否下载国家反诈app" labelWidth="120" prop="isFzApp">
<u-radio-group v-model="info.isFzApp">
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList" :key="index"
:label="item.name" :name="item.id">
@@ -51,10 +51,10 @@
:label="item.name" :name="item.id">
</u-radio>
</u-radio-group>
- </u-form-item> -->
+ </u-form-item>
</view>
<view class="upload bgc-ff">
- <view class="f-28">宣传佐证照片</view>
+ <view class="f-28">宣防佐证照片</view>
<view class="mt-20">
<u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
@@ -67,7 +67,7 @@
</view>
</view>
- <view class="info mt-20 bgc-ff" v-if="isScan">
+ <view class="info mt-20 bgc-ff" v-if="isScan && houseHoldInfo.name">
<caption-row title="房屋信息" />
<view class="info-row flex j-c-s-b a-i-c f-28">
<text>业主姓名</text>
@@ -83,7 +83,19 @@
</view>
</view>
- <view class="info mt-20 bgc-ff" v-if="false">
+ <view class="info mt-20 bgc-ff" v-if="isScan && principalInfo.principal">
+ <caption-row title="场所负责人信息" />
+ <view class="info-row flex j-c-s-b a-i-c f-28">
+ <text>负责人姓名</text>
+ <text>{{principalInfo.principal}}</text>
+ </view>
+ <view class="info-row flex j-c-s-b a-i-c f-28">
+ <text>负责人手机号</text>
+ <text>{{principalInfo.principalPhone}}</text>
+ </view>
+ </view>
+
+ <view class="info mt-20 bgc-ff">
<caption-row title="宣防对象" />
<view v-for="(item, index) in info.backblastPubPersonEntityList" :key="index">
<view class="flex a-i-c j-c-s-b" style="padding:20rpx;">
@@ -124,9 +136,6 @@
<u-input v-model="info.backblastPubPersonEntityList[index].address" border="none"
placeholderClass="f-28 c-99" inputAlign="right" placeholder="请输入居住地"></u-input>
</u-form-item>
-
-
-
</view>
<view class="add-person" style="padding:20rpx 30rpx;">
<u-button type="success" plain @click="addPerson">再加一人</u-button>
@@ -251,7 +260,9 @@
id: 2
}
],
- personList: []
+ personList: [],
+ principalInfo: {}, //场所负责人信息
+ placeType: 1 // 1房屋 2场所 3都是 4都不是
}
},
// onLoad() {
@@ -402,27 +413,25 @@
this.$showTips("请选择地址")
return
}
-
- // if (!this.info.backblastPubPersonEntityList.length) {
- // this.$showTips("请添加宣防对象")
- // return;
- // } else {
- // for (let i of this.info.backblastPubPersonEntityList) {
- // if (!i.name) {
- // this.$showTips("请完善宣防对象信息")
- // return;
- // }
- // if (!i.telephone) {
- // this.$showTips("请完善宣防对象信息")
- // return;
- // }
- // if (!i.idCard) {
- // this.$showTips("请完善宣防对象信息")
- // return;
- // }
- // }
- // }
-
+ if (!this.info.backblastPubPersonEntityList.length) {
+ this.$showTips("请添加宣防对象")
+ return;
+ } else {
+ for (let i of this.info.backblastPubPersonEntityList) {
+ if (!i.name) {
+ this.$showTips("请完善宣防对象信息")
+ return;
+ }
+ if (!i.telephone) {
+ this.$showTips("请完善宣防对象信息")
+ return;
+ }
+ if (!i.idCard) {
+ this.$showTips("请完善宣防对象信息")
+ return;
+ }
+ }
+ }
if (this.isEdit) {
this.updateWorkLogRequest()
} else {
@@ -493,10 +502,11 @@
let {
isJur,
doorplateType,
- addressLevel
+ addressLevel,
+ addType
} = res.data;
if (isJur == 1) {
- if (doorplateType == "户室牌") {
+ if (addType && addType != 4) {
if (res.data.addressType) {
this.addressType = res.data.addressType
}
@@ -507,7 +517,25 @@
this.info.lat = res.data.y;
this.info.lng = res.data.x;
this.isScan = true;
- this.getHouseInfo(code)
+ if (addType == 1 || addType == 3) {
+ if (res.data.householdList.length) {
+ this.houseHoldInfo = res.data.householdList[0]
+ } else {
+ this.houseHoldInfo = {}
+ }
+ }
+ if (addType == 2 || addType == 3) {
+
+ if (res.data.place) {
+ this.principalInfo = res.data.place;
+ } else {
+ this.principalInfo = {}
+ }
+ } else {
+ this.principalInfo = {}
+ }
+
+ // this.getHouseInfo(code)
}
} else {
uni.showModal({
@@ -524,7 +552,6 @@
url: `/subPackage/house/roomDetails/index?id=${this.info.houseCode}`
})
},
-
navigatorPage() {
@@ -550,16 +577,17 @@
},
-
recognizePersonSuccess(e, index) {
let {
detail: {
name,
id,
+ address
}
} = e;
this.info.backblastPubPersonEntityList[index].name = name.text;
this.info.backblastPubPersonEntityList[index].idCard = id.text;
+ this.info.backblastPubPersonEntityList[index].address = address.text;
}
diff --git a/subPackage/counterfraud/propagateDetail.vue b/subPackage/counterfraud/propagateDetail.vue
index c2e8025..aa9ad97 100644
--- a/subPackage/counterfraud/propagateDetail.vue
+++ b/subPackage/counterfraud/propagateDetail.vue
@@ -1,12 +1,12 @@
<template>
<view class="">
- <view class="bgc-ff">
+ <view class="box bgc-ff">
<view class="item-row flex j-c-s-b a-i-c">
<text>地址</text>
<text class="address">{{detail.address}}</text>
</view>
<view class="item-row flex j-c-s-b a-i-c" v-if="detail.pubContent">
- <text>宣传内容</text>
+ <text>宣防内容</text>
<text class="address">{{detail.pubContent}}</text>
</view>
@@ -15,20 +15,45 @@
<text>{{detail.createTime}}</text>
</view>
</view>
- <!-- <view class="box bgc-ff" v-if="detail.context">
- <view class="caption f-28">
- 巡查内容
+
+ <view class="box images bgc-ff" v-if="images.length">
+ <caption-row title="宣防佐证照片" />
+ <view class="ml-20 mt-10">
+ <u-album :urls="images" singleSize="100" multipleSize="100"></u-album>
</view>
- <view class="f-30">
- {{detail.context}}
- </view>
- </view> -->
- <view class="box bgc-ff" v-if="images.length">
- <view class="caption f-28">
- 宣传佐证照片
- </view>
- <u-album :urls="images" singleSize="100" multipleSize="100"></u-album>
+
</view>
+
+ <view class="box bgc-ff">
+ <caption-row title="宣防对象" />
+ <view class="" v-for="(i,k) in detail.backblastPubPersonEntityList" :key="k">
+ <view class="index-name f-28 fw">
+ 人员-#{{k+ 1}}
+ </view>
+ <view class="item-row flex j-c-s-b a-i-c">
+ <text>姓名</text>
+ <text>{{i.name}}</text>
+ </view>
+ <view class="item-row flex j-c-s-b a-i-c">
+ <text>手机号</text>
+ <text>{{i.telephone}}</text>
+ </view>
+ <view class="item-row flex j-c-s-b a-i-c">
+ <text>身份证号</text>
+ <text>{{i.idCard}}</text>
+ </view>
+ <view class="item-row flex j-c-s-b a-i-c">
+ <text>职业</text>
+ <text>{{i.occupation}}</text>
+ </view>
+ <view class="item-row flex j-c-s-b a-i-c">
+ <text>居住地</text>
+ <text class="address">{{i.address}}</text>
+ </view>
+ </view>
+ </view>
+ <view class="blank"></view>
+
</view>
</template>
@@ -42,7 +67,11 @@
minioBaseUrl
}
from "@/common/setting.js"
+ import captionRow from "@/components/caption/caption.vue"
export default {
+ components: {
+ captionRow
+ },
data() {
return {
detail: {},
@@ -60,8 +89,8 @@
id
}).then(res => {
this.detail = res.data;
- if (res.data.url) {
- this.images = this.setImageUrl(res.data.url);
+ if (res.data.pubUrls) {
+ this.images = this.setImageUrl(res.data.pubUrls);
}
})
},
@@ -85,7 +114,7 @@
.item-row {
width: 100%;
- padding: 30rpx;
+ padding: 20rpx;
box-sizing: border-box;
border-bottom: 1px solid #f5f5f5;
font-size: 28rpx;
@@ -97,11 +126,25 @@
}
.box {
- padding: 0 30rpx 30rpx;
- margin-top: 20rpx;
+ padding: 0 20rpx;
+ margin: 20rpx 20rpx 0;
+ }
+
+ .images {
+ padding-bottom: 20rpx;
}
.caption {
padding: 30rpx 0;
}
+
+ .index-name {
+ padding: 20rpx 0;
+ margin-left: 20rpx;
+ }
+
+ .blank {
+ width: 100%;
+ height: 100rpx;
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/grid/comprehensive.vue b/subPackage/grid/comprehensive.vue
index a471aae..e706fb9 100644
--- a/subPackage/grid/comprehensive.vue
+++ b/subPackage/grid/comprehensive.vue
@@ -18,7 +18,7 @@
<view class="detail bgc-ff">
<caption-row title="网格基本情况" />
<view class="detail-content f-28">
- <text v-for="i in houseList">{{i.aoiName?i.aoiName:''}} {{i.buildingName}} </text>
+ <text v-for="i in houseList" v-if="i.aoiName">{{i.aoiName?i.aoiName:''}} {{i.buildingName}} </text>
</view>
</view>
@@ -64,6 +64,11 @@
},
onLoad(option) {
+ if (option.from) {
+ uni.setNavigationBarTitle({
+ title: "我的网格"
+ })
+ }
this.getDetailInfo()
},
diff --git a/subPackage/house/member/add.vue b/subPackage/house/member/add.vue
index e74d50d..5761dfe 100644
--- a/subPackage/house/member/add.vue
+++ b/subPackage/house/member/add.vue
@@ -2,14 +2,24 @@
<view class="container">
<view class="main">
<view class="content">
- <view style="padding:0 20rpx;">
- <view class="top flex j-c-s-b a-i-c bgc-ff" @click="onScan()" v-if="!currentId">
+ <view class="top flex j-c-s-b a-i-c">
+ <view class="top-item flex j-c-s-b a-i-c bgc-ff" @click="onScan()">
<view class="flex a-i-c">
<u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon>
<text class="f-28 ml-10">扫码获取信息</text>
</view>
- <u-icon name="arrow-right" size="20"></u-icon>
+ <!-- <u-icon name="arrow-right" size="20"></u-icon> -->
</view>
+ <ocr-navigator @onSuccess="recognizeSuccess()" certificateType="idCard" :opposite="false"
+ style="width:48%;">
+ <view class="top-item flex j-c-s-b a-i-c bgc-ff" style="width:100%;">
+ <view class="flex a-i-c">
+ <u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon>
+ <text class="f-28 ml-10">身份证信息识别</text>
+ </view>
+ <!-- <u-icon name="arrow-right" size="20"></u-icon> -->
+ </view>
+ </ocr-navigator>
</view>
<u-form labelWidth="70" :model="form" :rules="rules" ref="form">
@@ -300,10 +310,16 @@
</view>
- <view class="footer flex j-c-s-b a-i-c bgc-ff" v-if="type == 2 && from == 'family'">
- <button class="del-btn footer-btn" @click="delAction">删除</button>
- <button class="save-btn footer-btn" @click="submit">保存</button>
- </view>
+ <!-- <view class="footer flex j-c-s-b a-i-c bgc-ff" v-if="(type == 1 && from == 'family') || !from">
+ <ocr-navigator @onSuccess="recognizeSuccess()" certificateType="idCard" :opposite="false"
+ style="width:48%;">
+ <view class="del-btn c-main footer-btn flex j-c-c a-i-c" style="width:100%;">
+ <u-icon name="scan" color="#017BFC" size="24"></u-icon>
+ <text class="f-26 " style="margin-left: 10rpx;">身份证信息识别</text>
+ </view>
+ </ocr-navigator>
+ <button class="save-btn footer-btn c-ff" @click="submit">保存</button>
+ </view> -->
<footer-btn v-if="(type == 1 && from == 'family') || !from" :text="addOrUpdateTitle" @click="submit" />
</view>
@@ -373,7 +389,8 @@
} from '@/api/system/dict.js'
import {
- select
+ select,
+ regionTree
} from "@/api/system/region.js"
@@ -730,6 +747,13 @@
this.regionList = res.data;
}
+ })
+ },
+
+ getRegionTree(callback) {
+ regionTree().then(res => {
+ console.log("region ==>", res.data)
+ callback(res.data);
})
},
@@ -1095,6 +1119,91 @@
uni.navigateTo({
url: `/subPackage/house/roomControl/index?code=${this.houseCode}&from=home`
})
+ },
+
+ //识别身份证信息
+ recognizeSuccess(e, index) {
+ let {
+ detail: {
+ name,
+ id,
+ address,
+ gender,
+ nationality
+ }
+ } = e;
+
+ this.$set(this.form, "name", name.text);
+ this.$set(this.form, "idCard", id.text);
+ this.selectDefaultName.gender = gender.text; //性别
+ this.selectDefaultName.ethnicity = `${nationality.text}族`; //民族
+ this.form.gender = this.getValue(this.dataList.gender, gender.text).value;
+ this.form.ethnicity = this.getValue(this.dataList.ethnicity, `${nationality.text}族`)
+ .value;
+ this.selectDefaultIndex.gender = [this.getValue(this.dataList.gender, gender.text).index];
+ this.selectDefaultIndex.ethnicity = [this.getValue(this.dataList.ethnicity, `${nationality.text}族`)
+ .index
+ ];
+ let {
+ province,
+ city,
+ district
+ } = this.extractAddressComponents(address.text);
+ // this.residentadDefault = [province, city, district]; //户籍地区
+ // this.residentad = `${province}-${city}-${district}`;
+ this.$set(this.form, "hukouRegistration", address.text);
+ // this.getRegionTree(data => {
+ // for (let i = 0, ii = data.length; i < ii; i++) {
+ // if (data[i].name == province) {
+ // for (let j = 0, jj = data[i].children.length; j < jj; j++) {
+ // for (let k = 0, kk = data[i].children[j].children.length; k < kk; k++) {
+ // if (data[i].children[j].children[k].name == district) {
+ // this.$set(this.form, "residentAdcode", data[i].children[j].children[k].id);
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ // })
+
+ },
+
+
+ getValue(arr, name) {
+ for (let i = 0, ii = arr.length; i < ii; i++) {
+ if (arr[i].name == name) {
+ return {
+ index: i,
+ value: arr[i].value
+ }
+ }
+ }
+ },
+
+ extractAddressComponents(address) {
+ const provinceRegex = /(?<province>[^省]+省|[^自治区]+自治区|[^市]+市)/;
+ const cityRegex = /(?<city>[^市]+市|[^县]+县)/;
+ const districtRegex = /(?<district>[^区]+区|[^县]+县|[^乡]+乡|[^镇]+镇|[^街]+街)/;
+
+ let province, city, district;
+ const provinceMatch = address.match(provinceRegex);
+ if (provinceMatch && provinceMatch.groups.province) {
+ province = provinceMatch.groups.province;
+ const cityMatch = address.substring(address.indexOf(province) + province.length).match(cityRegex);
+ if (cityMatch && cityMatch.groups.city) {
+ city = cityMatch.groups.city;
+ const districtMatch = address.substring(address.indexOf(city) + city.length).match(districtRegex);
+ if (districtMatch && districtMatch.groups.district) {
+ district = districtMatch.groups.district;
+ }
+ }
+ }
+ return {
+ province,
+ city,
+ district
+ };
}
}
@@ -1207,7 +1316,7 @@
line-height: 78rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
font-size: 32rpx;
- color: #fff;
+ // color: #fff;
}
.add-btn {
@@ -1216,7 +1325,9 @@
}
.del-btn {
- background: linear-gradient(163deg, #FE6C5C 0%, #EA1F1F 99%);
+ // background: linear-gradient(163deg, #FE6C5C 0%, #EA1F1F 99%);
+ background-color: transparent;
+ border: 1px solid currentColor;
}
@@ -1262,8 +1373,15 @@
}
.top {
- padding: 20rpx;
- marign: 20rpx 30rpx;
+ padding: 0 30rpx;
+ marign: 20rpx 0;
border-radius: 8rpx;
}
+
+ .top-item {
+ width: 48%;
+ padding: 20rpx;
+ border-radius: 8rpx;
+ box-sizing: border-box;
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/house/member/index.vue b/subPackage/house/member/index.vue
index 92fd515..8e9c919 100644
--- a/subPackage/house/member/index.vue
+++ b/subPackage/house/member/index.vue
@@ -2,6 +2,20 @@
<view class="container">
<view class="main">
<view class="content">
+
+ <view class="top">
+ <ocr-navigator @onSuccess="recognizeSuccess()" certificateType="idCard" :opposite="false">
+ <view class="top-item flex j-c-s-b a-i-c bgc-ff">
+ <view class="flex a-i-c">
+ <u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon>
+ <text class="f-28 ml-10">身份证信息识别</text>
+ </view>
+ <u-icon name="arrow-right" size="20"></u-icon>
+ </view>
+ </ocr-navigator>
+ </view>
+
+
<u-form labelWidth="70" :model="form" :rules="rules" ref="form">
<view class="event-info">
<view class="box-title">
@@ -115,8 +129,8 @@
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
- <u-form-item v-if="volunteerOrg == '其他'" required class="form-item" labelWidth="120" label="其他志愿者组织"
- prop="volunteerOrgTemp">
+ <u-form-item v-if="volunteerOrg == '其他'" required class="form-item" labelWidth="120"
+ label="其他志愿者组织" prop="volunteerOrgTemp">
<u--input border="none" v-model="form.volunteerOrgTemp" placeholder="请输入其他志愿者组织">
</u--input>
</u-form-item>
@@ -303,6 +317,19 @@
</view>
<footer-btn v-if="(type == 1 && from == 'family') || !from" :text="addOrUpdateTitle" @click="submit" />
+
+ <!-- <view class="footer flex j-c-s-b a-i-c bgc-ff" v-if="(type == 1 && from == 'family') || !from">
+ <ocr-navigator @onSuccess="recognizeSuccess()" certificateType="idCard" :opposite="false"
+ style="width:48%;">
+ <view class="recognize-btn c-main footer-btn flex j-c-c a-i-c" style="width:100%;">
+ <u-icon name="scan" color="#017BFC" size="24"></u-icon>
+ <text class="f-26 " style="margin-left: 10rpx;">身份证信息识别</text>
+ </view>
+ </ocr-navigator>
+ <button class="save-btn footer-btn c-ff" @click="submit">{{addOrUpdateTitle}}</button>
+ </view> -->
+
+
</view>
<!-- 事件类型下拉框 -->
@@ -344,7 +371,8 @@
} from '@/api/system/dict.js'
import {
- select
+ select,
+ regionTree
} from "@/api/system/region.js"
import boxTitle from '../components/boxTitle/index2.vue'
@@ -526,7 +554,7 @@
volunteerOrgTypeList: ["信州义警", "蓝天救援", "其他"],
volunteerOrgTypeIndex: [0],
volunteerOrg: "",
- volunteerOrgTemp:"",
+ volunteerOrgTemp: "",
showVolunteerOrg: false,
houseTag: ""
}
@@ -670,6 +698,14 @@
})
},
+ getRegionTree(callback) {
+ regionTree().then(res => {
+ console.log("region ==>", res.data)
+ callback(res.data);
+ })
+ },
+
+
regionSelect(e) {
console.log(e);
const [result] = e.value;
@@ -782,18 +818,18 @@
.nativePlaceCityAdName, data.nativePlaceAdName
]
}
- if(data.volunteerOrg){
+ if (data.volunteerOrg) {
// 信州义警", "蓝天救援", "其他
- if(data.volunteerOrg !='信州义警' && data.volunteerOrg !='蓝天救援'){
+ if (data.volunteerOrg != '信州义警' && data.volunteerOrg != '蓝天救援') {
this.form.volunteerOrgTemp = data.volunteerOrg;
this.form.volunteerOrg = '其他'
this.volunteerOrg = '其他'
- }else{
+ } else {
this.form.volunteerOrg = data.volunteerOrg
this.volunteerOrg = data.volunteerOrg
}
}
-
+
if (data.residentAdName) {
this.residentad =
`${data.residentProvinceAdName}-${data.residentCityAdName}-${data.residentAdName}`
@@ -893,9 +929,9 @@
}
}
}
-
+
// 重新赋值
- if(this.form.volunteerOrgTemp){
+ if (this.form.volunteerOrgTemp) {
this.form.volunteerOrg = this.form.volunteerOrgTemp
}
@@ -994,7 +1030,96 @@
uni.navigateTo({
url: `/subPackage/house/roomControl/index?code=${this.houseCode}&from=house`
})
+ },
+
+
+
+ //识别身份证信息
+ recognizeSuccess(e, index) {
+ let {
+ detail: {
+ name,
+ id,
+ address,
+ gender,
+ nationality
+ }
+ } = e;
+
+ this.$set(this.form, "name", name.text);
+ this.$set(this.form, "idCard", id.text);
+ this.selectDefaultName.gender = gender.text; //性别
+ this.selectDefaultName.ethnicity = `${nationality.text}族`; //民族
+ this.form.gender = this.getValue(this.dataList.gender, gender.text).value;
+ this.form.ethnicity = this.getValue(this.dataList.ethnicity, `${nationality.text}族`)
+ .value;
+ this.selectDefaultIndex.gender = [this.getValue(this.dataList.gender, gender.text).index];
+ this.selectDefaultIndex.ethnicity = [this.getValue(this.dataList.ethnicity, `${nationality.text}族`)
+ .index
+ ];
+ let {
+ province,
+ city,
+ district
+ } = this.extractAddressComponents(address.text);
+ // this.residentadDefault = [province, city, district]; //户籍地区
+ // this.residentad = `${province}-${city}-${district}`;
+ this.$set(this.form, "hukouRegistration", address.text);
+ // this.getRegionTree(data => {
+ // for (let i = 0, ii = data.length; i < ii; i++) {
+ // if (data[i].name == province) {
+ // for (let j = 0, jj = data[i].children.length; j < jj; j++) {
+ // for (let k = 0, kk = data[i].children[j].children.length; k < kk; k++) {
+ // if (data[i].children[j].children[k].name == district) {
+ // this.$set(this.form, "residentAdcode", data[i].children[j].children[k].id);
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ // })
+
+ },
+
+
+ getValue(arr, name) {
+ for (let i = 0, ii = arr.length; i < ii; i++) {
+ if (arr[i].name == name) {
+ return {
+ index: i,
+ value: arr[i].value
+ }
+ }
+ }
+ },
+
+ extractAddressComponents(address) {
+ const provinceRegex = /(?<province>[^省]+省|[^自治区]+自治区|[^市]+市)/;
+ const cityRegex = /(?<city>[^市]+市|[^县]+县)/;
+ const districtRegex = /(?<district>[^区]+区|[^县]+县|[^乡]+乡|[^镇]+镇|[^街]+街)/;
+
+ let province, city, district;
+ const provinceMatch = address.match(provinceRegex);
+ if (provinceMatch && provinceMatch.groups.province) {
+ province = provinceMatch.groups.province;
+ const cityMatch = address.substring(address.indexOf(province) + province.length).match(cityRegex);
+ if (cityMatch && cityMatch.groups.city) {
+ city = cityMatch.groups.city;
+ const districtMatch = address.substring(address.indexOf(city) + city.length).match(districtRegex);
+ if (districtMatch && districtMatch.groups.district) {
+ district = districtMatch.groups.district;
+ }
+ }
+ }
+ return {
+ province,
+ city,
+ district
+ };
}
+
+
}
@@ -1021,7 +1146,7 @@
// height: 0;
// flex: 1;
// overflow-y: auto;
- padding-bottom: 160rpx;
+ padding: 20rpx 0 160rpx;
// padding-bottom: 36rpx;
}
@@ -1106,21 +1231,41 @@
line-height: 78rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
font-size: 32rpx;
- color: #fff;
+
}
.add-btn {
width: 100%;
background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
+ color: #fff;
}
.del-btn {
background: linear-gradient(163deg, #FE6C5C 0%, #EA1F1F 99%);
+ color: #fff;
}
.save-btn {
background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
+ color: #fff;
}
+
+ .recognize-btn {
+ background-color: transparent;
+ border: 1px solid currentColor;
+ }
+ }
+
+ .top {
+ padding: 0 30rpx;
+ marign: 20rpx 0;
+ border-radius: 8rpx;
+ }
+
+ .top-item {
+ width: 100%;
+ padding: 20rpx;
+ box-sizing: border-box;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3