Commit b74b23a8 by 刘海龙

111

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