...
|
...
|
@@ -4,7 +4,8 @@ |
|
|
* @date: 2016/2/29
|
|
|
*/
|
|
|
var $ = require('yoho-jquery'),
|
|
|
Addr = require('./common-address');
|
|
|
Addr = require('./common-address'),
|
|
|
_dialog = require('../common/dialog');
|
|
|
|
|
|
var $goodsTable = $('#goods-table'),
|
|
|
$checkBox = $goodsTable.find('input[type="checkbox"]'),
|
...
|
...
|
@@ -54,7 +55,8 @@ var option = { |
|
|
|
|
|
var refundConfirm = {};
|
|
|
|
|
|
var Dialog = require('../common/dialog').Dialog;
|
|
|
var Dialog = _dialog.Dialog,
|
|
|
Confirm = _dialog.Confirm;
|
|
|
|
|
|
var resetImg = function($p) {
|
|
|
$p.removeClass('selected');
|
...
|
...
|
@@ -113,6 +115,42 @@ function setBackInput(type) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
function formatExchangeOption($dom, type) {
|
|
|
var sku = $dom.data('sku');
|
|
|
var $optItem;
|
|
|
var cd;
|
|
|
|
|
|
if (!$dom || !sku) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$dom.children().each(function() {
|
|
|
if (+sku === +$(this).attr('value')) {
|
|
|
$optItem = $(this);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (!$optItem) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
type = type * 1;
|
|
|
if (!type || type === 4 || type === 6 || type === 8) {
|
|
|
$optItem.removeAttr('disabled');
|
|
|
} else {
|
|
|
if (+$dom.val() === +sku) {
|
|
|
$dom.val(0);
|
|
|
cd = new Confirm({
|
|
|
content: '无理由换货不可选择换为相同颜色尺码',
|
|
|
cb: function() {
|
|
|
cd.close();
|
|
|
}
|
|
|
}).show();
|
|
|
}
|
|
|
$optItem.attr('disabled', 'disabled');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($refundInfo.length) {
|
|
|
pageType = 1;
|
|
|
|
...
|
...
|
@@ -150,6 +188,8 @@ $reasons.change(function() { |
|
|
} else {
|
|
|
$par.next().hide();
|
|
|
}
|
|
|
|
|
|
formatExchangeOption($par.find('.exchange-size'), type);
|
|
|
});
|
|
|
|
|
|
// 切换支行银行信息
|
...
|
...
|
@@ -181,6 +221,7 @@ $checkBox.change(function() { |
|
|
|
|
|
$goodsTable.on('change', '.exchange-color', function() {
|
|
|
var $warp = $(this).closest('.exchange-choose-wrap'),
|
|
|
$warpSize = $warp.find('.exchange-size'),
|
|
|
_html = '<option value="0">请选择尺码</option>',
|
|
|
id = $(this).val();
|
|
|
|
...
|
...
|
@@ -189,7 +230,9 @@ $goodsTable.on('change', '.exchange-color', function() { |
|
|
_html += '<option value="' + v.id + '">' + v.name + '</option>';
|
|
|
});
|
|
|
}
|
|
|
$warp.find('.exchange-size').html(_html).val(0);
|
|
|
$warpSize.html(_html).val(0);
|
|
|
|
|
|
formatExchangeOption($warpSize, $warp.find('.return-reason').val());
|
|
|
});
|
|
|
|
|
|
$goodsTable.on('click', '.btn-del', function(e) {
|
...
|
...
|
@@ -277,6 +320,14 @@ $refundType.change(function() { |
|
|
setBackInput(type);
|
|
|
});
|
|
|
|
|
|
$('#bank-card').keyup(function() {
|
|
|
var $this = $(this),
|
|
|
v = $this.val();
|
|
|
|
|
|
/(\S{5}|\D)/.test(v) && $this.val($.trim(v.replace(/\D/g, '').replace(/(.{4})/g, '$1 ')));
|
|
|
});
|
|
|
|
|
|
|
|
|
// 打包退换货商品信息
|
|
|
function packGoogsList() {
|
|
|
var goods = [],
|
...
|
...
|
@@ -381,7 +432,7 @@ function packRefundInfo(returnMode) { |
|
|
verifyTip = '请填写收款人姓名';
|
|
|
}
|
|
|
|
|
|
res.payment.bank_card = $.trim($refundInfo.find('input[name="bank-card"]').val());
|
|
|
res.payment.bank_card = $refundInfo.find('input[name="bank-card"]').val().replace(/\s/g, '');
|
|
|
if (!verifyTip && !res.payment.bank_card) {
|
|
|
verifyTip = '请填写收款账户';
|
|
|
}
|
...
|
...
|
|