Showing
10 changed files
with
509 additions
and
163 deletions
1 | import Vue from 'vue'; | 1 | import Vue from 'vue'; |
2 | +import VueCookie from 'vue-cookie'; | ||
2 | import Router from 'vue-router'; | 3 | import Router from 'vue-router'; |
3 | import App from './pages/app'; | 4 | import App from './pages/app'; |
4 | import Routers from './pages'; | 5 | import Routers from './pages'; |
@@ -15,6 +16,7 @@ let router = new Router({routes: Routers}); | @@ -15,6 +16,7 @@ let router = new Router({routes: Routers}); | ||
15 | Vue.use(yohoPluginCore, {router}); | 16 | Vue.use(yohoPluginCore, {router}); |
16 | Vue.use(yohoPluginPurview); | 17 | Vue.use(yohoPluginPurview); |
17 | Vue.use(yohoPluginUser); | 18 | Vue.use(yohoPluginUser); |
19 | +Vue.use(VueCookie); | ||
18 | 20 | ||
19 | new Vue({ | 21 | new Vue({ |
20 | el: '#app', | 22 | el: '#app', |
@@ -45,7 +45,8 @@ export default { | @@ -45,7 +45,8 @@ export default { | ||
45 | }); | 45 | }); |
46 | }, | 46 | }, |
47 | login(username, password) { | 47 | login(username, password) { |
48 | - Vue.passport.local(username, password).then(() => { | 48 | + Vue.passport.local(username, password).then((result) => { |
49 | + this.$cookie.set('SHOP_ID', result.currentShop.id); | ||
49 | this.$router.push('/'); | 50 | this.$router.push('/'); |
50 | }, (error) => { | 51 | }, (error) => { |
51 | this.$Message.error(error.message); | 52 | this.$Message.error(error.message); |
1 | 1 | ||
2 | +let apiUrl = { | ||
3 | + brand: '/platform/getSellerBrandInfo', | ||
4 | + sort: '/platform/getSellerSortInfo', | ||
5 | + color: '/platform/querySellerProductColors', | ||
6 | + size: '/platform/querySortSize' | ||
7 | +}; | ||
2 | 8 | ||
3 | const request = require('axios'); | 9 | const request = require('axios'); |
4 | 10 | ||
5 | - | ||
6 | function getBrand(shopId) { | 11 | function getBrand(shopId) { |
7 | return request.get(apiUrl.brand, { | 12 | return request.get(apiUrl.brand, { |
8 | params: { | 13 | params: { |
9 | shopsId:shopId | 14 | shopsId:shopId |
10 | } | 15 | } |
11 | - }) | 16 | + }).then((result) => result.data) |
12 | } | 17 | } |
13 | 18 | ||
14 | -function getCategory(shopId, brandId, level , sortId) { | 19 | +function getSort(shopId, brandId, level , sortId) { |
15 | let opts = { | 20 | let opts = { |
16 | shopsId: shopId, | 21 | shopsId: shopId, |
17 | brandId: brandId, | 22 | brandId: brandId, |
@@ -22,12 +27,26 @@ function getCategory(shopId, brandId, level , sortId) { | @@ -22,12 +27,26 @@ function getCategory(shopId, brandId, level , sortId) { | ||
22 | Object.assign(opts, {sortId}); | 27 | Object.assign(opts, {sortId}); |
23 | } | 28 | } |
24 | 29 | ||
25 | - return request.get(apiUrl.category, { | 30 | + return request.get(apiUrl.sort, { |
26 | params: opts | 31 | params: opts |
27 | - }); | 32 | + }).then((result) => result.data); |
33 | +} | ||
34 | + | ||
35 | +function getColor() { | ||
36 | + return request.get(apiUrl.color).then((result) => result.data) | ||
37 | +} | ||
38 | + | ||
39 | +function getSize(smallSortId) { | ||
40 | + return request.get(apiUrl.size, { | ||
41 | + params: { | ||
42 | + sortId: smallSortId | ||
43 | + } | ||
44 | + }).then(result => result.data) | ||
28 | } | 45 | } |
29 | 46 | ||
30 | export default { | 47 | export default { |
31 | getBrand, | 48 | getBrand, |
32 | - getCategory | 49 | + getSort, |
50 | + getColor, | ||
51 | + getSize | ||
33 | } | 52 | } |
@@ -4,7 +4,22 @@ | @@ -4,7 +4,22 @@ | ||
4 | 4 | ||
5 | export default () => { | 5 | export default () => { |
6 | return { | 6 | return { |
7 | - brand: {}, | ||
8 | - sort: {} | 7 | + shopId: '', |
8 | + brandId: '', | ||
9 | + brandName: '', | ||
10 | + maxSortId: '', | ||
11 | + middleSortId: '', | ||
12 | + smallSortId: '', | ||
13 | + sortName: '', | ||
14 | + productName: '', | ||
15 | + phrase: '', | ||
16 | + factoryCode: '', | ||
17 | + goodsYears: '', | ||
18 | + goodsSeason: '', | ||
19 | + gender: '', | ||
20 | + seasons: '', | ||
21 | + ageLevel: [], | ||
22 | + retailPrice: '', | ||
23 | + salesPrice: '' | ||
9 | }; | 24 | }; |
10 | } | 25 | } |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <Row> | 3 | <Row> |
4 | - <Form :model="formItem" :label-width="80"> | ||
5 | - <Form-item label="品 牌*"> | ||
6 | - <Select v-model="formItem.sort" placeholder="请选择"> | ||
7 | - <Option value="beijing">北京市</Option> | ||
8 | - <Option value="shanghai">上海市</Option> | ||
9 | - <Option value="shenzhen">深圳市</Option> | 4 | + <Col span="8"> |
5 | + <Form :model="product" :label-width="80"> | ||
6 | + <Form-item label="品 牌*"> | ||
7 | + <Select v-model="product.brandId" placeholder="请选择" :label-in-value="true" @on-change="selectBrand"> | ||
8 | + <Option v-for="brand in brands" :value="brand.brandId" :key="brand">{{ brand.brandName }}</Option> | ||
9 | + </Select> | ||
10 | + </Form-item> | ||
11 | + </Form> | ||
12 | + </Col> | ||
13 | + </Row> | ||
14 | + | ||
15 | + <Row> | ||
16 | + <Col span="8" v-if="show[1]"> | ||
17 | + <Form :model="product" :label-width="80"> | ||
18 | + <Form-item label="类目*"> | ||
19 | + <Select v-model="pickedSortId[1]" placeholder="一级类目" @on-change="selectSort1" :label-in-value="true"> | ||
20 | + <Option v-for="sort in sorts[1]" :value="sort.sortId" :key="sort">{{ sort.sortName }}</Option> | ||
10 | </Select> | 21 | </Select> |
11 | </Form-item> | 22 | </Form-item> |
23 | + </Form> | ||
24 | + </Col> | ||
12 | 25 | ||
13 | - <Form-item label="类目*"> | ||
14 | - <Select v-model="formItem.sort" placeholder="请选择"> | ||
15 | - <Option value="beijing">北京市</Option> | ||
16 | - <Option value="shanghai">上海市</Option> | ||
17 | - <Option value="shenzhen">深圳市</Option> | 26 | + <Col span="8" v-if="show[2]"> |
27 | + <Form :model="product"> | ||
28 | + <Form-item> | ||
29 | + <Select v-model="pickedSortId[2]" placeholder="二级类目" @on-change="selectSort2" :label-in-value="true"> | ||
30 | + <Option v-for="sort in sorts[2]" :value="sort.sortId" :key="sort">{{ sort.sortName }}</Option> | ||
18 | </Select> | 31 | </Select> |
19 | </Form-item> | 32 | </Form-item> |
20 | </Form> | 33 | </Form> |
21 | - </Row> | 34 | + </Col> |
22 | 35 | ||
36 | + <Col span="8" v-if="show[3]"> | ||
37 | + <Form :model="product"> | ||
38 | + <Form-item> | ||
39 | + <Select v-model="pickedSortId[3]" placeholder="三级类目" @on-change="selectSort3" :label-in-value="true"> | ||
40 | + <Option v-for="sort in sorts[3]" :value="sort.sortId" :key="sort">{{ sort.sortName }}</Option> | ||
41 | + </Select> | ||
42 | + </Form-item> | ||
43 | + </Form> | ||
44 | + </Col> | ||
45 | + </Row> | ||
46 | + <span>{{this.sortName}}</span> | ||
23 | <div> | 47 | <div> |
24 | <Button type="primary" @click="nextStep">下一步</Button> | 48 | <Button type="primary" @click="nextStep">下一步</Button> |
25 | </div> | 49 | </div> |
@@ -27,22 +51,40 @@ | @@ -27,22 +51,40 @@ | ||
27 | </template> | 51 | </template> |
28 | 52 | ||
29 | <script> | 53 | <script> |
30 | - | ||
31 | import api from '../api' | 54 | import api from '../api' |
32 | 55 | ||
33 | export default { | 56 | export default { |
34 | props: ['step', 'product'], | 57 | props: ['step', 'product'], |
35 | mounted : function() { | 58 | mounted : function() { |
59 | + this.shopId = this.$cookie.get('SHOP_ID'); | ||
36 | this.getBrand(); | 60 | this.getBrand(); |
37 | }, | 61 | }, |
38 | data() { | 62 | data() { |
39 | return { | 63 | return { |
40 | - formItem: { | ||
41 | - brand: '', | ||
42 | - sort: '' | ||
43 | - }, | ||
44 | brands: [], | 64 | brands: [], |
45 | - sorts: [] | 65 | + sorts: { |
66 | + 1: [], | ||
67 | + 2: [], | ||
68 | + 3: [] | ||
69 | + }, | ||
70 | + pickedSortId: { | ||
71 | + 1: '', | ||
72 | + 2: '', | ||
73 | + 3: '' | ||
74 | + }, | ||
75 | + pickedLabel: { | ||
76 | + 1: '', | ||
77 | + 2: '', | ||
78 | + 3: '' | ||
79 | + }, | ||
80 | + show: { | ||
81 | + 1: true, | ||
82 | + 2: false, | ||
83 | + 3: false | ||
84 | + }, | ||
85 | + shopId: '', | ||
86 | + level: 1, | ||
87 | + sortId: '', | ||
46 | } | 88 | } |
47 | }, | 89 | }, |
48 | methods: { | 90 | methods: { |
@@ -50,16 +92,62 @@ | @@ -50,16 +92,62 @@ | ||
50 | this.step.value = 1; | 92 | this.step.value = 1; |
51 | this.$router.push({name:'product.create.step2'}); | 93 | this.$router.push({name:'product.create.step2'}); |
52 | }, | 94 | }, |
53 | - selectBrand: function() { | ||
54 | - | 95 | + selectSort1: function(value) { |
96 | + this.level = 2; | ||
97 | + this.sortId= this.pickedSortId[1]; | ||
98 | + this.pickedLabel[1] = value.label; | ||
99 | + this.product.maxSortId = this.sortId; | ||
100 | + this.sorts[2] = []; | ||
101 | + this.sorts[3] = []; | ||
102 | + this.getSort(); | ||
55 | }, | 103 | }, |
56 | - selectSort: function() { | ||
57 | - | 104 | + selectSort2: function(value) { |
105 | + this.level = 3; | ||
106 | + this.sortId= this.pickedSortId[2]; | ||
107 | + this.pickedLabel[2] = value.label; | ||
108 | + this.product.middleSortId = this.sortId; | ||
109 | + this.getSort(); | ||
110 | + }, | ||
111 | + selectSort3: function(value) { | ||
112 | + this.sortId= this.pickedSortId[3]; | ||
113 | + this.pickedLabel[3] = value.label; | ||
114 | + this.product.smallSortId = this.sortId; | ||
115 | + }, | ||
116 | + selectBrand: function(value) { | ||
117 | + console.log(value); | ||
118 | + this.product.brandName = value.label; | ||
58 | }, | 119 | }, |
59 | getBrand: function() { | 120 | getBrand: function() { |
60 | - api.getBrand(this.$cookie.get('SHOP_ID')).then((result) => { | ||
61 | - console.log(result); | 121 | + return api.getBrand(this.shopId).then((result) => { |
122 | + if (result.code === 200) { | ||
123 | + this.brands = result.data; | ||
124 | + } | ||
62 | }); | 125 | }); |
126 | + }, | ||
127 | + getSort: function() { | ||
128 | + return api.getSort( | ||
129 | + this.shopId, | ||
130 | + this.product.brandId, | ||
131 | + this.level, | ||
132 | + this.sortId | ||
133 | + ).then((result) => { | ||
134 | + if (result.code === 200 && result.data && result.data.length > 0) { | ||
135 | + this.sorts[this.level] = result.data; | ||
136 | + this.show[this.level] = true; | ||
137 | + } | ||
138 | + }); | ||
139 | + } | ||
140 | + }, | ||
141 | + computed: { | ||
142 | + sortName: function() { | ||
143 | + return this.product.sortName = `${this.pickedLabel[1]}/${this.pickedLabel[2]}/${this.pickedLabel[3]}` | ||
144 | + } | ||
145 | + }, | ||
146 | + watch: { | ||
147 | + 'product.brandId': function() { | ||
148 | + this.level = 1; | ||
149 | + this.sortId = ''; | ||
150 | + this.getSort(); | ||
63 | } | 151 | } |
64 | } | 152 | } |
65 | } | 153 | } |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <Row> | ||
4 | - <Form :model="formItem" :label-width="80"> | ||
5 | - <Form-item label="品 牌*"> | ||
6 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
7 | - <Option value="beijing">北京市</Option> | ||
8 | - <Option value="shanghai">上海市</Option> | ||
9 | - <Option value="shenzhen">深圳市</Option> | ||
10 | - </Select> | ||
11 | - </Form-item> | 3 | + <Form :model="product" :label-width="80"> |
4 | + <Row> | ||
5 | + <Col span="8"> | ||
6 | + <Form-item> | ||
7 | + <span>商品基本信息</span> | ||
8 | + </Form-item> | ||
9 | + </Col> | ||
10 | + </Row> | ||
12 | 11 | ||
13 | - <Form-item label="类目*"> | ||
14 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
15 | - <Option value="beijing">北京市</Option> | ||
16 | - <Option value="shanghai">上海市</Option> | ||
17 | - <Option value="shenzhen">深圳市</Option> | ||
18 | - </Select> | ||
19 | - </Form-item> | 12 | + <Row> |
13 | + <Col span="8"> | ||
14 | + <Form-item label="品 牌*"> | ||
15 | + <span>{{product.brandName}}</span> | ||
16 | + </Form-item> | ||
17 | + </Col> | ||
18 | + </Row> | ||
20 | 19 | ||
21 | - <Form-item label="商品名称*"> | ||
22 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
23 | - <Option value="beijing">北京市</Option> | ||
24 | - <Option value="shanghai">上海市</Option> | ||
25 | - <Option value="shenzhen">深圳市</Option> | ||
26 | - </Select> | ||
27 | - </Form-item> | 20 | + <Row> |
21 | + <Col span="8"> | ||
22 | + <Form-item label="类目*"> | ||
23 | + <span>{{product.sortName}}</span> | ||
24 | + </Form-item> | ||
25 | + </Col> | ||
26 | + </Row> | ||
28 | 27 | ||
29 | - <Form-item label="商品卖点*"> | ||
30 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
31 | - <Option value="beijing">北京市</Option> | ||
32 | - <Option value="shanghai">上海市</Option> | ||
33 | - <Option value="shenzhen">深圳市</Option> | ||
34 | - </Select> | ||
35 | - </Form-item> | 28 | + <Row> |
29 | + <Col span="8"> | ||
30 | + <Form-item label="商品名称*"> | ||
31 | + <Input v-model="product.productName" placeholder="请输入..."/> | ||
32 | + </Form-item> | ||
33 | + </Col> | ||
34 | + </Row> | ||
36 | 35 | ||
37 | - <Form-item label="商品编码*"> | ||
38 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
39 | - <Option value="beijing">北京市</Option> | ||
40 | - <Option value="shanghai">上海市</Option> | ||
41 | - <Option value="shenzhen">深圳市</Option> | ||
42 | - </Select> | ||
43 | - </Form-item> | 36 | + <Row> |
37 | + <Col span="8"> | ||
38 | + <Form-item label="商品卖点*"> | ||
39 | + <Input v-model="product.phrase" type="textarea" :rows="4" placeholder="请输入..."/> | ||
40 | + </Form-item> | ||
41 | + </Col> | ||
42 | + </Row> | ||
43 | + | ||
44 | + <Row> | ||
45 | + <Col span="8"> | ||
46 | + <Form-item label="商品编码*"> | ||
47 | + <Input v-model="product.factoryCode" placeholder="请输入..."/> | ||
48 | + </Form-item> | ||
49 | + </Col> | ||
50 | + </Row> | ||
51 | + | ||
52 | + <Row> | ||
53 | + <Col span="8"> | ||
54 | + <Form-item label="货品年*"> | ||
55 | + <Date-picker type="year" placeholder="选择年" style="width: 200px"></Date-picker> | ||
56 | + </Form-item> | ||
57 | + </Col> | ||
58 | + </Row> | ||
59 | + | ||
60 | + <Row> | ||
61 | + <Col span="8"> | ||
62 | + <Form-item label="货品季*"> | ||
63 | + <Select v-model="product.goodsSeason" placeholder="请选择"> | ||
64 | + <Option value="1">春季</Option> | ||
65 | + <Option value="2">夏季</Option> | ||
66 | + <Option value="3">秋季</Option> | ||
67 | + <Option value="4">冬季</Option> | ||
68 | + <Option value="5">春夏季</Option> | ||
69 | + <Option value="6">秋冬季</Option> | ||
70 | + </Select> | ||
71 | + </Form-item> | ||
72 | + </Col> | ||
73 | + </Row> | ||
44 | 74 | ||
45 | - <Form-item label="商品编码*"> | ||
46 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
47 | - <Option value="beijing">北京市</Option> | ||
48 | - <Option value="shanghai">上海市</Option> | ||
49 | - <Option value="shenzhen">深圳市</Option> | ||
50 | - </Select> | 75 | + <Row> |
76 | + <Col span="8"> | ||
77 | + <Form-item label="上市日期*"> | ||
78 | + <Date-picker type="date" placeholder="选择日期" style="width: 200px"></Date-picker> | ||
51 | </Form-item> | 79 | </Form-item> |
80 | + </Col> | ||
81 | + </Row> | ||
52 | 82 | ||
83 | + <Form-item label="性别*"> | ||
84 | + <Radio-group v-model="product.gender"> | ||
85 | + <Radio label="1"> | ||
86 | + <span>男</span> | ||
87 | + </Radio> | ||
88 | + <Radio label="2"> | ||
89 | + <span>女</span> | ||
90 | + </Radio> | ||
91 | + <Radio label="3"> | ||
92 | + <span>通用</span> | ||
93 | + </Radio> | ||
94 | + </Radio-group> | ||
95 | + </Form-item> | ||
53 | 96 | ||
54 | - <Form-item label="货品年*"> | ||
55 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
56 | - <Option value="beijing">北京市</Option> | ||
57 | - <Option value="shanghai">上海市</Option> | ||
58 | - <Option value="shenzhen">深圳市</Option> | ||
59 | - </Select> | 97 | + <Form-item label="适销季*"> |
98 | + <Radio-group v-model="product.seasons"> | ||
99 | + <Radio label="1"> | ||
100 | + <span>春秋</span> | ||
101 | + </Radio> | ||
102 | + <Radio label="2"> | ||
103 | + <span>夏</span> | ||
104 | + </Radio> | ||
105 | + <Radio label="3"> | ||
106 | + <span>冬</span> | ||
107 | + </Radio> | ||
108 | + <Radio label="4"> | ||
109 | + <span>四季</span> | ||
110 | + </Radio> | ||
111 | + </Radio-group> | ||
112 | + </Form-item> | ||
113 | + | ||
114 | + | ||
115 | + <Form-item label="年龄层*"> | ||
116 | + <Checkbox-group v-model="product.ageLevel"> | ||
117 | + <Checkbox label="1"> | ||
118 | + <span>成人</span> | ||
119 | + </Checkbox> | ||
120 | + <Checkbox label="2"> | ||
121 | + <span>大童</span> | ||
122 | + </Checkbox> | ||
123 | + <Checkbox label="4"> | ||
124 | + <span>中童</span> | ||
125 | + </Checkbox> | ||
126 | + <Checkbox label="3"> | ||
127 | + <span>小童</span> | ||
128 | + </Checkbox> | ||
129 | + <Checkbox label="5"> | ||
130 | + <span>幼童 </span> | ||
131 | + </Checkbox> | ||
132 | + </Checkbox-group> | ||
133 | + </Form-item> | ||
134 | + | ||
135 | + <Row> | ||
136 | + <Col span="8"> | ||
137 | + <span>商品规格</span> | ||
138 | + </Col> | ||
139 | + </Row> | ||
140 | + | ||
141 | + <Row> | ||
142 | + <Form-item label="颜色*"> | ||
143 | + <span class='squre' v-for="color in colors" @click="clickColor(color)"> | ||
144 | + <span class="squre-color" :style="{ 'background-color': '#' + color.colorCode}"></span> | ||
145 | + <span class="squre-name">{{color.colorName}}</span> | ||
146 | + </span> | ||
60 | </Form-item> | 147 | </Form-item> |
148 | + </Row> | ||
61 | 149 | ||
62 | - <Form-item label="货品季*"> | ||
63 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
64 | - <Option value="beijing">北京市</Option> | ||
65 | - <Option value="shanghai">上海市</Option> | ||
66 | - <Option value="shenzhen">深圳市</Option> | ||
67 | - </Select> | 150 | + <Row> |
151 | + <Form-item label="尺寸*"> | ||
152 | + <Checkbox-group v-model="table.selectedSizes" @on-change="clickSize"> | ||
153 | + <Checkbox v-for="size in sizes" :key="size" :label="size.id" > | ||
154 | + <span>{{size.sizeName}}</span> | ||
155 | + </Checkbox> | ||
156 | + </Checkbox-group> | ||
68 | </Form-item> | 157 | </Form-item> |
158 | + </Row> | ||
69 | 159 | ||
70 | - <Form-item label="性别*"> | ||
71 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
72 | - <Option value="beijing">北京市</Option> | ||
73 | - <Option value="shanghai">上海市</Option> | ||
74 | - <Option value="shenzhen">深圳市</Option> | ||
75 | - </Select> | 160 | + <Row> |
161 | + <Form-item > | ||
162 | + <Table :columns="table.columns" :data="table.data"></Table> | ||
76 | </Form-item> | 163 | </Form-item> |
164 | + </Row> | ||
77 | 165 | ||
78 | - <Form-item label="适销季*"> | ||
79 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
80 | - <Option value="beijing">北京市</Option> | ||
81 | - <Option value="shanghai">上海市</Option> | ||
82 | - <Option value="shenzhen">深圳市</Option> | ||
83 | - </Select> | 166 | + <Row> |
167 | + <Col span="8"> | ||
168 | + <Form-item> | ||
169 | + <span>商品价格</span> | ||
84 | </Form-item> | 170 | </Form-item> |
171 | + </Col> | ||
172 | + </Row> | ||
173 | + | ||
174 | + <Row> | ||
175 | + <Col span="8"> | ||
176 | + <Form-item label="吊牌价*"> | ||
177 | + <Input v-model="product.retailPrice" placeholder="请输入..."/> | ||
178 | + </Form-item> | ||
179 | + </Col> | ||
180 | + </Row> | ||
85 | 181 | ||
86 | 182 | ||
87 | - <Form-item label="年龄层*"> | ||
88 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
89 | - <Option value="beijing">北京市</Option> | ||
90 | - <Option value="shanghai">上海市</Option> | ||
91 | - <Option value="shenzhen">深圳市</Option> | ||
92 | - </Select> | 183 | + <Row> |
184 | + <Col span="8"> | ||
185 | + <Form-item label="销售价*"> | ||
186 | + <Input v-model="product.salesPrice" placeholder="请输入..."/> | ||
93 | </Form-item> | 187 | </Form-item> |
94 | - </Form> | ||
95 | - </Row> | 188 | + </Col> |
189 | + </Row> | ||
190 | + | ||
191 | + </Form> | ||
96 | 192 | ||
97 | <div> | 193 | <div> |
98 | <Button type="primary" @click="backStep">上一步</Button> | 194 | <Button type="primary" @click="backStep">上一步</Button> |
@@ -102,16 +198,59 @@ | @@ -102,16 +198,59 @@ | ||
102 | </template> | 198 | </template> |
103 | 199 | ||
104 | <script> | 200 | <script> |
201 | + | ||
202 | + import api from '../api'; | ||
203 | + | ||
105 | export default { | 204 | export default { |
106 | props: ['step', 'product'], | 205 | props: ['step', 'product'], |
107 | data() { | 206 | data() { |
108 | return { | 207 | return { |
109 | - formItem: { | ||
110 | - brand: '', | 208 | + colors: [], |
209 | + sizes: [], | ||
210 | + table: { | ||
211 | + columns: [ | ||
212 | + { | ||
213 | + title: '色系名称', | ||
214 | + key: 'colorName' | ||
215 | + }, | ||
216 | + { | ||
217 | + title: '颜色展示名称*', | ||
218 | + key: 'color' | ||
219 | + }, | ||
220 | + { | ||
221 | + title: '色卡图片*', | ||
222 | + key: 'address' | ||
223 | + }, | ||
224 | + { | ||
225 | + title: '类型编码', | ||
226 | + key: 'name' | ||
227 | + }, | ||
228 | + { | ||
229 | + title: '尺码*', | ||
230 | + key: 'age' | ||
231 | + }, | ||
232 | + { | ||
233 | + title: '商品条码*', | ||
234 | + key: 'address' | ||
235 | + }, | ||
236 | + { | ||
237 | + title: '操作', | ||
238 | + key: 'address' | ||
239 | + } | ||
240 | + ], | ||
241 | + data: [ | ||
111 | 242 | ||
112 | - }, | 243 | + ], |
244 | + selectedSizes: [], | ||
245 | + selectedColors: [] | ||
246 | + } | ||
113 | } | 247 | } |
114 | }, | 248 | }, |
249 | + mounted: function() { | ||
250 | + console.log(this.product); | ||
251 | + this.getColor(); | ||
252 | + this.getSize(); | ||
253 | + }, | ||
115 | methods: { | 254 | methods: { |
116 | nextStep: function() { | 255 | nextStep: function() { |
117 | this.step.value = 2; | 256 | this.step.value = 2; |
@@ -120,11 +259,56 @@ | @@ -120,11 +259,56 @@ | ||
120 | backStep: function() { | 259 | backStep: function() { |
121 | this.step.value = 0; | 260 | this.step.value = 0; |
122 | this.$router.push({name:'product.create.step1'}) | 261 | this.$router.push({name:'product.create.step1'}) |
262 | + }, | ||
263 | + getColor: function() { | ||
264 | + return api.getColor().then((result) => { | ||
265 | + if (result.code === 200) { | ||
266 | + this.colors = result.data; | ||
267 | + } | ||
268 | + }); | ||
269 | + }, | ||
270 | + getSize: function() { | ||
271 | + return api.getSize(119).then((result) => { | ||
272 | + if(result.code === 200) { | ||
273 | + this.sizes = result.data; | ||
274 | + } | ||
275 | + }); | ||
276 | + }, | ||
277 | + clickColor: function(color) { | ||
278 | + console.log(color) | ||
279 | + }, | ||
280 | + clickSize: function(size) { | ||
281 | + console.log(size); | ||
282 | + }, | ||
283 | + | ||
284 | + }, | ||
285 | + watch: { | ||
286 | + 'table.selectedSizes': function() { | ||
287 | + console.log(this.table.selectedSizes); | ||
123 | } | 288 | } |
124 | } | 289 | } |
125 | } | 290 | } |
126 | </script> | 291 | </script> |
127 | 292 | ||
128 | <style lang="scss" scoped> | 293 | <style lang="scss" scoped> |
294 | + .squre { | ||
295 | + display: inline-block; | ||
296 | + height: 30px; | ||
297 | + margin-right: 10px; | ||
298 | + cursor: pointer; | ||
299 | + } | ||
129 | 300 | ||
301 | + .squre-color { | ||
302 | + display: inline-block; | ||
303 | + height: 30px; | ||
304 | + width: 30px; | ||
305 | + border: 1px solid gainsboro; | ||
306 | + } | ||
307 | + | ||
308 | + .squre-name { | ||
309 | + display: inline-block; | ||
310 | + height: 30px; | ||
311 | + line-height: 30px; | ||
312 | + vertical-align: top; | ||
313 | + } | ||
130 | </style> | 314 | </style> |
@@ -2,21 +2,90 @@ | @@ -2,21 +2,90 @@ | ||
2 | <div> | 2 | <div> |
3 | <Row> | 3 | <Row> |
4 | <Form :model="formItem" :label-width="80"> | 4 | <Form :model="formItem" :label-width="80"> |
5 | - <Form-item label="品 牌*"> | ||
6 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
7 | - <Option value="beijing">北京市</Option> | ||
8 | - <Option value="shanghai">上海市</Option> | ||
9 | - <Option value="shenzhen">深圳市</Option> | ||
10 | - </Select> | ||
11 | - </Form-item> | ||
12 | - | ||
13 | - <Form-item label="类目*"> | ||
14 | - <Select v-model="formItem.select" placeholder="请选择"> | ||
15 | - <Option value="beijing">北京市</Option> | ||
16 | - <Option value="shanghai">上海市</Option> | ||
17 | - <Option value="shenzhen">深圳市</Option> | ||
18 | - </Select> | ||
19 | - </Form-item> | 5 | + <Row> |
6 | + <Col span="8"> | ||
7 | + <Form-item> | ||
8 | + <span>网销信息</span> | ||
9 | + </Form-item> | ||
10 | + </Col> | ||
11 | + </Row> | ||
12 | + | ||
13 | + <Row> | ||
14 | + <Col span="8"> | ||
15 | + <Form-item> | ||
16 | + <span>商品颜色主图</span> | ||
17 | + </Form-item> | ||
18 | + </Col> | ||
19 | + </Row> | ||
20 | + | ||
21 | + <Row> | ||
22 | + | ||
23 | + </Row> | ||
24 | + | ||
25 | + <Row> | ||
26 | + <Col span="8"> | ||
27 | + <Form-item> | ||
28 | + <span>商品描述</span> | ||
29 | + </Form-item> | ||
30 | + </Col> | ||
31 | + </Row> | ||
32 | + | ||
33 | + <Row> | ||
34 | + | ||
35 | + </Row> | ||
36 | + | ||
37 | + <Row> | ||
38 | + <Col span="8"> | ||
39 | + <Form-item> | ||
40 | + <span>商品属性</span> | ||
41 | + </Form-item> | ||
42 | + </Col> | ||
43 | + </Row> | ||
44 | + | ||
45 | + <Row> | ||
46 | + <Col span="8"> | ||
47 | + <Form-item label="面料材质"> | ||
48 | + <Select v-model="product.goodsSeason" placeholder="请选择面料材质"> | ||
49 | + <Option value="1">春季</Option> | ||
50 | + <Option value="2">夏季</Option> | ||
51 | + <Option value="3">秋季</Option> | ||
52 | + <Option value="4">冬季</Option> | ||
53 | + <Option value="5">春夏季</Option> | ||
54 | + <Option value="6">秋冬季</Option> | ||
55 | + </Select> | ||
56 | + </Form-item> | ||
57 | + </Col> | ||
58 | + </Row> | ||
59 | + | ||
60 | + <Row> | ||
61 | + <Form-item label="洗涤题示"> | ||
62 | + | ||
63 | + </Form-item> | ||
64 | + </Row> | ||
65 | + | ||
66 | + <Row> | ||
67 | + <Col span="8"> | ||
68 | + <Form-item label="透气性"> | ||
69 | + <Select v-model="product.goodsSeason" placeholder="请选择"> | ||
70 | + <Option value="1">春季</Option> | ||
71 | + <Option value="2">夏季</Option> | ||
72 | + <Option value="3">秋季</Option> | ||
73 | + <Option value="4">冬季</Option> | ||
74 | + <Option value="5">春夏季</Option> | ||
75 | + <Option value="6">秋冬季</Option> | ||
76 | + </Select> | ||
77 | + </Form-item> | ||
78 | + </Col> | ||
79 | + </Row> | ||
80 | + | ||
81 | + <Row> | ||
82 | + <Row> | ||
83 | + <Form-item label="风格题示"> | ||
84 | + | ||
85 | + </Form-item> | ||
86 | + </Row> | ||
87 | + </Row> | ||
88 | + | ||
20 | </Form> | 89 | </Form> |
21 | </Row> | 90 | </Row> |
22 | 91 |
@@ -7,7 +7,10 @@ let domainApis = { | @@ -7,7 +7,10 @@ let domainApis = { | ||
7 | }, | 7 | }, |
8 | platform: { | 8 | platform: { |
9 | queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid', | 9 | queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid', |
10 | - getSellerBrandInfo: '/SellerProductController/getSellerBrandInfo' | 10 | + getSellerBrandInfo: '/SellerProductController/getSellerBrandInfo', |
11 | + getSellerSortInfo: '/SellerProductController/getSellerSortInfo', | ||
12 | + querySellerProductColors: '/SellerProductController/querySellerProductColors', | ||
13 | + querySortSize: '/SellerSortSizeController/querySortSize' | ||
11 | } | 14 | } |
12 | }; | 15 | }; |
13 | 16 |
server/common/apiDomain.js
deleted
100644 → 0
1 | -const _ = require('lodash'); | ||
2 | - | ||
3 | -// 域名列表 | ||
4 | -const domains = { | ||
5 | - auth: 'http://serve.yohobuy.com', | ||
6 | - shop: 'http://192.168.102.210:8088/platform' | ||
7 | -}; | ||
8 | - | ||
9 | -// api调用列表 | ||
10 | -let domainApis = { | ||
11 | - auth: { | ||
12 | - login: { | ||
13 | - path: '/service/account/v1/Profile/login' | ||
14 | - } | ||
15 | - }, | ||
16 | - shop: { | ||
17 | - profile: { | ||
18 | - path: '/SellerShopController/queryShopsByAdminPid' | ||
19 | - }, | ||
20 | - brand: { | ||
21 | - path: '/SellerProductController/getSellerBrandInfo' | ||
22 | - }, | ||
23 | - sort: { | ||
24 | - path: '/SellerProductController/getSellerSortInfo' | ||
25 | - } | ||
26 | - } | ||
27 | -}; | ||
28 | - | ||
29 | -_.each(domainApis, (apis, domainName) => { | ||
30 | - _.each(apis, (uri, api) => { | ||
31 | - apis[api].url = domains[domainName] + uri.path; | ||
32 | - }); | ||
33 | -}); | ||
34 | - | ||
35 | - | ||
36 | -module.exports = domainApis; |
@@ -24,6 +24,7 @@ module.exports = (req, res, next) => { | @@ -24,6 +24,7 @@ module.exports = (req, res, next) => { | ||
24 | message: '无权限访问的接口' | 24 | message: '无权限访问的接口' |
25 | }); | 25 | }); |
26 | } | 26 | } |
27 | + | ||
27 | let apiUrl = _.get(apiDomain, apiMap); | 28 | let apiUrl = _.get(apiDomain, apiMap); |
28 | 29 | ||
29 | if (!apiUrl) { | 30 | if (!apiUrl) { |
-
Please register or login to post a comment