Commit a1c9ea46 by 刘海龙

1111

parent 3047bea1
......@@ -157,40 +157,39 @@
saveName = 'auth_' + uid + '_3';
}
var loadingIndex = layer.load(2);
$.ajaxFileUpload({
url: './index.php?g=Appapi&m=Auth&a=upload',
secureuri: false,
fileElementId: id,
data: {saveName: saveName},
dataType: 'html',
success: function (data) {
data = data.replace(/<[^>]+>/g, "");
var str = JSON.parse(data);
if (str.ret == 0) {
layer.close(loadingIndex);
let msg = str.msg ? str.msg : '上传失败';
layer.msg(msg);
} else {
if (_this.uploadName === 'front_view') {
_this.form.front_view = str.data.url;
$(document).off('change','#file').on('change','#file');
}
if (_this.uploadName === 'back_view') {
_this.form.back_view = str.data.url;
$(document).off('change','#file1').on('change','#file1');
}
if (_this.uploadName === 'handset_view') {
_this.form.handset_view = str.data.url;
$(document).off('change','#file2').on('change','#file2');
}
_this.checkSubmit();
layer.close(loadingIndex);
}
},
error: function (data) {
layer.msg("上传失败");
console.log(data);
}
$(document).off('change',id).on('change',id,function(){
$.ajaxFileUpload({
url: './index.php?g=Appapi&m=Auth&a=upload',
secureuri: false,
fileElementId: id,
data: {saveName: saveName},
dataType: 'html',
success: function (data) {
data = data.replace(/<[^>]+>/g, "");
var str = JSON.parse(data);
if (str.ret == 0) {
layer.close(loadingIndex);
let msg = str.msg ? str.msg : '上传失败';
layer.msg(msg);
} else {
if (_this.uploadName === 'front_view') {
_this.form.front_view = str.data.url;
}
if (_this.uploadName === 'back_view') {
_this.form.back_view = str.data.url;
}
if (_this.uploadName === 'handset_view') {
_this.form.handset_view = str.data.url;
}
_this.checkSubmit();
layer.close(loadingIndex);
}
},
error: function (data) {
layer.msg("上传失败");
console.log(data);
}
});
});
},
submit: function () {
......
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