diff --git a/pages/access-card/access-card.vue b/pages/access-card/access-card.vue index 433ede8..18ea3cd 100644 --- a/pages/access-card/access-card.vue +++ b/pages/access-card/access-card.vue @@ -16,7 +16,6 @@ - 办卡选择 @@ -44,91 +43,317 @@ - - - 出入区域*: - - 选择 - - - - - - - - - {{ item.address }} - {{ item.area }} - - - - - 是否开通人脸权限: - - - - - - - - - 人员姓名*: - - - - 人员部门*: - - - - 联系电话*: - - - 人脸照片(上传1张)*: - - - - - - - + + + + + + + {{ item.address }} + {{ item.area }} + + + + + 是否开通人脸权限: + + + + - - - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! - 身份证正反面(上传2张) - - - - - + + + + 人员信息{{peopleIndex+1}} + + 人员姓名*: + + + + 人员部门*: + + + + 联系电话*: + + + 人脸照片(上传1张)*: + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + 身份证正反面(上传2张)* + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + 增加人员 + + + 删除人员 + - - + + + + 审批人: + + + + {{ examList[examIndex].name }} + + - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + + 项目归口管理部门*: + + + + {{ unitList[unitIndex].name }} + + + + + 经办人*: + + + + 联系电话*: + + + + 申请人姓名*: + + + + 所属单位*: + + + + 联系方式*: + + + + 申请类别*: + + + + {{ typeList[typeIndex].name }} + + + + + 申请期限*: + + + + {{ limitList[limitIndex].name }} + + + + + + + 申请区域*: + + 选择 + + + + + + + + + {{ item.address }} + {{ item.area }} + + + + 人脸照片(上传1张)* + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + 身份证正反面(上传2张)* + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + 情况说明(上传图片) + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + + 项目归口部门负责人*: + + + + {{ examList1[examIndex1].name }} + + + + + + + + + 经办部门*: + + + + {{ unitList2[unitIndex2].name }} + + + + + 经办人员*: + + + + 联系电话*: + + + + 借出时间*: + + + + 归还时间*: + + + 附件: + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + 实际归还时间*: + + + + 备注*: + + + + + 经办部门负责人*: + + + + {{ examList2[examIndex2].name }} + + + + + + - - - - - - + 人员单位*: - 登记照片(上传1张) - - - - - - - - - - + - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! - 身份证正反面(上传2张) - - - - - - - - - - - - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! - - 申请事由: - - - - - - - 证明文件 - - - - - - - - - - - - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! @@ -284,18 +456,7 @@ - - - 审批人: - - - - {{ examList[examIndex].name }} - - - - + @@ -460,16 +621,11 @@ contentrefresh: '正在加载...', contentnomore: '没有更多数据了' }, - // deptList: [], - // departmentIndex: 0, + userInfo: getStorage('userInfo'), - areaData0:[],//出入区域 - unit: '', - personnel: '', - personnelPhone: '', - matter: '', - chosenType:0, - isEnableFace: '0', + //办卡-职工卡-------------------------------------------- + areaData0:[],//职工卡-出入区域 + isEnableFace: '0',//职工卡-是否开启人脸权限 faceList: [{ name: '是', value: '1' @@ -477,17 +633,99 @@ name: '否', value: '0' }], - reasonList: [{ - name: '运维', - value: '运维' + peopleList0:[//职工卡-人员列表 + { + personnelName: '', + unitName: '', + personnelPhone: '', + faceImgs:[], + faceImgsId:[], + idPhotoes:[], + idPhotoesId: [], + } + ], + examIndex: 0,//审批人 + examList: [],//审批人 + //办卡-第三方人员---------------------------------------- + unitIndex:0,//项目归口管理部门 + unitList: [{ + name: '后勤部', + value: '后勤部' }, { - name: '施工', - value: '施工' + name: '综合部', + value: '综合部' + }, { + name: '办公室', + value: '办公室' }], + handlerName: '', //经办人 + handlerPhone: '',//经办人联系电话 + unitName: '',//申请人姓名 + personnelName: '',//所属单位 + personnelPhone: '',//联系方式 + typeIndex:0,//申请类型 + typeList: [{ + name: '信息运维', + value: '信息运维' + }, { + name: '物业服务', + value: '物业服务' + }, { + name: '其他', + value: '其他' + }], + limitIndex:0,//申请时限 + limitList: [{ + name: '一年', + value: '一年' + }, { + name: '固定期限', + value: '固定期限' + }, { + name: '其他', + value: '其他' + }], + areaData1:[],//第三方人员-出入区域 + faceImgs:[],//人脸图片 + faceImgsId:[],//人脸图片 + idPhotoes:[],//身份证正反面 + idPhotoesId: [],//身份证正反面 + situationPhotoes: [],//情况说明 + situationPhotoesId: [],//情况说明 + examIndex1: 0,//项目归口部门负责人 + examList1: [],//项目归口部门负责人 + //办卡-VIP贵宾------------------------------------ + unitIndex2:0,//项目归口管理部门 + unitList2: [{ + name: '后勤部', + value: '后勤部' + }, { + name: '综合部', + value: '综合部' + }, { + name: '办公室', + value: '办公室' + }], + handlerName2: '', //经办人 + handlerPhone2: '',//经办人联系电话 + outDate:'',//借出时间 + backDate:'',//归还时间 + realBackDate:'',//实际归还时间 + remarks:'',//备注 + documentPhoto: [],//附件 + documentPhotoId: [],//附件 + examIndex2: 0,//经办部门负责人 + examList2: [],//经办部门负责人 + + + + + + + matter: '', + chosenType:0, accessArea: '', dateRange: '', - examIndex: 0, - examList: [], myCardList:[],//我的卡列表 reissueCardList:[],//待补办卡列表 losscard:{}, @@ -530,14 +768,10 @@ submitFlag: true, showAlert: false, - imgs: [], - imgsId: [], + + - idPhoto: [], - idPhotoId: [], - documentPhoto: [], - documentPhotoId: [], scienceTechRemarks: '', //科技楼备注 dispatchRemarks: '', //调度楼备注 @@ -573,9 +807,7 @@ } }, methods: { - radioChange(evt){ - this.matter = evt.target.value; - }, + faceChange(evt){ this.isEnableFace = evt.target.value; }, @@ -591,27 +823,25 @@ this.unit= '' this.personnel= '' this.personnelPhone= '' - this.imgs= [] - this.imgsId= [] - this.idPhoto= [] - this.idPhotoId= [] - this.documentPhoto = []; - this.documentPhotoId= []; + + // this.idPhoto= [] + // this.idPhotoId= [] + // this.documentPhoto = []; + // this.documentPhotoId= []; this.isEnableFace = '0' this.accessArea = '' this.areaData0 = [] + this.areaData1 = [] } if(index==1){ this.unit= '' this.personnel= '' this.personnelPhone= '' - this.imgs= [] - this.imgsId= [] - this.idPhoto= [] - this.idPhotoId= [] - this.documentPhoto = []; - this.documentPhotoId= []; - this.matter = '维保' + + // this.idPhoto= [] + // this.idPhotoId= [] + // this.documentPhoto = []; + // this.documentPhotoId= []; this.accessArea = '' } if(index==2){ @@ -648,8 +878,49 @@ //选择证件类型 changesecondCardItems(e) { this.secondIndex = e.detail.value; + console.log(this.secondIndex) }, - //获取审批人 + + //新办卡-职工卡 + //添加人员 + addpeople0(){ + uni.showModal({ + title: '确认', + content: '请确认是否增加新的人员?', + showCancel: true, + cancelText: '取消', + confirmText: '确认', + success: res => { + if (res.confirm) { + this.peopleList0.push({ + personnelName: '', + unitName: '', + personnelPhone: '', + faceImgs:[], + faceImgsId:[], + idPhotoes:[], + idPhotoesId: [] + }) + } else if (res.cancel) {} + } + }); + }, + //删除人员 + delpeople0(peopleIndex){ + uni.showModal({ + title: '确认', + content: '请确认是否删除人员?', + showCancel: true, + cancelText: '取消', + confirmText: '确认', + success: res => { + if (res.confirm) { + this.peopleList0.splice(peopleIndex, 1); + } else if (res.cancel) {} + } + }); + }, + //新办卡-职工卡-获取审批人 getDeptExamineAuth() { let params = { method: getDeptExamineAuth, @@ -668,152 +939,196 @@ } }); }, - //选择审批人 + //新办卡-职工卡-选择审批人 changeExamList(e) { // console.log(e) this.examIndex = e.detail.value; }, + + + //新办卡-第三方-选择项目归口管理部门 + changeUnit(e) { + console.log(e) + this.unitIndex = e.detail.value; + }, + //新办卡-第三方-选择申请类别 + changeApplyType(e) { + console.log(e) + this.typeIndex = e.detail.value; + }, + //新办卡-第三方-申请期限 + changeLimitType(e) { + console.log(e) + this.limitIndex = e.detail.value; + }, + //新办卡-职工卡-选择审批人 + changeExamList1(e) { + // console.log(e) + this.examIndex1 = e.detail.value; + }, + + + + + //新办卡-VIP贵宾-经办部门 + changeUnit2(e) { + console.log(e) + this.unitIndex2 = e.detail.value; + }, + //新办卡-VIP贵宾-经办部门负责人 + changeExamList2(e) { + // console.log(e) + this.examIndex2 = e.detail.value; + }, + + + //提交(新办卡,新办证) submit() { + console.log(this.firstIndex) + console.log(this.secondIndex) + console.log(this.peopleList0) var regPhone = /^1[3|4|5|6|7|8|9]\d{9}$/; // var regCard = /^[a-zA-Z0-9_]{0,}$/; // var regNumber = /[^\d]/; if (this.firstIndex == 0) { - if (!this.unit) { - alertTip('请输入人员部门'); - return false; - } - if (!this.personnel) { - alertTip('请输入人员姓名'); - return false; - } - if (!this.personnelPhone) { - alertTip('请输入联系电话'); - return false; - } - if (!regPhone.test(this.personnelPhone)) { - alertTip('请输入正确的手机号'); - return false; - } - if(this.areaData0.length>0){ - let idList = this.areaData0.map(item=>{ - return item.areaIds - }) - this.accessArea =idList.join(',') - } - if (!this.accessArea) { - alertTip('请选择出入区域'); - return false; - } - if (this.isEnableFace=='1') { - if (this.imgsId.length==0) { - alertTip('请选择登记照片'); - return false; - } - } - }else if (this.firstIndex == 1) { - console.log(this.accessArea) - if (!this.personnel) { - alertTip('请输入人员姓名'); - return false; - } - if (!this.unit) { - alertTip('请输入人员单位'); - return false; - } - if (!regPhone.test(this.personnelPhone)) { - alertTip('请输入正确的手机号'); - return false; - } - - if (!this.accessArea) { - alertTip('请选择出入区域'); - return false; - } - if(this.accessArea.length>0){ - this.accessArea = this.accessArea.join(',') - }else{ - alertTip('请选择出入区域'); - return false; - } - if (!this.dateRange) { - alertTip('请选择日期期限'); - return false; - } + // if (!this.unit) { + // alertTip('请输入人员部门'); + // return false; + // } + // if (!this.personnel) { + // alertTip('请输入人员姓名'); + // return false; + // } + // if (!this.personnelPhone) { + // alertTip('请输入联系电话'); + // return false; + // } + // if (!regPhone.test(this.personnelPhone)) { + // alertTip('请输入正确的手机号'); + // return false; + // } + // if(this.areaData0.length>0){ + // let idList = this.areaData0.map(item=>{ + // return item.areaIds + // }) + // this.accessArea =idList.join(',') + // } + // if (!this.accessArea) { + // alertTip('请选择出入区域'); + // return false; + // } + // if (this.isEnableFace=='1') { + // // if (this.imgsId.length==0) { + // // alertTip('请选择登记照片'); + // // return false; + // // } + // } } - if (!this.submitFlag) { - return false; - } - this.submitFlag = false; - let params = { - method: addCard, - data: { - type: this.firstCardItems[this.firstIndex].id,//办卡类型 - typeName: this.firstCardItems[this.firstIndex].name,//办卡名称 - cardType: this.secondCardItems[this.secondIndex].DESCRIPTION,//证件类型 - isEnableFace: this.isEnableFace,//人脸权限 - accessArea: this.accessArea,//出入区域 - - userId: this.userInfo.id, - userName: this.userInfo.userName, - phone: this.userInfo.telnumber, - orgId: this.userInfo.orgId, - departmentId: this.userInfo.deptId, - orgName: this.userInfo.orgName, - - unit: this.unit, - personnel: this.personnel, - personnelPhone: this.personnelPhone, - personnel: this.personnel, - matter: this.matter,//申请事由 + // else if (this.firstIndex == 1) { + // console.log(this.accessArea) + // if (!this.personnel) { + // alertTip('请输入人员姓名'); + // return false; + // } + // if (!this.unit) { + // alertTip('请输入人员单位'); + // return false; + // } + // if (!regPhone.test(this.personnelPhone)) { + // alertTip('请输入正确的手机号'); + // return false; + // } - startTime: this.dateRange[0], - endTime: this.dateRange[1], + // if (!this.accessArea) { + // alertTip('请选择出入区域'); + // return false; + // } + // if(this.accessArea.length>0){ + // this.accessArea = this.accessArea.join(',') + // }else{ + // alertTip('请选择出入区域'); + // return false; + // } + // if (!this.dateRange) { + // alertTip('请选择日期期限'); + // return false; + // } + // } + + + + // if (!this.submitFlag) { + // return false; + // } + // this.submitFlag = false; + // let params = { + // method: addCard, + // data: { + // type: this.firstCardItems[this.firstIndex].id,//办卡类型 + // typeName: this.firstCardItems[this.firstIndex].name,//办卡名称 + // cardType: this.secondCardItems[this.secondIndex].DESCRIPTION,//证件类型 + // isEnableFace: this.isEnableFace,//人脸权限 + // accessArea: this.accessArea,//出入区域 - examinePersonId: this.examList[this.examIndex].id, - examinePersonName: this.examList[this.examIndex].name, + // userId: this.userInfo.id, + // userName: this.userInfo.userName, + // phone: this.userInfo.telnumber, + // orgId: this.userInfo.orgId, + // departmentId: this.userInfo.deptId, + // orgName: this.userInfo.orgName, - photo: this.imgsId.toString(), - idPhoto: this.idPhotoId.toString(), - documentation: this.documentPhotoId.toString() + // unit: this.unit, + // personnel: this.personnel, + // personnelPhone: this.personnelPhone, + // personnel: this.personnel, + + // startTime: this.dateRange[0], + // endTime: this.dateRange[1], - } - }; - callbackRequest(params).then(res => { - res = res.data; - if (res.returnCode == 1) { - alertTip(res.returnMsg); - setTimeout(_ => { - this.unit = ''; - this.personnel = ''; - this.personnelPhone = ''; - this.matter = ''; - this.accessArea = ''; - this.scienceTechRemarks = ''; - this.dispatchRemarks = ''; - this.logisticsRemarks = ''; - this.dateRange = ''; - this.isEnableFace = '0' - this.areaData0 = []; - this.imgs = []; - this.imgsId = []; - this.idPhoto = []; - this.idPhotoId = []; - this.documentPhoto = []; - this.documentPhotoId= []; - this.currentTabIndex = 1; - this.submitFlag = true; - }, 2000); - } else { - alertTip(res.returnMsg); - this.submitFlag = true; - } - - }); + // examinePersonId: this.examList[this.examIndex].id, + // examinePersonName: this.examList[this.examIndex].name, + + // photo: this.imgsId.toString(), + // idPhoto: this.idPhotoId.toString(), + // documentation: this.documentPhotoId.toString() + + // } + // }; + // callbackRequest(params).then(res => { + // res = res.data; + // if (res.returnCode == 1) { + // alertTip(res.returnMsg); + // setTimeout(_ => { + // this.unit = ''; + // this.personnel = ''; + // this.personnelPhone = ''; + // this.matter = ''; + // this.accessArea = ''; + // this.scienceTechRemarks = ''; + // this.dispatchRemarks = ''; + // this.logisticsRemarks = ''; + // this.dateRange = ''; + // this.isEnableFace = '0' + // this.areaData0 = []; + // this.areaData1 = []; + + // // this.idPhoto = []; + // // this.idPhotoId = []; + // this.documentPhoto = []; + // this.documentPhotoId= []; + // this.currentTabIndex = 1; + // this.submitFlag = true; + // }, 2000); + // } else { + // alertTip(res.returnMsg); + // this.submitFlag = true; + // } + // }); }, - //登记照片 - async chooseImg() { + //办卡-人脸照片-职工卡-多人多张图片 + async chooseFaceImg(peopleIndex) { let chec = 0; let sty = []; let _this = this; @@ -834,16 +1149,14 @@ success: async function(res) { let resData = res.tempFilePaths; for (let i = 0; i < resData.length; i++) { - if (_this.imgs.length > 1) { + if (_this.peopleList0[peopleIndex].faceImgs.length > 1) { break; } uni.getImageInfo({ src: resData[i], success: async (path) => { - convertImgToBase64(path.path, - async function(base64) { - if (_this.imgs.length < 1) { - // _this.imgs.push(base64); + convertImgToBase64(path.path,async function(base64) { + if (_this.peopleList0[peopleIndex].faceImgs.length < 1) { uni.showLoading({title: '图片上传中'}) let blength = base64.length; let glength = 7500; @@ -860,8 +1173,8 @@ if (resu.returnCode !=1) { alertTip(resu.returnMsg); } else { - _this.imgs.push(base64); - _this.imgsId.push(resu.returnData + ".jpg"); + _this.peopleList0[peopleIndex].faceImgs.push(base64); + _this.peopleList0[peopleIndex].faceImgsId.push(resu.returnData + ".jpg"); } }); } else { @@ -869,12 +1182,6 @@ for (let j =1; j < fnum + 1; j++) { if (j == fnum) { let groupBase = base64.slice((j-1)*glength); - // console - // .log( - // groupBase - // .length, - // "groupBaselength" - // ); let uploadParam = { base64: groupBase, userId: getStorage('userInfo').userId +i, @@ -883,8 +1190,8 @@ await uploadImg(uploadParam).then(resu => { resu = resu.data; if (resu.returnCode==1) { - _this.imgs.push(base64); - _this.imgsId.push(resu.returnData+".jpg"); + _this.peopleList0[peopleIndex].faceImgs.push(base64); + _this.peopleList0[peopleIndex].faceImgsId.push(resu.returnData+".jpg"); } else { uni.hideLoading(); alertTip(resu.returnMsg); @@ -925,8 +1232,13 @@ } }); }, - //身份证照片 - async chooseImg2() { + //删除人脸照片-职工卡 + removeFaceImg(peopleIndex,index) { + this.peopleList0[peopleIndex].faceImgs.splice(index, 1); + this.peopleList0[peopleIndex].faceImgsId.splice(index, 1); + }, + //办卡-身份证照片-职工卡-多人多张图片 + async chooseIdCardImg(peopleIndex) { let chec = 0; let sty = []; let _this = this; @@ -947,39 +1259,34 @@ success: async function(res) { let resData = res.tempFilePaths; for (let i = 0; i < resData.length; i++) { - if (_this.idPhoto.length > 2) { + if (_this.peopleList0[peopleIndex].idPhotoes.length > 2) { break; } uni.getImageInfo({ src: resData[i], success: async (path) => { - convertImgToBase64(path.path, - async function(base64) { - if (_this.idPhoto.length < 2) { - // _this.imgs.push(base64); + convertImgToBase64(path.path,async function(base64) { + if (_this.peopleList0[peopleIndex].idPhotoes.length < 2) { uni.showLoading({ title: '图片上传中' }) let blength = base64.length; let glength = 7500; console.log("base64:",base64) - if (blength <= - glength) { + if (blength <= glength) { let uploadParam = { base64: base64, userId: getStorage('userInfo').userId +i, groupEnd: '1' } - await uploadImg(uploadParam) - .then( - resu => { + await uploadImg(uploadParam).then(resu => { resu =resu.data; uni.hideLoading(); if (resu.returnCode !=1) { alertTip(resu.returnMsg); } else { - _this.idPhoto.push(base64); - _this.idPhotoId.push(resu.returnData +".jpg"); + _this.peopleList0[peopleIndex].idPhotoes.push(base64); + _this.peopleList0[peopleIndex].idPhotoesId.push(resu.returnData +".jpg"); } }); } else { @@ -990,93 +1297,42 @@ console.log(groupBase.length,"groupBaselength"); let uploadParam = { base64: groupBase, - userId: getStorage( - 'userInfo' - ) - .userId + - i, + userId: getStorage('userInfo').userId + i, groupEnd: '1' } - await uploadImg - ( - uploadParam) - .then( - resu => { - resu = - resu - .data; - if (resu - .returnCode == - 1 - ) { - _this - .idPhoto - .push( - base64 - ); - _this - .idPhotoId - .push( - resu - .returnData + - ".jpg" - ); + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode == 1) { + _this.peopleList0[peopleIndex].idPhotoes.push(base64); + _this.peopleList0[peopleIndex].idPhotoesId.push(resu.returnData +".jpg"); } else { - uni - .hideLoading(); - alertTip - (resu - .returnMsg - ); + uni.hideLoading(); + alertTip(resu.returnMsg); return; } } ); } else { - let groupBase = - base64 - .slice( - (j - - 1) * - glength, - glength * - j - ); + let groupBase =base64.slice((j - 1) * glength,glength * j); let uploadParam = { base64: groupBase, - userId: getStorage( - 'userInfo' - ) - .userId + - i, + userId: getStorage('userInfo').userId + i, groupEnd: '0' } - await uploadImg - ( - uploadParam) - .then( - resu => { - resu = - resu - .data; - if (resu - .returnCode == - 1 - ) {} else { - uni - .hideLoading(); - alertTip - (resu - .returnMsg - ); + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode == 1) { + + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); return; } } ); } } - uni - .hideLoading(); + uni.hideLoading(); } } }); @@ -1091,8 +1347,345 @@ } }); }, - //证明文件照片 - async chooseImg3() { + //删除身份证图片 + removeIdCardImg(peopleIndex,index) { + this.peopleList0[peopleIndex].idPhotoes.splice(index, 1); + this.peopleList0[peopleIndex].idPhotoesId.splice(index, 1); + }, + + //办卡-人脸照片-第三方人员-单人多张图片 + async chooseFaceImg2() { + let chec = 0; + let sty = []; + let _this = this; + uni.showActionSheet({ + itemList: ['拍照', '相册'], + success: function(resp) { + chec = resp.tapIndex; + if (chec == 0) { + sty = ['camera']; //从相册相机选择 + } else { + sty = ['album']; //从相册相机选择 + } + uni.chooseImage({ + count: 1, + sizeType: ['compressed'], + sourceType: sty, + quality: 1, + success: async function(res) { + let resData = res.tempFilePaths; + for (let i = 0; i < resData.length; i++) { + if (_this.faceImgs.length > 1) { + break; + } + uni.getImageInfo({ + src: resData[i], + success: async (path) => { + convertImgToBase64(path.path,async function(base64) { + if (_this.faceImgs.length < 1) { + uni.showLoading({title: '图片上传中'}) + let blength = base64.length; + let glength = 7500; + // console.log("base64:",base64) + if (blength <= glength) { + let uploadParam = { + base64: base64, + userId: getStorage('userInfo').userId + i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + uni.hideLoading(); + if (resu.returnCode !=1) { + alertTip(resu.returnMsg); + } else { + _this.faceImgs.push(base64); + _this.faceImgsId.push(resu.returnData + ".jpg"); + } + }); + } else { + let fnum = parseInt(blength / glength); + for (let j =1; j < fnum + 1; j++) { + if (j == fnum) { + let groupBase = base64.slice((j-1)*glength); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId +i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode==1) { + _this.faceImgs.push(base64); + _this.faceImgsId.push(resu.returnData+".jpg"); + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } else { + let groupBase =base64.slice((j-1)*glength,glength*j); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId+i, + groupEnd: '0' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode ==1) { + + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } + } + uni.hideLoading(); + } + } + }); + }, + }); + } + } + }); + }, + fail: function(resp) { + console.log(resp.errMsg); + } + }); + }, + //办卡-删除人脸照片-第三方人员 + removeFaceImg2(index) { + this.faceImgs.splice(index, 1); + this.faceImgsId.splice(index, 1); + }, + //办卡-身份证照片-第三方人员-单人多张图片 + async chooseIdCardImg2() { + let chec = 0; + let sty = []; + let _this = this; + uni.showActionSheet({ + itemList: ['拍照', '相册'], + success: function(resp) { + chec = resp.tapIndex; + if (chec == 0) { + sty = ['camera']; //从相册相机选择 + } else { + sty = ['album']; //从相册相机选择 + } + uni.chooseImage({ + count: 1, + sizeType: ['compressed'], + sourceType: sty, + quality: 1, + success: async function(res) { + let resData = res.tempFilePaths; + for (let i = 0; i < resData.length; i++) { + if (_this.idPhotoes.length > 1) { + break; + } + uni.getImageInfo({ + src: resData[i], + success: async (path) => { + convertImgToBase64(path.path,async function(base64) { + if (_this.idPhotoes.length < 1) { + uni.showLoading({title: '图片上传中'}) + let blength = base64.length; + let glength = 7500; + // console.log("base64:",base64) + if (blength <= glength) { + let uploadParam = { + base64: base64, + userId: getStorage('userInfo').userId + i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + uni.hideLoading(); + if (resu.returnCode !=1) { + alertTip(resu.returnMsg); + } else { + _this.idPhotoes.push(base64); + _this.idPhotoesId.push(resu.returnData + ".jpg"); + } + }); + } else { + let fnum = parseInt(blength / glength); + for (let j =1; j < fnum + 1; j++) { + if (j == fnum) { + let groupBase = base64.slice((j-1)*glength); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId +i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode==1) { + _this.idPhotoes.push(base64); + _this.idPhotoesId.push(resu.returnData+".jpg"); + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } else { + let groupBase =base64.slice((j-1)*glength,glength*j); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId+i, + groupEnd: '0' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode ==1) { + + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } + } + uni.hideLoading(); + } + } + }); + }, + }); + } + } + }); + }, + fail: function(resp) { + console.log(resp.errMsg); + } + }); + }, + //办卡-删除身份证照片-第三方人员 + removeIdCardImg2(index) { + this.idPhotoes.splice(index, 1); + this.idPhotoesId.splice(index, 1); + }, + //办卡-情况说明照片-第三方人员-单人多张图片 + async chooseSituationImg() { + let chec = 0; + let sty = []; + let _this = this; + uni.showActionSheet({ + itemList: ['拍照', '相册'], + success: function(resp) { + chec = resp.tapIndex; + if (chec == 0) { + sty = ['camera']; //从相册相机选择 + } else { + sty = ['album']; //从相册相机选择 + } + uni.chooseImage({ + count: 1, + sizeType: ['compressed'], + sourceType: sty, + quality: 1, + success: async function(res) { + let resData = res.tempFilePaths; + for (let i = 0; i < resData.length; i++) { + if (_this.situationPhotoes.length > 1) { + break; + } + uni.getImageInfo({ + src: resData[i], + success: async (path) => { + convertImgToBase64(path.path,async function(base64) { + if (_this.situationPhotoes.length < 1) { + uni.showLoading({title: '图片上传中'}) + let blength = base64.length; + let glength = 7500; + // console.log("base64:",base64) + if (blength <= glength) { + let uploadParam = { + base64: base64, + userId: getStorage('userInfo').userId + i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + uni.hideLoading(); + if (resu.returnCode !=1) { + alertTip(resu.returnMsg); + } else { + _this.situationPhotoes.push(base64); + _this.situationPhotoesId.push(resu.returnData + ".jpg"); + } + }); + } else { + let fnum = parseInt(blength / glength); + for (let j =1; j < fnum + 1; j++) { + if (j == fnum) { + let groupBase = base64.slice((j-1)*glength); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId +i, + groupEnd: '1' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode==1) { + _this.situationPhotoes.push(base64); + _this.situationPhotoesId.push(resu.returnData+".jpg"); + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } else { + let groupBase =base64.slice((j-1)*glength,glength*j); + let uploadParam = { + base64: groupBase, + userId: getStorage('userInfo').userId+i, + groupEnd: '0' + } + await uploadImg(uploadParam).then(resu => { + resu = resu.data; + if (resu.returnCode ==1) { + + } else { + uni.hideLoading(); + alertTip(resu.returnMsg); + return; + } + }); + } + } + uni.hideLoading(); + } + } + }); + }, + }); + } + } + }); + }, + fail: function(resp) { + console.log(resp.errMsg); + } + }); + }, + //办卡-删除情况说明照片-第三方人员 + removeSituationImg(index) { + this.situationPhotoes.splice(index, 1); + this.situationPhotoesId.splice(index, 1); + }, + + //办卡-附件照片-VIP贵宾 + async chooseDocumentImg() { let chec = 0; let sty = []; let _this = this; @@ -1256,22 +1849,20 @@ } }); }, - //删除登记照片 - removeImg(index) { - this.imgs.splice(index, 1); - this.imgsId.splice(index, 1); - }, - //删除身份证图片 - removeImg2(index) { - this.idPhoto.splice(index, 1); - this.idPhotoId.splice(index, 1); - }, - //删除证明文件 - removeImg3(index) { + + //办卡-删除附件文件-VIP贵宾 + removeDocumentImg(index) { this.documentPhoto.splice(index, 1); this.documentPhotoId.splice(index, 1); }, + + + + + + + //补办挂失 //获取所有卡 getAllCardList() { @@ -1496,7 +2087,6 @@ - //获取申请列表 dataList() { let params = { @@ -1757,7 +2347,7 @@ .label { float: left; - width: 150upx; + width: 140upx; font-size: 28upx; color: #333; font-weight: bold; @@ -1765,7 +2355,7 @@ } .ipt-box { - margin-left: 160upx; + margin-left: 150upx; .areaBtn{ font-size: 24upx; width: 100upx;