Commit 0a8b5acb authored by 郑秀明's avatar 郑秀明

Merge commit '32826774' into develop

parents 27c11114 32826774
......@@ -80,7 +80,7 @@
<view class="apply_desc">支持(zip/rar)格式</view>
</view>
<view class="apply_data_item">
<view class="apply_upload" v-if="!params.bank_card_record" @click="uploadZip('bank_card_record')">
<view class="apply_upload" v-if="!params.bank_card_record" ref="compress">
<text class="eosfont icons">&#xe60d;</text>
<text class="upload_font">企业半年银行流水</text>
</view>
......@@ -140,14 +140,71 @@
}
});
},
mounted() {
// #ifdef H5
const _input = document.createElement('input');
_input.type = 'file';
_input.accept = 'application/x-zip-compressed,application/x-rar-compressed';
_input.style.position = 'absolute';
_input.style.top = '0';
_input.style.width = '100%';
_input.style.height = '100%';
_input.style.opacity = '0';
this.$refs.compress.$el.append(_input);
_input.onchange = (e) => {
let file = e.target.files[0];
let fileName = file.name;
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if ((lastName.toLowerCase() != ".zip" ) && (lastName.toLowerCase() != ".rar")) {
uni.showToast({
title: "文件必须为.zip或.rar类型",
icon: 'none',
duration: 2000
})
return;
}
let url = null;
if (window.createObjectURL != undefined) {
// basic
url = window.createObjectURL(file);
} else if (window.webkitURL != undefined) {
// webkit or chrome
url = window.webkitURL.createObjectURL(file);
} else if (window.URL != undefined) {
// mozilla(firefox)
url = window.URL.createObjectURL(file);
}
uni.showLoading({
title: '上传中'
})
uni.uploadFile({
url: '/uni/api/resources',
filePath: url,
name: 'file',
formData: {
name: file.name
},
success: (uploadFileRes) => {
const data = JSON.parse(uploadFileRes.data)
this.params['bank_card_record'] = data.data;
this.compressName = fileName;
uni.hideLoading();
}
});
}
// #endif
},
methods: {
uploadImage(key) {
uni.chooseImage({
sizeType: ['compress'],
count:1,
success: (res) => {
const tempFilePaths = res.tempFilePaths;
uni.showLoading({
title: '上传中'
})
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: '/uni/api/resources',
filePath: tempFilePaths[0],
......@@ -161,56 +218,6 @@
}
})
},
uploadZip(key) {
// #ifdef H5
const _input = document.createElement('input');
_input.type = 'file';
_input.accept = 'application/x-zip-compressed,application/x-rar-compressed';
_input.click();
_input.onchange = (e) => {
let file = e.target.files[0];
let fileName = file.name;
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if ((lastName.toLowerCase() != ".zip" ) && (lastName.toLowerCase() != ".rar")) {
uni.showToast({
title: "文件必须为.zip或.rar类型",
icon: 'none',
duration: 2000
})
return;
}
let url = null;
if (window.createObjectURL != undefined) {
// basic
url = window.createObjectURL(file);
} else if (window.webkitURL != undefined) {
// webkit or chrome
url = window.webkitURL.createObjectURL(file);
} else if (window.URL != undefined) {
// mozilla(firefox)
url = window.URL.createObjectURL(file);
}
uni.showLoading({
title: '上传中'
})
uni.uploadFile({
url: '/uni/api/resources',
filePath: url,
name: 'file',
formData: {
name: file.name
},
success: (uploadFileRes) => {
const data = JSON.parse(uploadFileRes.data)
this.params[key] = data.data;
this.compressName = fileName;
uni.hideLoading();
}
});
}
// #endif
},
clearParams(key) {
this.params[key] = '';
},
......@@ -274,6 +281,7 @@
qualification_id: this.qualification_id
},
success: (res) => {
this.submitFlag = true;
if(res.data.code === 0) {
uni.setStorage({
key: 'installment',
......@@ -288,7 +296,6 @@
}
})
} else {
this.submitFlag = true;
uni.hideToast();
uni.showToast({
icon: 'none',
......
......@@ -55,7 +55,7 @@
<view class="apply_desc">支持(zip/rar)格式</view>
</view>
<view class="apply_data_item">
<view class="apply_upload" @click="uploadZip('legal_card_record')" v-if="!params.legal_card_record">
<view class="apply_upload" v-if="!params.legal_card_record">
<text class="eosfont icons">&#xe60d;</text>
<text class="upload_font">法人半年银行流水</text>
</view>
......@@ -111,9 +111,66 @@
}
});
},
mounted() {
// #ifdef H5
const _input = document.createElement('input');
_input.type = 'file';
_input.accept = 'application/x-zip-compressed,application/x-rar-compressed';
_input.style.position = 'absolute';
_input.style.top = '0';
_input.style.width = '100%';
_input.style.height = '100%';
_input.style.opacity = '0';
this.$refs.compress.$el.append(_input);
_input.onchange = (e) => {
let file = e.target.files[0];
let fileName = file.name;
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if ((lastName.toLowerCase() != ".zip" ) && (lastName.toLowerCase() != ".rar")) {
uni.showToast({
title: "文件必须为.zip或.rar类型",
icon: 'none',
duration: 2000
})
return;
}
let url = null;
if (window.createObjectURL != undefined) {
// basic
url = window.createObjectURL(file);
} else if (window.webkitURL != undefined) {
// webkit or chrome
url = window.webkitURL.createObjectURL(file);
} else if (window.URL != undefined) {
// mozilla(firefox)
url = window.URL.createObjectURL(file);
}
uni.showLoading({
title: '上传中'
})
uni.uploadFile({
url: '/uni/api/resources',
filePath: url,
name: 'file',
formData: {
name: file.name
},
success: (uploadFileRes) => {
const data = JSON.parse(uploadFileRes.data)
this.params['legal_card_record'] = data.data;
this.compressName = fileName;
uni.hideLoading();
}
});
}
// #endif
},
methods: {
uploadImage(key) {
uni.chooseImage({
sizeType: ['compress'],
count:1,
success: (res) => {
uni.showLoading({
title: '上传中',
......@@ -134,56 +191,6 @@
}
})
},
uploadZip(key) {
// #ifdef H5
const _input = document.createElement('input');
_input.type = 'file';
_input.accept = 'application/x-zip-compressed,application/x-rar-compressed';
_input.click();
_input.onchange = (e) => {
let file = e.target.files[0];
let fileName = file.name;
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if ((lastName.toLowerCase() != ".zip" ) && (lastName.toLowerCase() != ".rar")) {
uni.showToast({
title: "文件必须为.zip或.rar类型",
icon: 'none',
duration: 2000
})
return;
}
let url = null;
if (window.createObjectURL != undefined) {
// basic
url = window.createObjectURL(file);
} else if (window.webkitURL != undefined) {
// webkit or chrome
url = window.webkitURL.createObjectURL(file);
} else if (window.URL != undefined) {
// mozilla(firefox)
url = window.URL.createObjectURL(file);
}
uni.showLoading({
title: '上传中'
})
uni.uploadFile({
url: '/uni/api/resources',
filePath: url,
name: 'file',
formData: {
name: file.name
},
success: (uploadFileRes) => {
const data = JSON.parse(uploadFileRes.data)
this.params[key] = data.data;
this.compressName = fileName;
uni.hideLoading();
}
});
}
// #endif
},
clearParams(key) {
this.params[key] = '';
},
......@@ -233,12 +240,12 @@
...this.data
},
success: (res) => {
this.submitFlag = true;
if(res.data.code === 0) {
uni.navigateTo({
url: '/pages/apply/applypage3'
});
} else {
this.submitFlag = true;
uni.hideToast();
uni.showToast({
icon: 'none',
......
......@@ -89,6 +89,8 @@
methods: {
uploadImage(key) {
uni.chooseImage({
sizeType: ['compress'],
count:1,
success: (res) => {
uni.showLoading({
title: '上传中'
......@@ -128,12 +130,12 @@
...this.data
},
success: (res) => {
this.submitFlag = true;
if(res.data.code === 0) {
uni.navigateTo({
url: '/pages/signcontract/signcontract'
});
} else {
this.submitFlag = true;
uni.hideToast();
uni.showToast({
icon: 'none',
......
......@@ -98,6 +98,8 @@
},
uploadImage(key) {
uni.chooseImage({
sizeType: ['compress'],
count:1,
success: (res) => {
uni.showLoading({
title: '上传中'
......
......@@ -505,15 +505,16 @@
.installment_table_box {
padding: 0 28rpx 40rpx;
background: #fff;
overflow: scroll;
.installment_table {
background: #FBFBFB;
border-radius:16rpx;
border:1px solid rgba(236,236,236,1);
padding: 40rpx 40rpx 16rpx;
display: flex;
overflow: scroll;
.table_title {
margin-right: 20rpx;
min-width: 160rpx;
view {
height:36rpx;
line-height: 36rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment