Authored by yyq

图片上传提示

... ... @@ -17,7 +17,7 @@
<span class="iconfont">&#xe61f;</span>
</div>
<span class="img-up-tip">0/4</span>
<span class="warn hide">
<span class="warn">
<span class="iconfont blue">&#xe60d;</span>
<span class="blue">最多上传4张照片</span>
</span>
... ...
... ... @@ -58,11 +58,11 @@ function refreshBag() {
$bagGoodsList.empty();
$bagGoodsList.parent().addClass('bag-empty');
}
}
}
})
};
});
}
refreshBag();
... ...
... ... @@ -221,6 +221,8 @@ $refundTable.on('change', '.refund-reason', function() {
upload.up({
callback: function(result) {
var data = {};
if (result && result.code === 200) {
// 避免异步上传导致数量不统一
num = $this.data('num') || 0;
... ... @@ -231,9 +233,13 @@ $refundTable.on('change', '.refund-reason', function() {
} else if (num === 3) {
$this.addClass('hide');
}
data.src = result.data;
if (data.imgs && data.imgs.length) {
data.url = data.imgs[0];
}
$this.siblings('.img-up-tip').text(++num + '/4');
$this.data('num', num);
$this.before(imgBoxTpl({src: result.data}));
$this.before(imgBoxTpl(data));
}
}
});
... ...
... ... @@ -108,6 +108,11 @@
font-size: 34px;
}
}
.warn .iconfont {
font-size: 16px;
margin-left: 10px;
}
}
.thumb-box {
... ...
<div class="thumb-box" data-img="{{src}}">
<div class="thumb-box" data-img="{{url}}">
<img class="envidence" src="{{src}}" alt="凭证图片">
<div class="operation-box">
<a href="{{src}}" target="_blank">查看</a>
... ...