Showing
10 changed files
with
88 additions
and
116 deletions
@@ -55,33 +55,30 @@ | @@ -55,33 +55,30 @@ | ||
55 | }; | 55 | }; |
56 | }, | 56 | }, |
57 | methods: { | 57 | methods: { |
58 | - loadMore: function() { | ||
59 | - let _this = this; | ||
60 | - | 58 | + loadMore() { |
61 | this.busy = true; | 59 | this.busy = true; |
62 | $.ajax({ | 60 | $.ajax({ |
63 | url: '/me/collection/favpaging', | 61 | url: '/me/collection/favpaging', |
64 | data: { | 62 | data: { |
65 | - page: ++_this.page, | 63 | + page: ++this.page, |
66 | tab: 'brand' | 64 | tab: 'brand' |
67 | } | 65 | } |
68 | }).then(data => { | 66 | }).then(data => { |
69 | if ($.isEmptyObject(data) || data.pageTotal === 0) { | 67 | if ($.isEmptyObject(data) || data.pageTotal === 0) { |
70 | - _this.busy = true; | 68 | + this.busy = true; |
71 | } else { | 69 | } else { |
72 | - if (data.pageTotal && _this.page === data.pageTotal) { | ||
73 | - _this.busy = true; | 70 | + if (data.pageTotal && this.page === data.pageTotal) { |
71 | + this.busy = true; | ||
74 | } else { | 72 | } else { |
75 | - _this.busy = false; | 73 | + this.busy = false; |
76 | } | 74 | } |
77 | 75 | ||
78 | const list = data.brandList || []; | 76 | const list = data.brandList || []; |
79 | 77 | ||
80 | - list.forEach(function(o) { | ||
81 | - if (!_this.keys[o.brandId]) { | ||
82 | - _this.keys[o.brandId] = true; | ||
83 | - | ||
84 | - _this.brandData.push({ | 78 | + list.forEach(o => { |
79 | + if (!this.keys[o.brandId]) { | ||
80 | + this.keys[o.brandId] = true; | ||
81 | + this.brandData.push({ | ||
85 | fav_id: o.brandId, | 82 | fav_id: o.brandId, |
86 | link: o.brandDomain, | 83 | link: o.brandDomain, |
87 | imgUrl: o.brandIco, | 84 | imgUrl: o.brandIco, |
@@ -92,7 +89,7 @@ | @@ -92,7 +89,7 @@ | ||
92 | }); | 89 | }); |
93 | } | 90 | } |
94 | 91 | ||
95 | - _this.nullbox = _this.brandData.length ? 'hide' : ''; | 92 | + this.nullbox = this.brandData.length ? 'hide' : ''; |
96 | }).fail(() => { | 93 | }).fail(() => { |
97 | tip('网络错误'); | 94 | tip('网络错误'); |
98 | }); | 95 | }); |
@@ -108,15 +105,13 @@ | @@ -108,15 +105,13 @@ | ||
108 | this.pandata.objX = -width; | 105 | this.pandata.objX = -width; |
109 | }, | 106 | }, |
110 | hideDelBth() { | 107 | hideDelBth() { |
111 | - this.brandData.forEach(function(d) { | 108 | + this.brandData.forEach(d => { |
112 | $('#li-' + d.fav_id).css('transform', 'translateX(0px)'); | 109 | $('#li-' + d.fav_id).css('transform', 'translateX(0px)'); |
113 | $('#del-' + d.fav_id).addClass('hide'); | 110 | $('#del-' + d.fav_id).addClass('hide'); |
114 | }); | 111 | }); |
115 | this.pandata = {}; | 112 | this.pandata = {}; |
116 | }, | 113 | }, |
117 | delItem(index, id) { | 114 | delItem(index, id) { |
118 | - let _this = this; | ||
119 | - | ||
120 | $.ajax({ | 115 | $.ajax({ |
121 | method: 'POST', | 116 | method: 'POST', |
122 | url: '/me/del-favdel', | 117 | url: '/me/del-favdel', |
@@ -124,21 +119,21 @@ | @@ -124,21 +119,21 @@ | ||
124 | favId: id, | 119 | favId: id, |
125 | type: 'brand' | 120 | type: 'brand' |
126 | } | 121 | } |
127 | - }).then(function(data) { | 122 | + }).then(data => { |
128 | if (data.code === 200) { | 123 | if (data.code === 200) { |
129 | - _this.brandData.splice(index, 1); | ||
130 | - _this.hideDelBth(); | ||
131 | - delete _this.keys[id]; | 124 | + this.brandData.splice(index, 1); |
125 | + this.hideDelBth(); | ||
126 | + delete this.keys[id]; | ||
132 | } else if (data.code === 400) { | 127 | } else if (data.code === 400) { |
133 | tip(data.message); | 128 | tip(data.message); |
134 | } else { | 129 | } else { |
135 | tip('刪除收藏失败'); | 130 | tip('刪除收藏失败'); |
136 | } | 131 | } |
137 | - }).fail(function() { | 132 | + }).fail(() => { |
138 | tip('网络错误'); | 133 | tip('网络错误'); |
139 | }); | 134 | }); |
140 | }, | 135 | }, |
141 | - panstart: function(id) { | 136 | + panstart(id) { |
142 | event.preventDefault(); | 137 | event.preventDefault(); |
143 | if (this.editmodel && this.pandata.id !== id) { | 138 | if (this.editmodel && this.pandata.id !== id) { |
144 | return false; | 139 | return false; |
@@ -156,7 +151,7 @@ | @@ -156,7 +151,7 @@ | ||
156 | this.pandata.id = id; | 151 | this.pandata.id = id; |
157 | } | 152 | } |
158 | }, | 153 | }, |
159 | - panmove: function(id) { | 154 | + panmove(id) { |
160 | event.preventDefault(); | 155 | event.preventDefault(); |
161 | if (this.editmodel && this.pandata.id !== id) { | 156 | if (this.editmodel && this.pandata.id !== id) { |
162 | return false; | 157 | return false; |
@@ -183,7 +178,7 @@ | @@ -183,7 +178,7 @@ | ||
183 | li.css('transform', 'translateX(' + this.currentX + 'px)'); | 178 | li.css('transform', 'translateX(' + this.currentX + 'px)'); |
184 | } | 179 | } |
185 | }, | 180 | }, |
186 | - panend: function(id) { | 181 | + panend(id) { |
187 | event.preventDefault(); | 182 | event.preventDefault(); |
188 | if (this.editmodel && this.pandata.id !== id) { | 183 | if (this.editmodel && this.pandata.id !== id) { |
189 | return false; | 184 | return false; |
@@ -206,16 +201,15 @@ | @@ -206,16 +201,15 @@ | ||
206 | } | 201 | } |
207 | } | 202 | } |
208 | }, | 203 | }, |
209 | - created: function() { | ||
210 | - let _this = this; | ||
211 | - yoho.addNativeMethod('editModel', function() { | ||
212 | - _this.hideDelBth(); | ||
213 | - _this.editmodel = !_this.editmodel; | 204 | + created() { |
205 | + yoho.addNativeMethod('editModel', () => { | ||
206 | + this.hideDelBth(); | ||
207 | + this.editmodel = !this.editmodel; | ||
214 | 208 | ||
215 | let header = interceptClick.titleMap[5]; | 209 | let header = interceptClick.titleMap[5]; |
216 | 210 | ||
217 | header.defaultSelectedIndex = '1'; | 211 | header.defaultSelectedIndex = '1'; |
218 | - header.right.des = _this.editmodel ? '完成' : '编辑'; | 212 | + header.right.des = this.editmodel ? '完成' : '编辑'; |
219 | return yoho.goPageView({ | 213 | return yoho.goPageView({ |
220 | header: header | 214 | header: header |
221 | }); | 215 | }); |
@@ -60,34 +60,32 @@ | @@ -60,34 +60,32 @@ | ||
60 | }; | 60 | }; |
61 | }, | 61 | }, |
62 | methods: { | 62 | methods: { |
63 | - loadMore: function() { | ||
64 | - let _this = this; | ||
65 | - | 63 | + loadMore() { |
66 | this.busy = true; | 64 | this.busy = true; |
67 | $.ajax({ | 65 | $.ajax({ |
68 | url: '/me/collection/favpaging', | 66 | url: '/me/collection/favpaging', |
69 | data: { | 67 | data: { |
70 | - page: ++_this.page | 68 | + page: ++this.page |
71 | } | 69 | } |
72 | }).then(data => { | 70 | }).then(data => { |
73 | if ($.isEmptyObject(data) || data.pageTotal === 0) { | 71 | if ($.isEmptyObject(data) || data.pageTotal === 0) { |
74 | - _this.busy = true; | 72 | + this.busy = true; |
75 | } else { | 73 | } else { |
76 | - if (_this.page === data.pageTotal) { | ||
77 | - _this.busy = true; | 74 | + if (this.page === data.pageTotal) { |
75 | + this.busy = true; | ||
78 | } else { | 76 | } else { |
79 | - _this.busy = false; | 77 | + this.busy = false; |
80 | } | 78 | } |
81 | 79 | ||
82 | const list = data.productList || []; | 80 | const list = data.productList || []; |
83 | 81 | ||
84 | - list.forEach(function(o) { | 82 | + list.forEach(o => { |
85 | if (!o.productSkn) { | 83 | if (!o.productSkn) { |
86 | return; | 84 | return; |
87 | } | 85 | } |
88 | 86 | ||
89 | - if (!_this.keys[o.productId]) { | ||
90 | - _this.keys[o.productId] = true; | 87 | + if (!this.keys[o.productId]) { |
88 | + this.keys[o.productId] = true; | ||
91 | 89 | ||
92 | let discountPrice = false; | 90 | let discountPrice = false; |
93 | 91 | ||
@@ -95,7 +93,7 @@ | @@ -95,7 +93,7 @@ | ||
95 | discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2); | 93 | discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2); |
96 | } | 94 | } |
97 | 95 | ||
98 | - _this.productData.push({ | 96 | + this.productData.push({ |
99 | fav_id: o.productId, | 97 | fav_id: o.productId, |
100 | link: o.goodsId && o.cnAlphabet ? o.productId : '', | 98 | link: o.goodsId && o.cnAlphabet ? o.productId : '', |
101 | imgUrl: o.image, | 99 | imgUrl: o.image, |
@@ -109,7 +107,7 @@ | @@ -109,7 +107,7 @@ | ||
109 | }); | 107 | }); |
110 | } | 108 | } |
111 | 109 | ||
112 | - _this.nullbox = _this.productData.length ? 'hide' : ''; | 110 | + this.nullbox = this.productData.length ? 'hide' : ''; |
113 | }).fail(() => { | 111 | }).fail(() => { |
114 | tip('网络错误'); | 112 | tip('网络错误'); |
115 | }); | 113 | }); |
@@ -125,15 +123,13 @@ | @@ -125,15 +123,13 @@ | ||
125 | this.pandata.objX = -width; | 123 | this.pandata.objX = -width; |
126 | }, | 124 | }, |
127 | hideDelBth() { | 125 | hideDelBth() { |
128 | - this.productData.forEach(function(d) { | 126 | + this.productData.forEach(d => { |
129 | $('#li-' + d.fav_id).css('transform', 'translateX(0px)'); | 127 | $('#li-' + d.fav_id).css('transform', 'translateX(0px)'); |
130 | $('#del-' + d.fav_id).addClass('hide'); | 128 | $('#del-' + d.fav_id).addClass('hide'); |
131 | }); | 129 | }); |
132 | this.pandata = {}; | 130 | this.pandata = {}; |
133 | }, | 131 | }, |
134 | delItem(index, id) { | 132 | delItem(index, id) { |
135 | - let _this = this; | ||
136 | - | ||
137 | $.ajax({ | 133 | $.ajax({ |
138 | method: 'POST', | 134 | method: 'POST', |
139 | url: '/me/del-favdel', | 135 | url: '/me/del-favdel', |
@@ -141,21 +137,21 @@ | @@ -141,21 +137,21 @@ | ||
141 | favId: id, | 137 | favId: id, |
142 | type: 'product' | 138 | type: 'product' |
143 | } | 139 | } |
144 | - }).then(function(data) { | 140 | + }).then(data => { |
145 | if (data.code === 200) { | 141 | if (data.code === 200) { |
146 | - _this.productData.splice(index, 1); | ||
147 | - _this.hideDelBth(); | ||
148 | - delete _this.keys[id]; | 142 | + this.productData.splice(index, 1); |
143 | + this.hideDelBth(); | ||
144 | + delete this.keys[id]; | ||
149 | } else if (data.code === 400) { | 145 | } else if (data.code === 400) { |
150 | tip(data.message); | 146 | tip(data.message); |
151 | } else { | 147 | } else { |
152 | tip('刪除收藏失败'); | 148 | tip('刪除收藏失败'); |
153 | } | 149 | } |
154 | - }).fail(function() { | 150 | + }).fail(() => { |
155 | tip('网络错误'); | 151 | tip('网络错误'); |
156 | }); | 152 | }); |
157 | }, | 153 | }, |
158 | - panstart: function(id) { | 154 | + panstart(id) { |
159 | event.preventDefault(); | 155 | event.preventDefault(); |
160 | if (this.editmodel && this.pandata.id !== id) { | 156 | if (this.editmodel && this.pandata.id !== id) { |
161 | return false; | 157 | return false; |
@@ -173,7 +169,7 @@ | @@ -173,7 +169,7 @@ | ||
173 | this.pandata.id = id; | 169 | this.pandata.id = id; |
174 | } | 170 | } |
175 | }, | 171 | }, |
176 | - panmove: function(id) { | 172 | + panmove(id) { |
177 | event.preventDefault(); | 173 | event.preventDefault(); |
178 | if (this.editmodel && this.pandata.id !== id) { | 174 | if (this.editmodel && this.pandata.id !== id) { |
179 | return false; | 175 | return false; |
@@ -200,7 +196,7 @@ | @@ -200,7 +196,7 @@ | ||
200 | li.css('transform', 'translateX(' + this.currentX + 'px)'); | 196 | li.css('transform', 'translateX(' + this.currentX + 'px)'); |
201 | } | 197 | } |
202 | }, | 198 | }, |
203 | - panend: function(id) { | 199 | + panend(id) { |
204 | event.preventDefault(); | 200 | event.preventDefault(); |
205 | if (this.editmodel && this.pandata.id !== id) { | 201 | if (this.editmodel && this.pandata.id !== id) { |
206 | return false; | 202 | return false; |
@@ -223,17 +219,15 @@ | @@ -223,17 +219,15 @@ | ||
223 | } | 219 | } |
224 | } | 220 | } |
225 | }, | 221 | }, |
226 | - created: function() { | ||
227 | - let _this = this; | ||
228 | - | ||
229 | - yoho.addNativeMethod('editModel', function() { | ||
230 | - _this.hideDelBth(); | ||
231 | - _this.editmodel = !_this.editmodel; | 222 | + created() { |
223 | + yoho.addNativeMethod('editModel', () => { | ||
224 | + this.hideDelBth(); | ||
225 | + this.editmodel = !this.editmodel; | ||
232 | 226 | ||
233 | let header = interceptClick.titleMap[5]; | 227 | let header = interceptClick.titleMap[5]; |
234 | 228 | ||
235 | header.defaultSelectedIndex = '0'; | 229 | header.defaultSelectedIndex = '0'; |
236 | - header.right.des = _this.editmodel ? '完成' : '编辑'; | 230 | + header.right.des = this.editmodel ? '完成' : '编辑'; |
237 | return yoho.goPageView({ | 231 | return yoho.goPageView({ |
238 | header: header | 232 | header: header |
239 | }); | 233 | }); |
@@ -71,12 +71,10 @@ | @@ -71,12 +71,10 @@ | ||
71 | }); | 71 | }); |
72 | }, | 72 | }, |
73 | setAender: function() { | 73 | setAender: function() { |
74 | - let _this = this; | ||
75 | - | ||
76 | - genderSel.show(function(item) { | ||
77 | - _this.gender = item.val.toLowerCase(); | ||
78 | - _this.saveDetails({ | ||
79 | - nickname: _this.nickname, | 74 | + genderSel.show(item => { |
75 | + this.gender = item.val.toLowerCase(); | ||
76 | + this.saveDetails({ | ||
77 | + nickname: this.nickname, | ||
80 | gender: item.key | 78 | gender: item.key |
81 | }); | 79 | }); |
82 | }); | 80 | }); |
@@ -127,13 +127,11 @@ | @@ -127,13 +127,11 @@ | ||
127 | }); | 127 | }); |
128 | }, | 128 | }, |
129 | getCancelReason() { | 129 | getCancelReason() { |
130 | - let that = this; | ||
131 | - | ||
132 | $.ajax({ | 130 | $.ajax({ |
133 | url: '/me/getCancelOrderReason', | 131 | url: '/me/getCancelOrderReason', |
134 | }).then(result => { | 132 | }).then(result => { |
135 | if (result.data.length > 0) { | 133 | if (result.data.length > 0) { |
136 | - that.options = result.data; | 134 | + this.options = result.data; |
137 | } | 135 | } |
138 | }).fail(() => { | 136 | }).fail(() => { |
139 | tip('操作失败'); | 137 | tip('操作失败'); |
@@ -151,10 +149,8 @@ | @@ -151,10 +149,8 @@ | ||
151 | }; | 149 | }; |
152 | }, | 150 | }, |
153 | autoCancel(code) { | 151 | autoCancel(code) { |
154 | - let _that = this; | ||
155 | - | ||
156 | return () => { | 152 | return () => { |
157 | - _that.orderDetail().cancel({orderCode: code}, (result) => { | 153 | + this.orderDetail().cancel({orderCode: code}, (result) => { |
158 | if (result.code === 200) { | 154 | if (result.code === 200) { |
159 | location.reload(); | 155 | location.reload(); |
160 | } | 156 | } |
@@ -211,7 +207,7 @@ | @@ -211,7 +207,7 @@ | ||
211 | yohoAPI.goPay({orderid: code}); | 207 | yohoAPI.goPay({orderid: code}); |
212 | }, | 208 | }, |
213 | applyRefund() { | 209 | applyRefund() { |
214 | - genderSel.show(function(item) { | 210 | + genderSel.show(item => { |
215 | if (item.url) { | 211 | if (item.url) { |
216 | interceptClick.intercept(item.url); | 212 | interceptClick.intercept(item.url); |
217 | } | 213 | } |
@@ -85,8 +85,6 @@ | @@ -85,8 +85,6 @@ | ||
85 | 85 | ||
86 | methods: { | 86 | methods: { |
87 | getOrderData() { | 87 | getOrderData() { |
88 | - let _that = this; | ||
89 | - | ||
90 | this.busy = true; | 88 | this.busy = true; |
91 | if (this.page >= this.pageTotal) { | 89 | if (this.page >= this.pageTotal) { |
92 | return; | 90 | return; |
@@ -100,15 +98,15 @@ | @@ -100,15 +98,15 @@ | ||
100 | } | 98 | } |
101 | }).then(result => { | 99 | }).then(result => { |
102 | if (result.code === 200) { | 100 | if (result.code === 200) { |
103 | - _that.busy = false; | 101 | + this.busy = false; |
104 | if (result.data.orderList.length > 0) { | 102 | if (result.data.orderList.length > 0) { |
105 | - this.$set('orderList', _that.orderList.concat(result.data.orderList)); | ||
106 | - _that.pageTotal = result.data.pageTotal; | 103 | + this.$set('orderList', this.orderList.concat(result.data.orderList)); |
104 | + this.pageTotal = result.data.pageTotal; | ||
107 | } | 105 | } |
108 | } | 106 | } |
109 | 107 | ||
110 | - if (_that.orderList.length === 0) { | ||
111 | - _that.emptybox = ''; | 108 | + if (this.orderList.length === 0) { |
109 | + this.emptybox = ''; | ||
112 | } | 110 | } |
113 | }).fail(() => { | 111 | }).fail(() => { |
114 | tip('网络错误'); | 112 | tip('网络错误'); |
@@ -129,23 +127,19 @@ | @@ -129,23 +127,19 @@ | ||
129 | }); | 127 | }); |
130 | }, | 128 | }, |
131 | getCancelReason() { | 129 | getCancelReason() { |
132 | - let that = this; | ||
133 | - | ||
134 | $.ajax({ | 130 | $.ajax({ |
135 | url: '/me/getCancelOrderReason', | 131 | url: '/me/getCancelOrderReason', |
136 | }).then(result => { | 132 | }).then(result => { |
137 | if (result.data.length > 0) { | 133 | if (result.data.length > 0) { |
138 | - that.options = result.data; | 134 | + this.options = result.data; |
139 | } | 135 | } |
140 | }).fail(() => { | 136 | }).fail(() => { |
141 | tip('操作失败'); | 137 | tip('操作失败'); |
142 | }); | 138 | }); |
143 | }, | 139 | }, |
144 | autoCancel(code) { | 140 | autoCancel(code) { |
145 | - let _that = this; | ||
146 | - | ||
147 | return () => { | 141 | return () => { |
148 | - _that.order().cancel({orderCode: code}, (result) => { | 142 | + this.order().cancel({orderCode: code}, (result) => { |
149 | if (result.code === 200) { | 143 | if (result.code === 200) { |
150 | location.reload(); | 144 | location.reload(); |
151 | } | 145 | } |
@@ -173,7 +167,7 @@ | @@ -173,7 +167,7 @@ | ||
173 | }); | 167 | }); |
174 | }, | 168 | }, |
175 | deleteOrder(order, index) { | 169 | deleteOrder(order, index) { |
176 | - let that = this; | 170 | + let _that = this; |
177 | 171 | ||
178 | Modal.confirm('', '确认删除订单?', function() { | 172 | Modal.confirm('', '确认删除订单?', function() { |
179 | this.hide(); | 173 | this.hide(); |
@@ -185,7 +179,7 @@ | @@ -185,7 +179,7 @@ | ||
185 | } | 179 | } |
186 | }).then(result => { | 180 | }).then(result => { |
187 | if (result.code === 200) { | 181 | if (result.code === 200) { |
188 | - that.orderList.splice(index, 1); | 182 | + _that.orderList.splice(index, 1); |
189 | } else { | 183 | } else { |
190 | tip(result.message); | 184 | tip(result.message); |
191 | } | 185 | } |
@@ -66,8 +66,6 @@ | @@ -66,8 +66,6 @@ | ||
66 | 66 | ||
67 | methods: { | 67 | methods: { |
68 | getOrderData() { | 68 | getOrderData() { |
69 | - let _that = this; | ||
70 | - | ||
71 | this.busy = true; | 69 | this.busy = true; |
72 | if (this.page >= this.pageTotal) { | 70 | if (this.page >= this.pageTotal) { |
73 | return; | 71 | return; |
@@ -79,14 +77,14 @@ | @@ -79,14 +77,14 @@ | ||
79 | limit: this.limit | 77 | limit: this.limit |
80 | } | 78 | } |
81 | }).then(result => { | 79 | }).then(result => { |
82 | - _that.busy = false; | 80 | + this.busy = false; |
83 | if (result.data.list.length > 0) { | 81 | if (result.data.list.length > 0) { |
84 | - this.$set('orderList', _that.orderList.concat(result.data.list)); | ||
85 | - _that.pageTotal = result.data.totalPage; | 82 | + this.$set('orderList', this.orderList.concat(result.data.list)); |
83 | + this.pageTotal = result.data.totalPage; | ||
86 | } | 84 | } |
87 | 85 | ||
88 | - if (_that.orderList.length === 0) { | ||
89 | - _that.emptybox = ''; | 86 | + if (this.orderList.length === 0) { |
87 | + this.emptybox = ''; | ||
90 | } | 88 | } |
91 | }).fail(() => { | 89 | }).fail(() => { |
92 | tip('网络错误'); | 90 | tip('网络错误'); |
@@ -121,7 +121,7 @@ | @@ -121,7 +121,7 @@ | ||
121 | }; | 121 | }; |
122 | }, | 122 | }, |
123 | methods: { | 123 | methods: { |
124 | - cancel: function() { | 124 | + cancel() { |
125 | if (!this.detail || !this.orderCode) { | 125 | if (!this.detail || !this.orderCode) { |
126 | return false; | 126 | return false; |
127 | } | 127 | } |
@@ -140,7 +140,7 @@ | @@ -140,7 +140,7 @@ | ||
140 | data: { | 140 | data: { |
141 | id: this.orderCode, | 141 | id: this.orderCode, |
142 | } | 142 | } |
143 | - }).then(function(data) { | 143 | + }).then(data => { |
144 | if (data.code === 200) { | 144 | if (data.code === 200) { |
145 | interceptClick.intercept('/me/return'); | 145 | interceptClick.intercept('/me/return'); |
146 | } else if (data.code === 400) { | 146 | } else if (data.code === 400) { |
@@ -151,9 +151,7 @@ | @@ -151,9 +151,7 @@ | ||
151 | }); | 151 | }); |
152 | } | 152 | } |
153 | }, | 153 | }, |
154 | - created: function() { | ||
155 | - let _this = this; | ||
156 | - | 154 | + created() { |
157 | $.ajax({ | 155 | $.ajax({ |
158 | url: '/me/return/status-detail', | 156 | url: '/me/return/status-detail', |
159 | data: { | 157 | data: { |
@@ -162,19 +160,19 @@ | @@ -162,19 +160,19 @@ | ||
162 | } | 160 | } |
163 | }).then(res => { | 161 | }).then(res => { |
164 | if (res.data) { | 162 | if (res.data) { |
165 | - _this.detail = res.data; | ||
166 | - if (!_this.detail.goodsList) { | 163 | + this.detail = res.data; |
164 | + if (!this.detail.goodsList) { | ||
167 | return; | 165 | return; |
168 | } | 166 | } |
169 | 167 | ||
170 | if (this.type === 'refund') { | 168 | if (this.type === 'refund') { |
171 | - _this.orderCode = _this.detail.sourceOrderCode; | 169 | + this.orderCode = this.detail.sourceOrderCode; |
172 | } else if (this.type === 'exchange') { | 170 | } else if (this.type === 'exchange') { |
173 | - _this.orderCode = _this.detail.orderCode; | 171 | + this.orderCode = this.detail.orderCode; |
174 | } | 172 | } |
175 | 173 | ||
176 | - _this.detail.goodsList.forEach(function(d) { | ||
177 | - d.evidenceImages = d.evidenceImages.map(function(p) { | 174 | + this.detail.goodsList.forEach(d => { |
175 | + d.evidenceImages = d.evidenceImages.map(p => { | ||
178 | return util.getImgHost(p) + '?imageView2/2/w/154/h/154'; | 176 | return util.getImgHost(p) + '?imageView2/2/w/154/h/154'; |
179 | }) | 177 | }) |
180 | }); | 178 | }); |
@@ -185,5 +183,5 @@ | @@ -185,5 +183,5 @@ | ||
185 | </script> | 183 | </script> |
186 | 184 | ||
187 | <style> | 185 | <style> |
188 | - @import "../../../scss/me/_status.css"; | 186 | + @import "../../scss/me/_status.css"; |
189 | </style> | 187 | </style> |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | indexList | 29 | indexList |
30 | }, | 30 | }, |
31 | methods: { | 31 | methods: { |
32 | - search: function() { | 32 | + search() { |
33 | let inputname = this.inputname; | 33 | let inputname = this.inputname; |
34 | 34 | ||
35 | if (!inputname) { | 35 | if (!inputname) { |
@@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
40 | let filter = {}; | 40 | let filter = {}; |
41 | 41 | ||
42 | for (let k in this.company_list) { | 42 | for (let k in this.company_list) { |
43 | - this.company_list[k].forEach(function(d) { | 43 | + this.company_list[k].forEach(d => { |
44 | if (d.company_name.indexOf(inputname) > -1) { | 44 | if (d.company_name.indexOf(inputname) > -1) { |
45 | if (!filter[k]) { | 45 | if (!filter[k]) { |
46 | filter[k] = []; | 46 | filter[k] = []; |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | } | 51 | } |
52 | this.showData = filter; | 52 | this.showData = filter; |
53 | }, | 53 | }, |
54 | - select: function(companyId, companyName) { | 54 | + select(companyId, companyName) { |
55 | this.$dispatch('changeView', { | 55 | this.$dispatch('changeView', { |
56 | view: 'logistics', | 56 | view: 'logistics', |
57 | company_id: companyId, | 57 | company_id: companyId, |
@@ -27,12 +27,12 @@ | @@ -27,12 +27,12 @@ | ||
27 | }; | 27 | }; |
28 | }, | 28 | }, |
29 | methods: { | 29 | methods: { |
30 | - companylist: function() { | 30 | + companylist() { |
31 | this.$dispatch('changeView', { | 31 | this.$dispatch('changeView', { |
32 | view: 'logisticsCompany' | 32 | view: 'logisticsCompany' |
33 | }); | 33 | }); |
34 | }, | 34 | }, |
35 | - submit: function() { | 35 | + submit() { |
36 | if (!this.company_name) { | 36 | if (!this.company_name) { |
37 | tip('请选择快递公司'); | 37 | tip('请选择快递公司'); |
38 | return false; | 38 | return false; |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | expressCompany: this.company_name, | 51 | expressCompany: this.company_name, |
52 | expressNumber: this.num | 52 | expressNumber: this.num |
53 | } | 53 | } |
54 | - }).then(function(res) { | 54 | + }).then(res => { |
55 | if ($.type(res) !== 'object') { | 55 | if ($.type(res) !== 'object') { |
56 | res = {}; | 56 | res = {}; |
57 | } | 57 | } |
-
Please register or login to post a comment