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,6 +100,8 @@ @@ -99,6 +100,8 @@
99 * @param type refundType 1为退货,2为换货 100 * @param type refundType 1为退货,2为换货
100 */ 101 */
101 cancelApply(id, type) { 102 cancelApply(id, type) {
  103 + Modal.confirm('', '取消后不能恢复,确认取消吗?', function() {
  104 + this.hide();
102 $.ajax({ 105 $.ajax({
103 url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply', 106 url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
104 type: 'post', 107 type: 'post',
@@ -114,6 +117,7 @@ @@ -114,6 +117,7 @@
114 }).fail(() => { 117 }).fail(() => {
115 tip('操作失敗'); 118 tip('操作失敗');
116 }); 119 });
  120 + });
117 } 121 }
118 } 122 }
119 }; 123 };
@@ -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,33 +123,34 @@ @@ -123,33 +123,34 @@
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 + Modal.confirm('', '取消后不能恢复,确认取消吗?', function() {
  139 + this.hide();
138 $.ajax({ 140 $.ajax({
139 method: 'POST', 141 method: 'POST',
140 url: url, 142 url: url,
141 data: { 143 data: {
142 - id: this.id, 144 + id: id,
143 } 145 }
144 }).then(data => { 146 }).then(data => {
145 if (data.code === 200) { 147 if (data.code === 200) {
146 interceptClick.intercept('/me/return'); 148 interceptClick.intercept('/me/return');
147 - } else if (data.code === 400) {  
148 - tip(data.message);  
149 } else { 149 } else {
150 - tip('取消失败'); 150 + tip(data.message);
151 } 151 }
152 }); 152 });
  153 + });
153 } 154 }
154 }, 155 },
155 created() { 156 created() {