Authored by biao

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

... ... @@ -10,6 +10,6 @@
<span>尺码:
<span class="bold">{{sizeName}}</span>
</span>
<p class="bold buy-number">{{> icon/error-round}}{{buyNumber}}</p>
<p class="bold buy-number"><span class="iconfont">&#xe61d;</span>{{buyNumber}}</p>
</div>
</div>
... ...
... ... @@ -68,6 +68,7 @@ const uploadImg = (req, res) => {
code: 200,
data: datas[0],
datas: datas,
imgs: imgs,
names: req.body.fileNames,
message: '上传成功',
status: true
... ...
... ... @@ -5,7 +5,6 @@
*/
var $ = require('yoho-jquery'),
lazyload = require('yoho-jquery-lazyload'),
handlebars = require('yoho-handlebars'),
upload = require('../plugins/upload'),
Alert = require('../plugins/dialog').Alert;
... ... @@ -23,14 +22,7 @@ var orderCode = $('#order-code').val() || 0,
type: $refundType.find('.type-item.cur').data('id') // 1--原卡返回 2--银行卡 3--支付宝 4--yoho币
};
var tpl = '<div class="img-wrap" data-img="{{data}}">' +
'<div class="img-opt">' +
'<span class="review-upimg">查看</span>' +
'<span class="cancel-upimg">删除</span>' +
'</div>' +
'<div class="img-view"><img src="{{data}}"></div>' +
'</div>',
imgFn = handlebars.compile(tpl);
var imgBoxTpl = require('../../tpl/me/thumbnail.hbs');
var checked;
... ... @@ -139,7 +131,7 @@ function packApplyInfo() {
}
good.evidence_images = [];
$special.find('.img-wrap').each(function() {
$special.find('.thumb-box').each(function() {
var img = $(this).data('img');
if (img) {
... ... @@ -223,7 +215,7 @@ $refundTable.on('change', '.refund-reason', function() {
num = $this.data('num') || 0;
if (num > 3) {
new Alert('<h1>最多上传4张凭证</h1>').show();
$this.addClass('hide');
return;
}
... ... @@ -232,26 +224,28 @@ $refundTable.on('change', '.refund-reason', function() {
if (result && result.code === 200) {
// 避免异步上传导致数量不统一
num = $this.data('num') || 0;
if (num > 3) {
$this.addClass('hide');
return;
} else if (num === 3) {
$this.addClass('hide');
}
$this.siblings('.img-up-tip').text(++num + '/4');
$this.data('num', num);
$this.before(imgFn(result));
$this.before(imgBoxTpl({src: result.data}));
}
}
});
}).on('click', '.img-opt > span', function() {
}).on('click', '.thumb-box .delete', function() {
var $this = $(this),
$wrap = $this.closest('.img-wrap'),
$wrap = $this.closest('.thumb-box'),
$upBtn = $wrap.siblings('.img-upload'),
num = $upBtn.data('num') || 0;
if ($this.hasClass('cancel-upimg')) {
$wrap.siblings('.img-up-tip').text(--num + '/4');
$wrap.remove();
$upBtn.data('num', num);
}
$wrap.siblings('.img-up-tip').text(--num + '/4');
$wrap.remove();
$upBtn.removeClass('hide').data('num', num);
});
$refundType.on('click', '.type-item', function() {
... ...
... ... @@ -121,12 +121,8 @@
font-weight: normal;
.iconfont {
outline: 3px solid #fff;
outline-offset: -3px;
border-radius: 100%;
background: #000;
font-weight: normal;
color: #fff;
color: #000000;
}
&.last {
... ...
... ... @@ -93,17 +93,13 @@
margin-right: 20px;
}
.img-wrap,
.img-upload {
width: 60px;
height: 60px;
border: 1px dashed #eee;
line-height: 60px;
float: left;
border: 1px dashed #eee;
margin-right: 10px;
}
.img-upload {
line-height: 60px;
text-align: center;
color: #dfdfdf;
cursor: pointer;
... ... @@ -112,31 +108,35 @@
font-size: 34px;
}
}
}
.img-wrap {
position: relative;
}
.img-wrap:hover .img-opt {
display: block;
}
.thumb-box {
position: relative;
float: left;
.img-opt {
width: 100%;
height: 20px;
line-height: 20px;
background: #555;
font-size: 12px;
color: #fff;
opacity: 0.7;
.operation-box {
display: none;
width: 60px;
padding: 5px 0;
position: absolute;
top: 0;
background-color: rgba(0, 0, 0, 0.6);
text-align: center;
display: none;
font-size: 12px;
> * {
display: inline-block;
.delete {
cursor: pointer;
}
* {
color: #fff !important;
}
}
&:hover {
.operation-box {
display: block;
}
}
}
... ...
<div class="thumb-box">
<div class="thumb-box" data-img="{{src}}">
<img class="envidence" src="{{src}}" alt="凭证图片">
<div class="operation-box">
<a href="{{src}}" target="_blank">查看</a>
... ...