|
@@ -2,7 +2,7 @@ import {
|
|
|
visiteeList,
|
|
|
threeElements,
|
|
|
configList,
|
|
|
- riskQuery,
|
|
|
+ riskQuery, areaInfo,
|
|
|
} from '../../utils/api/api'
|
|
|
import {
|
|
|
getWaterDrop,
|
|
@@ -170,7 +170,7 @@ Page({
|
|
|
onLoad() {
|
|
|
my.hideBackHome();
|
|
|
const _this = this
|
|
|
- this.initScreenType().then(isPortraitScreenRes=>{
|
|
|
+ this.initScreenType().then(isPortraitScreenRes => {
|
|
|
console.log('isPortraitScreenRes', isPortraitScreenRes)
|
|
|
_this.setData({
|
|
|
isPortraitScreen: isPortraitScreenRes
|
|
@@ -204,7 +204,7 @@ Page({
|
|
|
},
|
|
|
initScreenType() {
|
|
|
let that = this
|
|
|
- return new Promise((resolve,reject) => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
if (app.globalData.isPortraitScreen) {
|
|
|
if (app.globalData.isPortraitScreen != null) {
|
|
|
resolve(app.globalData.isPortraitScreen)
|
|
@@ -540,50 +540,106 @@ Page({
|
|
|
carnum
|
|
|
} = this.data
|
|
|
console.log(
|
|
|
- 'remainingInfo',
|
|
|
- remainingInfo)
|
|
|
+ 'remainingInfo',
|
|
|
+ remainingInfo)
|
|
|
console.log(
|
|
|
- 'intervieweeForm',
|
|
|
- intervieweeForm)
|
|
|
+ 'intervieweeForm',
|
|
|
+ intervieweeForm)
|
|
|
let form = Object.assign({}, remainingInfo, intervieweeForm);
|
|
|
console.log(form)
|
|
|
form.carnum = carnum
|
|
|
form.visitingTime = getDate()
|
|
|
app.data.visitoMsgData = form
|
|
|
- let data = {
|
|
|
- "reason": form.causeMatterName,
|
|
|
- "num_peoples": form.peopleNum, //人数
|
|
|
- "machine_id": app.globalData.sn,
|
|
|
- "xm": form.visitorName,
|
|
|
- "sfzh": form.visitorIdCard,
|
|
|
- "phone": form.visitorPhone,
|
|
|
- // "xm": '张佳燕',
|
|
|
- // "sfzh": '331082199910045826',
|
|
|
- // "phone": '15888632412',
|
|
|
- "company": form.visitorUnit,
|
|
|
- "carno": form.carnum,
|
|
|
- "visitee_xm": form.name, //受访人姓名
|
|
|
- "visitee_bm": form.unitName,
|
|
|
- "visitee_company": form.company,
|
|
|
- "visitee_room": form.room,
|
|
|
- "visiteePhone": intervieweeForm.phone,
|
|
|
- "visitee_floor": form.floor,
|
|
|
- xp: app.data.userInfo.idCardPhoto,
|
|
|
- scene_xp: app.data.userInfo.avatar,
|
|
|
- time: form.visitingTime,
|
|
|
- }
|
|
|
- console.log('data', data)
|
|
|
- let url = app.globalData.snDisposition.transitPushUrl
|
|
|
- try {
|
|
|
- let res = await threeElements(url, data)
|
|
|
- console.log('commonQrCode', res.data.commonQrCode);
|
|
|
- console.log('ladderQrCode', res.data.ladderQrCode);
|
|
|
- app.data.visitoMsgData.commonQrCode = res.data.commonQrCode
|
|
|
- app.data.visitoMsgData.ladderQrCode = res.data.ladderQrCode
|
|
|
+
|
|
|
+ // 启用进出记录推送
|
|
|
+ let transitPushSwitch = app.globalData.snDisposition.transitPushSwitch
|
|
|
+ if (transitPushSwitch) {
|
|
|
+ // 获取辖区配置
|
|
|
+ let areaRes = await areaInfo({
|
|
|
+ sn: app.globalData.sn,
|
|
|
+ }).data || {}
|
|
|
+ /*let data = {
|
|
|
+ "reason": form.causeMatterName,
|
|
|
+ "num_peoples": form.peopleNum, //人数
|
|
|
+ "machine_id": app.globalData.sn,
|
|
|
+ "xm": form.visitorName,
|
|
|
+ "sfzh": form.visitorIdCard,
|
|
|
+ "phone": form.visitorPhone,
|
|
|
+ // "xm": '张佳燕',
|
|
|
+ // "sfzh": '331082199910045826',
|
|
|
+ // "phone": '15888632412',
|
|
|
+ "company": form.visitorUnit,
|
|
|
+ "carno": form.carnum,
|
|
|
+ "visitee_xm": form.name, //受访人姓名
|
|
|
+ "visitee_bm": form.unitName,
|
|
|
+ "visitee_company": form.company,
|
|
|
+ "visitee_room": form.room,
|
|
|
+ "visiteePhone": intervieweeForm.phone,
|
|
|
+ "visitee_floor": form.floor,
|
|
|
+ xp: app.data.userInfo.idCardPhoto,
|
|
|
+ scene_xp: app.data.userInfo.avatar,
|
|
|
+ time: form.visitingTime,
|
|
|
+ }
|
|
|
+ console.log('data', data)*/
|
|
|
+ console.log(JSON.stringify(areaRes))
|
|
|
+ let newPushData = {
|
|
|
+ "appType": "HHVisit",
|
|
|
+ "recordid": 0, // 没有
|
|
|
+ "sn": app.globalData.sn,
|
|
|
+ "adminId": null, // 没有
|
|
|
+ "pcsname": areaRes.policeStationName || '', // 所属辖区派出所名称
|
|
|
+ "pcsdm": areaRes.policeStationCode || '', // 所属辖区派出所代码
|
|
|
+ "provinceName": areaRes.provinceName || '', // 所属省份
|
|
|
+ "cityName": areaRes.cityName || '', // 所属城市
|
|
|
+ "areaName": areaRes.areaName || '', // 所属区/县
|
|
|
+ "streetName": areaRes.streetName || '', // 街道/乡/镇
|
|
|
+ "address": areaRes.address || '', // 详细地址
|
|
|
+ "deviceAddress": areaRes.deviceAddress || '', // 设备地点
|
|
|
+ "outType": 1, // 服务端设备所属进出口: 0 通用 1进门 2出门
|
|
|
+ "status": true,// 人员进入是否有效: true 有效 false 无效
|
|
|
+ "reasonType": null,// 无效原因: 1 未成年人禁止进入 2 黑名单
|
|
|
+ "userId": 0,// 服务端用户id
|
|
|
+ "verifyType": app.data.userInfo.verifyType,// todo 识别类型
|
|
|
+ "certName": form.visitorName, // 用户姓名
|
|
|
+ "certNo": form.visitorIdCard, // 用户证件号
|
|
|
+ "certContent": JSON.stringify(app.data.userInfo.certContent || '') || '', // 身份证阅读器返回全部 todo
|
|
|
+ "phone": form.visitorPhone, // 用户手机号
|
|
|
+ "cardidex": null, // 用户卡号
|
|
|
+ "photo": app.data.userInfo.avatar, // 用户现场照片
|
|
|
+ "originPhoto": '', // 比对源照片url todo
|
|
|
+ "originPhotoBase64": app.data.userInfo.idCardPhoto, // 比对源照片base64 todo
|
|
|
+ "verifyScore": null, // 人脸比对分值: 0-100 todo
|
|
|
+ "company": form.visitorUnit, // 用户单位名称
|
|
|
+ "carno": form.carnum, // 用户车牌号
|
|
|
+ "reason": form.causeMatterName, // 拜访事由
|
|
|
+ "time": form.visitingTime, // 刷脸时间
|
|
|
+ "visiteeXm": form.name, //受访人姓名
|
|
|
+ "visiteePhone": intervieweeForm.phone, // 受访人手机号
|
|
|
+ "visiteeCompany": form.company, // 受访人单位
|
|
|
+ "visiteeBm": form.unitName, // 受访人部门
|
|
|
+ "visiteeFloor": form.floor, // 受访人所在楼层
|
|
|
+ "visiteeRoom": form.room, // 受访人所在房间号
|
|
|
+ "startTime": null, // 有效期开始时间
|
|
|
+ "endTime": null, // 有效期结束时间
|
|
|
+ "event": 1 // 事件类型: 1 登记 2 签离
|
|
|
+ }
|
|
|
+ console.log(JSON.stringify(newPushData))
|
|
|
+ let url = app.globalData.snDisposition.transitPushUrl
|
|
|
+ try {
|
|
|
+ // 进出记录推送
|
|
|
+ let res = await threeElements(url, newPushData)
|
|
|
+ console.log('commonQrCode', res.data.commonQrCode);
|
|
|
+ console.log('ladderQrCode', res.data.ladderQrCode);
|
|
|
+ app.data.visitoMsgData.commonQrCode = res.data.commonQrCode
|
|
|
+ app.data.visitoMsgData.ladderQrCode = res.data.ladderQrCode
|
|
|
+ this.backToSpecifiedPage('/pages/resultPage/index?result=登记成功')
|
|
|
+ viceBroadcast(app.globalData.snDisposition.registerSuccessVoice)
|
|
|
+ } catch (error) {
|
|
|
+ this.backToSpecifiedPage('/pages/resultPage/index?result=登记失败')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.backToSpecifiedPage('/pages/resultPage/index?result=登记成功')
|
|
|
viceBroadcast(app.globalData.snDisposition.registerSuccessVoice)
|
|
|
- } catch (error) {
|
|
|
- this.backToSpecifiedPage('/pages/resultPage/index?result=登记失败')
|
|
|
}
|
|
|
},
|
|
|
closeCanNot() {
|
|
@@ -786,8 +842,8 @@ Page({
|
|
|
closeSecondaryScreenFuc() {
|
|
|
console.log('关闭副屏', app.data.isSecondaryScreenState)
|
|
|
if (app.data.isSecondaryScreenState) {
|
|
|
- closeSecondaryScreen()
|
|
|
- // closeCycleSecondaryScreen()
|
|
|
+ closeSecondaryScreen()
|
|
|
+ // closeCycleSecondaryScreen()
|
|
|
}
|
|
|
},
|
|
|
// 键盘函数结束
|
|
@@ -803,7 +859,7 @@ Page({
|
|
|
my.reLaunch({
|
|
|
url: url,
|
|
|
})
|
|
|
- setTimeout(()=> {
|
|
|
+ setTimeout(() => {
|
|
|
this.closeSecondaryScreenFuc();
|
|
|
}, 500)
|
|
|
},
|
|
@@ -821,7 +877,7 @@ Page({
|
|
|
if (url) {
|
|
|
openSecondaryScreen(url)
|
|
|
}
|
|
|
- setTimeout(()=> {
|
|
|
+ setTimeout(() => {
|
|
|
this.toTitleRef && this.toTitleRef.clearIntervalAll()
|
|
|
my.reLaunch({
|
|
|
url: '/pages/home/index',
|
|
@@ -833,7 +889,7 @@ Page({
|
|
|
if (url) {
|
|
|
openSecondaryScreen(url)
|
|
|
}
|
|
|
- setTimeout(()=> {
|
|
|
+ setTimeout(() => {
|
|
|
this.toTitleRef && this.toTitleRef.clearIntervalAll()
|
|
|
my.reLaunch({
|
|
|
url: '/pages/home/index',
|