Commit ecb3a94a by 王昆

法人身份证正面图+声明书

parent 0dba71a6
......@@ -24,6 +24,7 @@ var app = new Vue({
};
return {
btnloading: false,
uploadLoading: null,
action: "",
d:{},
supportInfo: {
......@@ -84,6 +85,7 @@ var app = new Vue({
let xml = this.loadXML(res);
let ossUrl = xml.documentElement.getElementsByTagName("Location")[0].textContent;
this.supportInfo.front_half_img = ossUrl || "";
this.uploadLoading.close();
console.log(xml, ossUrl);
},
declarationFileSuccess(res, file) {
......@@ -91,10 +93,17 @@ var app = new Vue({
let xml = this.loadXML(res);
let ossUrl = xml.documentElement.getElementsByTagName("Location")[0].textContent;
this.supportInfo.declaration_file = ossUrl || "";
this.uploadLoading.close();
console.log(xml, ossUrl);
},
beforeAvatarUpload(file) {
console.log(file);
const isLt2M = file.size / 1024 / 1024 < 20;
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 20MB!');
return false;
}
let ext = ".png";
let fileNameArr = (file.name || "").split(".");
if (fileNameArr.length > 1) {
......@@ -104,9 +113,23 @@ var app = new Vue({
console.log(ext);
var key = "zc_gth_hc_" + new Date().getTime() + this.randomString(8) + ext;
this.d.key = key;
this.uploadLoading = this.$loading({
lock: true,
text: '正在上传中,请耐心等待',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
this.uploadLoading.close();
}, 15000);
return true;
},
randomString(len) {
uploadError(err, file, fileList){
this.uploadLoading.close();
},
randomString(len) {
len = len || 32;
let chars = '0123456789abcdefghijklmnopqrstuvwxyz_';
let maxPos = chars.length;
......
......@@ -273,6 +273,7 @@
:data="d"
:show-file-list="false"
:on-success="frontHalfImgSuccess"
:on-error="uploadError"
:before-upload="beforeAvatarUpload">
<img v-if="supportInfo.front_half_img" :src="supportInfo.front_half_img" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
......@@ -287,6 +288,7 @@
:data="d"
:show-file-list="false"
:on-success="declarationFileSuccess"
:on-error="uploadError"
:before-upload="beforeAvatarUpload">
<img v-if="supportInfo.declaration_file" :src="supportInfo.declaration_file" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
......
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