1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177 |
- import {
- visiteeList,
- threeElements,
- configList,
- riskQuery,
- areaInfo,
- publicInterface
- } from '../../utils/api/api'
- import {
- getWaterDrop,
- getDate
- } from '../../utils/index/index'
- import {
- viceBroadcast, closeSecondaryScreen, openSecondaryScreen
- } from '../../utils/index/callAmpe'
- import {
- encryptAndSign
- } from '../../utils/index/getSM4'
- import { match } from 'assert'
- const app = getApp()
- Page({
- data: {
- toTitleRef: null,
- snDisposition: {},
-
- remainingInfo: {
- avatar: '',
- visitorName: '',
- visitorIdCard: '',
- visitorPhone: '',
- visitorUnit: '',
- carnum: '',
- peopleNum: 1,
- causeMatterName: '',
- },
-
- formInfo: {
- visitorPhone: '',
- visitorUnit: '',
- carnum: '',
- peopleNum: 1,
- causeMatterName: '',
- },
-
- causeMatterList: [
-
- ],
- isShowCauseMatter: false,
- floorNum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0],
- cs: [1, 2, 3, 4, 5, 6,],
-
- isShowSearch: false,
-
- searchList: [
- {
- name: '姓名',
- placeholder: '请输入姓名',
- value: 'name',
- show: true,
- },
- {
- name: '手机号',
- placeholder: '请输入手机号',
- value: 'phone',
- show: true,
- },
- {
- name: '身份证',
- placeholder: '请输入身份证',
- value: 'idNumber',
- show: false,
- },
- {
- name: '单位',
- placeholder: '请输入单位',
- value: 'company',
- show: true,
- },
- {
- name: '部门',
- placeholder: '请输入部门',
- value: 'unitName',
- show: false,
- },
- {
- name: '楼层',
- placeholder: '请选择楼层',
- value: 'floor',
- show: true,
- }, {
- name: '房间号',
- placeholder: '请输入房间号',
- value: 'room',
- show: true,
- }, {
- name: '标题',
- placeholder: '请输入标题',
- value: 'showTitle',
- show: true,
- }
- ],
-
- searchForm: {
- name: '',
- phone: '',
- company: '',
- floor: '',
- room: '',
- showTitle: '',
- },
-
- intervieweeForm: {
- name: '',
- phone: '',
- idNumber: '',
- company: '',
- unitName: '',
- floor: '',
- room: '',
- showTitle: '',
- },
- intervieweeFormCopy: {},
-
- isEnterInterviewee: false,
- carNumberShow: true,
-
- touchStartTime: 0,
-
- touchEndTime: 0,
-
- lastTapTime: 0,
-
- lastTapTimeoutFunc: null,
- allList: [],
- allListCopy: [],
- tableList: [],
- total: 0,
- pageNum: 0,
- pageSize: 0,
- sliceStart: 0,
- sliceEnd: 15,
- mumberRows: 15,
-
- notNum: true,
- strDisabled: false,
- checked: false,
- provinceArr: ["粤", "京", "津", "渝", "沪", "冀", "晋", "辽", "吉", "黑", "苏", "浙", "皖", "闽", "赣", "鲁", "豫", "鄂", "湘", "琼", "川", "贵", "云", "陕", "甘", "青", "蒙", "桂", "宁", "新", "藏", "使", "领", "警", "学", "港", "澳"],
- strArr: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
- hiddenPro: true,
- hiddenStr: true,
- carnum: '',
-
- downBtn: '返回',
-
- isShowfloor: false,
- allFloorList: [],
- chooseFloorIndex: [],
- chooseFloorItem: [],
-
- isPortraitScreen: false,
- screenIntervalId: null,
-
- historyPagNum: 1,
- historyPageSize: 0,
- isHistory: true,
- historyList: [],
- userVisitorListDetailId: null,
- historySelObj:{
- info1Sel: false,
- info2Sel: false,
- }
- },
- onLoad() {
- my.hideBackHome();
- const _this = this
- this.initScreenType().then(isPortraitScreenRes => {
- console.log('isPortraitScreenRes', isPortraitScreenRes)
- _this.setData({
- isPortraitScreen: isPortraitScreenRes
- })
- })
- this.data.intervieweeFormCopy = JSON.parse(JSON.stringify(this.data.intervieweeForm));
- this.data.searchFormCopy = JSON.parse(JSON.stringify(this.data.searchForm));
- let visitReasonList = (app.globalData.snDisposition.visitReason || '业务拜访/会议邀请/施工单位/其他事项').split('/');
- console.log(JSON.stringify(app.globalData.snDisposition))
- console.log(JSON.stringify(app.globalData.registerNotDesensitizedColumn))
- console.log('phone', app.data.userInfo.phone, app.data.inputPhone)
- this.setData({
- snDisposition: app.globalData.snDisposition,
- causeMatterList: visitReasonList,
- 'remainingInfo.visitorPhone': app.data.userInfo.phone || app.data.inputPhone,
- 'remainingInfo.visitorName': app.data.userInfo.xm,
- 'remainingInfo.visitorIdCard': app.data.userInfo.sfzh,
- 'remainingInfo.avatar': app.data.userInfo.avatar,
- 'remainingInfo.idCardPhoto': app.data.userInfo.idCardPhoto,
- 'remainingInfo.visitorUnit': app.data.userInfo.visitorUnit || '',
- carnum: app.data.userInfo.carnum || '',
- 'remainingInfo.causeMatterName': visitReasonList.length > 0 ? visitReasonList[0] : '',
- 'formInfo.causeMatterName': visitReasonList.length > 0 ? visitReasonList[0] : '',
- 'formInfo.visitorPhone': app.data.userInfo.phone || app.data.inputPhone
- })
- console.log(visitReasonList)
-
- if (this.data.snDisposition.riskCheck) {
- this.riskQuery()
- }
- this.getHistory()
- this.getTable()
- this.configList()
- },
- initScreenType() {
- let that = this
- return new Promise((resolve, reject) => {
- if (app.globalData.isPortraitScreen) {
- if (app.globalData.isPortraitScreen != null) {
- resolve(app.globalData.isPortraitScreen)
- }
- } else {
- that.data.screenIntervalId = setInterval(function () {
- if (app.globalData.isPortraitScreen != null) {
- resolve(app.globalData.isPortraitScreen)
- clearInterval(that.data.screenIntervalId);
- }
- }, 1000);
- }
- })
- },
- async getHistory(historyPagNum){
- try {
- let params = {
- data : {
- certNo: this.data.remainingInfo.visitorIdCard,
- sn: app.globalData.sn,
- },
- pageNum: historyPagNum ? historyPagNum : 1,
- pageSize: 2
- }
- let res = await publicInterface(
- {
- prop: 'fkjHistoryRecordUrl',
- defaultProp: '/history',
- data: params,
- method: 'post',
- errorTip: '历史访问记录api请求失败'
- }
- )
- if(res.data.total > 0 ){
- let array = res.data.list.map((item,index)=>{
- return{
- userVisitorListDetailId: item.userVisitorListDetailId,
- info1:{
- 'carnum': item.carno,
- 'visitorName': item.certName,
- 'visitorPhone': item.certPhone,
- 'visitorUnit': item.company,
- 'causeMatterName': item.reason,
- 'isSel': false
- },
- info2:{
- "unitName": item.visiteeBm,
- "company": item.visiteeCompany,
- "floor": item.visiteeFloor ? item.visiteeFloor : '',
- "phone": item.visiteePhone,
- "room": item.visiteeRoom,
- "name": item.visiteeXm,
- 'isSel': false
- }
- }
- })
- this.setData({
- historyPagNum: historyPagNum ? historyPagNum : 1,
- historyPageSize: res.data.pages,
- historyList: array,
- })
- }else{
- this.setData({
- isHistory: false
- })
- }
- } catch (error) {
- console.log(error);
- my.showToast({
- content: error.msg || '历史访问记录api请求失败',
- duration: 2000
- });
- }
- },
-
- async historyPreviousFun() {
- console.log(this.data)
- const pageNum = this.data.historyPagNum - 1
- if (pageNum <= 0) {
- return
- }
- await this.getHistory(pageNum)
- await this.displaySelectedDataFunc()
- },
-
- async historyNextFun() {
- const pageNum = this.data.historyPagNum + 1
- if (pageNum > this.data.historyPageSize) {
- return
- }
- await this.getHistory(pageNum)
- await this.displaySelectedDataFunc()
- },
- async getTable(e) {
- try {
- let {
- sliceStart,
- mumberRows
- } = this.data
- let dto = {
- sn: app.globalData.sn,
- }
- let res = await visiteeList(app.globalData.snDisposition.visiteeUrl, dto)
- var pageNum = Math.ceil(res.data.length / mumberRows)
- sliceStart = 0
- this.setData({
- allList: res.data,
- allListCopy: res.data,
- tableList: res.data.slice(sliceStart, mumberRows),
- total: res.data.length,
- sliceStart: 0,
- sliceEnd: mumberRows,
- pageNum,
- pageSize: res.data.length > 0 ? 1 : 0,
- })
- } catch (error) {
- console.log(error);
- }
- },
- displaySelectedDataFunc(){
- if(this.data.userVisitorListDetailId){
- this.data.historyList.forEach((item,index)=>{
- if(item.userVisitorListDetailId === this.data.userVisitorListDetailId){
- item.info1.isSel = this.data.historySelObj.info1Sel
- item.info2.isSel = this.data.historySelObj.info2Sel
- }
- })
- this.setData({
- historyList: this.data.historyList
- })
- }
- },
-
- selInfo: function (e) {
- const idx = e.currentTarget.dataset.index;
- const items = this.data.historyList.map((item,index) => {
- item.info1.isSel = false
- item.info2.isSel = false
- if (index == idx) {
- this.setData({
- historySelObj:{
- info1Sel: true,
- info2Sel: true,
- },
- userVisitorListDetailId: item.userVisitorListDetailId,
- carnum: item.info1.carnum,
- remainingInfo: {
- ...this.data.remainingInfo,
- ...item.info1
- },
- intervieweeForm:{
- ...item.info2
- }
- })
- return {
- ...item,
- info1:{
- ...item.info1,
- isSel: !item.info1.isSel
- },
- info2:{
- ...item.info2,
- isSel: !item.info2.isSel
- }
- };
- }
- return item;
- });
- this.setData({
- historyList: items,
- });
- },
-
- selInfo1: function (e){
- let visitReasonList = (app.globalData.snDisposition.visitReason || '业务拜访/会议邀请/施工单位/其他事项').split('/')
- const idx = e.currentTarget.dataset.index;
- const items = this.data.historyList.map((item,index) => {
- if (index == idx) {
- if(!item.info1.isSel){
- this.setData({
- carnum: item.info1.carnum,
- remainingInfo:{
- ...this.data.remainingInfo,
- ...item.info1
- }
- })
- }else{
- if(!item.info2.isSel){
- this.setData({
- historySelObj:{
- info1Sel: false,
- info2Sel: false,
- },
- userVisitorListDetailId: null
- })
- }
- this.defaultFormInfo()
- }
- this.setData({
- 'historySelObj.info2Sel': !item.info2.isSel,
- })
- return {
- ...item,
- info1:{
- ...item.info1,
- isSel: !item.info1.isSel
- }
- };
- }
- return item;
- });
- this.setData({
- historyList: items
- });
- },
- defaultFormInfo(){
- this.setData({
- carnum: this.data.formInfo.carnum || '',
- remainingInfo:{
- ...this.data.remainingInfo,
- ...this.data.formInfo
- }
- })
- },
-
- selInfo2: function (e){
- const idx = e.currentTarget.dataset.index;
- const items = this.data.historyList.map((item,index) => {
- if (index == idx) {
- if(!item.info2.isSel){
- this.setData({
- intervieweeForm:{
- ...item.info2
- }
- })
- }else{
- if(!item.info1.isSel){
- this.setData({
- historySelObj:{
- info1Sel: false,
- info2Sel: false,
- },
- userVisitorListDetailId: null
- })
- }
- this.clearIntervieweeValue()
- }
- this.setData({
- 'historySelObj.info2Sel': !item.info2.isSel,
- })
- return {
- ...item,
- info2:{
- ...item.info2,
- isSel: !item.info2.isSel
- }
- };
- }
- return item;
- });
- this.setData({
- historyList: items
- });
- },
- backEnter(){
- this.clearIntervieweeValue()
- this.setData({
- isHistory: !this.data.isHistory,
- })
- },
-
- async riskQuery() {
- let appKeyRisk = app.globalData.appKeyRisk
- let appSecretRisk = app.globalData.appSecretRisk
- let privateKeyRisk = app.globalData.privateKeyRisk
- let content = {
- sn: app.globalData.sn,
- name: app.data.userInfo.xm,
- idNumber: app.data.userInfo.sfzh,
- phone: app.data.userInfo.phone
- }
-
-
-
-
-
-
- content = JSON.stringify(content)
-
- let sm4 = await encryptAndSign(appKeyRisk, appSecretRisk, privateKeyRisk, content, "encrypted")
- try {
- let data = {
- "appId": app.globalData.appIdRisk,
- "bizContent": sm4.encrypted,
- "reqTimestamp": sm4.timestamp,
- "sign": sm4.sign
- }
- let res = await riskQuery(data)
-
- let decryptedData = encryptAndSign(appKeyRisk, appSecretRisk, privateKeyRisk, res.data.bizContent, "decrypt")
- this.data.isRisk = false
- if (!decryptedData.decrypted) {
- return
- }
- let decrypted = JSON.parse(decryptedData.decrypted)
- if (!decrypted.result) {
- app.globalData.riskResult = 1
- } else if (decrypted.resultInfo.personFxpfjx && decrypted.resultInfo.personFxpfjx[4] == 1) {
- app.globalData.riskResult = 2
- } else {
- app.globalData.riskResult = 3
- }
- } catch (error) {
- console.log(error)
-
-
-
- }
- },
-
- previousFun() {
- let {
- allList,
- pageSize,
- sliceEnd,
- sliceStart,
- mumberRows
- } = this.data
- if (pageSize <= 1) {
- return
- }
- this.setData({
- tableList: allList.slice(sliceStart - mumberRows, sliceEnd - mumberRows),
- sliceStart: sliceStart - mumberRows,
- sliceEnd: sliceEnd - mumberRows,
- pageSize: pageSize - 1
- })
- },
-
- nextFun() {
- let {
- allList,
- pageSize,
- pageNum,
- sliceEnd,
- sliceStart,
- mumberRows
- } = this.data
- if (pageSize >= pageNum) {
- return
- }
- this.setData({
- tableList: allList.slice(sliceStart + mumberRows, sliceEnd + mumberRows),
- sliceStart: sliceStart + mumberRows,
- sliceEnd: sliceEnd + mumberRows,
- pageSize: pageSize + 1
- })
- },
-
- finish() {
- this.backToSpecifiedPage('/pages/resultPage/index?result=结果页超时')
- },
-
- getValue(e) {
- let type = e.target.dataset.type
- let val = e.detail.value
- let key = `remainingInfo.${type}`
- let formKey = `formInfo.${type}`
- this.setData({
- [key]: val,
- [formKey]: val
- })
- if(this.data.historyList.length>0){
- this.data.historyList.forEach(item=>{
- item.info1.isSel = false
- })
- this.setData({
- historyList: this.data.historyList
- })
- }
- },
-
- openChoose(e) {
- this.setData({
- isShowCauseMatter: !this.data.isShowCauseMatter,
- hiddenPro: true,
- hiddenStr: true,
- })
- },
- closeCauseMatter() {
- getWaterDrop()
- this.setData({
- isShowCauseMatter: false
- })
- },
- getCauseMatterVal(e) {
- let item = e.currentTarget.dataset.item
- this.setData({
- 'remainingInfo.causeMatterName': item,
- 'formInfo.causeMatterName': item,
- isShowCauseMatter: false
- })
- },
-
- getIsShow() {
- let {
- isShowSearch
- } = this.data
- let mumberRows = isShowSearch ? 15 : 9
- let searchForm = JSON.parse(JSON.stringify(this.data.searchFormCopy));
- this.setData({
- isShowSearch: !isShowSearch,
- mumberRows: mumberRows,
- searchForm
- })
- this.getTable()
- },
-
- getSearchValue(e) {
- let type = e.target.dataset.type
- let val = e.detail.value
- let key = `searchForm.${type}`
- this.setData({
- [key]: val
- })
- },
-
- inquireFun() {
- let {
- searchForm,
- allList,
- isShowSearch,
- mumberRows,
- allListCopy
- } = this.data
- allList = JSON.parse(JSON.stringify(allListCopy))
-
- let result = this.filterData(searchForm, allList)
- var pageNum = Math.ceil(result.length / mumberRows)
- let sliceStart = 0
- let sliceEnd = mumberRows
- this.setData({
- tableList: result.slice(sliceStart, mumberRows),
- allList: result,
- sliceEnd,
- sliceStart,
- total: result.length,
- pageNum,
- pageSize: result.length > 0 ? 1 : 0,
- })
- },
-
- filterData(queryObj, list) {
- let arr = list
- Object.keys(queryObj).forEach(key => {
- if (queryObj[key] == undefined || queryObj[key] == '') return arr
- if (key == 'name') {
- arr = arr.filter(p => p[key] !== null && (p[key].indexOf(queryObj[key]) > -1 || p['pinyinFirstLetter'].toLowerCase().indexOf(queryObj[key].toLowerCase()) == 0))
- } else {
- arr = arr.filter(p => p[key] !== null && (p[key].indexOf(queryObj[key]) > -1))
- }
- })
- return arr
- },
-
- clearFun() {
- let searchForm = JSON.parse(JSON.stringify(this.data.searchFormCopy));
- this.setData({
- searchForm
- })
- this.getTable()
- },
-
- chooseInterviewee() {
- this.setData({
- isEnterInterviewee: !this.data.isEnterInterviewee
- })
- },
-
- getIntervieweeValue(e) {
- let type = e.target.dataset.type
- let val = e.detail.value
- let key = `intervieweeForm.${type}`
- this.setData({
- [key]: val
- })
- },
-
- clearIntervieweeValue() {
- let intervieweeForm = JSON.parse(JSON.stringify(this.data.intervieweeFormCopy));
- this.setData({
- intervieweeForm
- })
- },
-
- chooseFloor(e) {
- let val = e.currentTarget.dataset.item
- let {
- searchForm
- } = this.data
- if (searchForm.floor.length < 2) {
- this.setData({
- 'searchForm.floor': searchForm.floor + val
- })
- this.inquireFun()
- }
- },
-
- delFloor() {
- let {
- searchForm
- } = this.data
- this.setData({
- 'searchForm.floor': searchForm.floor.substr(0, searchForm.floor.length - 1)
- })
- this.inquireFun()
- },
-
- touchStart: function (e) {
- this.touchStartTime = e.timeStamp
- },
-
- touchEnd: function (e) {
- this.touchEndTime = e.timeStamp
- },
- chooesFloor(e) {
- let item = e.currentTarget.dataset.item
- var that = this
-
- if (that.data.touchEndTime - that.data.touchStartTime < 350) {
-
- var currentTime = e.timeStamp
- var lastTapTime = that.data.lastTapTime
-
- that.data.lastTapTime = currentTime
-
- if (currentTime - lastTapTime < 300) {
-
-
- clearTimeout(that.data.lastTapTimeoutFunc);
- that.setData({
- intervieweeForm: item
- })
- that.sure()
- } else {
-
- that.data.lastTapTimeoutFunc = setTimeout(function () {
- that.setData({
- isEnterInterviewee: true,
- intervieweeForm: item
- })
- }, 300);
- }
- }
- },
-
- async sure() {
- if(this.data.isHistory){
- if(!this.data.intervieweeForm.name) {
- this.backEnter()
- return
- }
- }
- let {
- remainingInfo,
- intervieweeForm,
- carnum
- } = this.data
- let form = Object.assign({}, remainingInfo, intervieweeForm);
- console.log('form --->', form)
- form.carnum = carnum
- form.visitingTime = getDate()
- app.data.visitoMsgData = form
-
- let transitPushSwitch = app.globalData.snDisposition.transitPushSwitch
- if (transitPushSwitch) {
-
- let areaRes = await areaInfo({
- sn: app.globalData.sn,
- }).data || {}
-
- console.log('areaRes ----> ', 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,
- "status": true,
- "reasonType": null,
- "userId": 0,
- "verifyType": app.data.userInfo.verifyType,
- "certName": form.visitorName,
- "certNo": form.visitorIdCard,
- "certContent": JSON.stringify(app.data.userInfo.certContent || '') || '',
- "phone": form.visitorPhone,
- "cardidex": null,
- "photo": app.data.userInfo.avatar,
- "originPhoto": '',
- "originPhotoBase64": app.data.userInfo.idCardPhoto,
- "verifyScore": null,
- "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
- }
- console.log('newPushData ----> ',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)
- }
- },
- closeCanNot() {
- this.setData({
- hiddenPro: true,
- hiddenStr: true,
- isShowCauseMatter: false
- })
- },
-
- async configList() {
- try {
- let data = {
- sn: app.globalData.sn
- }
- let res = await configList(data)
- this.setData({
- allFloorList: res.data
- })
- } catch (error) {
- console.log(error);
- }
- },
- openFloor() {
- let {
- intervieweeForm,
- allFloorList
- } = this.data
- let floorList = []
- if (intervieweeForm.floor) {
- floorList = intervieweeForm.floor.split(',')
- }
- let indexList = []
- if (floorList.length > 0) {
- floorList.forEach(item1 => {
- let index = allFloorList.findIndex(item => {
- return item1 == item.actualityFloor
- })
- if (index > -1) {
- indexList.push(index)
- }
- })
- }
- this.setData({
- isShowfloor: true,
- chooseFloorIndex: indexList,
- chooseFloorItem: floorList
- })
- },
- multipleChoiceFloor(e) {
- let index = e.currentTarget.dataset.index
- let item = e.currentTarget.dataset.item
- let {
- chooseFloorIndex,
- chooseFloorItem,
- } = this.data
- let index1 = chooseFloorIndex.findIndex(item => {
- return item == index
- })
- if (index1 == -1) {
- chooseFloorIndex.push(index)
- chooseFloorItem.push(item.actualityFloor)
- } else {
- chooseFloorIndex.splice(index1, 1);
- chooseFloorItem.splice(index1, 1);
- }
- this.setData({
- chooseFloorIndex,
- chooseFloorItem,
- })
- },
- delmultipleChoiceFloor(e) {
- let index = e.currentTarget.dataset.index
- let {
- chooseFloorIndex,
- chooseFloorItem,
- } = this.data
- chooseFloorIndex.splice(index, 1);
- chooseFloorItem.splice(index, 1);
- this.setData({
- chooseFloorIndex,
- chooseFloorItem,
- })
- },
- floorCancel() {
- this.setData({
- isShowfloor: false,
- chooseFloorIndex: [],
- chooseFloorItem: []
- })
- },
- floorSure() {
- let str = this.data.chooseFloorItem.join(',');
- this.setData({
- isShowfloor: false,
- 'intervieweeForm.floor': str
- })
- },
-
-
- proTap(e) {
- let that = this;
- let province = e.currentTarget.dataset.province;
- let carnum = this.data.carnum;
- if (carnum.length < 1) {
- carnum += province;
- }
- this.setData({
- carnum: carnum,
- 'formInfo.carnum': carnum,
- hiddenPro: true,
- hiddenStr: false,
- })
- },
- strTap(e) {
- let that = this;
- this.setData({
- waiting: true
- })
- let province = e.currentTarget.dataset.str;
- let carnum = this.data.carnum;
-
- if (carnum.length <= 8) {
- carnum += province;
- console.log(carnum);
- }
-
-
-
-
- this.setData({
- notNum: false,
- carnum: carnum,
- 'formInfo.carnum': carnum,
- })
- setTimeout(() => {
- that.setData({
- waiting: false
- })
- }, 100);
- if (carnum.length > 6) {
- this.setData({
- downBtn: '完成',
- strDisabled: true,
- })
-
- return;
- }
- },
- backSpace() {
- let carnum = this.data.carnum;
- if (carnum.length <= 7) {
- this.setData({
- downBtn: '返回',
- strDisabled: false,
- })
- }
- var arr = carnum.split('');
- arr.splice(-1, 1)
- var str = arr.join('')
- if (arr.length < 2) {
- this.setData({
- notNum: true
- })
- }
- if (str == '') {
- this.setData({
- hiddenPro: false,
- hiddenStr: true
- })
- }
- this.setData({
- carnum: str
- })
- },
- backKeyboard() {
- if (this.data.carnum.length > 6) {
- this.setData({
- downBtn: '完成',
- hiddenPro: true,
- hiddenStr: false
- })
- } else if (this.data.carnum.length > 0) {
- this.setData({
- hiddenPro: true,
- hiddenStr: false
- })
- } else {
- this.setData({
- hiddenPro: false,
- hiddenStr: true
- })
- }
- },
- applyNum() {
- this.setData({
- hiddenPro: true,
- hiddenStr: true,
- })
- },
- closeSecondaryScreenFuc() {
- console.log('关闭副屏', app.data.isSecondaryScreenState)
- if (app.data.isSecondaryScreenState) {
- closeSecondaryScreen()
-
- }
- },
-
- saveRef(ref) {
-
- this.toTitleRef = ref
- },
-
- backToSpecifiedPage(url) {
- this.toTitleRef && this.toTitleRef.clearIntervalAll()
- my.reLaunch({
- url: url,
- })
- setTimeout(() => {
- this.closeSecondaryScreenFuc();
- }, 500)
- },
- back() {
-
- let isSecondaryScreenState = app.data.isSecondaryScreenState;
- if (isSecondaryScreenState) {
-
- let processingPageSwitch = app.globalData.snDisposition.processingPageSwitch;
-
- let secondaryPageSwitch = app.globalData.snDisposition.secondaryPageSwitch;
- if (processingPageSwitch && secondaryPageSwitch) {
- app.data.cycleIntervalSwitch = true
- let url = app.globalData.snDisposition.secondaryPageImages[app.data.secondaryPageImagesIndex] || ''
- if (url) {
- openSecondaryScreen(url)
- }
- setTimeout(() => {
- this.toTitleRef && this.toTitleRef.clearIntervalAll()
- my.reLaunch({
- url: '/pages/home/index',
- })
- }, 500)
- } else if (!processingPageSwitch && secondaryPageSwitch) {
- app.data.cycleIntervalSwitch = true
- let url = app.globalData.snDisposition.secondaryPageImages[app.data.secondaryPageImagesIndex] || ''
- if (url) {
- openSecondaryScreen(url)
- }
- setTimeout(() => {
- this.toTitleRef && this.toTitleRef.clearIntervalAll()
- my.reLaunch({
- url: '/pages/home/index',
- })
- }, 500)
- } else {
- this.backToSpecifiedPage('/pages/home/index')
- }
- } else {
- this.backToSpecifiedPage('/pages/home/index')
- }
- },
- didUnmount() {
-
- },
- onUnload() {
-
- },
- });
|