...
|
...
|
@@ -6,12 +6,19 @@ |
|
|
var $ = require('yoho-jquery'),
|
|
|
lazyload = require('yoho-jquery-lazyload');
|
|
|
|
|
|
var $check = $('.check'),
|
|
|
var $refundTable = $('.refund-goods'),
|
|
|
$check = $('.check'),
|
|
|
$refundType = $('.refund-type'),
|
|
|
$typeInfo = $refundType.children('dl');
|
|
|
|
|
|
var $applyBtn = $('#apply-btn');
|
|
|
|
|
|
var specialReason = $refundTable.data() || {},
|
|
|
payInfo = { // 退款信息
|
|
|
type: 3, // 2--银行卡 3--支付宝 4--yoho币
|
|
|
dom: $typeInfo.eq(0)
|
|
|
};
|
|
|
|
|
|
var checked;
|
|
|
|
|
|
require('../plugins/check');
|
...
|
...
|
@@ -26,6 +33,12 @@ function restApplyBtn() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
function packApplyInfo() {
|
|
|
if (checked && checked.documents) {
|
|
|
console.log(checked);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$check.check({
|
|
|
type: 'checkbox',
|
|
|
onChange: function() {
|
...
|
...
|
@@ -34,29 +47,67 @@ $check.check({ |
|
|
}
|
|
|
});
|
|
|
|
|
|
$refundTable.on('change', '.refund-reason', function() {
|
|
|
var $this = $(this),
|
|
|
$specialDom = $this.parent().siblings('.special-reason'),
|
|
|
val = $this.val();
|
|
|
|
|
|
if (specialReason.hasOwnProperty(val)) {
|
|
|
$specialDom.slideDown();
|
|
|
} else {
|
|
|
$specialDom.slideUp();
|
|
|
}
|
|
|
$specialDom.siblings('.check').data({reason: val});
|
|
|
});
|
|
|
|
|
|
$refundType.on('click', '.type-item', function() {
|
|
|
var $this = $(this),
|
|
|
index;
|
|
|
|
|
|
if (!$this.hasClass('cur')) {
|
|
|
if ($this.hasClass('ali-item')) {
|
|
|
payInfo.type = 3;
|
|
|
} else {
|
|
|
payInfo.type = 2;
|
|
|
}
|
|
|
index = $this.index();
|
|
|
|
|
|
// 切换退款卡片
|
|
|
$this.addClass('cur').siblings('.cur').removeClass('cur');
|
|
|
|
|
|
// 切换退款信息输入容器
|
|
|
payInfo.dom = $typeInfo.eq(index);
|
|
|
$typeInfo.addClass('hide');
|
|
|
$typeInfo.eq(index).removeClass('hide');
|
|
|
payInfo.dom.removeClass('hide');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// "last_price": "385.00",
|
|
|
// "remark": "重量不行",
|
|
|
// "returned_reason": "8",
|
|
|
// "evidence_images": [
|
|
|
// "/2016/06/30/11/02ba04e8b96654fc6c1fab12dda61bec21.png",
|
|
|
// "/2016/06/30/11/014c64b459499081c8bd237eb8e26decf8.png"
|
|
|
// ],
|
|
|
// "product_skn": "51177771",
|
|
|
// "goods_type": "1",
|
|
|
// "product_skc": "310207",
|
|
|
// "product_sku": "978129"
|
|
|
|
|
|
$applyBtn.click(function() {
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/me/return/refund/apply',
|
|
|
data: {
|
|
|
id: 11
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
console.log(data);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
packApplyInfo();
|
|
|
|
|
|
// $.ajax({
|
|
|
// type: 'POST',
|
|
|
// url: '/me/return/refund/apply',
|
|
|
// data: {
|
|
|
// id: 11
|
|
|
// },
|
|
|
// success: function(data) {
|
|
|
// if (data.code === 200) {
|
|
|
// console.log(data);
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
}); |
...
|
...
|
|