Commit a1c9ea46 by 刘海龙

1111

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