Commit aefa0104 by 冷斌

fix bug

parent 8ec482c9
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
var input = '<input type="file" id="ipt-file1" name="image" style="display:none" accept="image/*" />'; var input = '<input type="file" id="ipt-file1" name="image" style="display:none" accept="image/*" />';
$('#upload').html(input); $('#upload').html(input);
var iptt=document.getElementById(index); var iptt=document.getElementById(index);
if(window.addEventListener){ if(window.addEventListener){
iptt.addEventListener('change',function(){ iptt.addEventListener('change',function(){
ajaxFileUpload(index); ajaxFileUpload(index);
$(".shadd[data-select="+index+"]").show(); $(".shadd[data-select="+index+"]").show();
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
{ {
iptt.attachEvent('onchange',function() iptt.attachEvent('onchange',function()
{ {
ajaxFileUpload(index); ajaxFileUpload(index);
$(".shadd[data-select="+index+"]").show(); $(".shadd[data-select="+index+"]").show();
}); });
} }
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
var str=JSON.parse(data); var str=JSON.parse(data);
if(str.ret==200) if(str.ret==200)
{ {
$("#thumb").val(str.data.url); $("#thumb").val(str.data.url);
$("#img_file1").attr("src",str.data.url); $("#img_file1").attr("src",str.data.url);
$(".shadd[data-select="+img+"]").hide(); $(".shadd[data-select="+img+"]").hide();
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
layer.msg(str.msg); layer.msg(str.msg);
} }
}, },
error: function(data) error: function(data)
{ {
layer.msg("上传失败"); layer.msg("上传失败");
$(".shadd[data-select="+img+"]").hide(); $(".shadd[data-select="+img+"]").hide();
...@@ -116,7 +116,6 @@ ...@@ -116,7 +116,6 @@
layer.msg('提交成功',{},function(){ layer.msg('提交成功',{},function(){
location.reload(); location.reload();
}); });
}else{ }else{
layer.msg(result.errormsg); layer.msg(result.errormsg);
} }
...@@ -132,5 +131,5 @@ ...@@ -132,5 +131,5 @@
} }
$(function(){ $(function(){
$("#content").css({"height":$(window).height() *0.5+"px"}); $("#content").css({"height":$(window).height() *0.5+"px"});
$('#save_btn').on('click', save); $('#save_btn').on('click', save);
}) })
\ No newline at end of file
...@@ -18,18 +18,18 @@ ...@@ -18,18 +18,18 @@
<div class="headBox"> <div class="headBox">
<div style="font-size: 0.7rem; color: #333; margin-right: 1rem;">联系方式</div> <div style="font-size: 0.7rem; color: #333; margin-right: 1rem;">联系方式</div>
<input class="inputTel" type="text" v-model="thumb" placeholder="请留下您的微信/QQ/手机号" /> <input class="inputTel" type="text" v-model="form.thumb" placeholder="请留下您的微信/QQ/手机号" />
</div> </div>
<div class="bodyBox"> <div class="bodyBox">
<textarea class="content" v-model="content" rows="" cols="" maxlength="200" placeholder="我的意见…"> <textarea class="content" v-model="form.content" rows="" cols="" maxlength="200" placeholder="我的意见…">
</textarea> </textarea>
</div> </div>
<!-- 提交 --> <!-- 提交 -->
<div class="btnBox"> <div class="btnBox">
<input type="button" value="提交" /> <input type="button" :disable="isSub" value="提交" />
</div> </div>
</div> </div>
...@@ -37,12 +37,15 @@ ...@@ -37,12 +37,15 @@
var vm = new Vue({ var vm = new Vue({
el: '#app', el: '#app',
data: { data: {
uid: "{$uid}", form:{
token: "{$token}", uid: "{$uid}",
version: "{$version}", token: "{$token}",
model: "{$model}", version: "{$version}",
content: '', model: "{$model}",
thumb: '', content: '',
thumb: '',
},
isSub: false
}, },
methods: { methods: {
//事件 //事件
......
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