Merge branch 'feature/ufo' of http://git.yoho.cn/fe/yoho-app-web into feature/ufo
# Conflicts: # config/api-map.js # config/common.js
Showing
19 changed files
with
271 additions
and
117 deletions
@@ -31,7 +31,7 @@ if (cluster.isMaster) { | @@ -31,7 +31,7 @@ if (cluster.isMaster) { | ||
31 | if (msg.action === 'ssr_request') { | 31 | if (msg.action === 'ssr_request') { |
32 | realyPromise.then(() => { | 32 | realyPromise.then(() => { |
33 | renderer.renderToString(msg.context, (err, html) => { | 33 | renderer.renderToString(msg.context, (err, html) => { |
34 | - worker.send({action: 'ssr_request', html, err: err && (err.stack || JSON.stringify(err))}); | 34 | + worker.send({action: 'ssr_request', html, err: err && JSON.stringify(err)}); |
35 | }); | 35 | }); |
36 | }); | 36 | }); |
37 | } | 37 | } |
1 | -const api = global.yoho.API; | ||
2 | -const service = global.yoho.ServiceAPI; | 1 | +const yohoApi = global.yoho.API; |
2 | +const ufoAPI = global.yoho.UfoAPI; | ||
3 | +const serviceApi = global.yoho.ServiceAPI; | ||
3 | const checkParams = require('../../utils/check-params'); | 4 | const checkParams = require('../../utils/check-params'); |
4 | const apiMaps = require('../../config/api-map'); | 5 | const apiMaps = require('../../config/api-map'); |
5 | 6 | ||
6 | -const NOT_FOUND_API_MAP = { | ||
7 | - code: 400, | ||
8 | - message: '未找到对应的接口' | ||
9 | -}; | ||
10 | const checkApiMap = url => { | 7 | const checkApiMap = url => { |
11 | return apiMaps[url] ? apiMaps[url] : void 0; | 8 | return apiMaps[url] ? apiMaps[url] : void 0; |
12 | }; | 9 | }; |
@@ -15,7 +12,7 @@ const request = async({url, method, reqParams, context}) => { | @@ -15,7 +12,7 @@ const request = async({url, method, reqParams, context}) => { | ||
15 | const {env, user} = context; | 12 | const {env, user} = context; |
16 | 13 | ||
17 | if (!apiInfo) { | 14 | if (!apiInfo) { |
18 | - return Promise.reject(NOT_FOUND_API_MAP); | 15 | + return Promise.reject(new Error(`未找到对应的接口:${url}`)); |
19 | } | 16 | } |
20 | if (!apiInfo.service) { | 17 | if (!apiInfo.service) { |
21 | Object.assign(reqParams, { | 18 | Object.assign(reqParams, { |
@@ -32,26 +29,29 @@ const request = async({url, method, reqParams, context}) => { | @@ -32,26 +29,29 @@ const request = async({url, method, reqParams, context}) => { | ||
32 | 29 | ||
33 | const params = checkParams.getParams(reqParams, apiInfo); | 30 | const params = checkParams.getParams(reqParams, apiInfo); |
34 | const cache = method.toLowerCase() !== 'get' ? false : apiInfo.cache; | 31 | const cache = method.toLowerCase() !== 'get' ? false : apiInfo.cache; |
32 | + const headers = { | ||
33 | + 'X-YOHO-IP': env.clientIp, | ||
34 | + 'X-Forwarded-For': env.clientIp, | ||
35 | + 'User-Agent': 'yoho/nodejs' | ||
36 | + }; | ||
35 | 37 | ||
36 | if (apiInfo.service) { | 38 | if (apiInfo.service) { |
37 | - return await service.get(apiInfo.api, params, { | 39 | + return await serviceApi.get(apiInfo.api, params, { |
40 | + cache: cache, | ||
41 | + code: 200, | ||
42 | + headers | ||
43 | + }); | ||
44 | + } else if (apiInfo.ufo) { | ||
45 | + return await ufoAPI[method]('', params, { | ||
38 | cache: cache, | 46 | cache: cache, |
39 | code: 200, | 47 | code: 200, |
40 | - headers: { | ||
41 | - 'X-YOHO-IP': env.clientIp, | ||
42 | - 'X-Forwarded-For': env.clientIp, | ||
43 | - 'User-Agent': 'yoho/nodejs' | ||
44 | - } | 48 | + headers |
45 | }); | 49 | }); |
46 | } else { | 50 | } else { |
47 | - return await api[method]('', params, { | 51 | + return await yohoApi[method]('', params, { |
48 | code: 200, | 52 | code: 200, |
49 | cache: cache, | 53 | cache: cache, |
50 | - headers: { | ||
51 | - 'X-YOHO-IP': env.clientIp, | ||
52 | - 'X-Forwarded-For': env.clientIp, | ||
53 | - 'User-Agent': 'yoho/nodejs' | ||
54 | - } | 54 | + headers |
55 | }); | 55 | }); |
56 | } | 56 | } |
57 | }; | 57 | }; |
apps/components/img-size.vue
0 → 100644
1 | +<template> | ||
2 | + <img :src="currentSrc" :alt="alt"> | ||
3 | +</template> | ||
4 | + | ||
5 | +<script> | ||
6 | +export default { | ||
7 | + name: 'ImgSize', | ||
8 | + props: { | ||
9 | + src: String, | ||
10 | + width: Number, | ||
11 | + height: Number, | ||
12 | + alt: String | ||
13 | + }, | ||
14 | + computed: { | ||
15 | + currentSrc() { | ||
16 | + return (this.src || '') | ||
17 | + .replace('{width}', this.width) | ||
18 | + .replace('{height}', this.height); | ||
19 | + } | ||
20 | + } | ||
21 | +} | ||
22 | +</script> | ||
23 | + | ||
24 | +<style> | ||
25 | + | ||
26 | +</style> |
@@ -8,7 +8,7 @@ const sender = global.yoho.apmSender; | @@ -8,7 +8,7 @@ const sender = global.yoho.apmSender; | ||
8 | const logger = global.yoho.logger; | 8 | const logger = global.yoho.logger; |
9 | 9 | ||
10 | const catchError = (err, context) => { | 10 | const catchError = (err, context) => { |
11 | - logger.error(`[catchError], ${err}`); | 11 | + logger.error(err); |
12 | setImmediate(() => { | 12 | setImmediate(() => { |
13 | try { | 13 | try { |
14 | sender.addMessage({ | 14 | sender.addMessage({ |
1 | <template> | 1 | <template> |
2 | - <div v-show="value" v-transfer-dom :data-transfer="transfer"> | 2 | + <div class="modal-box" v-show="value" v-transfer-dom :data-transfer="transfer"> |
3 | <div class="modal-mask"></div> | 3 | <div class="modal-mask"></div> |
4 | <div class="modal-wrap" @touchmove.prevent.stop="onTouchmove"> | 4 | <div class="modal-wrap" @touchmove.prevent.stop="onTouchmove"> |
5 | <div class="modal modal-content"> | 5 | <div class="modal modal-content"> |
@@ -44,6 +44,10 @@ export default { | @@ -44,6 +44,10 @@ export default { | ||
44 | </script> | 44 | </script> |
45 | 45 | ||
46 | <style lang="scss"> | 46 | <style lang="scss"> |
47 | +.modal-box { | ||
48 | + font-size: 24px; | ||
49 | +} | ||
50 | + | ||
47 | .modal-mask { | 51 | .modal-mask { |
48 | position: fixed; | 52 | position: fixed; |
49 | top: 0; | 53 | top: 0; |
1 | <template> | 1 | <template> |
2 | - <Modal class="ufo-font" :value="value" @input="onInput" ref="modal" :transfer="true" @on-sure="onSure"> | 2 | + <Modal class="ufo-font" :value="visiable" @input="onInput" ref="modal" :transfer="true" @on-sure="onSure" @on-cancel="onCancel"> |
3 | <div class="change-price-modal"> | 3 | <div class="change-price-modal"> |
4 | <p class="modal-title">选择你要下架的数量</p> | 4 | <p class="modal-title">选择你要下架的数量</p> |
5 | - <Inputx v-model="stockNum" :maxlength="8" :readonly="true" class="input-number"> | 5 | + <Inputx v-model="unStockNum" :maxlength="8" :readonly="true" class="input-number"> |
6 | <i slot="prefix" class="iconfont icon-plus-minus" @touchend="onChangeNum(-1)"></i> | 6 | <i slot="prefix" class="iconfont icon-plus-minus" @touchend="onChangeNum(-1)"></i> |
7 | <i slot="suffix" class="iconfont icon-i-add" @touchend="onChangeNum(1)"></i> | 7 | <i slot="suffix" class="iconfont icon-i-add" @touchend="onChangeNum(1)"></i> |
8 | </Inputx> | 8 | </Inputx> |
9 | <p class="stock-txt"> | 9 | <p class="stock-txt"> |
10 | - 目前还有 6 个库存 | 10 | + 目前还有 {{storageNum}} 个库存 |
11 | </p> | 11 | </p> |
12 | <p class="tips"> | 12 | <p class="tips"> |
13 | 下架商品的保证金将会被释放 | 13 | 下架商品的保证金将会被释放 |
@@ -20,31 +20,38 @@ | @@ -20,31 +20,38 @@ | ||
20 | import Inputx from '../../components/inputx.vue'; | 20 | import Inputx from '../../components/inputx.vue'; |
21 | import Modal from '../../components/modal.vue'; | 21 | import Modal from '../../components/modal.vue'; |
22 | 22 | ||
23 | + | ||
23 | export default { | 24 | export default { |
24 | name: 'ModalPrice', | 25 | name: 'ModalPrice', |
25 | - props: { | ||
26 | - value: Boolean, | ||
27 | - }, | ||
28 | data() { | 26 | data() { |
29 | return { | 27 | return { |
30 | - stockNum: 1, | ||
31 | - maxNum: 6, | 28 | + visiable: false, |
29 | + unStockNum: 1, | ||
30 | + storageNum: 6, | ||
32 | }; | 31 | }; |
33 | }, | 32 | }, |
34 | methods: { | 33 | methods: { |
34 | + show({storageNum}) { | ||
35 | + this.storageNum = storageNum; | ||
36 | + this.visiable = true; | ||
37 | + }, | ||
35 | onSure() { | 38 | onSure() { |
36 | - this.$emit('on-sure'); | 39 | + this.$emit('on-sure', this.unStockNum); |
40 | + this.visiable = false; | ||
41 | + }, | ||
42 | + onCancel() { | ||
43 | + this.visiable = false; | ||
37 | }, | 44 | }, |
38 | onInput(val) { | 45 | onInput(val) { |
39 | this.$emit('input', val); | 46 | this.$emit('input', val); |
40 | }, | 47 | }, |
41 | onChangeNum(num) { | 48 | onChangeNum(num) { |
42 | - const value = this.stockNum + num; | 49 | + const value = this.unStockNum + num; |
43 | 50 | ||
44 | - if (value <= 0 || value > this.maxNum) { | 51 | + if (value <= 0 || value > this.storageNum) { |
45 | return; | 52 | return; |
46 | } | 53 | } |
47 | - this.stockNum = value; | 54 | + this.unStockNum = value; |
48 | } | 55 | } |
49 | }, | 56 | }, |
50 | components: {Modal, Inputx} | 57 | components: {Modal, Inputx} |
@@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
4 | <div class="tip" v-if="value.tip">超出建议售价将被限制超出建议售价将被限制展示</div> | 4 | <div class="tip" v-if="value.tip">超出建议售价将被限制超出建议售价将被限制展示</div> |
5 | <div class="info"> | 5 | <div class="info"> |
6 | <div class="left"> | 6 | <div class="left"> |
7 | - <span class="size">{{value.size}}</span> | 7 | + <span class="size">{{value.goodsInfo.sizeName}}</span> |
8 | <span class="l-size">1/3</span> | 8 | <span class="l-size">1/3</span> |
9 | <span class="unit">码</span> | 9 | <span class="unit">码</span> |
10 | </div> | 10 | </div> |
11 | <div class="middle"> | 11 | <div class="middle"> |
12 | - <p class="size-store">¥{{value.price}},12个库存</p> | ||
13 | - <p class="low-price">当前最低价¥{{value.price}}</p> | 12 | + <p class="size-store">¥{{value.goodsInfo.goodPrice}},{{value.goodsInfo.storageNum}}个库存</p> |
13 | + <p class="low-price">当前最低价¥{{value.goodsInfo.leastPrice}}</p> | ||
14 | </div> | 14 | </div> |
15 | <div class="right"> | 15 | <div class="right"> |
16 | <Button class="chg-price" @click="onChgPrice">调 价</Button> | 16 | <Button class="chg-price" @click="onChgPrice">调 价</Button> |
@@ -64,10 +64,10 @@ export default { | @@ -64,10 +64,10 @@ export default { | ||
64 | }, | 64 | }, |
65 | methods: { | 65 | methods: { |
66 | onNoSale() { | 66 | onNoSale() { |
67 | - this.$emit('on-no-sale'); | 67 | + this.$emit('on-no-sale', this.value.goodsInfo); |
68 | }, | 68 | }, |
69 | onChgPrice() { | 69 | onChgPrice() { |
70 | - this.$emit('on-chg-price'); | 70 | + this.$emit('on-chg-price', this.value.goodsInfo); |
71 | }, | 71 | }, |
72 | onTouchStart(evt) { | 72 | onTouchStart(evt) { |
73 | const {clientX, clientY} = evt.touches[0]; | 73 | const {clientX, clientY} = evt.touches[0]; |
@@ -146,7 +146,7 @@ export default { | @@ -146,7 +146,7 @@ export default { | ||
146 | bottom: 0; | 146 | bottom: 0; |
147 | z-index: 1; | 147 | z-index: 1; |
148 | 148 | ||
149 | - .cube-btn { | 149 | + .btn-no-sale { |
150 | height: 100%; | 150 | height: 100%; |
151 | line-height: 1; | 151 | line-height: 1; |
152 | background-color: #eee; | 152 | background-color: #eee; |
@@ -27,6 +27,12 @@ | @@ -27,6 +27,12 @@ | ||
27 | import ModalPrice from './modal-price'; | 27 | import ModalPrice from './modal-price'; |
28 | import ModalUnstock from './modal-unstock'; | 28 | import ModalUnstock from './modal-unstock'; |
29 | import ProductItem from './product-item'; | 29 | import ProductItem from './product-item'; |
30 | +import {createNamespacedHelpers} from 'vuex'; | ||
31 | +import Vue from 'vue'; | ||
32 | +import {Toast} from 'cube-ui'; | ||
33 | + | ||
34 | +Vue.use(Toast); | ||
35 | +const {mapActions} = createNamespacedHelpers('ufo/order'); | ||
30 | 36 | ||
31 | export default { | 37 | export default { |
32 | name: 'ProductList', | 38 | name: 'ProductList', |
@@ -46,20 +52,34 @@ export default { | @@ -46,20 +52,34 @@ export default { | ||
46 | this.modalLoad = true; | 52 | this.modalLoad = true; |
47 | }, | 53 | }, |
48 | methods: { | 54 | methods: { |
55 | + ...mapActions(['postNoSale']), | ||
49 | onPriceSure() { | 56 | onPriceSure() { |
50 | this.showTips = !this.showTips; | 57 | this.showTips = !this.showTips; |
51 | }, | 58 | }, |
52 | - onUnstockSure() { | ||
53 | - this.showTips = !this.showTips; | 59 | + async onUnstockSure(product) { |
60 | + const result = await this.postNoSale(product); | ||
61 | + | ||
62 | + if (result.code === 200) { | ||
63 | + this.$createToast({ | ||
64 | + txt: '下架成功', | ||
65 | + time: 5000, | ||
66 | + type: 'correct' | ||
67 | + }).show(); | ||
68 | + } else { | ||
69 | + this.$createToast({ | ||
70 | + txt: result.message || '下架失败', | ||
71 | + type: 'warn' | ||
72 | + }).show(); | ||
73 | + } | ||
74 | + this.slideSkc = {}; | ||
54 | }, | 75 | }, |
55 | onChgPrice() { | 76 | onChgPrice() { |
56 | this.showModalPrice = true; | 77 | this.showModalPrice = true; |
57 | }, | 78 | }, |
58 | - onNoSale() { | ||
59 | - this.showModalUnstock = true; | 79 | + onNoSale(productInfo) { |
80 | + this.$refs.modalUnstock.show(productInfo); | ||
60 | }, | 81 | }, |
61 | onSlide(val) { | 82 | onSlide(val) { |
62 | - console.log('onSlide') | ||
63 | this.slideSkc = val; | 83 | this.slideSkc = val; |
64 | } | 84 | } |
65 | }, | 85 | }, |
@@ -2,31 +2,37 @@ | @@ -2,31 +2,37 @@ | ||
2 | <LayoutApp class="ufo-font" :class="classes"> | 2 | <LayoutApp class="ufo-font" :class="classes"> |
3 | <ScrollView ref="scroll" :observe-dom="false" :pull-up-load="true" :pull-down-refresh="true" @pullingUp="onPullingUp" @pullingDown="onPullingDown"> | 3 | <ScrollView ref="scroll" :observe-dom="false" :pull-up-load="true" :pull-down-refresh="true" @pullingUp="onPullingUp" @pullingDown="onPullingDown"> |
4 | <div class="order-page"> | 4 | <div class="order-page"> |
5 | - <div class="title">出售中</div> | 5 | + <div class="title">{{productInfo.statuStr}}</div> |
6 | <div class="product"> | 6 | <div class="product"> |
7 | - <img class="pro-img" src="//img11.static.yhbimg.com/goodsimg/2018/11/23/12/017e70f47d95b3e2f93f7946e0574a291a.jpg?imageMogr2/thumbnail/200x200/background/d2hpdGU=/position/center/quality/80" alt=""> | 7 | + <ImgSize class="pro-img" :src="productInfo.goodsImg"></ImgSize> |
8 | <div class="pro-info"> | 8 | <div class="pro-info"> |
9 | - <p class="pro-name">Air Jordan 11 Con版康扣Con版康扣 2018年版2018年版</p> | ||
10 | - <p class="stock-info">5个尺码,39个商品库存</p> | 9 | + <p class="pro-name">{{productInfo.productName}}</p> |
10 | + <p class="stock-info">{{productInfo.sizeNum}}个尺码,{{productInfo.storageNum}}个商品库存</p> | ||
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | <div class="arrival"> | 13 | <div class="arrival"> |
14 | <p class="arrival-time"><i class="iconfont icon-info"></i><span>尺码列表左滑选择 不卖了 ,下架当前尺码商品</span></p> | 14 | <p class="arrival-time"><i class="iconfont icon-info"></i><span>尺码列表左滑选择 不卖了 ,下架当前尺码商品</span></p> |
15 | </div> | 15 | </div> |
16 | - <ProductList :skcs="orderDetail.skcs"></ProductList> | 16 | + <ProductList :skcs="sizes"></ProductList> |
17 | </div> | 17 | </div> |
18 | </ScrollView> | 18 | </ScrollView> |
19 | </LayoutApp> | 19 | </LayoutApp> |
20 | </template> | 20 | </template> |
21 | 21 | ||
22 | <script> | 22 | <script> |
23 | +import ImgSize from 'components/img-size'; | ||
23 | import {Button} from 'cube-ui'; | 24 | import {Button} from 'cube-ui'; |
24 | import ScrollView from 'components/scroll-view'; | 25 | import ScrollView from 'components/scroll-view'; |
25 | import ProductList from './components/product-list'; | 26 | import ProductList from './components/product-list'; |
27 | +import Vue from 'vue'; | ||
28 | +import {Toast} from 'cube-ui'; | ||
26 | import {createNamespacedHelpers} from 'vuex'; | 29 | import {createNamespacedHelpers} from 'vuex'; |
27 | 30 | ||
31 | +import {Style} from 'cube-ui'; | ||
28 | 32 | ||
29 | -const {mapState, mapActions} = createNamespacedHelpers('ufo/order'); | 33 | +Vue.use(Toast); |
34 | + | ||
35 | +const {mapState} = createNamespacedHelpers('ufo/order'); | ||
30 | 36 | ||
31 | export default { | 37 | export default { |
32 | name: 'OrderPage', | 38 | name: 'OrderPage', |
@@ -40,16 +46,18 @@ export default { | @@ -40,16 +46,18 @@ export default { | ||
40 | }; | 46 | }; |
41 | }, | 47 | }, |
42 | computed: { | 48 | computed: { |
43 | - ...mapState(['orderProduct', 'orderDetail']) | 49 | + ...mapState(['orderInfo']), |
50 | + productInfo() { | ||
51 | + return this.orderInfo.productInfo || {}; | ||
52 | + }, | ||
53 | + sizes() { | ||
54 | + return this.orderInfo.data || []; | ||
55 | + } | ||
44 | }, | 56 | }, |
45 | asyncData({store, router}) { | 57 | asyncData({store, router}) { |
46 | return store.dispatch('ufo/order/fetchProduct', {orderId: router.params.orderId}); | 58 | return store.dispatch('ufo/order/fetchProduct', {orderId: router.params.orderId}); |
47 | }, | 59 | }, |
48 | - mounted() { | ||
49 | - this.fetchOrderDetail({orderId: this.$route.params.orderId}); | ||
50 | - }, | ||
51 | methods: { | 60 | methods: { |
52 | - ...mapActions(['fetchOrderDetail']), | ||
53 | onPullingUp() { | 61 | onPullingUp() { |
54 | setTimeout(() => { | 62 | setTimeout(() => { |
55 | this.$refs.scroll.forceUpdate(); | 63 | this.$refs.scroll.forceUpdate(); |
@@ -64,7 +72,7 @@ export default { | @@ -64,7 +72,7 @@ export default { | ||
64 | this.showModalUnstock = true; | 72 | this.showModalUnstock = true; |
65 | }, | 73 | }, |
66 | }, | 74 | }, |
67 | - components: {Button, ScrollView, ProductList} | 75 | + components: {Button, ScrollView, ProductList, ImgSize} |
68 | }; | 76 | }; |
69 | </script> | 77 | </script> |
70 | 78 |
1 | import * as Types from './types'; | 1 | import * as Types from './types'; |
2 | 2 | ||
3 | export default { | 3 | export default { |
4 | - async fetchProduct({commit}, {orderId}) { | 4 | + async fetchProduct({commit}, {productId}) { |
5 | commit(Types.FETCH_ORDER_PRODUCT_REQUEST); | 5 | commit(Types.FETCH_ORDER_PRODUCT_REQUEST); |
6 | 6 | ||
7 | - // const result = await this.$api.get('/getproductxxx', {orderId}); | ||
8 | - const result = await Promise.resolve({ | ||
9 | - code: 200, | ||
10 | - data: { | ||
11 | - name: '测试产品', | ||
12 | - image: 'xxx' | ||
13 | - } | ||
14 | - }); | 7 | + // const result = await this.$api.get('/api/ufo/seller/entryGoodsSizeList', { |
8 | + // productId, | ||
9 | + // }); | ||
10 | + const result = { | ||
11 | + "alg": "SALT_MD5", | ||
12 | + "code": 200, | ||
13 | + "data": { | ||
14 | + productInfo:{ | ||
15 | + "productId": 10000078, | ||
16 | + "productName": "Air Jordan XX9 Low “Chicago Bulls”", | ||
17 | + "colorName":"红色", | ||
18 | + "goodsImg" : "http://img11.static.yhbimg.com/goodsimg/2018/10/18/17/01699014e8981a532f27abc74730e40bbd.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80", | ||
19 | + "sizeNum":5, | ||
20 | + "storageNum":100, | ||
21 | + "statuStr": "出售中", | ||
22 | + "status": 1, | ||
23 | + }, | ||
24 | + "data": [ | ||
25 | + { | ||
26 | + "buttons": [ | ||
27 | + { | ||
28 | + "code": "batch_cancel_sold", | ||
29 | + "name": "BATCH_CANCEL_SOLD", | ||
30 | + "text": "不卖了" | ||
31 | + }, | ||
32 | + { | ||
33 | + "code": "change_price", | ||
34 | + "name": "CHANGE_PRICE", | ||
35 | + "text": "调价" | ||
36 | + } | ||
37 | + ], | ||
38 | + | ||
39 | + "createTime": "2018-11-05 15:03:27", | ||
40 | + "goodsInfo": { | ||
41 | + "colorName": "", | ||
42 | + "goodImg": "", | ||
43 | + "goodPrice": "9.00", | ||
44 | + "storageNum":100, | ||
45 | + "sizeName": "L", | ||
46 | + "storageId": 10000162, | ||
47 | + "leastPrice": 1119 | ||
48 | + }, | ||
49 | + "secendLevelCreateTime": 1541401407, | ||
50 | + "uid": 500031152 | ||
51 | + } | ||
52 | + | ||
53 | + ], | ||
54 | + "page": 1, | ||
55 | + "pageSize": 20, | ||
56 | + "pagetotal": 1, | ||
57 | + "total": 2 | ||
58 | + }, | ||
59 | + "md5": "42a616d78633c19d80eb410da1ae4644", | ||
60 | + "message": "列表" | ||
61 | + } | ||
62 | + | ||
15 | 63 | ||
16 | if (result && result.code === 200) { | 64 | if (result && result.code === 200) { |
17 | commit(Types.FETCH_ORDER_PRODUCT_SUCCESS, { | 65 | commit(Types.FETCH_ORDER_PRODUCT_SUCCESS, { |
18 | - product: result.data | 66 | + order: result.data |
19 | }); | 67 | }); |
20 | } else { | 68 | } else { |
21 | commit(Types.FETCH_ORDER_PRODUCT_FAILD); | 69 | commit(Types.FETCH_ORDER_PRODUCT_FAILD); |
22 | } | 70 | } |
23 | }, | 71 | }, |
24 | - async fetchOrderDetail({commit}, {orderId}) { | ||
25 | - commit(Types.FETCH_ORDERDETAIL_REQUEST); | ||
26 | - | ||
27 | - // const result = await this.$api.get('/getproductxxx', {orderId}); | ||
28 | - const skcs = []; | ||
29 | - | ||
30 | - for (let i = 0; i < 40; i++) { | ||
31 | - skcs.push({ | ||
32 | - id: 1, | ||
33 | - size: '39', | ||
34 | - num: 10, | ||
35 | - price: 1089, | ||
36 | - tip: !(i % 3) | ||
37 | - }) | ||
38 | - } | ||
39 | - const result = await Promise.resolve({ | ||
40 | - code: 200, | ||
41 | - data: { | ||
42 | - name: '测试订单', | ||
43 | - image: 'xxx', | ||
44 | - skcs: skcs | ||
45 | - } | ||
46 | - }); | ||
47 | - | 72 | + async postNoSale({commit}, {product}) { |
73 | + commit(Types.POST_NOSALE_REQUEST); | ||
74 | + // const result = await this.$api.get('/api/ufo/sellerOrder/batchDownShelf', product); | ||
75 | + const result = { | ||
76 | + "alg": "SALT_MD5", | ||
77 | + "code": 200, | ||
78 | + "data": true, | ||
79 | + "md5": "40f3824dd1e55b340dc5357dd7ccab72", | ||
80 | + "message": "批量取消成功" | ||
81 | + }; | ||
48 | if (result && result.code === 200) { | 82 | if (result && result.code === 200) { |
49 | - commit(Types.FETCH_ORDERDETAIL_SUCCESS, { | 83 | + commit(Types.POST_NOSALE_SUCCESS, { |
50 | order: result.data | 84 | order: result.data |
51 | }); | 85 | }); |
52 | } else { | 86 | } else { |
53 | - commit(Types.FETCH_ORDERDETAIL_FAILD); | 87 | + commit(Types.POST_NOSALE_FAILD); |
54 | } | 88 | } |
89 | + return result || {}; | ||
55 | } | 90 | } |
56 | }; | 91 | }; |
@@ -6,11 +6,8 @@ export default function() { | @@ -6,11 +6,8 @@ export default function() { | ||
6 | namespaced: true, | 6 | namespaced: true, |
7 | state: { | 7 | state: { |
8 | fetchingPro: false, | 8 | fetchingPro: false, |
9 | - orderProduct: {}, | ||
10 | - fetchingOrder: false, | ||
11 | - orderDetail: { | ||
12 | - skcs: [] | ||
13 | - } | 9 | + fetchingNoSale: false, |
10 | + orderInfo: {}, | ||
14 | }, | 11 | }, |
15 | actions, | 12 | actions, |
16 | mutations | 13 | mutations |
@@ -2,25 +2,23 @@ import * as Types from './types'; | @@ -2,25 +2,23 @@ import * as Types from './types'; | ||
2 | 2 | ||
3 | export default { | 3 | export default { |
4 | [Types.FETCH_ORDER_PRODUCT_REQUEST](state) { | 4 | [Types.FETCH_ORDER_PRODUCT_REQUEST](state) { |
5 | - state.orderProduct = {}; | 5 | + state.orderInfo = {}; |
6 | state.fetchingPro = true; | 6 | state.fetchingPro = true; |
7 | }, | 7 | }, |
8 | [Types.FETCH_ORDER_PRODUCT_FAILD](state) { | 8 | [Types.FETCH_ORDER_PRODUCT_FAILD](state) { |
9 | state.fetchingPro = false; | 9 | state.fetchingPro = false; |
10 | }, | 10 | }, |
11 | - [Types.FETCH_ORDER_PRODUCT_SUCCESS](state, {product}) { | 11 | + [Types.FETCH_ORDER_PRODUCT_SUCCESS](state, {order}) { |
12 | state.fetchingPro = false; | 12 | state.fetchingPro = false; |
13 | - state.orderProduct = product; | 13 | + state.orderInfo = order; |
14 | }, | 14 | }, |
15 | - [Types.FETCH_ORDERDETAIL_REQUEST](state) { | ||
16 | - state.orderDetail = {}; | ||
17 | - state.fetchingOrder = true; | 15 | + [Types.POST_NOSALE_REQUEST](state) { |
16 | + state.fetchingNoSale = true; | ||
18 | }, | 17 | }, |
19 | - [Types.FETCH_ORDERDETAIL_FAILD](state) { | ||
20 | - state.fetchingOrder = false; | 18 | + [Types.POST_NOSALE_FAILD](state) { |
19 | + state.fetchingNoSale = false; | ||
21 | }, | 20 | }, |
22 | - [Types.FETCH_ORDERDETAIL_SUCCESS](state, {order}) { | ||
23 | - state.fetchingOrder = false; | ||
24 | - state.orderDetail = order; | 21 | + [Types.POST_NOSALE_SUCCESS](state) { |
22 | + state.fetchingNoSale = false; | ||
25 | }, | 23 | }, |
26 | }; | 24 | }; |
@@ -2,6 +2,10 @@ export const FETCH_ORDER_PRODUCT_REQUEST = 'FETCH_ORDER_PRODUCT_REQUEST'; | @@ -2,6 +2,10 @@ export const FETCH_ORDER_PRODUCT_REQUEST = 'FETCH_ORDER_PRODUCT_REQUEST'; | ||
2 | export const FETCH_ORDER_PRODUCT_FAILD = 'FETCH_ORDER_PRODUCT_FAILD'; | 2 | export const FETCH_ORDER_PRODUCT_FAILD = 'FETCH_ORDER_PRODUCT_FAILD'; |
3 | export const FETCH_ORDER_PRODUCT_SUCCESS = 'FETCH_ORDER_PRODUCT_SUCCESS'; | 3 | export const FETCH_ORDER_PRODUCT_SUCCESS = 'FETCH_ORDER_PRODUCT_SUCCESS'; |
4 | 4 | ||
5 | -export const FETCH_ORDERDETAIL_REQUEST = 'FETCH_ORDERDETAIL_REQUEST'; | ||
6 | -export const FETCH_ORDERDETAIL_FAILD = 'FETCH_ORDERDETAIL_FAILD'; | ||
7 | -export const FETCH_ORDERDETAIL_SUCCESS = 'FETCH_ORDERDETAIL_SUCCESS'; | 5 | +export const POST_NOSALE_REQUEST = 'POST_NOSALE_REQUEST'; |
6 | +export const POST_NOSALE_FAILD = 'POST_NOSALE_FAILD'; | ||
7 | +export const POST_NOSALE_SUCCESS = 'POST_NOSALE_SUCCESS'; | ||
8 | + | ||
9 | +export const POST_CHANGEPRICE_REQUEST = 'POST_CHANGEPRICE_REQUEST'; | ||
10 | +export const POST_CHANGEPRICE_FAILD = 'POST_CHANGEPRICE_FAILD'; | ||
11 | +export const POST_CHANGEPRICE_SUCCESS = 'POST_CHANGEPRICE_SUCCESS'; |
@@ -24,5 +24,46 @@ module.exports = { | @@ -24,5 +24,46 @@ module.exports = { | ||
24 | api: 'ufo.coupons.get', | 24 | api: 'ufo.coupons.get', |
25 | ufo: true, | 25 | ufo: true, |
26 | params: {} | 26 | params: {} |
27 | + }, | ||
28 | + '/api/ufo/seller/entryGoodsSizeList': { | ||
29 | + ufo: true, | ||
30 | + api: 'ufo.seller.entryGoodsSizeList', | ||
31 | + params: { | ||
32 | + productId: {type: Number}, | ||
33 | + limit: {type: Number}, | ||
34 | + page: {type: Number} | ||
35 | + } | ||
36 | + }, | ||
37 | + '/api/ufo/sellerOrder/computeAdjustPrice': { | ||
38 | + ufo: true, | ||
39 | + api: 'ufo.sellerOrder.computeAdjustPrice', | ||
40 | + params: { | ||
41 | + product_id: {type: Number}, | ||
42 | + storage_id: {type: Number}, | ||
43 | + new_price: {type: Number}, | ||
44 | + old_price: {type: Number}, | ||
45 | + num: {type: Number} | ||
46 | + } | ||
47 | + }, | ||
48 | + '/api/ufo/sellerOrder/batchAdjustPrice': { | ||
49 | + ufo: true, | ||
50 | + api: 'ufo.sellerOrder.batchAdjustPrice', | ||
51 | + params: { | ||
52 | + product_id: {type: Number}, | ||
53 | + storage_id: {type: Number}, | ||
54 | + new_price: {type: Number}, | ||
55 | + old_price: {type: Number}, | ||
56 | + num: {type: Number} | ||
57 | + } | ||
58 | + }, | ||
59 | + '/api/ufo/sellerOrder/batchDownShelf': { | ||
60 | + ufo: true, | ||
61 | + api: 'ufo.sellerOrder.batchDownShelf', | ||
62 | + params: { | ||
63 | + product_id: {type: Number}, | ||
64 | + storage_id: {type: Number}, | ||
65 | + old_price: {type: Number}, | ||
66 | + num: {type: Number} | ||
67 | + } | ||
27 | } | 68 | } |
28 | }; | 69 | }; |
@@ -13,6 +13,7 @@ const domains = { | @@ -13,6 +13,7 @@ const domains = { | ||
13 | 13 | ||
14 | // api: 'http://api.yoho.cn/', | 14 | // api: 'http://api.yoho.cn/', |
15 | // service: 'http://service.yoho.cn/', | 15 | // service: 'http://service.yoho.cn/', |
16 | + // ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/', | ||
16 | 17 | ||
17 | // liveApi: 'http://testapi.live.yohops.com:9999/', | 18 | // liveApi: 'http://testapi.live.yohops.com:9999/', |
18 | // singleApi: 'http://api-test3.yohops.com:9999/', | 19 | // singleApi: 'http://api-test3.yohops.com:9999/', |
@@ -25,7 +26,7 @@ const domains = { | @@ -25,7 +26,7 @@ const domains = { | ||
25 | 26 | ||
26 | api: 'http://api-test3.dev.yohocorp.com/', | 27 | api: 'http://api-test3.dev.yohocorp.com/', |
27 | service: 'http://api-test3.dev.yohocorp.com/', | 28 | service: 'http://api-test3.dev.yohocorp.com/', |
28 | - // ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/', | 29 | + ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/', |
29 | }; | 30 | }; |
30 | 31 | ||
31 | module.exports = { | 32 | module.exports = { |
@@ -36,7 +37,7 @@ module.exports = { | @@ -36,7 +37,7 @@ module.exports = { | ||
36 | siteUrl: '//m.yohobuy.com', | 37 | siteUrl: '//m.yohobuy.com', |
37 | assetUrl: '//localhost:5001/yohoapp-node/', | 38 | assetUrl: '//localhost:5001/yohoapp-node/', |
38 | testCode: 'yoho4946abcdef#$%&!@', | 39 | testCode: 'yoho4946abcdef#$%&!@', |
39 | - domains: domains, | 40 | + domains, |
40 | yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc', | 41 | yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc', |
41 | signExtend: { | 42 | signExtend: { |
42 | business_line: 'yohobuy' | 43 | business_line: 'yohobuy' |
1 | -const service = global.yoho.ServiceAPI; | 1 | +const serviceApi = global.yoho.ServiceAPI; |
2 | +const ufoAPI = global.yoho.UfoAPI; | ||
2 | const logger = global.yoho.logger; | 3 | const logger = global.yoho.logger; |
3 | const checkParams = require('../../utils/check-params'); | 4 | const checkParams = require('../../utils/check-params'); |
4 | const apiMaps = require('../../config/api-map'); | 5 | const apiMaps = require('../../config/api-map'); |
@@ -36,7 +37,7 @@ module.exports = async(req, res, next) => { | @@ -36,7 +37,7 @@ module.exports = async(req, res, next) => { | ||
36 | 37 | ||
37 | if (apiInfo.service) { | 38 | if (apiInfo.service) { |
38 | result = await apiCtx.get({ | 39 | result = await apiCtx.get({ |
39 | - api: service, | 40 | + api: serviceApi, |
40 | url: apiInfo.api, | 41 | url: apiInfo.api, |
41 | data: params, | 42 | data: params, |
42 | param: { | 43 | param: { |
@@ -44,6 +45,15 @@ module.exports = async(req, res, next) => { | @@ -44,6 +45,15 @@ module.exports = async(req, res, next) => { | ||
44 | code: 200 | 45 | code: 200 |
45 | } | 46 | } |
46 | }); | 47 | }); |
48 | + } else if (apiInfo.ufo) { | ||
49 | + result = await apiCtx[method]({ | ||
50 | + api: ufoAPI, | ||
51 | + data: params, | ||
52 | + param: { | ||
53 | + code: 200, | ||
54 | + cache: cache | ||
55 | + } | ||
56 | + }); | ||
47 | } else { | 57 | } else { |
48 | result = await apiCtx[method]({ | 58 | result = await apiCtx[method]({ |
49 | data: params, | 59 | data: params, |
@@ -6,7 +6,7 @@ module.exports = { | @@ -6,7 +6,7 @@ module.exports = { | ||
6 | rootValue: 40, | 6 | rootValue: 40, |
7 | unitPrecision: 5, // 保留5位小数字 | 7 | unitPrecision: 5, // 保留5位小数字 |
8 | minPixelValue: 2, // 小于 2 时,不转换 | 8 | minPixelValue: 2, // 小于 2 时,不转换 |
9 | - selectorBlackList: ['.fix-ios-top'], // 选择器黑名单,可以使用正则 | 9 | + selectorBlackList: ['.fix-ios-top', /cube-/], // 选择器黑名单,可以使用正则 |
10 | propWhiteList: [] // 属性名称为空,表示替换所有属性的值 | 10 | propWhiteList: [] // 属性名称为空,表示替换所有属性的值 |
11 | }), | 11 | }), |
12 | require('autoprefixer')({ | 12 | require('autoprefixer')({ |
-
Please register or login to post a comment