Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop
Showing
8 changed files
with
157 additions
and
422 deletions
@@ -2,15 +2,12 @@ | @@ -2,15 +2,12 @@ | ||
2 | /* eslint-disable space-before-function-paren */ | 2 | /* eslint-disable space-before-function-paren */ |
3 | import { orderActionsMap, ownType } from 'constants/order-constants'; | 3 | import { orderActionsMap, ownType } from 'constants/order-constants'; |
4 | import { createNamespacedHelpers } from 'vuex'; | 4 | import { createNamespacedHelpers } from 'vuex'; |
5 | -import DialogConfirmInfo from '../../components/dialog-confirm-info'; | ||
6 | -import DialogChangeBidPrice from '../../components/dialog-change-bid-price'; | 5 | +import DialogConfirmInfo from '../components/dialog-confirm-info'; |
6 | +import DialogChangeBidPrice from '../components/dialog-change-bid-price'; | ||
7 | 7 | ||
8 | const { mapActions, mapMutations, mapState } = createNamespacedHelpers( | 8 | const { mapActions, mapMutations, mapState } = createNamespacedHelpers( |
9 | 'order/orderList', | 9 | 'order/orderList', |
10 | ); | 10 | ); |
11 | -const { mapMutations: inSaleMapMutations } = createNamespacedHelpers( | ||
12 | - 'order/inSaleOrderList', | ||
13 | -); | ||
14 | 11 | ||
15 | export default { | 12 | export default { |
16 | computed: { | 13 | computed: { |
@@ -25,16 +22,15 @@ export default { | @@ -25,16 +22,15 @@ export default { | ||
25 | 'confirmChangePrice', | 22 | 'confirmChangePrice', |
26 | ]), | 23 | ]), |
27 | ...mapMutations(['filterOrderList', 'resetData']), | 24 | ...mapMutations(['filterOrderList', 'resetData']), |
28 | - ...inSaleMapMutations(['filterInSaleOrderList']), | ||
29 | 25 | ||
30 | - // 订单列表 | ||
31 | - async onAction({ action, order }) { | 26 | + async onAction({ action, order, isDetail = false } = {}) { |
32 | const { owner = ownType.SELL } = this.$route.params; | 27 | const { owner = ownType.SELL } = this.$route.params; |
33 | const { | 28 | const { |
34 | orderCode, | 29 | orderCode, |
35 | realPrice = '', | 30 | realPrice = '', |
36 | bidDepositInfo = {}, | 31 | bidDepositInfo = {}, |
37 | goodsInfo = {}, | 32 | goodsInfo = {}, |
33 | + priceInfo = {}, | ||
38 | } = order; | 34 | } = order; |
39 | 35 | ||
40 | switch (action.name) { | 36 | switch (action.name) { |
@@ -50,8 +46,12 @@ export default { | @@ -50,8 +46,12 @@ export default { | ||
50 | }); | 46 | }); |
51 | 47 | ||
52 | if (isOk) { | 48 | if (isOk) { |
49 | + if (isDetail) { | ||
50 | + this.$router.back(); | ||
51 | + } else { | ||
53 | this.filterOrderList(orderCode); | 52 | this.filterOrderList(orderCode); |
54 | } | 53 | } |
54 | + } | ||
55 | const txt = isOk ? '删除成功' : '删除失败'; | 55 | const txt = isOk ? '删除成功' : '删除失败'; |
56 | 56 | ||
57 | this.$createToast({ txt, type: 'txt' }).show(); | 57 | this.$createToast({ txt, type: 'txt' }).show(); |
@@ -68,9 +68,14 @@ export default { | @@ -68,9 +68,14 @@ export default { | ||
68 | if (Array.isArray(confirmInfo)) { | 68 | if (Array.isArray(confirmInfo)) { |
69 | confirmInfo = { confirmDesc: '确定取消求购' }; | 69 | confirmInfo = { confirmDesc: '确定取消求购' }; |
70 | } | 70 | } |
71 | + | ||
72 | + const confirmBtnText = confirmInfo.needPenalty | ||
73 | + ? '赔付并取消订单' | ||
74 | + : '取消订单'; | ||
75 | + | ||
71 | this.$createConfirmDialog( | 76 | this.$createConfirmDialog( |
72 | { | 77 | { |
73 | - confirmBtn: { text: '取消订单', style: { color: '#D0021B' } }, | 78 | + confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } }, |
74 | cancelBtn: { text: '保留订单', active: true }, | 79 | cancelBtn: { text: '保留订单', active: true }, |
75 | onConfirm: async () => { | 80 | onConfirm: async () => { |
76 | const isOk = await this.cancelTrade({ | 81 | const isOk = await this.cancelTrade({ |
@@ -79,9 +84,13 @@ export default { | @@ -79,9 +84,13 @@ export default { | ||
79 | }); | 84 | }); |
80 | 85 | ||
81 | if (isOk) { | 86 | if (isOk) { |
87 | + if (isDetail) { | ||
88 | + this.fetchOrderDetail(this.$route.params); | ||
89 | + } else { | ||
82 | this.resetData(); | 90 | this.resetData(); |
83 | this.fetchData(this.$route.params); | 91 | this.fetchData(this.$route.params); |
84 | } | 92 | } |
93 | + } | ||
85 | const txt = isOk ? '取消成功' : '取消失败'; | 94 | const txt = isOk ? '取消成功' : '取消失败'; |
86 | 95 | ||
87 | this.$createToast({ txt, type: 'txt' }).show(); | 96 | this.$createToast({ txt, type: 'txt' }).show(); |
@@ -100,15 +109,23 @@ export default { | @@ -100,15 +109,23 @@ export default { | ||
100 | } | 109 | } |
101 | 110 | ||
102 | case orderActionsMap.NOW_BUY.name: { | 111 | case orderActionsMap.NOW_BUY.name: { |
112 | + let price = realPrice, | ||
113 | + pageBackName = 'OrderList'; | ||
114 | + | ||
115 | + if (isDetail) { | ||
116 | + price = priceInfo.realPayPrice; | ||
117 | + pageBackName = 'buyOrderDetail'; | ||
118 | + } | ||
103 | this.$createOrderPayType({ | 119 | this.$createOrderPayType({ |
104 | orderCode, | 120 | orderCode, |
105 | - price: parseFloat(realPrice), | 121 | + price: parseFloat(price || ''), |
106 | desc: '', | 122 | desc: '', |
107 | extra: JSON.stringify({ | 123 | extra: JSON.stringify({ |
108 | - forward: { | ||
109 | - name: 'OrderList', | 124 | + back: { |
125 | + name: pageBackName, | ||
110 | params: { | 126 | params: { |
111 | - owner: 'buy', | 127 | + owner, |
128 | + orderCode, | ||
112 | }, | 129 | }, |
113 | }, | 130 | }, |
114 | }), | 131 | }), |
@@ -145,12 +162,13 @@ export default { | @@ -145,12 +162,13 @@ export default { | ||
145 | }); | 162 | }); |
146 | 163 | ||
147 | if (isOk) { | 164 | if (isOk) { |
165 | + if (isDetail) { | ||
166 | + this.fetchOrderDetail(this.$route.params); | ||
167 | + } else { | ||
148 | this.resetData(); | 168 | this.resetData(); |
149 | this.fetchData(this.$route.params); | 169 | this.fetchData(this.$route.params); |
150 | } | 170 | } |
151 | - | ||
152 | - // const txt = isOk ? "收货成功" : "收货失败"; | ||
153 | - // this.$createToast({ txt, type: "txt" }).show(); | 171 | + } |
154 | }, | 172 | }, |
155 | }).show(); | 173 | }).show(); |
156 | break; | 174 | break; |
@@ -187,9 +205,13 @@ export default { | @@ -187,9 +205,13 @@ export default { | ||
187 | }); | 205 | }); |
188 | 206 | ||
189 | if (isOk) { | 207 | if (isOk) { |
208 | + if (isDetail) { | ||
209 | + this.fetchOrderDetail(this.$route.params); | ||
210 | + } else { | ||
190 | this.resetData(); | 211 | this.resetData(); |
191 | this.fetchData(this.$route.params); | 212 | this.fetchData(this.$route.params); |
192 | } | 213 | } |
214 | + } | ||
193 | }, | 215 | }, |
194 | }, | 216 | }, |
195 | createElement => { | 217 | createElement => { |
@@ -207,111 +229,6 @@ export default { | @@ -207,111 +229,6 @@ export default { | ||
207 | ).show(); | 229 | ).show(); |
208 | break; | 230 | break; |
209 | } | 231 | } |
210 | - case orderActionsMap.NOT_SOLD.name: { | ||
211 | - const confirmInfo = await this.cancelTradeConfirmInfo({ | ||
212 | - orderCode, | ||
213 | - owner, | ||
214 | - }); | ||
215 | - | ||
216 | - const confirmBtnText = confirmInfo.needPenalty | ||
217 | - ? '赔付并取消订单' | ||
218 | - : '不卖了'; | ||
219 | - | ||
220 | - this.$createConfirmDialog( | ||
221 | - { | ||
222 | - confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } }, | ||
223 | - cancelBtn: { text: '继续出售', active: true }, | ||
224 | - onConfirm: async () => { | ||
225 | - const isOk = await this.cancelTrade({ | ||
226 | - orderCode, | ||
227 | - owner, | ||
228 | - }); | ||
229 | - | ||
230 | - if (isOk) { | ||
231 | - this.resetData(); | ||
232 | - this.fetchData(this.$route.params); | ||
233 | - } | ||
234 | - | ||
235 | - // const txt = isOk ? "取消成功" : "取消失败"; | ||
236 | - // this.$createToast({ txt, type: "txt" }).show(); | ||
237 | - }, | ||
238 | - }, | ||
239 | - createElement => { | ||
240 | - return [ | ||
241 | - createElement(DialogConfirmInfo, { | ||
242 | - props: { info: confirmInfo }, | ||
243 | - slot: 'content', | ||
244 | - }), | ||
245 | - ]; | ||
246 | - }, | ||
247 | - ).show(); | ||
248 | - break; | ||
249 | - } | ||
250 | - default: | ||
251 | - return; | ||
252 | - } | ||
253 | - }, | ||
254 | - | ||
255 | - // 出售中订单列表 | ||
256 | - async onInsaleOrderAction({ action, order }) { | ||
257 | - const { owner = ownType.SELL } = this.$route.params; | ||
258 | - const { orderCode, earnestMoney = 0 } = order; | ||
259 | - | ||
260 | - switch (action.name) { | ||
261 | - case orderActionsMap.NOT_SOLD.name: { | ||
262 | - const confirmInfo = await this.cancelTradeConfirmInfo({ | ||
263 | - orderCode, | ||
264 | - owner, | ||
265 | - }); | ||
266 | - | ||
267 | - const confirmBtnText = confirmInfo.needPenalty | ||
268 | - ? '赔付并取消订单' | ||
269 | - : '不卖了'; | ||
270 | - | ||
271 | - this.$createConfirmDialog( | ||
272 | - { | ||
273 | - confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } }, | ||
274 | - cancelBtn: { text: '继续出售', active: true }, | ||
275 | - onConfirm: async () => { | ||
276 | - const isOk = await this.cancelTrade({ | ||
277 | - orderCode, | ||
278 | - owner, | ||
279 | - }); | ||
280 | - | ||
281 | - if (isOk) { | ||
282 | - this.filterInSaleOrderList(orderCode); | ||
283 | - } | ||
284 | - | ||
285 | - // const txt = isOk ? "取消成功" : "取消失败"; | ||
286 | - // this.$createToast({ txt, type: "txt" }).show(); | ||
287 | - }, | ||
288 | - }, | ||
289 | - createElement => { | ||
290 | - return [ | ||
291 | - createElement(DialogConfirmInfo, { | ||
292 | - props: { info: confirmInfo }, | ||
293 | - slot: 'content', | ||
294 | - }), | ||
295 | - ]; | ||
296 | - }, | ||
297 | - ).show(); | ||
298 | - break; | ||
299 | - } | ||
300 | - case orderActionsMap.PAY_EARNESTMONEY.name: { | ||
301 | - this.$createOrderPayType({ | ||
302 | - orderCode, | ||
303 | - price: earnestMoney, | ||
304 | - desc: '保证金', | ||
305 | - | ||
306 | - // 支付成功会跳route | ||
307 | - extra: JSON.stringify({ | ||
308 | - forward: { | ||
309 | - name: 'InSaleOrderList', | ||
310 | - }, | ||
311 | - }), | ||
312 | - }).show(); | ||
313 | - break; | ||
314 | - } | ||
315 | default: | 232 | default: |
316 | return; | 233 | return; |
317 | } | 234 | } |
apps/pages/order/mixin/order-sell.js
0 → 100644
1 | +/* eslint-disable operator-linebreak */ | ||
2 | +/* eslint-disable space-before-function-paren */ | ||
3 | +import { orderActionsMap, ownType } from 'constants/order-constants'; | ||
4 | +import { createNamespacedHelpers } from 'vuex'; | ||
5 | +import DialogConfirmInfo from '../components/dialog-confirm-info'; | ||
6 | + | ||
7 | +const { mapActions } = createNamespacedHelpers('order/orderList'); | ||
8 | +const { mapMutations: inSaleMapMutations } = createNamespacedHelpers( | ||
9 | + 'order/inSaleOrderList', | ||
10 | +); | ||
11 | + | ||
12 | +export default { | ||
13 | + methods: { | ||
14 | + ...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']), | ||
15 | + ...inSaleMapMutations(['filterInSaleOrderList']), | ||
16 | + async onSaleOrderAction({ action, order, isDetail = false } = {}) { | ||
17 | + const { owner = ownType.SELL } = this.$route.params; | ||
18 | + const { orderCode, earnestMoney = 0 } = order; | ||
19 | + | ||
20 | + switch (action.name) { | ||
21 | + case orderActionsMap.NOT_SOLD.name: { | ||
22 | + const confirmInfo = await this.cancelTradeConfirmInfo({ | ||
23 | + orderCode, | ||
24 | + owner, | ||
25 | + }); | ||
26 | + | ||
27 | + const confirmBtnText = confirmInfo.needPenalty | ||
28 | + ? '赔付并取消订单' | ||
29 | + : '不卖了'; | ||
30 | + | ||
31 | + this.$createConfirmDialog( | ||
32 | + { | ||
33 | + confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } }, | ||
34 | + cancelBtn: { text: '继续出售', active: true }, | ||
35 | + onConfirm: async () => { | ||
36 | + const isOk = await this.cancelTrade({ | ||
37 | + orderCode, | ||
38 | + owner, | ||
39 | + }); | ||
40 | + | ||
41 | + if (isOk) { | ||
42 | + if (isDetail) { | ||
43 | + this.fetchOrderDetail(this.$route.params); | ||
44 | + } else { | ||
45 | + this.filterInSaleOrderList(orderCode); | ||
46 | + } | ||
47 | + } | ||
48 | + }, | ||
49 | + }, | ||
50 | + createElement => { | ||
51 | + return [ | ||
52 | + createElement(DialogConfirmInfo, { | ||
53 | + props: { info: confirmInfo }, | ||
54 | + slot: 'content', | ||
55 | + }), | ||
56 | + ]; | ||
57 | + }, | ||
58 | + ).show(); | ||
59 | + break; | ||
60 | + } | ||
61 | + case orderActionsMap.PAY_EARNESTMONEY.name: { | ||
62 | + const pageBackName = isDetail ? 'sellOrderDetail' : 'InSaleOrderList'; | ||
63 | + | ||
64 | + this.$createOrderPayType({ | ||
65 | + orderCode, | ||
66 | + price: earnestMoney, | ||
67 | + desc: '保证金', | ||
68 | + | ||
69 | + // 支付成功会跳route | ||
70 | + extra: JSON.stringify({ | ||
71 | + forward: { | ||
72 | + name: pageBackName, | ||
73 | + }, | ||
74 | + }), | ||
75 | + }).show(); | ||
76 | + break; | ||
77 | + } | ||
78 | + default: | ||
79 | + return; | ||
80 | + } | ||
81 | + }, | ||
82 | + }, | ||
83 | +}; |
@@ -25,7 +25,11 @@ | @@ -25,7 +25,11 @@ | ||
25 | <!-- 商品信息 --> | 25 | <!-- 商品信息 --> |
26 | <order-item-info class="item-wrapper" /> | 26 | <order-item-info class="item-wrapper" /> |
27 | <!-- 鉴定视频 --> | 27 | <!-- 鉴定视频 --> |
28 | - <div class="video-img" v-if="orderDetail.appraiseVideoUrl" @click="() => onVideoHandler()"></div> | 28 | + <div |
29 | + class="video-img" | ||
30 | + v-if="orderDetail.appraiseVideoUrl" | ||
31 | + @click="() => onVideoHandler()" | ||
32 | + ></div> | ||
29 | <div ref="videoWrapper" class="video-wrapper"> | 33 | <div ref="videoWrapper" class="video-wrapper"> |
30 | <VideoPlayer | 34 | <VideoPlayer |
31 | ref="videoPlayer" | 35 | ref="videoPlayer" |
@@ -114,7 +118,7 @@ | @@ -114,7 +118,7 @@ | ||
114 | class="detail-actions" | 118 | class="detail-actions" |
115 | :order="orderDetail" | 119 | :order="orderDetail" |
116 | @on-action=" | 120 | @on-action=" |
117 | - action => onBuyerOrderAction({ action, order: orderDetail }) | 121 | + action => onAction({ action, order: orderDetail, isDetail: true }) |
118 | " | 122 | " |
119 | /> | 123 | /> |
120 | </div> | 124 | </div> |
@@ -135,7 +139,7 @@ import DetailFooter from "./components//detail-footer"; | @@ -135,7 +139,7 @@ import DetailFooter from "./components//detail-footer"; | ||
135 | import OrderActions from "../components/order-actions"; | 139 | import OrderActions from "../components/order-actions"; |
136 | import VideoPlayer from "../order-list/components/video-player"; | 140 | import VideoPlayer from "../order-list/components/video-player"; |
137 | 141 | ||
138 | -import orderActionMixin from "./mixins/order-action"; | 142 | +import orderBuyActionMixin from "../mixin/order-buy"; |
139 | 143 | ||
140 | const STORE_PATH = "order/orderDetail"; | 144 | const STORE_PATH = "order/orderDetail"; |
141 | 145 | ||
@@ -144,7 +148,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | @@ -144,7 +148,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | ||
144 | ); | 148 | ); |
145 | 149 | ||
146 | export default { | 150 | export default { |
147 | - mixins: [orderActionMixin], | 151 | + mixins: [orderBuyActionMixin], |
148 | components: { | 152 | components: { |
149 | AddressInfo, | 153 | AddressInfo, |
150 | OrderItemInfo, | 154 | OrderItemInfo, |
@@ -55,6 +55,10 @@ export default { | @@ -55,6 +55,10 @@ export default { | ||
55 | ...mapGetters(["userAddress", "appraiseAddress"]) | 55 | ...mapGetters(["userAddress", "appraiseAddress"]) |
56 | }, | 56 | }, |
57 | activated() { | 57 | activated() { |
58 | + this.$nextTick(() => { | ||
59 | + if (!this.$refs.copy) { | ||
60 | + return; | ||
61 | + } | ||
58 | this.copyBtn = new Clipboard(this.$refs.copy, { | 62 | this.copyBtn = new Clipboard(this.$refs.copy, { |
59 | text: () => { | 63 | text: () => { |
60 | const { addressName, address, mobile } = this.appraiseAddress; | 64 | const { addressName, address, mobile } = this.appraiseAddress; |
@@ -67,6 +71,7 @@ export default { | @@ -67,6 +71,7 @@ export default { | ||
67 | type: "txt" | 71 | type: "txt" |
68 | }).show(); | 72 | }).show(); |
69 | }); | 73 | }); |
74 | + }); | ||
70 | } | 75 | } |
71 | }; | 76 | }; |
72 | </script> | 77 | </script> |
1 | -/* eslint-disable operator-linebreak */ | ||
2 | -/* eslint-disable space-before-function-paren */ | ||
3 | -import { createNamespacedHelpers } from 'vuex'; | ||
4 | -const { mapActions, mapState } = createNamespacedHelpers('order/orderList'); | ||
5 | - | ||
6 | -import { orderActionsMap, ownType } from 'constants/order-constants'; | ||
7 | -import DialogConfirmInfo from '../../components/dialog-confirm-info'; | ||
8 | -import DialogChangeBidPrice from '../../components/dialog-change-bid-price'; | ||
9 | - | ||
10 | -export default { | ||
11 | - data() { | ||
12 | - return { | ||
13 | - isMixin: true, | ||
14 | - }; | ||
15 | - }, | ||
16 | - computed: { | ||
17 | - ...mapState(['changePrice']), | ||
18 | - }, | ||
19 | - methods: { | ||
20 | - ...mapActions([ | ||
21 | - 'cancelTradeConfirmInfo', | ||
22 | - 'cancelTrade', | ||
23 | - 'deleteOrder', | ||
24 | - 'computeChangePrice', | ||
25 | - 'confirmChangePrice', | ||
26 | - ]), | ||
27 | - async onSellerOrderAction({ action, order }) { | ||
28 | - const { owner = ownType.SELL } = this.$route.params; | ||
29 | - const { orderCode, earnestMoney } = order; | ||
30 | - | ||
31 | - switch (action.name) { | ||
32 | - case orderActionsMap.DEL_ORDER.name: { | ||
33 | - this.deleteOrderConfirmDialog({ orderCode, owner }); | ||
34 | - break; | ||
35 | - } | ||
36 | - case orderActionsMap.NOT_SOLD.name: { | ||
37 | - const confirmInfo = await this.cancelTradeConfirmInfo({ | ||
38 | - orderCode, | ||
39 | - owner, | ||
40 | - }); | ||
41 | - | ||
42 | - const confirmBtnText = confirmInfo.needPenalty | ||
43 | - ? '赔付并取消订单' | ||
44 | - : '不卖了'; | ||
45 | - | ||
46 | - this.$createConfirmDialog( | ||
47 | - { | ||
48 | - confirmBtn: { | ||
49 | - text: confirmBtnText, | ||
50 | - style: { color: '#D0021B' }, | ||
51 | - }, | ||
52 | - cancelBtn: { text: '继续出售', active: true }, | ||
53 | - onConfirm: async () => { | ||
54 | - const isOk = await this.cancelTrade({ | ||
55 | - orderCode, | ||
56 | - owner, | ||
57 | - }); | ||
58 | - | ||
59 | - if (isOk) { | ||
60 | - this.fetchOrderDetail(this.$route.params); | ||
61 | - } | ||
62 | - | ||
63 | - // const txt = isOk ? "取消成功" : "取消失败"; | ||
64 | - // this.$createToast({ txt, type: "txt" }).show(); | ||
65 | - }, | ||
66 | - }, | ||
67 | - createElement => { | ||
68 | - return [ | ||
69 | - createElement(DialogConfirmInfo, { | ||
70 | - props: { info: confirmInfo }, | ||
71 | - slot: 'content', | ||
72 | - }), | ||
73 | - ]; | ||
74 | - }, | ||
75 | - ).show(); | ||
76 | - break; | ||
77 | - } | ||
78 | - | ||
79 | - case orderActionsMap.PAY_EARNESTMONEY.name: { | ||
80 | - this.$createOrderPayType({ | ||
81 | - orderCode, | ||
82 | - price: earnestMoney, | ||
83 | - desc: '保证金', | ||
84 | - | ||
85 | - // 支付成功会跳route | ||
86 | - extra: JSON.stringify({ | ||
87 | - back: { | ||
88 | - name: 'sellOrderDetail', | ||
89 | - params: { owner, orderCode }, | ||
90 | - }, | ||
91 | - }), | ||
92 | - }).show(); | ||
93 | - break; | ||
94 | - } | ||
95 | - | ||
96 | - default: | ||
97 | - return; | ||
98 | - } | ||
99 | - }, | ||
100 | - async onBuyerOrderAction({ action, order }) { | ||
101 | - const { owner = ownType.SELL } = this.$route.params; | ||
102 | - const { | ||
103 | - orderCode, | ||
104 | - priceInfo = {}, | ||
105 | - bidDepositInfo = {}, | ||
106 | - goodsInfo, | ||
107 | - } = order; | ||
108 | - | ||
109 | - switch (action.name) { | ||
110 | - case orderActionsMap.DEL_ORDER.name: { | ||
111 | - this.deleteOrderConfirmDialog({ orderCode, owner }); | ||
112 | - break; | ||
113 | - } | ||
114 | - case orderActionsMap.PAY_DEPOSIT.name: { | ||
115 | - this.$createOrderPayType({ | ||
116 | - orderCode, | ||
117 | - price: parseFloat(bidDepositInfo.depositAmount), | ||
118 | - desc: '支付定金', | ||
119 | - extra: JSON.stringify({ | ||
120 | - forward: { | ||
121 | - name: 'OrderList', | ||
122 | - params: { | ||
123 | - owner: 'buy', | ||
124 | - }, | ||
125 | - }, | ||
126 | - }), | ||
127 | - }).show(); | ||
128 | - break; | ||
129 | - } | ||
130 | - | ||
131 | - case orderActionsMap.CHANGE_BID_PRICE.name: { | ||
132 | - const { goodPrice } = goodsInfo; | ||
133 | - const computePriceInfo = await this.computeChangePrice({ | ||
134 | - orderCode, | ||
135 | - price: goodPrice, | ||
136 | - }); | ||
137 | - | ||
138 | - if (typeof computePriceInfo === 'string') { | ||
139 | - this.$createToast({ | ||
140 | - type: 'alert', | ||
141 | - txt: computePriceInfo, | ||
142 | - mask: true, | ||
143 | - }).show(); | ||
144 | - return; | ||
145 | - } | ||
146 | - | ||
147 | - this.$createDialog( | ||
148 | - { | ||
149 | - type: 'prompt', | ||
150 | - confirmBtn: { text: '调整求购价' }, | ||
151 | - cancelBtn: { active: true }, | ||
152 | - onConfirm: async () => { | ||
153 | - if (!this.changePrice) { | ||
154 | - return; | ||
155 | - } | ||
156 | - const isOk = await this.confirmChangePrice({ | ||
157 | - price: this.changePrice, | ||
158 | - orderCode, | ||
159 | - }); | ||
160 | - | ||
161 | - if (isOk) { | ||
162 | - this.fetchOrderDetail(this.$route.params); | ||
163 | - } | ||
164 | - }, | ||
165 | - }, | ||
166 | - createElement => { | ||
167 | - return [ | ||
168 | - createElement(DialogChangeBidPrice, { | ||
169 | - props: { | ||
170 | - computePriceInfo, | ||
171 | - goodsInfo, | ||
172 | - orderCode, | ||
173 | - }, | ||
174 | - slot: 'content', | ||
175 | - }), | ||
176 | - ]; | ||
177 | - }, | ||
178 | - ).show(); | ||
179 | - break; | ||
180 | - } | ||
181 | - case orderActionsMap.CANCEL_ORDER.name: { | ||
182 | - let confirmInfo = await this.cancelTradeConfirmInfo({ | ||
183 | - orderCode, | ||
184 | - owner, | ||
185 | - }); | ||
186 | - | ||
187 | - if (Array.isArray(confirmInfo)) { | ||
188 | - confirmInfo = { confirmDesc: '确定取消求购' }; | ||
189 | - } | ||
190 | - | ||
191 | - this.$createConfirmDialog( | ||
192 | - { | ||
193 | - confirmBtn: { text: '取消订单', style: { color: '#D0021B' } }, | ||
194 | - cancelBtn: { text: '保留订单', active: true }, | ||
195 | - onConfirm: async () => { | ||
196 | - const isOk = await this.cancelTrade({ | ||
197 | - orderCode, | ||
198 | - owner, | ||
199 | - }); | ||
200 | - | ||
201 | - if (isOk) { | ||
202 | - this.fetchOrderDetail(this.$route.params); | ||
203 | - } | ||
204 | - const txt = isOk ? '取消成功' : '取消失败'; | ||
205 | - | ||
206 | - this.$createToast({ txt, type: 'txt' }).show(); | ||
207 | - }, | ||
208 | - }, | ||
209 | - createElement => { | ||
210 | - return [ | ||
211 | - createElement(DialogConfirmInfo, { | ||
212 | - props: { info: confirmInfo }, | ||
213 | - slot: 'content', | ||
214 | - }), | ||
215 | - ]; | ||
216 | - }, | ||
217 | - ).show(); | ||
218 | - break; | ||
219 | - } | ||
220 | - | ||
221 | - case orderActionsMap.NOW_BUY.name: { | ||
222 | - this.$createOrderPayType({ | ||
223 | - orderCode, | ||
224 | - price: parseFloat(priceInfo.realPayPrice || ''), | ||
225 | - desc: '', | ||
226 | - extra: JSON.stringify({ | ||
227 | - back: { | ||
228 | - name: 'buyOrderDetail', | ||
229 | - params: { | ||
230 | - owner, | ||
231 | - orderCode, | ||
232 | - }, | ||
233 | - }, | ||
234 | - }), | ||
235 | - }).show(); | ||
236 | - break; | ||
237 | - } | ||
238 | - | ||
239 | - case orderActionsMap.CONFIRM_DELIVERY.name: { | ||
240 | - this.$createConfirmDialog({ | ||
241 | - content: '确认收货?', | ||
242 | - confirmBtn: { style: { color: '#D0021B' } }, | ||
243 | - cancelBtn: { active: true }, | ||
244 | - onConfirm: async () => { | ||
245 | - const isOk = await this.confirmReceipt({ | ||
246 | - orderCode, | ||
247 | - owner, | ||
248 | - }); | ||
249 | - | ||
250 | - if (isOk) { | ||
251 | - this.fetchOrderDetail(this.$route.params); | ||
252 | - } | ||
253 | - | ||
254 | - // const txt = isOk ? "收货成功" : "收货失败"; | ||
255 | - // this.$createToast({ txt, type: "txt" }).show(); | ||
256 | - }, | ||
257 | - }).show(); | ||
258 | - break; | ||
259 | - } | ||
260 | - default: | ||
261 | - return; | ||
262 | - } | ||
263 | - }, | ||
264 | - | ||
265 | - // 删除订单 | ||
266 | - deleteOrderConfirmDialog({ orderCode, owner }) { | ||
267 | - this.$createConfirmDialog({ | ||
268 | - type: 'confirm', | ||
269 | - content: '确认删除订单?', | ||
270 | - confirmBtn: { style: { color: '#D0021B' } }, | ||
271 | - onConfirm: async () => { | ||
272 | - const isOk = await this.deleteOrder({ | ||
273 | - orderCode, | ||
274 | - owner, | ||
275 | - }); | ||
276 | - | ||
277 | - if (isOk) { | ||
278 | - this.$router.back(); | ||
279 | - } | ||
280 | - | ||
281 | - // const txt = isOk ? "删除成功" : "删除失败"; | ||
282 | - // this.$createToast({ txt, type: "txt" }).show(); | ||
283 | - }, | ||
284 | - }).show(); | ||
285 | - }, | ||
286 | - }, | ||
287 | -}; |
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | <p class="delivery-fee"> | 35 | <p class="delivery-fee"> |
36 | <span class="label" | 36 | <span class="label" |
37 | >银行转账费({{ | 37 | >银行转账费({{ |
38 | - parseInt(platformFee.payChannelPercentage || 0) | 38 | + parseInt(platformFee.goodsPaymentRatePercent || 0) |
39 | }}%):</span | 39 | }}%):</span |
40 | > | 40 | > |
41 | <span>{{ orderDetail.bankTransferFee }}</span> | 41 | <span>{{ orderDetail.bankTransferFee }}</span> |
@@ -78,7 +78,10 @@ | @@ -78,7 +78,10 @@ | ||
78 | class="detail-actions" | 78 | class="detail-actions" |
79 | :order="orderDetail" | 79 | :order="orderDetail" |
80 | @on-action=" | 80 | @on-action=" |
81 | - action => onSellerOrderAction({ action, order: orderDetail }) | 81 | + action => { |
82 | + onSaleOrderAction({ action, order: orderDetail, isDetail: true }); | ||
83 | + onAction({ action, order: orderDetail, isDetail: true }); | ||
84 | + } | ||
82 | " | 85 | " |
83 | /> | 86 | /> |
84 | </div> | 87 | </div> |
@@ -98,7 +101,9 @@ import DetailFooter from "./components//detail-footer"; | @@ -98,7 +101,9 @@ import DetailFooter from "./components//detail-footer"; | ||
98 | 101 | ||
99 | import OrderActions from "../components/order-actions"; | 102 | import OrderActions from "../components/order-actions"; |
100 | 103 | ||
101 | -import orderActionMixin from "./mixins/order-action"; | 104 | +import orderBuyActionMixin from "../mixin/order-buy"; |
105 | +import orderSellActionMixin from "../mixin/order-sell"; | ||
106 | + | ||
102 | import PlatformFeeInfo from "../components/platform-fee-info"; | 107 | import PlatformFeeInfo from "../components/platform-fee-info"; |
103 | 108 | ||
104 | const STORE_PATH = "order/orderDetail"; | 109 | const STORE_PATH = "order/orderDetail"; |
@@ -108,7 +113,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | @@ -108,7 +113,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | ||
108 | ); | 113 | ); |
109 | 114 | ||
110 | export default { | 115 | export default { |
111 | - mixins: [orderActionMixin], | 116 | + mixins: [orderBuyActionMixin, orderSellActionMixin], |
112 | components: { | 117 | components: { |
113 | AddressInfo, | 118 | AddressInfo, |
114 | OrderItemInfo, | 119 | OrderItemInfo, |
@@ -121,6 +126,7 @@ export default { | @@ -121,6 +126,7 @@ export default { | ||
121 | return store.dispatch(`${STORE_PATH}/fetchOrderDetail`, router.params); | 126 | return store.dispatch(`${STORE_PATH}/fetchOrderDetail`, router.params); |
122 | }, | 127 | }, |
123 | activated() { | 128 | activated() { |
129 | + this.$nextTick(() => { | ||
124 | this.copyBtn = new Clipboard(this.$refs.copy, { | 130 | this.copyBtn = new Clipboard(this.$refs.copy, { |
125 | text: () => { | 131 | text: () => { |
126 | return this.orderDetail.orderCode; | 132 | return this.orderDetail.orderCode; |
@@ -132,6 +138,7 @@ export default { | @@ -132,6 +138,7 @@ export default { | ||
132 | type: "txt" | 138 | type: "txt" |
133 | }).show(); | 139 | }).show(); |
134 | }); | 140 | }); |
141 | + }); | ||
135 | }, | 142 | }, |
136 | computed: { | 143 | computed: { |
137 | ...mapState(["orderDetail"]), | 144 | ...mapState(["orderDetail"]), |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <order-actions | 17 | <order-actions |
18 | class="actions" | 18 | class="actions" |
19 | :order="order" | 19 | :order="order" |
20 | - @on-action="action => onInsaleOrderAction({ action, order })" | 20 | + @on-action="action => onSaleOrderAction({ action, order })" |
21 | /> | 21 | /> |
22 | </div> | 22 | </div> |
23 | </li> | 23 | </li> |
@@ -43,7 +43,7 @@ import EmptyList from "components//ufo-no-item"; | @@ -43,7 +43,7 @@ import EmptyList from "components//ufo-no-item"; | ||
43 | import OrderActions from "../components/order-actions"; | 43 | import OrderActions from "../components/order-actions"; |
44 | import CountDown from "../components/count-down"; | 44 | import CountDown from "../components/count-down"; |
45 | 45 | ||
46 | -import orderActionMixin from "./mixins/order-action"; | 46 | +import orderSellActionMixin from "../mixin/order-sell"; |
47 | 47 | ||
48 | const IN_SALE_STORE_PATH = "order/inSaleOrderList"; | 48 | const IN_SALE_STORE_PATH = "order/inSaleOrderList"; |
49 | 49 | ||
@@ -56,7 +56,7 @@ const { | @@ -56,7 +56,7 @@ const { | ||
56 | 56 | ||
57 | export default { | 57 | export default { |
58 | // 订单操作 | 58 | // 订单操作 |
59 | - mixins: [orderActionMixin], | 59 | + mixins: [orderSellActionMixin], |
60 | components: { | 60 | components: { |
61 | Scroll, | 61 | Scroll, |
62 | OrderItem, | 62 | OrderItem, |
@@ -20,7 +20,12 @@ | @@ -20,7 +20,12 @@ | ||
20 | class="actions" | 20 | class="actions" |
21 | pageName="list" | 21 | pageName="list" |
22 | :order="order" | 22 | :order="order" |
23 | - @on-action="action => onAction({ action, order })" | 23 | + @on-action=" |
24 | + action => { | ||
25 | + onAction({ action, order }); | ||
26 | + onSaleOrderAction({ action, order }); | ||
27 | + } | ||
28 | + " | ||
24 | @on-video="params => onVideoHandle(params)" | 29 | @on-video="params => onVideoHandle(params)" |
25 | /> | 30 | /> |
26 | </div> | 31 | </div> |
@@ -58,7 +63,8 @@ import EmptyList from "components//ufo-no-item"; | @@ -58,7 +63,8 @@ import EmptyList from "components//ufo-no-item"; | ||
58 | import OrderActions from "../components/order-actions"; | 63 | import OrderActions from "../components/order-actions"; |
59 | import CountDown from "../components/count-down"; | 64 | import CountDown from "../components/count-down"; |
60 | 65 | ||
61 | -import orderActionMixin from "./mixins/order-action"; | 66 | +import orderBuyActionMixin from "../mixin/order-buy"; |
67 | +import orderSellActionMixin from "../mixin/order-sell"; | ||
62 | 68 | ||
63 | const STORE_PATH = "order/orderList"; | 69 | const STORE_PATH = "order/orderList"; |
64 | 70 | ||
@@ -66,7 +72,7 @@ const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH); | @@ -66,7 +72,7 @@ const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH); | ||
66 | 72 | ||
67 | export default { | 73 | export default { |
68 | // 订单操作 | 74 | // 订单操作 |
69 | - mixins: [orderActionMixin], | 75 | + mixins: [orderBuyActionMixin, orderSellActionMixin], |
70 | components: { | 76 | components: { |
71 | Scroll, | 77 | Scroll, |
72 | OrderItem, | 78 | OrderItem, |
-
Please register or login to post a comment