Commit 5fd2a755 by 冷斌

fix bug

parent b62b7428
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<title>提现申请</title> <title>提现申请</title>
<tc_include file="Appapi/Public/head2"/> <tc_include file="Appapi/Public/head2"/>
<script src="__PUBLIC__/js/ajaxfileupload.js"></script>
</head> </head>
<body style="background: #fff;"> <body style="background: #fff;">
<div class="app" id="app" style="padding-top: 0;"> <div class="app" id="app" style="padding-top: 0;">
...@@ -15,15 +16,18 @@ ...@@ -15,15 +16,18 @@
<div class="part"> <div class="part">
<div class="part_name">上传身份证</div> <div class="part_name">上传身份证</div>
<div class="scimgBox"> <div class="scimgBox">
<div class="imgItem"> <div v-if="isFile" class="imgItem" @click="addImg('front_view')">
<img :src="front_view"> <img :src="front_view">
</div> </div>
<div class="imgItem"> <div v-if="isFile2" class="imgItem" @click="addImg('back_view')">
<img :src="back_view"> <img :src="back_view">
</div> </div>
<div class="imgItem"> <div v-if="isFile3" class="imgItem" @click="addImg('handset_view')">
<img :src="handset_view"> <img :src="handset_view">
</div> </div>
<input id="file" name="image" type="file" v-if="isFile" style="display: none;" accept="image/*" @change="upload"/>
<input id="file2" name="image" type="file" v-if="isFile2" style="display: none;" accept="image/*" @change="upload"/>
<input id="file3" name="image" type="file" v-if="isFile3" style="display: none;" accept="image/*" @change="upload"/>
</div> </div>
</div> </div>
<!-- 支付宝认证 --> <!-- 支付宝认证 -->
...@@ -100,6 +104,10 @@ ...@@ -100,6 +104,10 @@
'bank_province': '', 'bank_province': '',
'bank_city': '', 'bank_city': '',
status: 3, status: 3,
uploadName: '',
isFile: true,
isFile2: true,
isFile3: true,
}, },
methods: { methods: {
info() { info() {
...@@ -113,7 +121,84 @@ ...@@ -113,7 +121,84 @@
let info = this.info(); let info = this.info();
return url + '&uid=' + info.id + '&token=' + info.token; return url + '&uid=' + info.id + '&token=' + info.token;
}, },
addImg: function (name) {
// layer.msg("修改已图片方法调用了");
this.uploadName = name;
if (this.uploadName === 'front_view') {
$("#file").click();
}
if (this.uploadName === 'back_view') {
$("#file2").click();
}
if (this.uploadName === 'handset_view') {
$("#file3").click();
}
},
upload: function () {
// layer.msg("上传图片方法调用了");
let _this = this;
let saveName, id = '';
if (_this.uploadName === 'front_view') {
id = 'file';
saveName = 'auth_' + uid + '_1';
_this.isFile = false
}
if (_this.uploadName === 'back_view') {
id = 'file2';
saveName = 'auth_' + uid + '_2';
_this.isFile2 = false
}
if (_this.uploadName === 'handset_view') {
id = 'file3';
saveName = 'auth_' + uid + '_3';
_this.isFile3 = false
}
var loadingIndex = layer.load(2);
$.ajaxFileUpload({
url: './index.php?g=Appapi&m=Auth&a=upload',
secureuri: false,
fileElementId: id,
data: {saveName: saveName},
dataType: 'html',
processData: false,
contentType: false,
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);
_this.isFile = true
_this.isFile2 = true
_this.isFile3 = true
} else {
if (_this.uploadName === 'front_view') {
_this.front_view = str.data.url;
_this.isFile = true
}
if (_this.uploadName === 'back_view') {
_this.isFile2 = true
_this.back_view = str.data.url;
}
if (_this.uploadName === 'handset_view') {
_this.isFile3 = true
_this.handset_view = str.data.url;
}
_this.checkSubmit();
layer.close(loadingIndex);
}
},
error: function (data) {
layer.msg("上传失败");
console.log(data);
_this.isFile = true
_this.isFile2 = true
_this.isFile3 = true
}
});
},
}, },
watch: { watch: {
//数据监测函数 //数据监测函数
......
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