...
|
...
|
@@ -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() {
|
...
|
...
|
|