Authored by 郭成尧

Merge branch 'feature/refundApply' into release/5.5

... ... @@ -62,3 +62,32 @@
</div>
</div>
{{!-- 申请退款确认框 --}}
<div class="ymodal ymodal-alert" id="refundModal">
<div class="ymodal-dialog">
<div class="ymodal-content">
<div class="ymodal-body">
申请退款后,本单享有的优惠可能会一并取消,确定申请吗?
</div>
<div class="modal-btn">
<button id="disMissBtn" data-dismiss="ymodal">返回</button>
<button id="sureRefund">确定</button>
</div>
</div>
</div>
</div>
{{!-- 取消订单确认框 --}}
<div class="ymodal ymodal-alert" id="closeModal">
<div class="ymodal-dialog">
<div class="ymodal-content">
<div class="ymodal-body">
取消订单后,本单享有的优惠可能会一并取消,确定申请吗?
</div>
<div class="modal-btn">
<button class="dis-miss-btn" data-dismiss="ymodal">返回</button>
<button id="sureClose">确定</button>
</div>
</div>
</div>
</div>
... ...
... ... @@ -143,7 +143,7 @@
{{/unless}}
{{#if unpaid}}
<span class="btn btn-cancel">取消订单</span>
<span class="btn btn-cancel" data-toggle="ymodal" data-target="#closeModal">取消订单</span>
{{#if payUrl}}
<a class="btn btn-pay" href="{{payUrl}}">立即付款</a>
{{/if}}
... ... @@ -163,7 +163,7 @@
{{!-- 申请退款 --}}
{{#if refundApply}}
<span class="btn btn-refund">申请退款</span>
<span class="btn btn-refund" data-toggle="ymodal" data-target="#refundModal">申请退款</span>
{{/if}}
{{/if}}
</div>
... ... @@ -200,6 +200,38 @@
</div>
</div>
</div>
{{!-- 申请退款确认框 --}}
<div class="ymodal ymodal-alert" id="refundModal">
<div class="ymodal-dialog">
<div class="ymodal-content">
<div class="ymodal-body">
申请退款后,本单享有的优惠可能会一并取消,确定申请吗?
</div>
<div class="modal-btn">
<button id="disMissBtn" data-dismiss="ymodal">返回</button>
<button id="sureRefund">确定</button>
</div>
</div>
</div>
</div>
{{!-- 取消订单确认框 --}}
<div class="ymodal ymodal-alert" id="closeModal">
<div class="ymodal-dialog">
<div class="ymodal-content">
<div class="ymodal-body">
取消订单后,本单享有的优惠可能会一并取消,确定申请吗?
</div>
<div class="modal-btn">
<button class="dis-miss-btn" data-dismiss="ymodal">返回</button>
<button id="sureClose">确定</button>
</div>
</div>
</div>
</div>
<script>_ozprm = "orderid={{orderCode}}&ordertotal={{orderTotal}}";</script>
<script type="text/javascript" src="//static.yohobuy.com/m/v1/js/AG_Tracking.js"></script>
<script type="text/javascript">
... ...
... ... @@ -40,7 +40,7 @@
{{!-- 申请退款 --}}
{{#if refundApply}}
<span class="btn refund">申请退款</span>
<span class="btn refund" data-toggle="ymodal" data-target="#refundModal">申请退款</span>
{{/if}}
{{!-- 修改地址 --}}
{{#if modifyAddress.modifyAddress}}
... ... @@ -63,7 +63,7 @@
<span class="hours">{{leftTime}}</span>
</li>
</ul>
<span class="btn cancel">取消订单</span>
<span class="btn cancel" data-toggle="ymodal" data-target="#closeModal">取消订单</span>
{{#if payUrl}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
... ...
... ... @@ -13,6 +13,10 @@ var $ = require('yoho-jquery'),
var $navLi = $('#order-nav > li'),
$orderContainer = $('#order-container');
var $sureClose = $('#sureClose'); // 确定删除订单
var $sureRefund = $('#sureRefund'); // 确定申请退款
var $disMissBtn = $('.dis-miss-btn'); // 返回
var $curContainer = $orderContainer.children('.orders:not(.hide)');// 保存当前显示的order-container
var winH = $(window).height();
... ... @@ -40,6 +44,8 @@ var orderHammer,
var firstScreen = $('.firstscreen-orders').children().size() > 0;
require('../common');
require('../plugin/modal.alert');
require('../../scss/layout/_modal.css');
require('home/order-list.page.css');
... ... @@ -241,10 +247,11 @@ orderHammer.on('tap', function(e) {
});
} else if ($cur.closest('.cancel').length > 0) {
// 取消订单
$reaMask.css('visibility', 'visible');
// $reaMask.css('visibility', 'visible');
} else if ($cur.closest('.refund').length > 0) {
// 申请退款
$refundReaMask.css('visibility', 'visible');
// $refundReaMask.css('visibility', 'visible');
/**
* 埋点
... ... @@ -435,9 +442,21 @@ $reaMask.on('touchend', function(event) {
event.stopPropagation();
});
// 弹出取消订单提示框
$sureClose.on('click', function() {
$disMissBtn.trigger('click');
$reaMask.css('visibility', 'visible');
});
// 弹出申请退款提示框
$sureRefund.on('click', function() {
$disMissBtn.trigger('click');
$refundReaMask.css('visibility', 'visible');
});
// 申请退款
$refundReaMask.on('touchend', function(event) {
if (event.target.className !== 'reason-mask') {
if (event.target.className !== 'refund-reason-mask') {
return false;
}
... ...
... ... @@ -22,8 +22,15 @@ var orderId = $('#order-detail').data('id'),
optHammer,
$createTime = new Date($('.createTime').text() * 1000);
var $sureClose = $('#sureClose'); // 确定删除订单
var $sureRefund = $('#sureRefund'); // 确定申请退款
var $disMissBtn = $('.dis-miss-btn'); // 返回
require('home/order-detail-index.page.css');
require('../common');
require('../plugin/modal.alert');
require('../../scss/layout/_modal.css');
lazyLoad({
try_again_css: 'order-failure'
... ... @@ -117,9 +124,9 @@ optHammer.on('tap', function(e) {
});
});
} else if ($cur.hasClass('btn-cancel')) {
$reaMask.css('visibility', 'visible');
// $reaMask.css('visibility', 'visible');
} else if ($cur.hasClass('btn-refund')) {
$refundReaMask.css('visibility', 'visible');
// $refundReaMask.css('visibility', 'visible');
/**
* 埋点
... ... @@ -238,6 +245,9 @@ $(function() {
});
});
/**
* 取消订单
*/
$reaMask.find('.box-cmp').on('touchend', function() {
var selSolid = reasonSwiper.slides[reasonSwiper.activeIndex],
reason = $(selSolid).text(),
... ... @@ -308,7 +318,7 @@ $reaMask.on('touchend', function(event) {
// 申请退款
$refundReaMask.on('touchend', function(event) {
if (event.target.className !== 'reason-mask') {
if (event.target.className !== 'refund-reason-mask') {
return false;
}
... ... @@ -316,6 +326,19 @@ $refundReaMask.on('touchend', function(event) {
event.stopPropagation();
});
// 弹出取消订单提示框
$sureClose.on('click', function() {
$disMissBtn.trigger('click');
$reaMask.css('visibility', 'visible');
});
// 弹出申请退款提示框
$sureRefund.on('click', function() {
$disMissBtn.trigger('click');
$refundReaMask.css('visibility', 'visible');
});
function formatDate(objD) {
var str,
yy = objD.getYear(),
... ...
... ... @@ -358,3 +358,30 @@
color: #f00;
}
}
.modal-btn {
width: 100%;
height: 60px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
display: inline-block;
button {
width: 268px;
border: 0;
float: left;
height: 68px;
background-color: #fff;
border-top: 1px solid #ccc;
}
button:first-child {
border-bottom-left-radius: 4px;
border-right: 1px solid #ccc;
}
button:last-child {
border-bottom-right-radius: 4px;
color: #d0021b;
}
}
... ...