Commit 30a850b9 by 刘海龙

11

parent 1a96db79
...@@ -28,24 +28,27 @@ ...@@ -28,24 +28,27 @@
</div> </div>
<div class="scimgBox"> <div class="scimgBox">
<div class="imgItem" @click="addImg('front_view')"> <div v-if="isFile" class="imgItem" @click="addImg('front_view')">
<img :src="form.front_view ? form.front_view : upload_image" <img :src="form.front_view ? form.front_view : upload_image"
:class="[form.front_view ? 'zhengjz' : 'addTipsimg']"> :class="[form.front_view ? 'zhengjz' : 'addTipsimg']">
<div v-show="form.front_view ? false : true" class="addTips_wz">上传证件人像面</div> <div v-show="form.front_view ? false : true" class="addTips_wz">上传证件人像面</div>
</div> </div>
<div class="imgItem" @click="addImg('back_view')"> <div v-if="isFile2" class="imgItem" @click="addImg('back_view')">
<img :src="form.back_view ? form.back_view : upload_image" <img :src="form.back_view ? form.back_view : upload_image"
:class="[form.back_view ? 'zhengjz' : 'addTipsimg']"> :class="[form.back_view ? 'zhengjz' : 'addTipsimg']">
<div v-show="form.back_view ? false : true" class="addTips_wz">上传证件国徽面</div> <div v-show="form.back_view ? false : true" class="addTips_wz">上传证件国徽面</div>
</div> </div>
<div class="imgItem" @click="addImg('handset_view')"> <div v-if="isFile3" class="imgItem" @click="addImg('handset_view')">
<img :src="form.handset_view ? form.handset_view : upload_image" <img :src="form.handset_view ? form.handset_view : upload_image"
:class="[form.handset_view ? 'zhengjz' : 'addTipsimg']"> :class="[form.handset_view ? 'zhengjz' : 'addTipsimg']">
<div v-show="form.handset_view ? false : true" class="addTips_wz">手持证件照</div> <div v-show="form.handset_view ? false : true" class="addTips_wz">手持证件照</div>
</div> </div>
<input id="file" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" /> <!-- <input id="file" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" />
<input id="file2" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" /> <input id="file2" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" />
<input id="file3" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" /> <input id="file3" name="image" type="file" v-show="false" class="upload" accept="image/*" @change="upload" /> -->
<input id="file" name="image" type="file" v-if="isFile" class="upload" accept="image/*" />
<input id="file2" name="image" type="file" v-if="isFile2" class="upload" accept="image/*" />
<input id="file3" name="image" type="file" v-if="isFile3" class="upload" accept="image/*" />
</div> </div>
<!-- 按钮 --> <!-- 按钮 -->
...@@ -75,6 +78,9 @@ ...@@ -75,6 +78,9 @@
}, },
uploadName: '', uploadName: '',
isSubmit: true, isSubmit: true,
isFile: true,
isFile2:true,
isFile3:true,
upload_image: '__PUBLIC__/appapi/img/add_r@2x.png', upload_image: '__PUBLIC__/appapi/img/add_r@2x.png',
}, },
methods: { methods: {
...@@ -144,14 +150,17 @@ ...@@ -144,14 +150,17 @@
if (_this.uploadName === 'front_view') { if (_this.uploadName === 'front_view') {
id = 'file'; id = 'file';
saveName = 'auth_' + uid + '_1'; saveName = 'auth_' + uid + '_1';
_this.isFile = false
} }
if (_this.uploadName === 'back_view') { if (_this.uploadName === 'back_view') {
id = 'file2'; id = 'file2';
saveName = 'auth_' + uid + '_2'; saveName = 'auth_' + uid + '_2';
_this.isFile2 = false
} }
if (_this.uploadName === 'handset_view') { if (_this.uploadName === 'handset_view') {
id = 'file3'; id = 'file3';
saveName = 'auth_' + uid + '_3'; saveName = 'auth_' + uid + '_3';
_this.isFile3 = false
} }
var loadingIndex = layer.load(2); var loadingIndex = layer.load(2);
$.ajaxFileUpload({ $.ajaxFileUpload({
...@@ -170,13 +179,15 @@ ...@@ -170,13 +179,15 @@
} 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;
$("#file").empty(); _this.isFile = true
} }
if (_this.uploadName === 'back_view') { if (_this.uploadName === 'back_view') {
_this.form.back_view = str.data.url; _this.form.back_view = str.data.url;
_this.isFile2 = true
} }
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.isFile3 = true
} }
_this.checkSubmit(); _this.checkSubmit();
layer.close(loadingIndex); layer.close(loadingIndex);
...@@ -213,6 +224,9 @@ ...@@ -213,6 +224,9 @@
}, },
created: function () { created: function () {
//加载触发函数 //加载触发函数
$("#file").live('change',function(){
this.upload()
})
} }
}); });
</script> </script>
......
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