diff --git a/src/subpackage/party/components/popup-content/miniapp-change-category.vue b/src/subpackage/party/components/popup-content/miniapp-change-category.vue index 7f7e6c4..1b451bc 100644 --- a/src/subpackage/party/components/popup-content/miniapp-change-category.vue +++ b/src/subpackage/party/components/popup-content/miniapp-change-category.vue @@ -366,6 +366,7 @@ export default { let {exterList} = this exterList[i].url = await this.getLocalImg(); + console.log("clickUploadImg-local:", exterList[i].url) exterList[i].mediaid = await this.getUploadImgMediaId(exterList[i].url); console.log("clickUploadImg-mediaid:", exterList[i].mediaid) diff --git a/src/subpackage/party/pages/index/index.vue b/src/subpackage/party/pages/index/index.vue index 736a92a..2f69f37 100644 --- a/src/subpackage/party/pages/index/index.vue +++ b/src/subpackage/party/pages/index/index.vue @@ -14,6 +14,7 @@ 复制到电脑端打开 {{getManagerUrl.show}} + @@ -34,6 +35,7 @@ 复制到电脑端打开 {{getShouyingUrl.show}} + 可在后台设置教练账户 @@ -244,6 +246,10 @@ data: url, success: function () { util.showNone('复制成功') + }, + fail:function(e){ + console.error("剪切板调用失败:",e) + util.showNone(e) } }); }, @@ -292,7 +298,7 @@ font-size: 24rpx; color: #9A9A9D; margin-top: 25rpx; - padding-left: 60rpx; + padding-left: 30rpx; width: 100%; } .p-box-title-2{ @@ -304,6 +310,7 @@ .p-box{ width: 670rpx; overflow: hidden; + position: relative; >view{ width: 320rpx; height: 176rpx; @@ -325,6 +332,14 @@ width: 47.76rpx; height: 48.08rpx; } + .pb-icon-copy{ + width: 24rpx; + height: 24rpx; + z-index:5; + position:absolute; + top:18rpx; + right:18rpx; + } } } } diff --git a/src/subpackage/party/pages/index/web_view.vue b/src/subpackage/party/pages/index/web_view.vue index 6272ee3..ddf76aa 100644 --- a/src/subpackage/party/pages/index/web_view.vue +++ b/src/subpackage/party/pages/index/web_view.vue @@ -7,14 +7,13 @@ import { API,ORIGIN } from '@/js/api'; export default { data() { return { - url: 'https://testadmin.ouxuanzhineng.cn/' + url: '' } }, onLoad(opt){ console.log('web_view',opt,ORIGIN) this.url = opt.url - } } diff --git a/src/subpackage/party/pages/login/regist.vue b/src/subpackage/party/pages/login/regist.vue index 11f8cf7..244d14c 100644 --- a/src/subpackage/party/pages/login/regist.vue +++ b/src/subpackage/party/pages/login/regist.vue @@ -448,6 +448,7 @@ let ocr_type = 'BizLicenseOCR' console.log("clickUploadImg"); let img = await this.getLocalImg(); + let img_info = await util.checkFileInfo(img) console.log("getLocalImg:", img) let img_url = await this.getUploadImgURL(img); console.log("getUploadImgURL:", img_url) @@ -458,11 +459,13 @@ this.setOcrResult(ocr_type,ocr_res) this.submitData.business_license = img_url }, + // IDCardOCR async clickUploadIDCardImg() { let ocr_type = 'IDCardOCR' console.log("clickUploadIDCardImg"); let img = await this.getLocalImg(); + let img_info = await util.checkFileInfo(img) console.log("getLocalImg:", img) let img_url = await this.getUploadImgURL(img); console.log("getUploadImgURL:", img_url) @@ -476,6 +479,7 @@ async clickUploadIDCardBackImg() { console.log("clickUploadIDCardBackImg"); let img = await this.getLocalImg(); + let img_info = await util.checkFileInfo(img) console.log("getLocalImg:", img) let img_url = await this.getUploadImgURL(img); console.log("getUploadImgURL:", img_url) @@ -553,8 +557,14 @@ this.submitData.mailing_address = res.Response.Address; this.submitData.extension.legal_person_name = res.Response.Person; this.submitData.agency_code = res.Response.RegNum; +// <<<<<<< HEAD +// const t = this.company_types.find(item => item.label === res.Response.Type); +// if(t&&t.value)this.submitData.extension.company_type = t.value; //设置企业类型 + +// ======= // const t = this.company_types.find(item => item.label === res.Response.Type); // this.submitData.extension.company_type = t.value; +// >>>>>>> dev if (res.Response.Capital) { const num = res.Response.Capital.split('元')[0] this.submitData.extension.registered_capital = this.chineseToNumber(num) @@ -574,7 +584,7 @@ this.submitData.extension.credit_end_date = `${year}-${month}-${day}` } } - if(res.Response.Type){ + if(res.Response.Type){//当命中微信所需企业类型时, 自动回显并填充 let _index = "" const t = this.company_types.find((item,index) => { if(item.label === res.Response.Type){ @@ -583,6 +593,14 @@ return item } }); +// <<<<<<< HEAD +// if(t&&t.value){ +// this.submitData.extension.company_type = t.value +// this.company_type_index = _index +// this.company_type_show = this.company_types_arr[_index] +// } + +// ======= // console.log("t", t) if(t){ this.submitData.extension.company_type = t.value @@ -593,6 +611,7 @@ console.log("OCR对应的企业类型无法匹配:",this.company_types, res.Response.Type) util.showNone("请手动选择[企业类型],并二次确认证件信息") } +// >>>>>>> dev } } else { this.submitData.extension.business_id_card = res.Response.IdNum diff --git a/src/subpackage/party/static/index/icon-copy.png b/src/subpackage/party/static/index/icon-copy.png new file mode 100644 index 0000000..f4afc21 Binary files /dev/null and b/src/subpackage/party/static/index/icon-copy.png differ diff --git a/src/utils/util.js b/src/utils/util.js index 553db8c..8af92c5 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -400,6 +400,52 @@ function order_pay_type_txt(status = ''){ return _obj[status] || '-' } +function checkFileInfo(url){//获取文件信息, 超过2M时提醒太大, 文件格式要求JPG、JPEG、PNG + let util = this + return new Promise((rs,rj)=>{ + try{ + let MAX_SIZE = 2048; //最大size限制 + + let type = url.split(".")[1]||"" + // JPG、JPEG、PNG + let need_type = [,'jpeg','jpg','png','JPG','JPEG','PNG'] + if(need_type.indexOf(type)>0){ + console.log("文件格式符合预期:",type) + }else{ + util.showNone(`当前文件格式${type}不符合预期,请重新上传`) + rj(false) + } + rs(true) + + console.log(wx.env.USER_DATA_PATH,123,url) + + const fs = wx.getFileSystemManager() + // const fd = fs.openSync({ + const fd = fs.openSync({ + // filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + filePath:url, + flag: 'a+' + }) + const stats = fs.fstatSync({fd: fd}) + let size = stats.size||0 + size = size/1024 + + if(size>MAX_SIZE){ + util.showNone(`上传图片最大为${MAX_SIZE/1024}M,当前为:${(size/1024).toFixed(2)}M`) + rj(false) + } + if(!size){ + util.showNone("请上传正确的图片") + rj(false) + } + rs(stats) + }catch(e){ + util.showNone(e); + rj(e) + } + }) +} + export default { formatTime, formatNumber, @@ -432,5 +478,6 @@ export default { isProfile, $_once, $_emit, - order_pay_type_txt + order_pay_type_txt, + checkFileInfo, }