Showing
8 changed files
with
54 additions
and
55 deletions
@@ -7,7 +7,10 @@ | @@ -7,7 +7,10 @@ | ||
7 | <p class="status-desc">{{ statusDetail.detailDesc }}</p> | 7 | <p class="status-desc">{{ statusDetail.detailDesc }}</p> |
8 | </div> | 8 | </div> |
9 | <!-- 物流信息 --> | 9 | <!-- 物流信息 --> |
10 | - <router-link :to="{ name: 'orderLogisticsInfo', params: $route.params }"> | 10 | + <router-link |
11 | + v-if="lastExpressInfo" | ||
12 | + :to="{ name: 'orderLogisticsInfo', params: $route.params }" | ||
13 | + > | ||
11 | <div class="logistics-info item-wrapper"> | 14 | <div class="logistics-info item-wrapper"> |
12 | <div class="content"> | 15 | <div class="content"> |
13 | <i class="logistics-icon"></i> | 16 | <i class="logistics-icon"></i> |
@@ -56,9 +59,7 @@ | @@ -56,9 +59,7 @@ | ||
56 | </div> | 59 | </div> |
57 | <!-- 操作 --> | 60 | <!-- 操作 --> |
58 | <div v-if="actionList.length" class="actions"> | 61 | <div v-if="actionList.length" class="actions"> |
59 | - <Button v-for="actionInfo in actionList" :key="actionInfo.code">{{ | ||
60 | - actionInfo.text | ||
61 | - }}</Button> | 62 | + <order-actions class="detail-actions" :order="orderDetail" /> |
62 | </div> | 63 | </div> |
63 | </div> | 64 | </div> |
64 | </template> | 65 | </template> |
@@ -68,6 +69,7 @@ import { createNamespacedHelpers } from "vuex"; | @@ -68,6 +69,7 @@ import { createNamespacedHelpers } from "vuex"; | ||
68 | import AddressInfo from "./components/address-info"; | 69 | import AddressInfo from "./components/address-info"; |
69 | import OrderItemInfo from "./components/order-detail-item"; | 70 | import OrderItemInfo from "./components/order-detail-item"; |
70 | import { Button } from "cube-ui"; | 71 | import { Button } from "cube-ui"; |
72 | +import OrderActions from "../components/order-actions"; | ||
71 | 73 | ||
72 | const { mapActions, mapState, mapGetters } = createNamespacedHelpers( | 74 | const { mapActions, mapState, mapGetters } = createNamespacedHelpers( |
73 | "order/orderDetail" | 75 | "order/orderDetail" |
@@ -76,7 +78,8 @@ export default { | @@ -76,7 +78,8 @@ export default { | ||
76 | components: { | 78 | components: { |
77 | AddressInfo, | 79 | AddressInfo, |
78 | OrderItemInfo, | 80 | OrderItemInfo, |
79 | - Button | 81 | + Button, |
82 | + OrderActions | ||
80 | }, | 83 | }, |
81 | asyncData({ store, router }) { | 84 | asyncData({ store, router }) { |
82 | // store.dispatch("order/orderDetail/fetchOrderDetail", router.params); | 85 | // store.dispatch("order/orderDetail/fetchOrderDetail", router.params); |
@@ -115,6 +118,8 @@ export default { | @@ -115,6 +118,8 @@ export default { | ||
115 | } | 118 | } |
116 | 119 | ||
117 | .status-info { | 120 | .status-info { |
121 | + margin-bottom: 40px; | ||
122 | + | ||
118 | .status { | 123 | .status { |
119 | font-size: 68px; | 124 | font-size: 68px; |
120 | color: #000; | 125 | color: #000; |
@@ -131,7 +136,6 @@ export default { | @@ -131,7 +136,6 @@ export default { | ||
131 | } | 136 | } |
132 | 137 | ||
133 | .logistics-info { | 138 | .logistics-info { |
134 | - margin-top: 40px; | ||
135 | display: flex; | 139 | display: flex; |
136 | align-items: center; | 140 | align-items: center; |
137 | justify-content: space-between; | 141 | justify-content: space-between; |
@@ -212,24 +216,8 @@ export default { | @@ -212,24 +216,8 @@ export default { | ||
212 | padding: 20px; | 216 | padding: 20px; |
213 | z-index: 10; | 217 | z-index: 10; |
214 | 218 | ||
215 | - button { | ||
216 | - font-size: 24px; | ||
217 | - padding: 24px 64px 22px 64px; | ||
218 | - color: #999; | ||
219 | - letter-spacing: 0; | ||
220 | - border-radius: 0; | ||
221 | - background: #fff; | ||
222 | - border: 1px solid #ccc; | ||
223 | - line-height: 1.3; | ||
224 | - width: 224px; | ||
225 | - margin-right: 20px; | ||
226 | - } | ||
227 | - | ||
228 | - & :last-child { | ||
229 | - background: #002b47; | ||
230 | - color: #fff; | ||
231 | - border: 1px solid #002b47; | ||
232 | - margin-right: 0; | 219 | + .detail-actions { |
220 | + margin-top: 0; | ||
233 | } | 221 | } |
234 | } | 222 | } |
235 | } | 223 | } |
@@ -48,16 +48,11 @@ export default { | @@ -48,16 +48,11 @@ export default { | ||
48 | } | 48 | } |
49 | }, | 49 | }, |
50 | methods: { | 50 | methods: { |
51 | - ...mapMutations(["setOrderStatus"]), | 51 | + ...mapMutations(["setOrderStatus", "resetOrderData"]), |
52 | ...mapActions(["fetchOrderList"]), | 52 | ...mapActions(["fetchOrderList"]), |
53 | onHandleClick(status) { | 53 | onHandleClick(status) { |
54 | this.setOrderStatus(status); | 54 | this.setOrderStatus(status); |
55 | - // const { owner } = this.$route.params; | ||
56 | - // this.$router.push({ name: "OrderList", params: { owner, status } }); | ||
57 | - } | ||
58 | - }, | ||
59 | - watch: { | ||
60 | - currentStatus(status) { | 55 | + this.resetOrderData(); |
61 | const { owner } = this.$route.params; | 56 | const { owner } = this.$route.params; |
62 | this.fetchOrderList({ owner, status }); | 57 | this.fetchOrderList({ owner, status }); |
63 | } | 58 | } |
@@ -27,7 +27,9 @@ import StatusNav from "./components/status-nav"; | @@ -27,7 +27,9 @@ import StatusNav from "./components/status-nav"; | ||
27 | import Modal from "../components/confirm/modal"; | 27 | import Modal from "../components/confirm/modal"; |
28 | import OrderActions from "../components/order-actions"; | 28 | import OrderActions from "../components/order-actions"; |
29 | 29 | ||
30 | -const { mapActions, mapState } = createNamespacedHelpers("order/orderList"); | 30 | +const { mapActions, mapState, mapMutations } = createNamespacedHelpers( |
31 | + "order/orderList" | ||
32 | +); | ||
31 | 33 | ||
32 | export default { | 34 | export default { |
33 | components: { | 35 | components: { |
@@ -54,10 +56,15 @@ export default { | @@ -54,10 +56,15 @@ export default { | ||
54 | }, | 56 | }, |
55 | mounted() { | 57 | mounted() { |
56 | const { params } = this.$route; | 58 | const { params } = this.$route; |
59 | + const { status } = params; | ||
60 | + if (status) { | ||
61 | + this.setOrderStatus(status); | ||
62 | + } | ||
57 | this.fetchOrderList(params); | 63 | this.fetchOrderList(params); |
58 | }, | 64 | }, |
59 | methods: { | 65 | methods: { |
60 | ...mapActions(["fetchOrderList"]), | 66 | ...mapActions(["fetchOrderList"]), |
67 | + ...mapMutations(["setOrderStatus"]), | ||
61 | fetchMore() { | 68 | fetchMore() { |
62 | this.fetchOrderList(this.$route.params); | 69 | this.fetchOrderList(this.$route.params); |
63 | } | 70 | } |
@@ -12,7 +12,7 @@ export default function() { | @@ -12,7 +12,7 @@ export default function() { | ||
12 | getters: { | 12 | getters: { |
13 | userAddress: state => state.orderDetail.userAddress || {}, // 用户使用地址 | 13 | userAddress: state => state.orderDetail.userAddress || {}, // 用户使用地址 |
14 | statusDetail: state => state.orderDetail.statusDetail || {}, // 订单状态 | 14 | statusDetail: state => state.orderDetail.statusDetail || {}, // 订单状态 |
15 | - lastExpressInfo: state => state.orderDetail.lastExpressInfo || {}, // 物流信息 | 15 | + lastExpressInfo: state => state.orderDetail.lastExpressInfo || null, // 物流信息 |
16 | goodsInfo: state => state.orderDetail.goodsInfo || {}, // 商品信息 | 16 | goodsInfo: state => state.orderDetail.goodsInfo || {}, // 商品信息 |
17 | priceInfo: state => state.orderDetail.priceInfo || {}, // 价格信息 | 17 | priceInfo: state => state.orderDetail.priceInfo || {}, // 价格信息 |
18 | actionList: state => state.orderDetail.buttons || {}, // 允许操作 | 18 | actionList: state => state.orderDetail.buttons || {}, // 允许操作 |
@@ -36,11 +36,13 @@ export default function() { | @@ -36,11 +36,13 @@ export default function() { | ||
36 | ); | 36 | ); |
37 | }, | 37 | }, |
38 | setOrderStatus(state, currentStatus) { | 38 | setOrderStatus(state, currentStatus) { |
39 | + state.currentStatus = +currentStatus; | ||
40 | + }, | ||
41 | + resetOrderData(state) { | ||
39 | state.page = 1; | 42 | state.page = 1; |
40 | state.orderList = []; | 43 | state.orderList = []; |
41 | state.pagetotal = 0; | 44 | state.pagetotal = 0; |
42 | state.pullUpLoad = true; | 45 | state.pullUpLoad = true; |
43 | - state.currentStatus = +currentStatus; | ||
44 | }, | 46 | }, |
45 | }, | 47 | }, |
46 | actions: { | 48 | actions: { |
@@ -12,25 +12,22 @@ function resolve(dir) { | @@ -12,25 +12,22 @@ function resolve(dir) { | ||
12 | return path.join(__dirname, '..', dir); | 12 | return path.join(__dirname, '..', dir); |
13 | } | 13 | } |
14 | 14 | ||
15 | - | ||
16 | const webpackConfig = { | 15 | const webpackConfig = { |
17 | mode: isProd ? 'production' : 'development', | 16 | mode: isProd ? 'production' : 'development', |
18 | output: { | 17 | output: { |
19 | filename: 'static/js/[name].[chunkhash].js', | 18 | filename: 'static/js/[name].[chunkhash].js', |
20 | path: distDir, | 19 | path: distDir, |
21 | chunkFilename: 'static/js/[name].[chunkhash].js', | 20 | chunkFilename: 'static/js/[name].[chunkhash].js', |
22 | - publicPath: isProd ? '//cdn.yoho.cn/xianyu-ufo-app-web/' : '/' | 21 | + publicPath: isProd ? '//cdn.yoho.cn/xianyu-ufo-app-web/' : '/', |
23 | }, | 22 | }, |
23 | + devtool: isProd ? 'source-map' : 'cheap-module-eval-source-map', | ||
24 | resolve: { | 24 | resolve: { |
25 | extensions: ['.js', '.vue', '.json'], | 25 | extensions: ['.js', '.vue', '.json'], |
26 | alias: { | 26 | alias: { |
27 | vue$: 'vue/dist/vue.runtime.esm.js', | 27 | vue$: 'vue/dist/vue.runtime.esm.js', |
28 | - 'lottie-web': 'lottie-web/build/player/lottie_light.min.js' | 28 | + 'lottie-web': 'lottie-web/build/player/lottie_light.min.js', |
29 | }, | 29 | }, |
30 | - modules: [ | ||
31 | - path.join(__dirname, '../apps'), | ||
32 | - 'node_modules' | ||
33 | - ] | 30 | + modules: [path.join(__dirname, '../apps'), 'node_modules'], |
34 | }, | 31 | }, |
35 | module: { | 32 | module: { |
36 | rules: [ | 33 | rules: [ |
@@ -40,20 +37,20 @@ const webpackConfig = { | @@ -40,20 +37,20 @@ const webpackConfig = { | ||
40 | loader: 'vue-loader', | 37 | loader: 'vue-loader', |
41 | options: { | 38 | options: { |
42 | extractCSS: isProd, | 39 | extractCSS: isProd, |
43 | - } | 40 | + }, |
44 | }, | 41 | }, |
45 | }, | 42 | }, |
46 | { | 43 | { |
47 | resourceQuery: /blockType=client/, | 44 | resourceQuery: /blockType=client/, |
48 | use: 'babel-loader', | 45 | use: 'babel-loader', |
49 | - exclude: /node_modules/ | 46 | + exclude: /node_modules/, |
50 | }, | 47 | }, |
51 | { | 48 | { |
52 | test: /\.js$/, | 49 | test: /\.js$/, |
53 | use: 'babel-loader', | 50 | use: 'babel-loader', |
54 | - include: [resolve('apps'), /cube-ui/] | 51 | + include: [resolve('apps'), /cube-ui/], |
55 | }, | 52 | }, |
56 | - ] | 53 | + ], |
57 | }, | 54 | }, |
58 | plugins: [ | 55 | plugins: [ |
59 | new webpack.HashedModuleIdsPlugin(), | 56 | new webpack.HashedModuleIdsPlugin(), |
@@ -61,9 +58,7 @@ const webpackConfig = { | @@ -61,9 +58,7 @@ const webpackConfig = { | ||
61 | new PostCompilePlugin(), | 58 | new PostCompilePlugin(), |
62 | new TransformModulesPlugin(), | 59 | new TransformModulesPlugin(), |
63 | new VueLoaderPlugin(), | 60 | new VueLoaderPlugin(), |
64 | - ] | 61 | + ], |
65 | }; | 62 | }; |
66 | 63 | ||
67 | - | ||
68 | - | ||
69 | module.exports = webpackConfig; | 64 | module.exports = webpackConfig; |
@@ -82,7 +82,7 @@ module.exports = { | @@ -82,7 +82,7 @@ module.exports = { | ||
82 | api: 'ufo.notEntrySeller.computeChangePrice', | 82 | api: 'ufo.notEntrySeller.computeChangePrice', |
83 | params: { | 83 | params: { |
84 | price: { type: Number }, | 84 | price: { type: Number }, |
85 | - skup: { type: Number } | 85 | + skup: { type: Number }, |
86 | }, | 86 | }, |
87 | }, | 87 | }, |
88 | 88 | ||
@@ -94,9 +94,9 @@ module.exports = { | @@ -94,9 +94,9 @@ module.exports = { | ||
94 | ufo: true, | 94 | ufo: true, |
95 | api: 'ufo.notEntrySeller.changePrice', | 95 | api: 'ufo.notEntrySeller.changePrice', |
96 | params: { | 96 | params: { |
97 | - address_id: {type: Number}, | 97 | + address_id: { type: Number }, |
98 | price: { type: Number }, | 98 | price: { type: Number }, |
99 | - skup: { type: Number } | 99 | + skup: { type: Number }, |
100 | }, | 100 | }, |
101 | }, | 101 | }, |
102 | 102 | ||
@@ -212,6 +212,20 @@ module.exports = { | @@ -212,6 +212,20 @@ module.exports = { | ||
212 | }, | 212 | }, |
213 | }, | 213 | }, |
214 | 214 | ||
215 | + // 非入住商家订单类表 | ||
216 | + '/api/ufo/seller/notEntryPrdList': { | ||
217 | + auth: true, | ||
218 | + ufo: true, | ||
219 | + api: 'ufo.seller.notEntryPrdList', | ||
220 | + }, | ||
221 | + | ||
222 | + // 入住商家类表 | ||
223 | + '/api/ufo/seller/entryPrdList': { | ||
224 | + auth: true, | ||
225 | + ufo: true, | ||
226 | + api: 'ufo.seller.entryPrdList', | ||
227 | + }, | ||
228 | + | ||
215 | // 订单数量 | 229 | // 订单数量 |
216 | '/api/order/confirm/count': { | 230 | '/api/order/confirm/count': { |
217 | ufo: true, | 231 | ufo: true, |
@@ -25,10 +25,6 @@ export const buyerOrderStatus = { | @@ -25,10 +25,6 @@ export const buyerOrderStatus = { | ||
25 | // 卖家订单状态, 接口对应查询参数: type | 25 | // 卖家订单状态, 接口对应查询参数: type |
26 | export const sellerOrderStatusList = [ | 26 | export const sellerOrderStatusList = [ |
27 | { | 27 | { |
28 | - value: 1, | ||
29 | - text: '出售中', | ||
30 | - }, | ||
31 | - { | ||
32 | value: 2, | 28 | value: 2, |
33 | text: '待发货', | 29 | text: '待发货', |
34 | }, | 30 | }, |
@@ -120,6 +116,7 @@ export const orderActionsMap = { | @@ -120,6 +116,7 @@ export const orderActionsMap = { | ||
120 | text: '管理库存', | 116 | text: '管理库存', |
121 | }, | 117 | }, |
122 | 118 | ||
119 | + // Todo | ||
123 | NOW_BUY: { | 120 | NOW_BUY: { |
124 | code: 'now_buy', | 121 | code: 'now_buy', |
125 | name: 'NOW_BUY', | 122 | name: 'NOW_BUY', |
@@ -130,4 +127,5 @@ export const orderActionsMap = { | @@ -130,4 +127,5 @@ export const orderActionsMap = { | ||
130 | name: 'CONFIRM_DELIVERY', | 127 | name: 'CONFIRM_DELIVERY', |
131 | text: '确认收货', | 128 | text: '确认收货', |
132 | }, | 129 | }, |
130 | + PAY_DEPOSIT: { code: 'pay_deposit', name: 'PAY_DEPOSIT', text: '支付定金' }, | ||
133 | }; | 131 | }; |
-
Please register or login to post a comment