diff --git a/src/manifest.json b/src/manifest.json index 77907f6..3fe960c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -57,7 +57,7 @@ /* 微信小程序特有相关 */ "plugins": { "miniprogram-thirdparty-plugin": { - "version": "0.3.12", + "version": "0.3.13", "provider": "wxb8b928431b8c56d8", "export": "" }, diff --git a/src/subpackage/party/js/api.js b/src/subpackage/party/js/api.js index 8a02bbc..d86627c 100644 --- a/src/subpackage/party/js/api.js +++ b/src/subpackage/party/js/api.js @@ -29,8 +29,8 @@ export const PARTY_API = { gatewayDo: `${ORIGIN}/tpp/miniapp/gatewayDo`, //透传接口 gatewayDoDuplicate: `${ORIGIN}/tpp/miniapp/gatewayDoDuplicate`, //透传上传接口 - editTempDraft0: `${ORIGIN}/web/webBrandUser/temp/edit`, //保存草稿 - getTempDraft0: `${ORIGIN}/web/webBrandUser/temp/get`, //获取草稿 + editTempDraft0: `${ORIGIN}/web/webBrandUser/temp/edit`, //保存草稿-旧 + getTempDraft0: `${ORIGIN}/web/webBrandUser/temp/get`, //获取草稿-旧 editTempDraft: `${ORIGIN}/web/webBrandAuthenticationTemp/edit`, //保存草稿 getTempDraft: `${ORIGIN}/web/webBrandAuthenticationTemp/get`, //获取草稿 diff --git a/src/subpackage/party/pages/miniapp/record.vue b/src/subpackage/party/pages/miniapp/record.vue index ea3374a..d5877d9 100644 --- a/src/subpackage/party/pages/miniapp/record.vue +++ b/src/subpackage/party/pages/miniapp/record.vue @@ -126,9 +126,19 @@ 应急人联系方式* + + 证件类型* - + + + + + + 证件号码* @@ -531,6 +549,18 @@ export default { queryIcpCertificateTypes_show: "请选择", //证件类型-显示 queryIcpCertificateTypes_index: 0, //证件类型 + // queryIcpCertificateSubTypes: [],//主体负责人证件类型 + queryIcpCertificateSubTypes_remake:[], + // queryIcpCertificateSubTypesArr: [],//证件类型-关联主体 + queryIcpCertificateSubTypes_show: "请选择", //证件类型-显示 + queryIcpCertificateSubTypes_index: 0, //证件类型 + + // queryIcpCertificateAppTypes: [],//小程序负责人证件类型 + queryIcpCertificateAppTypes_remake:[], + // queryIcpCertificateAppTypesArr: [],//证件类型-关联主体 + queryIcpCertificateAppTypes_show: "请选择", //证件类型-显示 + queryIcpCertificateAppTypes_index: 0, //证件类型 + areaDetail: [],//省市区-详细信息 queryIcpDistrictCode: [],//备案省市区的区域信息 queryIcpDistrictCode_show: "请选择", // @@ -550,12 +580,23 @@ export default { certificate_photo_front: { mediaid: '', url: '', - txt:"负责人证件正面照片" + txt:"负责人证件正面照片", + need_certificate_type:true, //如果上传的是证件媒体材料,则必填 + need_check_msg:"请先选择负责人证件类型", + certificate_type_place_arr:['icp_subject','principal_info','certificate_type'],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_subject.principal_info.certificate_photo_front"//备案字段 + }, certificate_photo_back: { mediaid: '', url: '', - txt:"负责人证件背面照片" + txt:"负责人证件背面照片", + need_certificate_type:true, //如果上传的是证件媒体材料,则必填 + need_check_msg:"请先选择负责人证件类型", + certificate_type_place_arr:['icp_subject','principal_info','certificate_type'],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_subject.principal_info.certificate_photo_back"//备案字段 }, authorization_letter: { mediaid: '', @@ -568,21 +609,36 @@ export default { certificate_photo: { mediaid: '', url: '', - txt:"主体证件照片" + txt:"主体证件照片", + need_certificate_type:true, //如果上传的是证件媒体材料,则必填 + need_check_msg:"请先选择主体类型", + certificate_type_place_arr:['icp_subject','organize_info','certificate_type'],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_subject.organize_info.certificate_photo"//备案字段 } }, }, - icp_applets:{ + icp_applets:{ //小程序负责人信息 principal_info :{//法人 certificate_photo_front: { mediaid: '', url: '', - txt:"法人证件正面照片" + txt:"法人证件正面照片", + need_certificate_type:true, //如果上传的是证件媒体材料,则必填 + need_check_msg:"请先选择负责人证件类型", + certificate_type_place_arr:['icp_applets','principal_info','certificate_type'],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_applets.principal_info.certificate_photo_front"//备案字段 }, certificate_photo_back: { mediaid: '', url: '', - txt:"法人证件背面照片" + txt:"法人证件背面照片", + need_certificate_type:true, //如果上传的是证件媒体材料,则必填 + need_check_msg:"请先选择负责人证件类型", + certificate_type_place_arr:['icp_applets','principal_info','certificate_type'],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_applets.principal_info.certificate_photo_back"//备案字段 }, authorization_letter: { mediaid: '', @@ -597,52 +653,102 @@ export default { commitment_letter: { mediaid: "", url: '', - txt:"互联网信息服务承诺书" + txt:"互联网信息服务承诺书", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.commitment_letter"//备案字段 }, business_name_change_letter: { mediaid: '', url: '', - txt:"主体更名函" + txt:"主体更名函", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.business_name_change_letter"//备案字段 }, party_building_confirmation_letter: { mediaid: '', url: '', - txt:"党建确认函" + txt:"党建确认函", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.party_building_confirmation_letter"//备案字段 }, promise_video: { mediaid: '', url: '', - txt:"承诺视频" + txt:"承诺视频", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"video",//图片("image")和视频("video") + icp_order_field:"icp_materials.promise_video"//备案字段 }, authenticity_responsibility_letter: { mediaid: '', url: '', - txt:"网站备案信息真实性责任告知书" + txt:"网站备案信息真实性责任告知书", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.authenticity_responsibility_letter"//备案字段 }, authenticity_commitment_letter: { mediaid: '', url: '', - txt:"小程序备案信息真实性承诺书" + txt:"小程序备案信息真实性承诺书", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.authenticity_commitment_letter"//备案字段 }, website_construction_proposal: { mediaid: '', url: '', - txt:"小程序建设方案书" + txt:"小程序建设方案书", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.website_construction_proposal"//备案字段 }, subject_other_materials: { mediaid: '', url: '', - txt:"主体其它附件" + txt:"主体其它附件", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.subject_other_materials"//备案字段 }, applets_other_materials: { mediaid: '', url: '', - txt:"小程序其它附件" + txt:"小程序其它附件", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.applets_other_materials"//备案字段 }, holding_certificate_photo: { mediaid: '', url: '', - txt:"手持证件照" + txt:"手持证件照", + need_certificate_type:false, //如果上传的是证件媒体材料,则必填 + need_check_msg:"", + certificate_type_place_arr:[],//证件类型参数 + type:"image",//图片("image")和视频("video") + icp_order_field:"icp_materials.holding_certificate_photo"//备案字段 } }, }, @@ -745,6 +851,7 @@ export default { this.appid = opts.appid; await this.getData(); await this.getTempDraft(); + this.checkRid() }, onShow() { @@ -757,6 +864,12 @@ export default { queryIcpCertificateTypesArr() { return this.queryIcpCertificateTypes_remake.map(item => item.name) }, + queryIcpCertificateSubTypesArr() { + return this.queryIcpCertificateTypes.map(item => item.name) + }, + queryIcpCertificateAppTypesArr() { + return this.queryIcpCertificateTypes.map(item => item.name) + }, areaValueShow() { let areaDetail = this.areaDetail; if(!areaDetail.value)return ''; @@ -838,22 +951,42 @@ export default { }, - bindPickerChange_queryIcpSubjectTypes(e) { - console.log('picker发送选择改变,携带值为', e.detail.value) + bindPickerChange_queryIcpSubjectTypes(e) {//主体类型改变 + console.log('picker-主体类型', e.detail.value) this.queryIcpSubjectTypes_index = e.detail.value this.queryIcpSubjectTypes_show = this.queryIcpSubjectTypesArr[e.detail.value] this.form.icp_subject.base_info.type = this.queryIcpSubjectTypes[e.detail.value].type this.remake_queryIcpCertificateTypes() }, - bindPickerChange_queryIcpCertificateTypes(e) { - console.log('picker发送选择改变,携带值为', e.detail.value) + bindPickerChange_queryIcpCertificateTypes(e) {//主体证件类型改变 + console.log('picker-主体证件类型', e.detail.value) this.queryIcpCertificateTypes_index = e.detail.value this.queryIcpCertificateTypes_show = this.queryIcpCertificateTypesArr[e.detail.value] - this.form.icp_subject.organize_info.certificate_type = this.queryIcpCertificateTypes[e.detail.value].type + this.form.icp_subject.organize_info.certificate_type = this.queryIcpCertificateTypes_remake[e.detail.value].type + }, + // queryIcpCertificateTypes + // bindPickerChange_queryIcpCertificateTypes(e) { + // console.log('picker发送选择改变11,携带值为', e.detail.value) + // this.queryIcpCertificateTypes_index = e.detail.value + // this.queryIcpCertificateTypes_show = this.queryIcpCertificateTypesArr[e.detail.value] + // this.form.icp_subject.organize_info.certificate_type = this.queryIcpCertificateTypes[e.detail.value].type + // }, + bindPickerChange_queryIcpCertificateSubTypes(e) {//主体负责人证件类型改变 + console.log('picker-主体负责人证件类型', e.detail.value) + this.queryIcpCertificateSubTypes_index = e.detail.value + this.queryIcpCertificateSubTypes_show = this.queryIcpCertificateSubTypesArr[e.detail.value] + this.form.icp_subject.principal_info.certificate_type = this.queryIcpCertificateTypes[e.detail.value].type + }, + bindPickerChange_queryIcpCertificateAppTypes(e) {//小程序负责人证件类型改变 + console.log('picker-小程序负责人证件类型', e.detail.value) + this.queryIcpCertificateAppTypes_index = e.detail.value + this.queryIcpCertificateAppTypes_show = this.queryIcpCertificateAppTypesArr[e.detail.value] + this.form.icp_applets.principal_info.certificate_type = this.queryIcpCertificateTypes[e.detail.value].type }, + bindPickerChange_serverType(e) { - console.log('picker发送选择改变,携带值为', e.target.value) + console.log('picker-服务类目', e.target.value) let value = e.target.value; this.queryIcpServiceContentTypes_index = value; if (this.queryIcpServiceContentTypes[0].length != 0) { @@ -864,7 +997,7 @@ export default { } //获取选择的服务内容类型type参数 let select_type = [] - select_type.push(this.queryIcpServiceContentTypes[0][value[0]].type) + // select_type.push(this.queryIcpServiceContentTypes[0][value[0]].type) //备案小程序服务内容类型,只能填写二级服务内容类型,最多5个,示例值:[3, 4] select_type.push(this.queryIcpServiceContentTypes[1][value[1]].type) console.log('select_type:', select_type) @@ -916,6 +1049,7 @@ export default { this.form.icp_subject.base_info.city = e.detail.code[1] this.form.icp_subject.base_info.district = e.detail.code[2] }, + // remake_queryIcpCertificateTypes() { let {form}=this @@ -939,13 +1073,7 @@ export default { this.queryIcpCertificateTypes_index = 0 this.form.icp_subject.organize_info.certificate_type = "" }, - // queryIcpCertificateTypes - bindPickerChange_queryIcpCertificateTypes(e) { - console.log('picker发送选择改变,携带值为', e.detail.value) - this.queryIcpCertificateTypes_index = e.detail.value - this.queryIcpCertificateTypes_show = this.queryIcpCertificateTypesArr[e.detail.value] - this.form.icp_subject.organize_info.certificate_type = this.queryIcpCertificateTypes[e.detail.value].type - }, + SubmitEvent() { this.setLocalImgDataToForm() // console.log(this.form); @@ -969,6 +1097,7 @@ export default { return }else{ util.showNone(res.data.message) + util.showModalMsg(res.data.message) } }) .catch(err=>{ @@ -1019,7 +1148,10 @@ export default { }else{ console.log("获取缓存数据:", _res) this.form = _res.form//保存表单数据 - if(_res.localImg)this.localImg = _res.localImg//保存本地图片 + + let _localImg = this.localImg + + if(_res.localImg)this.localImg = _res.localImg//回显本地图片 this.setPickerValueShow() } @@ -1033,7 +1165,6 @@ export default { //icp_subject form.icp_subject.principal_info.certificate_photo_front = localImg.icp_subject.principal_info.certificate_photo_front.mediaid||"" - console.log(111) form.icp_subject.principal_info.certificate_photo_back = localImg.icp_subject.principal_info.certificate_photo_back.mediaid form.icp_subject.principal_info.authorization_letter = localImg.icp_subject.principal_info.authorization_letter.mediaid form.icp_subject.organize_info.certificate_photo = localImg.icp_subject.organize_info.certificate_photo.mediaid @@ -1043,13 +1174,10 @@ export default { form.icp_applets.principal_info.authorization_letter = localImg.icp_applets.principal_info.authorization_letter.mediaid //icp_materials try{ -console.log(112) if(localImg.icp_materials.commitment_letter.mediaid)form.icp_materials.commitment_letter = [localImg.icp_materials.commitment_letter.mediaid] - console.log(113) if(localImg.icp_materials.business_name_change_letter.mediaid)form.icp_materials.business_name_change_letter = [localImg.icp_materials.business_name_change_letter.mediaid] if(localImg.icp_materials.party_building_confirmation_letter.mediaid)form.icp_materials.party_building_confirmation_letter = [localImg.icp_materials.party_building_confirmation_letter.mediaid] if(localImg.icp_materials.promise_video.mediaid)form.icp_materials.promise_video = [localImg.icp_materials.promise_video.mediaid] - console.log(116) if(localImg.icp_materials.authenticity_responsibility_letter.mediaid)form.icp_materials.authenticity_responsibility_letter = [localImg.icp_materials.authenticity_responsibility_letter.mediaid] if(localImg.icp_materials.authenticity_commitment_letter.mediaid)form.icp_materials.authenticity_commitment_letter =[ localImg.icp_materials.authenticity_commitment_letter.mediaid] if(localImg.icp_materials.website_construction_proposal.mediaid)form.icp_materials.website_construction_proposal = [localImg.icp_materials.website_construction_proposal.mediaid] @@ -1088,7 +1216,15 @@ console.log(112) let {localImg} = this let _where = "" let place_arr = ['icp_subject','icp_applets'] //含有3层数据的地方 - + let check_certificate_res = await this.checkCertificateSelect(place,where,which) + console.log("check_certificate_select--000-:", check_certificate_res) + if(!check_certificate_res.checkSelectRes){ + util.showNone(check_certificate_res.need_check_msg||"请先选择证件类型-") + return + } + + let {icp_order_field,certificate_type} = check_certificate_res + if(place_arr.indexOf(place) >= 0){ _where = localImg[place][where] }else{ @@ -1096,10 +1232,55 @@ console.log(112) } let _which = _where[which] _which.url = await this.getLocalImg(); - _which.mediaid = await this.getUploadImgMediaId(_which.url); + + // _which.mediaid = await this.getUploadImgMediaId(_which.url); + _which.mediaid = await this.getIcpUploadImgMediaId(_which.type,_which.url,certificate_type,icp_order_field); _which.url = await this.getUploadImgURL(_which.url) console.log("clickUploadImg:", _which) }, + async checkCertificateSelect(place,where,which){//检查相关证件类型是否选择 + console.log("checkCertificateSelect:", place,where,which) + let {form,localImg} = this + let _res = true + let _checkRes = "" + let item = "" //当前需要检查的数据 + let place_arr = ['icp_subject','icp_applets'] //含有3层数据的地方 + if(place_arr.indexOf(place) >= 0){ + item = localImg[place][where][which] + + console.log("checkCertificateSelect item:", item) + if(item.need_certificate_type){ + let checkArr = item.certificate_type_place_arr + console.log("checkArr111:", checkArr) + _checkRes = form[checkArr[0]][checkArr[1]][checkArr[2]] + console.log("_checkRes222:", _checkRes) + if(_checkRes!=""){ + _res = true + }else{ + _res = false + } + } + }else{ + item = localImg[where][which] + if(item.need_certificate_type){ + let checkArr = item.certificate_type_place_arr + _checkRes = form[checkArr[1]][checkArr[2]] + if(_checkRes!=""){ + _res = true + }else{ + _res = false + } + } + } + if(!_res){//如果未选择证件类型 + item['checkSelectRes'] = false + }else{ + item['checkSelectRes'] = true + } + item['certificate_type'] = _checkRes + console.log("checkCertificateSelect item: ",item) + return item + }, getUploadImgURL(tempFilePath){ return servers.uploadFile({ url: party_api.webUpload, @@ -1169,6 +1350,85 @@ console.log(112) console.log("uploadFile-err", err) }) }, + getIcpUploadImgMediaId(type,tempFilePath,certificate_type,icp_order_field){ + let appid = this.appid + console.log("getIcpUploadImgMediaId:", tempFilePath,certificate_type,icp_order_field) + let _param_str = `module=/wxa/icp/upload_icp_media&appid=${appid}&form.type=image&form.certificate_type=${certificate_type}&form.icp_order_field=${icp_order_field}` // + let _url = party_api.gatewayDoDuplicate+"?"+_param_str + + // { + // 'form.type':"image", + // 'form.certificate_type':certificate_type, + // 'form.icp_order_field':icp_order_field + // } + let form_data = { + 'form.type':"image" + } + if(type)form_data['form.type'] = type + if(certificate_type||certificate_type==="0")form_data['form.certificate_type'] = certificate_type + if(icp_order_field)form_data['form.icp_order_field'] = icp_order_field + + console.log("form_data: ",form_data) + return this.uploadFileIcp({ + url: _url, + filePath: tempFilePath, + name: 'media', + formData: form_data + }) + .then(res=>{ + console.log("uploadFile-gatewayDoDuplicate-res", res) + if(res.statusCode == 200){ + + let _data = JSON.parse(JSON.stringify(res.data)) + console.log("uploadFile-url return type", typeof(_data)) + _data = JSON.parse(_data).data + console.log("uploadFile-gatewayDoDuplicate-上传成功 接口真正数据", _data) + return _data.media_id + } + }) + .catch(err=>{ + console.log("uploadFile-err", err) + }) + }, + checkRid(){ + return + let _data = { + appid: this.appid, + module: '/cgi-bin/openapi/rid/get', + method: 'POST', + rid:"661e4e29-4aa2aa91-3bec4ea2", + form: { + rid:"661e3e10-3a51bcf1-4075819d" + } + } + console.log("check_rid:", _data) + servers.post({ + url: party_api.gatewayDo, + data: _data, + isDefaultGet: false, + }) + .then(res=>{ + console.log("check_rid:", res.data) + let _res = res.data.data + if(res.data.code==0){ + util.showNone("提交成功") + return + }else{ + util.showNone(res.data.message) + } + }) + .catch(err=>{ + console.log("check_rid-err", err) + }) + }, + uploadFileIcp({url,filePath,name,formData,onProgressCallBack,}){ + return new Promise((rs,rj)=>{ + let uploadTask = uni.uploadFile({ + url,filePath,formData,name:'media',success:rs,fail:rj,header:{"Content-Type":"multipart/form-data"} + }) + uploadTask.onProgressUpdate(res=>onProgressCallBack&&onProgressCallBack(res)) + }) + }, async getData() { try { /** 获取证件类型 queryIcpCertificateTypes @@ -1190,6 +1450,8 @@ console.log(112) }); if (res.data.errcode === 0) { this.queryIcpCertificateTypes = res.data.items; + // this.queryIcpCertificateSubTypesArr = res.data.items.map(item => item.name) + } else { util.showNone(res.data.errmsg); } diff --git a/src/subpackage/party/pages/miniapp/regist.vue b/src/subpackage/party/pages/miniapp/regist.vue index b7aa6fd..c8e5509 100644 --- a/src/subpackage/party/pages/miniapp/regist.vue +++ b/src/subpackage/party/pages/miniapp/regist.vue @@ -131,16 +131,16 @@ 姓名* - + 身份证号* - 手机号* - + @@ -740,8 +740,23 @@ export default { }) }, toIcp(){ + let {icpInfo} = this + let no_pass_status_arr = [2,3,4,6] + if(no_pass_status_arr.indexOf(icpInfo.status) >= 0){ + let no_pass_msg = "" + if(icpInfo.audit_data.length>0){ + for(let i=0;i