刘嘉炜 8 months ago
parent
commit
b385c57b8d
  1. 1
      src/subpackage/party/components/popup-content/miniapp-change-category.vue
  2. 17
      src/subpackage/party/pages/index/index.vue
  3. 3
      src/subpackage/party/pages/index/web_view.vue
  4. 21
      src/subpackage/party/pages/login/regist.vue
  5. BIN
      src/subpackage/party/static/index/icon-copy.png
  6. 49
      src/utils/util.js

1
src/subpackage/party/components/popup-content/miniapp-change-category.vue

@ -366,6 +366,7 @@ export default {
let {exterList} = this let {exterList} = this
exterList[i].url = await this.getLocalImg(); exterList[i].url = await this.getLocalImg();
console.log("clickUploadImg-local:", exterList[i].url) console.log("clickUploadImg-local:", exterList[i].url)
exterList[i].mediaid = await this.getUploadImgMediaId(exterList[i].url); exterList[i].mediaid = await this.getUploadImgMediaId(exterList[i].url);
console.log("clickUploadImg-mediaid:", exterList[i].mediaid) console.log("clickUploadImg-mediaid:", exterList[i].mediaid)

17
src/subpackage/party/pages/index/index.vue

@ -14,6 +14,7 @@
<text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text> <text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text>
<text class="b-t-white b-t-24 p-index-2 b-ellipsis-1">{{getManagerUrl.show}}</text> <text class="b-t-white b-t-24 p-index-2 b-ellipsis-1">{{getManagerUrl.show}}</text>
<image class="pb-bg" src="../../static/index/p-bg-1.png"></image> <image class="pb-bg" src="../../static/index/p-bg-1.png"></image>
<image class="pb-icon-copy" src="../../static/index/icon-copy.png"></image>
</view> </view>
</view> </view>
@ -34,6 +35,7 @@
<text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text> <text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text>
<text class="b-t-white b-t-24 p-index-2">{{getShouyingUrl.show}}</text> <text class="b-t-white b-t-24 p-index-2">{{getShouyingUrl.show}}</text>
<image class="pb-bg" src="../../static/index/p-bg-1.png"></image> <image class="pb-bg" src="../../static/index/p-bg-1.png"></image>
<image class="pb-icon-copy" src="../../static/index/icon-copy.png"></image>
</view> </view>
</view> </view>
<view class="p-tip">可在后台设置教练账户</view> <view class="p-tip">可在后台设置教练账户</view>
@ -244,6 +246,10 @@
data: url, data: url,
success: function () { success: function () {
util.showNone('复制成功') util.showNone('复制成功')
},
fail:function(e){
console.error("剪切板调用失败:",e)
util.showNone(e)
} }
}); });
}, },
@ -292,7 +298,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #9A9A9D; color: #9A9A9D;
margin-top: 25rpx; margin-top: 25rpx;
padding-left: 60rpx;
padding-left: 30rpx;
width: 100%; width: 100%;
} }
.p-box-title-2{ .p-box-title-2{
@ -304,6 +310,7 @@
.p-box{ .p-box{
width: 670rpx; width: 670rpx;
overflow: hidden; overflow: hidden;
position: relative;
>view{ >view{
width: 320rpx; width: 320rpx;
height: 176rpx; height: 176rpx;
@ -325,6 +332,14 @@
width: 47.76rpx; width: 47.76rpx;
height: 48.08rpx; height: 48.08rpx;
} }
.pb-icon-copy{
width: 24rpx;
height: 24rpx;
z-index:5;
position:absolute;
top:18rpx;
right:18rpx;
}
} }
} }
} }

3
src/subpackage/party/pages/index/web_view.vue

@ -7,14 +7,13 @@ import { API,ORIGIN } from '@/js/api';
export default { export default {
data() { data() {
return { return {
url: 'https://testadmin.ouxuanzhineng.cn/'
url: ''
} }
}, },
onLoad(opt){ onLoad(opt){
console.log('web_view',opt,ORIGIN) console.log('web_view',opt,ORIGIN)
this.url = opt.url this.url = opt.url
} }
} }

21
src/subpackage/party/pages/login/regist.vue

@ -448,6 +448,7 @@
let ocr_type = 'BizLicenseOCR' let ocr_type = 'BizLicenseOCR'
console.log("clickUploadImg"); console.log("clickUploadImg");
let img = await this.getLocalImg(); let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img) console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img); let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url) console.log("getUploadImgURL:", img_url)
@ -458,11 +459,13 @@
this.setOcrResult(ocr_type,ocr_res) this.setOcrResult(ocr_type,ocr_res)
this.submitData.business_license = img_url this.submitData.business_license = img_url
}, },
// IDCardOCR // IDCardOCR
async clickUploadIDCardImg() { async clickUploadIDCardImg() {
let ocr_type = 'IDCardOCR' let ocr_type = 'IDCardOCR'
console.log("clickUploadIDCardImg"); console.log("clickUploadIDCardImg");
let img = await this.getLocalImg(); let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img) console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img); let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url) console.log("getUploadImgURL:", img_url)
@ -476,6 +479,7 @@
async clickUploadIDCardBackImg() { async clickUploadIDCardBackImg() {
console.log("clickUploadIDCardBackImg"); console.log("clickUploadIDCardBackImg");
let img = await this.getLocalImg(); let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img) console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img); let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url) console.log("getUploadImgURL:", img_url)
@ -553,8 +557,14 @@
this.submitData.mailing_address = res.Response.Address; this.submitData.mailing_address = res.Response.Address;
this.submitData.extension.legal_person_name = res.Response.Person; this.submitData.extension.legal_person_name = res.Response.Person;
this.submitData.agency_code = res.Response.RegNum; 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); // const t = this.company_types.find(item => item.label === res.Response.Type);
// this.submitData.extension.company_type = t.value; // this.submitData.extension.company_type = t.value;
// >>>>>>> dev
if (res.Response.Capital) { if (res.Response.Capital) {
const num = res.Response.Capital.split('元')[0] const num = res.Response.Capital.split('元')[0]
this.submitData.extension.registered_capital = this.chineseToNumber(num) this.submitData.extension.registered_capital = this.chineseToNumber(num)
@ -574,7 +584,7 @@
this.submitData.extension.credit_end_date = `${year}-${month}-${day}` this.submitData.extension.credit_end_date = `${year}-${month}-${day}`
} }
} }
if(res.Response.Type){
if(res.Response.Type){//,
let _index = "" let _index = ""
const t = this.company_types.find((item,index) => { const t = this.company_types.find((item,index) => {
if(item.label === res.Response.Type){ if(item.label === res.Response.Type){
@ -583,6 +593,14 @@
return item 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) // console.log("t", t)
if(t){ if(t){
this.submitData.extension.company_type = t.value this.submitData.extension.company_type = t.value
@ -593,6 +611,7 @@
console.log("OCR对应的企业类型无法匹配:",this.company_types, res.Response.Type) console.log("OCR对应的企业类型无法匹配:",this.company_types, res.Response.Type)
util.showNone("请手动选择[企业类型],并二次确认证件信息") util.showNone("请手动选择[企业类型],并二次确认证件信息")
} }
// >>>>>>> dev
} }
} else { } else {
this.submitData.extension.business_id_card = res.Response.IdNum this.submitData.extension.business_id_card = res.Response.IdNum

BIN
src/subpackage/party/static/index/icon-copy.png

After

Width: 48  |  Height: 52  |  Size: 724 B

49
src/utils/util.js

@ -400,6 +400,52 @@ function order_pay_type_txt(status = ''){
return _obj[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 { export default {
formatTime, formatTime,
formatNumber, formatNumber,
@ -432,5 +478,6 @@ export default {
isProfile, isProfile,
$_once, $_once,
$_emit, $_emit,
order_pay_type_txt
order_pay_type_txt,
checkFileInfo,
} }
Loading…
Cancel
Save