Authored by 沈志敏

fix bug

@@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
52 'use strict'; 52 'use strict';
53 const $ = require('jquery'); 53 const $ = require('jquery');
54 const tip = require('common/tip'); 54 const tip = require('common/tip');
  55 + const Modal = require('common/modal');
55 56
56 module.exports = { 57 module.exports = {
57 data() { 58 data() {
@@ -99,20 +100,23 @@ @@ -99,20 +100,23 @@
99 * @param type refundType 1为退货,2为换货 100 * @param type refundType 1为退货,2为换货
100 */ 101 */
101 cancelApply(id, type) { 102 cancelApply(id, type) {
102 - $.ajax({  
103 - url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',  
104 - type: 'post',  
105 - data: {  
106 - id: id  
107 - }  
108 - }).then(result => {  
109 - if (result.code === 200) {  
110 - location.reload();  
111 - } else {  
112 - tip(result.message);  
113 - }  
114 - }).fail(() => {  
115 - tip('操作失敗'); 103 + Modal.confirm('', '取消后不能恢复,确认取消吗?', function() {
  104 + this.hide();
  105 + $.ajax({
  106 + url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
  107 + type: 'post',
  108 + data: {
  109 + id: id
  110 + }
  111 + }).then(result => {
  112 + if (result.code === 200) {
  113 + location.reload();
  114 + } else {
  115 + tip(result.message);
  116 + }
  117 + }).fail(() => {
  118 + tip('操作失敗');
  119 + });
116 }); 120 });
117 } 121 }
118 } 122 }
@@ -73,8 +73,8 @@ @@ -73,8 +73,8 @@
73 <p>(现金:&yen;{{detail.returnAmountTotal}} - YOHO币:{{detail.returnYohoCoin}} - 优惠券:{{detail.returnCouponAmount}})</p> 73 <p>(现金:&yen;{{detail.returnAmountTotal}} - YOHO币:{{detail.returnYohoCoin}} - 优惠券:{{detail.returnCouponAmount}})</p>
74 </div> 74 </div>
75 <div class="exchange-type"> 75 <div class="exchange-type">
76 - <a href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>  
77 - </a> 76 + <span href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>
  77 + </span>
78 <div class="amount-modeinfo" v-if="detail.returnAmountModeInfo && detail.returnAmountModeInfo.length"> 78 <div class="amount-modeinfo" v-if="detail.returnAmountModeInfo && detail.returnAmountModeInfo.length">
79 <p v-if="detail.returnAmountModeInfo[0].bankName">银行 <span>{{detail.returnAmountModeInfo[0].bankName}}</span></p> 79 <p v-if="detail.returnAmountModeInfo[0].bankName">银行 <span>{{detail.returnAmountModeInfo[0].bankName}}</span></p>
80 <p v-if="detail.returnAmountModeInfo[0].bankCard">卡号 <span>{{detail.returnAmountModeInfo[0].bankCard}}</span></p> 80 <p v-if="detail.returnAmountModeInfo[0].bankCard">卡号 <span>{{detail.returnAmountModeInfo[0].bankCard}}</span></p>
@@ -91,8 +91,7 @@ @@ -91,8 +91,7 @@
91 <p>{{detail.province}}&nbsp;{{detail.city}}&nbsp;{{detail.county}} <br>{{detail.address}}</p> 91 <p>{{detail.province}}&nbsp;{{detail.city}}&nbsp;{{detail.county}} <br>{{detail.address}}</p>
92 </div> 92 </div>
93 <div class="exchange-type"> 93 <div class="exchange-type">
94 - <a href="" class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span>  
95 - </a> 94 + <span class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span></span>
96 </div> 95 </div>
97 </div> 96 </div>
98 <div class="exchange-order"> 97 <div class="exchange-order">
@@ -111,6 +110,7 @@ @@ -111,6 +110,7 @@
111 const tip = require('common/tip'); 110 const tip = require('common/tip');
112 const interceptClick = require('common/intercept-click'); 111 const interceptClick = require('common/intercept-click');
113 const yoho = require('yoho'); 112 const yoho = require('yoho');
  113 + const Modal = require('common/modal');
114 114
115 module.exports = { 115 module.exports = {
116 props: ['applyid', 'type'], 116 props: ['applyid', 'type'],
@@ -123,32 +123,33 @@ @@ -123,32 +123,33 @@
123 }, 123 },
124 methods: { 124 methods: {
125 cancel() { 125 cancel() {
126 - if (!this.id) {  
127 - return false;  
128 - }  
129 - 126 + let id = this.id;
130 let url = ''; 127 let url = '';
131 128
  129 + if (!id) {
  130 + return false;
  131 + }
132 if (this.type === 'refund') { 132 if (this.type === 'refund') {
133 url = '/me/return/refund/cancel-apply'; 133 url = '/me/return/refund/cancel-apply';
134 } else if (this.type === 'exchange') { 134 } else if (this.type === 'exchange') {
135 url = '/me/return/exchange/cancel-apply'; 135 url = '/me/return/exchange/cancel-apply';
136 } 136 }
137 137
138 - $.ajax({  
139 - method: 'POST',  
140 - url: url,  
141 - data: {  
142 - id: this.id,  
143 - }  
144 - }).then(data => {  
145 - if (data.code === 200) {  
146 - interceptClick.intercept('/me/return');  
147 - } else if (data.code === 400) {  
148 - tip(data.message);  
149 - } else {  
150 - tip('取消失败');  
151 - } 138 + Modal.confirm('', '取消后不能恢复,确认取消吗?', function() {
  139 + this.hide();
  140 + $.ajax({
  141 + method: 'POST',
  142 + url: url,
  143 + data: {
  144 + id: id,
  145 + }
  146 + }).then(data => {
  147 + if (data.code === 200) {
  148 + interceptClick.intercept('/me/return');
  149 + } else {
  150 + tip(data.message);
  151 + }
  152 + });
152 }); 153 });
153 } 154 }
154 }, 155 },