Authored by 郭成尧

Merge branch 'feature/refundApply' into release/5.5

@@ -335,8 +335,7 @@ const getOrders = (params) => { @@ -335,8 +335,7 @@ const getOrders = (params) => {
335 }); 335 });
336 336
337 // 如果不允许修改省 337 // 如果不允许修改省
338 - if (value.is_support_change_province !== 'Y' &&  
339 - !_.get(value, 'delivery_address.province_area_code', false)) { 338 + if (value.is_support_change_province !== 'Y') {
340 modifyAddress.modifyAddressUrl += '&provinceAreaCode=' + 339 modifyAddress.modifyAddressUrl += '&provinceAreaCode=' +
341 _.get(value, 'delivery_address.province_area_code', ''); 340 _.get(value, 'delivery_address.province_area_code', '');
342 } 341 }
@@ -305,8 +305,9 @@ const orderDetailData = (uid, orderCode) => { @@ -305,8 +305,9 @@ const orderDetailData = (uid, orderCode) => {
305 }); 305 });
306 306
307 // 如果不允许修改省 307 // 如果不允许修改省
308 - if (orderDetail.isSupportChangeProvince !== 'Y' && orderDetail.provinceAreaCode) {  
309 - orderDetail.newUrl = orderDetail.newUrl + '&provinceAreaCode=' + orderDetail.provinceAreaCode; 308 + if (orderDetail.isSupportChangeProvince !== 'Y') {
  309 + orderDetail.newUrl = orderDetail.newUrl + '&provinceAreaCode=' +
  310 + _.get(orderDetail, 'deliveryAddress.provinceAreaCode', '');
310 } 311 }
311 312
312 // 为支付的拆单配送信息 313 // 为支付的拆单配送信息
@@ -25,8 +25,7 @@ @@ -25,8 +25,7 @@
25 </div> 25 </div>
26 <div class="form-group"> 26 <div class="form-group">
27 <label for="address" class="label-address">详细地址:</label> 27 <label for="address" class="label-address">详细地址:</label>
28 - <textarea name="address" type="text" value="" maxlength="255">{{address}}  
29 - </textarea> 28 + <textarea name="address" type="text" value="" maxlength="255">{{address}}</textarea>
30 </div> 29 </div>
31 <input type="hidden" name="orderCode" value="{{orderCode}}"> 30 <input type="hidden" name="orderCode" value="{{orderCode}}">
32 </form> 31 </form>
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 </div> 9 </div>
10 </section> 10 </section>
11 {{else}} 11 {{else}}
12 - <section class="owner-info block" data-changeable="{{changeable}}" data-url="{{url}}"> 12 + <section class="owner-info block" data-changeable="{{false}}" data-url="{{url}}">
13 <span class="iconfont">&#xe637;</span> 13 <span class="iconfont">&#xe637;</span>
14 14
15 <div class="beside-icon"> 15 <div class="beside-icon">
@@ -122,6 +122,10 @@ @@ -122,6 +122,10 @@
122 {{/if}} 122 {{/if}}
123 123
124 <div class="opt block"> 124 <div class="opt block">
  125 + {{!-- 申请退款 --}}
  126 + {{#if refundApply}}
  127 + <span class="btn btn-refund">申请退款</span>
  128 + {{/if}}
125 {{!-- 修改地址 --}} 129 {{!-- 修改地址 --}}
126 {{#if addressModify}} 130 {{#if addressModify}}
127 <a href="{{newUrl}}" class="btn">修改地址</a> 131 <a href="{{newUrl}}" class="btn">修改地址</a>
@@ -160,11 +164,6 @@ @@ -160,11 +164,6 @@
160 <span class="btn btn-check-logistics">查看二维码</span> 164 <span class="btn btn-check-logistics">查看二维码</span>
161 </a> 165 </a>
162 {{/if}} 166 {{/if}}
163 -  
164 - {{!-- 申请退款 --}}  
165 - {{#if refundApply}}  
166 - <span class="btn btn-refund">申请退款</span>  
167 - {{/if}}  
168 {{/if}} 167 {{/if}}
169 </div> 168 </div>
170 </div> 169 </div>
@@ -13,9 +13,6 @@ var $ = require('yoho-jquery'), @@ -13,9 +13,6 @@ var $ = require('yoho-jquery'),
13 var $navLi = $('#order-nav > li'), 13 var $navLi = $('#order-nav > li'),
14 $orderContainer = $('#order-container'); 14 $orderContainer = $('#order-container');
15 15
16 -var $sureClose = $('.cancel'); // 删除订单按钮  
17 -var $sureRefund = $('.refund'); // 申请退款按钮  
18 -  
19 var $curContainer = $orderContainer.children('.orders:not(.hide)');// 保存当前显示的order-container 16 var $curContainer = $orderContainer.children('.orders:not(.hide)');// 保存当前显示的order-container
20 17
21 var winH = $(window).height(); 18 var winH = $(window).height();
@@ -246,11 +243,28 @@ orderHammer.on('tap', function(e) { @@ -246,11 +243,28 @@ orderHammer.on('tap', function(e) {
246 }); 243 });
247 } else if ($cur.closest('.cancel').length > 0) { 244 } else if ($cur.closest('.cancel').length > 0) {
248 // 取消订单 245 // 取消订单
249 - // $reaMask.css('visibility', 'visible'); 246 + dialog.showDialog({
  247 + dialogText: '取消订单后,本单享有的优惠可能会一并取消,确定申请吗?',
  248 + hasFooter: {
  249 + leftBtnText: '返回',
  250 + rightBtnText: '确定'
  251 + }
  252 + }, function() {
  253 + dialog.hideDialog();
  254 + $reaMask.css('visibility', 'visible');
  255 + });
250 } else if ($cur.closest('.refund').length > 0) { 256 } else if ($cur.closest('.refund').length > 0) {
251 -  
252 // 申请退款 257 // 申请退款
253 - // $refundReaMask.css('visibility', 'visible'); 258 + dialog.showDialog({
  259 + dialogText: '申请退款后,本单享有的优惠可能会一并取消,确定申请吗?',
  260 + hasFooter: {
  261 + leftBtnText: '返回',
  262 + rightBtnText: '确定'
  263 + }
  264 + }, function() {
  265 + dialog.hideDialog();
  266 + $refundReaMask.css('visibility', 'visible');
  267 + });
254 268
255 /** 269 /**
256 * 埋点 270 * 埋点
@@ -465,34 +479,6 @@ $reaMask.on('touchend', function(event) { @@ -465,34 +479,6 @@ $reaMask.on('touchend', function(event) {
465 event.stopPropagation(); 479 event.stopPropagation();
466 }); 480 });
467 481
468 -// 弹出取消订单提示框  
469 -$sureClose.on('click', function() {  
470 - dialog.showDialog({  
471 - dialogText: '取消订单后,本单享有的优惠可能会一并取消,确定申请吗?',  
472 - hasFooter: {  
473 - leftBtnText: '返回',  
474 - rightBtnText: '确定'  
475 - }  
476 - }, function() {  
477 - dialog.hideDialog();  
478 - $reaMask.css('visibility', 'visible');  
479 - });  
480 -});  
481 -  
482 -// 弹出申请退款提示框  
483 -$sureRefund.on('click', function() {  
484 - dialog.showDialog({  
485 - dialogText: '申请退款后,本单享有的优惠可能会一并取消,确定申请吗?',  
486 - hasFooter: {  
487 - leftBtnText: '返回',  
488 - rightBtnText: '确定'  
489 - }  
490 - }, function() {  
491 - dialog.hideDialog();  
492 - $refundReaMask.css('visibility', 'visible');  
493 - });  
494 -});  
495 -  
496 // 申请退款 482 // 申请退款
497 $refundReaMask.on('touchend', function(event) { 483 $refundReaMask.on('touchend', function(event) {
498 if (event.target.className !== 'refund-reason-mask') { 484 if (event.target.className !== 'refund-reason-mask') {