Showing
9 changed files
with
895 additions
and
30 deletions
.vscode/launch.json
0 → 100644
1 | +{ | ||
2 | + // 使用 IntelliSense 了解相关属性。 | ||
3 | + // 悬停以查看现有属性的描述。 | ||
4 | + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
5 | + "version": "0.2.0", | ||
6 | + "configurations": [ | ||
7 | + { | ||
8 | + "type": "node", | ||
9 | + "request": "attach", | ||
10 | + "name": "Attach by Process ID", | ||
11 | + "processId": "5390", | ||
12 | + "skipFiles": [ | ||
13 | + "<node_internals>/**", | ||
14 | + ], | ||
15 | + "sourceMaps": true, | ||
16 | + "internalConsoleOptions": "openOnSessionStart" | ||
17 | + } | ||
18 | + ] | ||
19 | +} |
@@ -9,40 +9,110 @@ | @@ -9,40 +9,110 @@ | ||
9 | !--> | 9 | !--> |
10 | <template> | 10 | <template> |
11 | <LayoutApp :show-back="true" title="商品详情"> | 11 | <LayoutApp :show-back="true" title="商品详情"> |
12 | - <div class="second-detail-wrap"> | ||
13 | - UfoSecondProductDetail | 12 | + <LayoutScroll |
13 | + ref="pageScroll" | ||
14 | + class="second-detail-wrap" | ||
15 | + @scroll-end="''"> | ||
16 | + <cube-slide v-if="info.imageList" :options="slideOptions" :data="info.imageList" :loop='false'> | ||
17 | + <cube-slide-item v-for="(item, index) in info.imageList" :key="index"> | ||
18 | + <img-size :src="item" :width="375" :height="375" /> | ||
19 | + <div class="pole-dot-area"></div> | ||
20 | + </cube-slide-item> | ||
21 | + <template slot="dots" slot-scope="props"> | ||
22 | + <div class="dot-wrap"> | ||
23 | + <span class="cube-dot" :class="{active: props.current === index}" v-for="(item, index) in props.dots" :key="item">•</span> | ||
24 | + </div> | ||
25 | + </template> | ||
26 | + </cube-slide> | ||
27 | + <div class="primary"> | ||
28 | + <div> | ||
29 | + <p class="price">¥{{info.price}}</p> | ||
30 | + <p class="size">{{info.sizeName}}</p> | ||
31 | + </div> | ||
32 | + <p class="name">{{info.describeInfo}}</p> | ||
33 | + </div> | ||
34 | + <div class="other-info"> | ||
35 | + <p>男款 Jordan brand</p> | ||
36 | + <p>状况:氧化泛黄</p> | ||
37 | + <p>鞋盒:{{ info.shoeBoxDesc }}</p> | ||
38 | + <p>售出时间:{{ info.soldTime }}</p> | ||
39 | + <p>{{ info.shoeQualityDesc }}</p> | ||
40 | + </div> | ||
41 | + <div class="extra-card"> | ||
42 | + <img-size class='image' src="//upyun.h800.com.cn/goods/1522828276980.png!/sq/1000" :width="375" :height="375" /> | ||
43 | + <div class="middle"> | ||
44 | + <p class="name ellipsis">Air Jordan 1 Rebel 20 Chicago Air Jordan 1 Rebel 20 Chicago</p> | ||
45 | + <p class="number ellipsis">货号 8764212-001</p> | ||
46 | + </div> | ||
47 | + <span class="iconfont iconright"></span> | ||
48 | + </div> | ||
49 | + </LayoutScroll> | ||
50 | + <div class="fixed-footer"> | ||
51 | + <cube-button class="buy active" @click="buy">购买 <span class="price">¥1209.00</span></cube-button> | ||
14 | </div> | 52 | </div> |
53 | + | ||
54 | + <Filtrate ref="filtrate" :yasParams="{P_NAME: 'XY_UFOSearchList', TYPE_ID: 1}"></Filtrate> | ||
15 | </LayoutApp> | 55 | </LayoutApp> |
16 | </template> | 56 | </template> |
17 | 57 | ||
18 | <script> | 58 | <script> |
59 | +import { Button, Slide } from 'cube-ui'; | ||
60 | +import { mapState } from 'vuex' | ||
61 | + | ||
62 | +import ImgSize from '@/components/img-size'; | ||
63 | +import Filtrate from './filtrate'; | ||
64 | + | ||
65 | + | ||
66 | +const info = { | ||
67 | + "brandName": "NIKE", | ||
68 | + "colorName": "黑色", | ||
69 | + "describeInfo": "ggAir Jordan 4 Retro Motorsport Away BG AJ4 赛车白40839787-002g", | ||
70 | + "gender": "男款", | ||
71 | + "image": "", | ||
72 | + "imageList": [ | ||
73 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/01f5f36a2ce3e935b7481a658466c574af.jpg", | ||
74 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/0150f24aed5fe9f26df7516c9479ee39c8.jpg", | ||
75 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/01f247d64097dfadd5d510621e9d69abc3.jpg", | ||
76 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/01e758d028aeb48d40e656a708488844dc.jpg", | ||
77 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/017d63f422ee227a6fa519d44d7aa27f7f.jpg", | ||
78 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/01a15766233785ea70f2fda57e1e906ce4.jpg", | ||
79 | + "http://img11.static.yhbimg.com/goodsimg/2019/11/07/17/01701885a5ca6b7cf8cae2fca6c0e36795.jpg" | ||
80 | + ], | ||
81 | + "price": "99.00", | ||
82 | + "productCode": "TB-011-A-BLK-GLD-49", | ||
83 | + "productId": 10014795, | ||
84 | + "productName": "DXF测试商品", | ||
85 | + "sechondHandTypeName": "二手", | ||
86 | + "shoeBoxDesc": "完好", | ||
87 | + "shoeQualityDesc": "该商品没有明显瑕疵", | ||
88 | + "sizeName": "37 2/3码", | ||
89 | + "soldTime": "2019.03.12", | ||
90 | + "status": 1 | ||
91 | +} | ||
92 | + | ||
93 | + | ||
19 | export default { | 94 | export default { |
20 | - // watchQuery: [], | ||
21 | - // layouts: '', | ||
22 | - // head() { | ||
23 | - // return { | ||
24 | - // title: '', | ||
25 | - // meta: [{ hid: 'keywords', name: 'keywords', content: '' },{ hid: 'hid', name: 'description', content: '' }], | ||
26 | - // // link: [{ rel: 'stylesheet', href: '' }], | ||
27 | - // // script: [{ src: '' }] | ||
28 | - // } | ||
29 | - // }, | ||
30 | name: 'UfoSecondProductDetail', | 95 | name: 'UfoSecondProductDetail', |
31 | mixins: [], | 96 | mixins: [], |
32 | props: { | 97 | props: { |
33 | skup: Number | 98 | skup: Number |
34 | }, | 99 | }, |
35 | - // // 服务端渲染函数 | ||
36 | - // async asyncData ({ isDev, route, store, env, params, query, req, res, redirect, error }) { | ||
37 | - // return {} | ||
38 | - // }, | ||
39 | - data() { | ||
40 | - return {} | 100 | + // 服务端渲染函数 |
101 | + asyncData({store, router}) { | ||
102 | + return store.dispatch('second/fetchDetailById', { skup: router.params.skup }); | ||
103 | + }, | ||
104 | + data(){ | ||
105 | + return { | ||
106 | + slideOptions: { | ||
107 | + eventPassthrough: 'vertical' | ||
108 | + }, | ||
109 | + | ||
110 | + info | ||
111 | + } | ||
41 | }, | 112 | }, |
42 | created() {}, | 113 | created() {}, |
43 | mounted() { | 114 | mounted() { |
44 | - // | ||
45 | - // this.skup | 115 | + console.log('mounted', this.info); |
46 | }, | 116 | }, |
47 | activated() {}, | 117 | activated() {}, |
48 | deactivated() {}, | 118 | deactivated() {}, |
@@ -50,18 +120,193 @@ export default { | @@ -50,18 +120,193 @@ export default { | ||
50 | // beforeRouteUpdate(to, from, next) {}, | 120 | // beforeRouteUpdate(to, from, next) {}, |
51 | // beforeRouteLeave(to, from, next) {}, | 121 | // beforeRouteLeave(to, from, next) {}, |
52 | destroyed() {}, | 122 | destroyed() {}, |
53 | - methods: {}, | ||
54 | - computed: {}, | 123 | + methods: { |
124 | + // 购买 | ||
125 | + buy() { | ||
126 | + this.$refs.filtrate.show(); | ||
127 | + | ||
128 | + /** | ||
129 | + * 数据埋点 | ||
130 | + * 商品详情页点击出售/购买/求购按钮 | ||
131 | + * event: XY_UFO_PRD_DT_SALE_C | ||
132 | + * params: 1.TAB_ID:1-出售,2-购买,3-求购; | ||
133 | + * 2.PRD_ID:商品ID; | ||
134 | + */ | ||
135 | + this.$store.dispatch('reportYas', { | ||
136 | + params: { | ||
137 | + appop: 'XY_UFO_PRD_DT_SALE_C', | ||
138 | + param: { | ||
139 | + TAB_ID: 2, | ||
140 | + PRD_ID: this.productId | ||
141 | + }, | ||
142 | + } | ||
143 | + }); | ||
144 | + this.resetSelectedSize(); | ||
145 | + this.selectSizeConfig = { | ||
146 | + dest: 'OrderBuyConfirm', | ||
147 | + type: 'buy', | ||
148 | + title: '购买', | ||
149 | + }; | ||
150 | + this.showSizeSelectSheet = true; | ||
151 | + } | ||
152 | + }, | ||
153 | + computed: { | ||
154 | + // ...mapState('second', ['info']) | ||
155 | + }, | ||
55 | watch: {}, | 156 | watch: {}, |
56 | - components: {} | 157 | + components: { |
158 | + ImgSize, | ||
159 | + Filtrate, | ||
160 | + | ||
161 | + 'cube-button': Button, | ||
162 | + 'cube-slide': Slide, | ||
163 | + 'cube-slide-item': Slide.Item, | ||
164 | + } | ||
57 | }; | 165 | }; |
58 | </script> | 166 | </script> |
59 | 167 | ||
60 | /* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */ | 168 | /* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */ |
61 | <style rel='stylesheet/scss' lang='scss' scoped> | 169 | <style rel='stylesheet/scss' lang='scss' scoped> |
62 | -.second-detail-wrap { | ||
63 | - background: red; | 170 | +@import '@/pages/product/product-detail.scss'; |
171 | +.second-detail-wrap {} | ||
172 | + | ||
173 | +.ellipsis { | ||
174 | + white-space: nowrap; | ||
175 | + text-overflow: ellipsis; | ||
176 | + overflow: hidden; | ||
177 | + word-break: break-all; | ||
178 | +} | ||
179 | + | ||
180 | +/* banner */ | ||
181 | +.cube-slide { | ||
182 | + /deep/ .cube-slide-dots { | ||
183 | + padding: 0; | ||
184 | + } | ||
185 | + .cube-slide-item { | ||
186 | + img { | ||
187 | + display: flex; | ||
188 | + height: 375px; | ||
189 | + } | ||
190 | + } | ||
191 | + .pole-dot-area { | ||
192 | + width: inherit; | ||
193 | + height: 21px; | ||
194 | + } | ||
195 | + .cube-dot { | ||
196 | + display: inline-block; | ||
197 | + width: 4px; | ||
198 | + height: 4px; | ||
199 | + margin: 0 5px; | ||
200 | + background: rgba(0, 0, 0, 0.15); | ||
201 | + border-radius: 50%; | ||
202 | + &.active { | ||
203 | + transform-origin: 50% 50%; | ||
204 | + transform: scale(1.5); | ||
205 | + background: rgba(0, 0, 0, 1); | ||
206 | + } | ||
207 | + } | ||
208 | +} | ||
209 | + | ||
210 | +// product information display | ||
211 | +.primary { | ||
212 | + margin: 0 40px 40px; | ||
213 | + padding: 9px 0 0 0; | ||
214 | + border-bottom: 1px solid #eee; | ||
215 | + & > div:first-child { | ||
216 | + display: flex; | ||
217 | + justify-content: space-between; | ||
218 | + align-items: center; | ||
219 | + margin-bottom: 5px; | ||
220 | + } | ||
221 | + .price { | ||
222 | + font-size: 48px; | ||
223 | + line-height: 56px; | ||
224 | + color: #D0021B; | ||
225 | + &::first-letter { | ||
226 | + font-size: 36px; | ||
227 | + letter-spacing: 2px; | ||
228 | + } | ||
229 | + } | ||
230 | + .size { | ||
231 | + font-size: 32px; | ||
232 | + color: #000; | ||
233 | + line-height: 38px; | ||
234 | + } | ||
235 | + .name { | ||
236 | + margin-bottom: 16px; | ||
237 | + font-size: 28px; | ||
238 | + color: #999; | ||
239 | + } | ||
240 | +} | ||
241 | + | ||
242 | +// other-info | ||
243 | +.other-info { | ||
244 | + margin: 0 40px 40px; | ||
245 | + color: #000; | ||
246 | + font-size: 28px; | ||
247 | + & > p:not(:last-child) { | ||
248 | + margin-bottom: 5px; | ||
249 | + } | ||
64 | } | 250 | } |
251 | + | ||
252 | +// extra-card | ||
253 | +.extra-card { | ||
254 | + display: flex; | ||
255 | + justify-content: space-between; | ||
256 | + align-items: center; | ||
257 | + margin: 0 40px 40px; | ||
258 | + border: 1px solid #f2f2f2; | ||
259 | + border-radius: 4px; | ||
260 | + .image { | ||
261 | + max-width: 140px; | ||
262 | + max-height: 140px; | ||
263 | + margin: 0 20px; | ||
264 | + } | ||
265 | + .middle { | ||
266 | + flex: 1 1 auto; | ||
267 | + display: flex; | ||
268 | + flex-direction: column; | ||
269 | + justify-content: space-between; | ||
270 | + max-width: 420px; | ||
271 | + height: 82px; | ||
272 | + font-size: 28px; | ||
273 | + line-height: 32px; | ||
274 | + .number { | ||
275 | + font-size: 24px; | ||
276 | + color: #999; | ||
277 | + line-height: 28px; | ||
278 | + } | ||
279 | + } | ||
280 | + .iconfont { | ||
281 | + font-size: 48px; | ||
282 | + color: #999; | ||
283 | + margin-right: 20px; | ||
284 | + } | ||
285 | +} | ||
286 | + | ||
287 | +// fixed-footer | ||
288 | +.fixed-footer { | ||
289 | + position: sticky; | ||
290 | + bottom: 0; | ||
291 | + display: flex; | ||
292 | + height: 120px; | ||
293 | + padding: 16px 30px; | ||
294 | + box-shadow: 0 0 4px rgba(0, 0, 0, 0.08); | ||
295 | + text-align: center; | ||
296 | + background: #fff; | ||
297 | + @include cube-ufo-btn; | ||
298 | + | ||
299 | + .price { | ||
300 | + font-size: 28px; | ||
301 | + line-height: 32px; | ||
302 | + color: #65AB85; | ||
303 | + &::first-letter { | ||
304 | + font-size: 20px; | ||
305 | + letter-spacing: 2px; | ||
306 | + } | ||
307 | + } | ||
308 | +} | ||
309 | + | ||
65 | </style> | 310 | </style> |
66 | 311 | ||
67 | /* 定义全局样式,添加外围容器,避免覆盖全局样式, 若不需要,请删除 */ | 312 | /* 定义全局样式,添加外围容器,避免覆盖全局样式, 若不需要,请删除 */ |
apps/pages/second/filtrate.vue
0 → 100644
1 | +<!-- | ||
2 | + * @description: 筛选组件 | ||
3 | + * @fileName: filtrate.vue | ||
4 | + * @author: huzhiming | ||
5 | + * @date: 2019-11-21 18:22:33 | ||
6 | + * @后台人员: | ||
7 | + * @version: v1.0.0 | ||
8 | + * @path: 页面访问路径及参数说明 | ||
9 | + * @调用示例说明: | ||
10 | + | ||
11 | +import Filtrate from './filtrate'; | ||
12 | + | ||
13 | +<filtrate ref="filtrate" :yasParams="null"></filtrate> | ||
14 | +components: { Filtrate } | ||
15 | + | ||
16 | +this.$refs.filtrate.show(); // 开启 | ||
17 | +this.$refs.filtrate.hide(); // 关闭 | ||
18 | +this.$refs.filtrate.getParams(); // 获取筛选参数 | ||
19 | + | ||
20 | +!--> | ||
21 | +<template> | ||
22 | + <div | ||
23 | + class="container" | ||
24 | + v-show="showType" | ||
25 | + > | ||
26 | + <!-- <div class="title">筛选 | ||
27 | + <div class="cancel" @click="back()">取消</div> | ||
28 | + </div> --> | ||
29 | + <div class="content-search" v-if="filterData && filterData.length"> | ||
30 | + <div | ||
31 | + class="item" | ||
32 | + v-for="(filter,row) in filterData" :key="filter.filterId" | ||
33 | + > | ||
34 | + <div class="item-title">{{filter.filterName}}</div> | ||
35 | + <div | ||
36 | + v-if="filter.itemList && filter.itemList.length" | ||
37 | + class="item-list" | ||
38 | + > | ||
39 | + <template v-if="filter.filterId === 'brand'"> | ||
40 | + <div | ||
41 | + class="item-img-content" | ||
42 | + :class="filterParams.brand.includes(item.itemId) && 'item-img-selected'" | ||
43 | + v-for="(item,i) in filter.itemList" :key="item.itemId" | ||
44 | + :style="i===0 && 'margin-left:1rem'" | ||
45 | + @click="select({filterId:filter.filterId, itemId:item.itemId, row})" | ||
46 | + > | ||
47 | + <div class="item-img"> | ||
48 | + <img :src="(item.itemUrl || '').replace('http://', '//').replace('{width}', 280).replace('{height}', 140)" /> | ||
49 | + </div> | ||
50 | + <div class="item-img-text">{{item.itemName}}</div> | ||
51 | + </div> | ||
52 | + </template> | ||
53 | + | ||
54 | + <template v-if="filter.filterId === 'size'"> | ||
55 | + <div | ||
56 | + class="item-text item-size" | ||
57 | + :style="i===0 && 'margin-left:1rem'" | ||
58 | + :class="filterParams.size.includes(item.itemId) && 'item-text-selected'" | ||
59 | + v-for="(item,i) in filter.itemList" :key="item.itemId" | ||
60 | + @click="select({filterId:filter.filterId, itemId:item.itemId, row})" | ||
61 | + > | ||
62 | + {{item.itemName}} | ||
63 | + </div> | ||
64 | + </template> | ||
65 | + | ||
66 | + <template v-if="filter.filterId === 'sort' || filter.filterId === 'gender'"> | ||
67 | + <div | ||
68 | + class="item-text" | ||
69 | + :style="i===0 && 'margin-left:1rem'" | ||
70 | + :class="(filterParams.sort.includes(item.itemId) || filterParams.gender.includes(item.itemId)) && 'item-text-selected'" | ||
71 | + v-for="(item,i) in filter.itemList" :key="item.itemId" | ||
72 | + @click="select({filterId:filter.filterId, itemId:item.itemId, row})" | ||
73 | + > | ||
74 | + {{item.itemName}} | ||
75 | + </div> | ||
76 | + </template> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + <div class="bottom"> | ||
81 | + <div | ||
82 | + class="clear" | ||
83 | + @click="clear()" | ||
84 | + >清除</div> | ||
85 | + <div | ||
86 | + class="submit" | ||
87 | + @click="submit()" | ||
88 | + >确定</div> | ||
89 | + </div> | ||
90 | + </div> | ||
91 | +</template> | ||
92 | +<script> | ||
93 | +import { mapState, createNamespacedHelpers } from 'vuex'; | ||
94 | + | ||
95 | +const { mapActions } = createNamespacedHelpers('list'); | ||
96 | + | ||
97 | +import ImgSize from '../../components/img-size'; | ||
98 | +import { Scroll } from 'cube-ui'; | ||
99 | + | ||
100 | +const filterData = [ | ||
101 | + { | ||
102 | + "filterId": "sort", | ||
103 | + "filterName": "品类", | ||
104 | + "itemList": [ | ||
105 | + { | ||
106 | + "itemId": "44", | ||
107 | + "itemName": "运动鞋" | ||
108 | + }, | ||
109 | + { | ||
110 | + "itemId": "46", | ||
111 | + "itemName": "跑步鞋" | ||
112 | + }, | ||
113 | + { | ||
114 | + "itemId": "48", | ||
115 | + "itemName": "篮球鞋" | ||
116 | + }, | ||
117 | + { | ||
118 | + "itemId": "50", | ||
119 | + "itemName": "夹克" | ||
120 | + }, | ||
121 | + { | ||
122 | + "itemId": "52", | ||
123 | + "itemName": "卫衣" | ||
124 | + }, | ||
125 | + { | ||
126 | + "itemId": "53", | ||
127 | + "itemName": "羽绒服" | ||
128 | + }, | ||
129 | + { | ||
130 | + "itemId": "55", | ||
131 | + "itemName": "短袖T恤" | ||
132 | + }, | ||
133 | + { | ||
134 | + "itemId": "77", | ||
135 | + "itemName": "蜡烛" | ||
136 | + }, | ||
137 | + { | ||
138 | + "itemId": "2,3", | ||
139 | + "itemName": "WOMEN" | ||
140 | + } | ||
141 | + ], | ||
142 | + "multiSelect": false | ||
143 | + }, | ||
144 | + { | ||
145 | + "filterId": "size", | ||
146 | + "filterName": "尺码", | ||
147 | + "itemList": [ | ||
148 | + { | ||
149 | + "itemId": "353,557", | ||
150 | + "itemName": "XXXXL" | ||
151 | + }, | ||
152 | + { | ||
153 | + "itemId": "355", | ||
154 | + "itemName": "11.5C" | ||
155 | + }, | ||
156 | + { | ||
157 | + "itemId": "357", | ||
158 | + "itemName": "12.5C" | ||
159 | + }, | ||
160 | + { | ||
161 | + "itemId": "251", | ||
162 | + "itemName": "48.5" | ||
163 | + }, | ||
164 | + { | ||
165 | + "itemId": "253", | ||
166 | + "itemName": "49" | ||
167 | + }, | ||
168 | + { | ||
169 | + "itemId": "527", | ||
170 | + "itemName": "49 1/3" | ||
171 | + }, | ||
172 | + { | ||
173 | + "itemId": "465", | ||
174 | + "itemName": "49.5" | ||
175 | + }, | ||
176 | + { | ||
177 | + "itemId": "467", | ||
178 | + "itemName": "50.5" | ||
179 | + }, | ||
180 | + { | ||
181 | + "itemId": "667", | ||
182 | + "itemName": "36 1/2" | ||
183 | + }, | ||
184 | + { | ||
185 | + "itemId": "669", | ||
186 | + "itemName": "38 1/2" | ||
187 | + }, | ||
188 | + { | ||
189 | + "itemId": "671", | ||
190 | + "itemName": "40 1/2" | ||
191 | + }, | ||
192 | + { | ||
193 | + "itemId": "673", | ||
194 | + "itemName": "42 1/2" | ||
195 | + }, | ||
196 | + { | ||
197 | + "itemId": "469", | ||
198 | + "itemName": "51.5" | ||
199 | + } | ||
200 | + ], | ||
201 | + "multiSelect": false | ||
202 | + }, | ||
203 | + { | ||
204 | + "filterId": "brand", | ||
205 | + "filterName": "品牌", | ||
206 | + "itemList": [ | ||
207 | + { | ||
208 | + "itemId": "3", | ||
209 | + "itemName": "NIKE", | ||
210 | + "itemUrl": "http://img11.static.yhbimg.com/brandLogo/2018/12/26/14/01184d5c4485f4dcd91498fa4acb8282fc.png?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80" | ||
211 | + }, | ||
212 | + { | ||
213 | + "itemId": "5", | ||
214 | + "itemName": "AIR JORDAN", | ||
215 | + "itemUrl": "http://img11.static.yhbimg.com/brandLogo/2018/12/26/13/017147f8b0cbfb5ca24b19d89c49ae150a.png?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80" | ||
216 | + }, | ||
217 | + { | ||
218 | + "itemId": "67", | ||
219 | + "itemName": "Timberland", | ||
220 | + "itemUrl": "http://img11.static.yhbimg.com/brandLogo/2019/06/07/21/010dad728577dda6f5052bcb0b40ecbfd0.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80" | ||
221 | + }, | ||
222 | + { | ||
223 | + "itemId": "45", | ||
224 | + "itemName": "CASIO", | ||
225 | + "itemUrl": "http://img11.static.yhbimg.com/brandLogo/2019/02/26/15/0150054789d34910ac0fd2ac400c5599e7.png?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80" | ||
226 | + } | ||
227 | + ], | ||
228 | + "multiSelect": false | ||
229 | + } | ||
230 | +] | ||
231 | + | ||
232 | + | ||
233 | +export default { | ||
234 | + name: 'Filtrate', | ||
235 | + components: { ImgSize, Scroll }, | ||
236 | + props: { | ||
237 | + yasParams: Object, | ||
238 | + }, | ||
239 | + data () { | ||
240 | + return { | ||
241 | + showType: false, | ||
242 | + filterParams: { | ||
243 | + sort: [], // 品类id | ||
244 | + brand: [], // 品牌id | ||
245 | + gender: [], // 性别 | ||
246 | + size: [], // 尺码id | ||
247 | + }, | ||
248 | + filterData, | ||
249 | + filterVisible: false, | ||
250 | + copyFilterParams: { | ||
251 | + sort: [], // 品类id | ||
252 | + brand: [], // 品牌id | ||
253 | + gender: [], // 性别 | ||
254 | + size: [], // 尺码id | ||
255 | + } | ||
256 | + }; | ||
257 | + }, | ||
258 | + activated () { | ||
259 | + let params = { ...this.$route.query }; | ||
260 | + | ||
261 | + if (this.yoho.direction === 'forword') { | ||
262 | + Object.assign(this.$data, this.$options.data()); | ||
263 | + !params.order && (params.order = 'sale_desc'); | ||
264 | + this.fetchData(params); | ||
265 | + } | ||
266 | + }, | ||
267 | + | ||
268 | + computed: { | ||
269 | + ...mapState(['yoho']) | ||
270 | + }, | ||
271 | + | ||
272 | + methods: { | ||
273 | + ...mapActions(['fetchFilterData']), | ||
274 | + clear () { | ||
275 | + let filterParams = { | ||
276 | + sort: [], // 品类id | ||
277 | + brand: [], // 品牌id | ||
278 | + gender: [], // 性别 | ||
279 | + size: [], // 尺码id | ||
280 | + }; | ||
281 | + | ||
282 | + for (let item of this.filterData) { | ||
283 | + if (item.itemList && item.itemList.length === 1) { | ||
284 | + filterParams[item.filterId].push(item.itemList[0].itemId); | ||
285 | + } | ||
286 | + } | ||
287 | + this.setFilterParam(filterParams); | ||
288 | + }, | ||
289 | + | ||
290 | + fetchData: async function (params) { | ||
291 | + let filterData = await this.fetchFilterData(params); | ||
292 | + let filterParams = this.filterParams; | ||
293 | + | ||
294 | + for (let item of filterData) { | ||
295 | + if (item.itemList && item.itemList.length === 1) { | ||
296 | + filterParams[item.filterId].push(item.itemList[0].itemId); | ||
297 | + } | ||
298 | + } | ||
299 | + this.filterData = filterData; | ||
300 | + this.filterParams = filterParams; | ||
301 | + }, | ||
302 | + | ||
303 | + back () { | ||
304 | + this.filterParams = { ...this.copyFilterParams }; | ||
305 | + this.hide(); | ||
306 | + }, | ||
307 | + | ||
308 | + submit () { | ||
309 | + let routeParams = this.$route.query; | ||
310 | + | ||
311 | + this.copyFilterParams = { ...this.filterParams }; | ||
312 | + let params = { | ||
313 | + sort: this.filterParams.sort.join(',') || routeParams.sort, | ||
314 | + brand: this.filterParams.brand.join(','), // 品牌id | ||
315 | + gender: this.filterParams.gender.join(','), // 性别 | ||
316 | + size: this.filterParams.size.join(','), // 尺码id | ||
317 | + }; | ||
318 | + | ||
319 | + this.filterData.length > 0 && this.filterData.map(row => { | ||
320 | + if (row.itemList && row.itemList.length === 1) { | ||
321 | + params[row.filterId] = row.itemList[0].itemId; | ||
322 | + } | ||
323 | + }); | ||
324 | + | ||
325 | + let ENT_PARAMS = {}, ENT_ID = [], ENT_NAME = []; | ||
326 | + | ||
327 | + for (let key in params) { | ||
328 | + if (key === 'sort' && params[key]) { | ||
329 | + ENT_PARAMS.category = params[key]; | ||
330 | + ENT_ID.push(params[key]); | ||
331 | + ENT_NAME.push('品类'); | ||
332 | + } | ||
333 | + if (key === 'brand' && params[key]) { | ||
334 | + ENT_PARAMS.brand = params[key]; | ||
335 | + ENT_ID.push(params[key]); | ||
336 | + ENT_NAME.push('品牌'); | ||
337 | + } | ||
338 | + if (key === 'size' && params[key]) { | ||
339 | + ENT_PARAMS.size = params[key]; | ||
340 | + ENT_ID.push(params[key]); | ||
341 | + ENT_NAME.push('尺寸'); | ||
342 | + } | ||
343 | + if (key === 'gender' && params[key]) { | ||
344 | + ENT_PARAMS.sex = params[key]; | ||
345 | + ENT_ID.push(params[key]); | ||
346 | + ENT_NAME.push('性别'); | ||
347 | + } | ||
348 | + } | ||
349 | + this.yasParams.ENT_PARAMS = JSON.stringify(ENT_PARAMS); | ||
350 | + this.yasParams.ENT_ID = ENT_ID.toString(); | ||
351 | + this.yasParams.ENT_NAME = ENT_NAME.toString(); | ||
352 | + | ||
353 | + params.isReset = true; | ||
354 | + this.yas(this.yasParams); | ||
355 | + this.$parent.fetchList(params); | ||
356 | + this.$parent.$refs.scroll.scrollTo(0, 0, 300); | ||
357 | + this.hide(); | ||
358 | + }, | ||
359 | + | ||
360 | + getParams () { | ||
361 | + return this.filterParams; | ||
362 | + }, | ||
363 | + | ||
364 | + select ({ filterId, itemId, row }) { | ||
365 | + let optParams = this.filterParams; | ||
366 | + let filterItemArray = optParams[filterId]; | ||
367 | + let rowData = this.filterData[row]; | ||
368 | + | ||
369 | + if (rowData && rowData.itemList && rowData.itemList.length === 1) { | ||
370 | + return; | ||
371 | + } | ||
372 | + | ||
373 | + if (filterItemArray.includes(itemId)) { | ||
374 | + filterItemArray = filterItemArray.filter(item => item !== itemId); | ||
375 | + } else { | ||
376 | + if (this.filterData[row].multiSelect) { | ||
377 | + filterItemArray.push(itemId); | ||
378 | + } else { | ||
379 | + filterItemArray = [itemId]; | ||
380 | + } | ||
381 | + } | ||
382 | + optParams[filterId] = filterItemArray; | ||
383 | + this.setFilterParam(optParams); | ||
384 | + }, | ||
385 | + | ||
386 | + setFilterParam (filter) { | ||
387 | + let filterParams = this.filterParams; | ||
388 | + | ||
389 | + if (typeof filter === 'object' && Object.keys(filter).length) { | ||
390 | + for (let key in filter) { | ||
391 | + filterParams[key] = filter[key]; | ||
392 | + } | ||
393 | + this.filterParams = filterParams; | ||
394 | + } | ||
395 | + }, | ||
396 | + | ||
397 | + show () { | ||
398 | + this.showType = true; | ||
399 | + }, | ||
400 | + hide () { | ||
401 | + this.showType = false; | ||
402 | + }, | ||
403 | + yas (param) { | ||
404 | + this.$store.dispatch('reportYas', { | ||
405 | + params: { | ||
406 | + param, | ||
407 | + appop: 'XY_UFO_PRD_LIST_SCREEN_C' | ||
408 | + } | ||
409 | + }); | ||
410 | + } | ||
411 | + } | ||
412 | +}; | ||
413 | +</script> | ||
414 | +<style lang="scss" scoped> | ||
415 | +.header { | ||
416 | + width: 100%; | ||
417 | + height: 45px; | ||
418 | + padding-left: 20px; | ||
419 | + padding-right: 20px; | ||
420 | + background-color: #fff; | ||
421 | + display: flex; | ||
422 | + align-items: stretch; | ||
423 | + box-sizing: border-box; | ||
424 | +} | ||
425 | + | ||
426 | +.container { | ||
427 | + position: absolute; | ||
428 | + top: 0; | ||
429 | + left: 0; | ||
430 | + right: 0; | ||
431 | + bottom: 0; | ||
432 | + background: #fff; | ||
433 | + z-index: 999; | ||
434 | +} | ||
435 | + | ||
436 | +.title { | ||
437 | + font-size: 68px; | ||
438 | + font-weight: bold; | ||
439 | + color: #000; | ||
440 | + height: 82px; | ||
441 | + line-height: 82px; | ||
442 | + margin: 40px; | ||
443 | + flex-direction: row; | ||
444 | + display: flex; | ||
445 | + justify-content: space-between; | ||
446 | + | ||
447 | + .cancel { | ||
448 | + font-size: 36px; | ||
449 | + color: #888; | ||
450 | + } | ||
451 | +} | ||
452 | + | ||
453 | +.content-search { | ||
454 | + margin-top: 80px; | ||
455 | + | ||
456 | + .item { | ||
457 | + margin-bottom: 60px; | ||
458 | + } | ||
459 | + | ||
460 | + .item-title { | ||
461 | + margin-left: 40px; | ||
462 | + margin-bottom: 20px; | ||
463 | + font-size: 40px; | ||
464 | + color: #000; | ||
465 | + letter-spacing: 0; | ||
466 | + font-weight: 500; | ||
467 | + } | ||
468 | + | ||
469 | + .item-list { | ||
470 | + overflow-y: hidden; | ||
471 | + overflow-x: scroll; | ||
472 | + display: -webkit-box; | ||
473 | + width: 100%; | ||
474 | + } | ||
475 | + | ||
476 | + .item-list ::-webkit-scrollbar { | ||
477 | + display: none; | ||
478 | + } | ||
479 | + | ||
480 | + .item-text { | ||
481 | + background: #f5f5f5; | ||
482 | + font-size: 28px; | ||
483 | + color: #222; | ||
484 | + text-align: center; | ||
485 | + width: 200px; | ||
486 | + height: 80px; | ||
487 | + line-height: 80px; | ||
488 | + margin-right: 20px; | ||
489 | + border-radius: 40px; | ||
490 | + } | ||
491 | + | ||
492 | + .item-text-selected { | ||
493 | + background: #08304b; | ||
494 | + color: #fff; | ||
495 | + } | ||
496 | + | ||
497 | + .item-size { | ||
498 | + width: 130px; | ||
499 | + height: 80px; | ||
500 | + line-height: 80px; | ||
501 | + } | ||
502 | + | ||
503 | + .item-img { | ||
504 | + width: 140px; | ||
505 | + height: 70px; | ||
506 | + margin-bottom: 22px; | ||
507 | + | ||
508 | + & > img { | ||
509 | + width: 100%; | ||
510 | + height: 100%; | ||
511 | + } | ||
512 | + } | ||
513 | + | ||
514 | + .item-img-selected { | ||
515 | + opacity: 1 !important; | ||
516 | + } | ||
517 | + | ||
518 | + .item-img-content { | ||
519 | + opacity: 0.2; | ||
520 | + width: 160px; | ||
521 | + height: 140px; | ||
522 | + display: flex; | ||
523 | + justify-content: center; | ||
524 | + flex-direction: column; | ||
525 | + margin-right: 20px; | ||
526 | + } | ||
527 | + | ||
528 | + .item-img-text { | ||
529 | + font-size: 20px; | ||
530 | + color: #000; | ||
531 | + letter-spacing: 0; | ||
532 | + text-align: center; | ||
533 | + width: 140px; | ||
534 | + height: 64px; | ||
535 | + } | ||
536 | +} | ||
537 | + | ||
538 | +.bottom { | ||
539 | + height: 120px; | ||
540 | + position: fixed; | ||
541 | + bottom: 0; | ||
542 | + z-index: 9; | ||
543 | + width: 100%; | ||
544 | + background: #fff; | ||
545 | + display: flex; | ||
546 | + border-top: 1px solid rgba(0, 0, 0, 0.12); | ||
547 | + justify-content: space-between; | ||
548 | + align-items: center; | ||
549 | +} | ||
550 | + | ||
551 | +.clear { | ||
552 | + margin-left: 32px; | ||
553 | + line-height: 80px; | ||
554 | + text-align: center; | ||
555 | + width: 330px; | ||
556 | + height: 80px; | ||
557 | + color: #000; | ||
558 | + font-size: 32px; | ||
559 | + border: 1px solid rgba(0, 0, 0, 0.12); | ||
560 | + border-radius: 40px; | ||
561 | +} | ||
562 | + | ||
563 | +.submit { | ||
564 | + line-height: 80px; | ||
565 | + background-color: #08304b; | ||
566 | + width: 330px; | ||
567 | + height: 80px; | ||
568 | + text-align: center; | ||
569 | + color: #fff; | ||
570 | + font-size: 32px; | ||
571 | + border-radius: 40px; | ||
572 | + margin-right: 32px; | ||
573 | +} | ||
574 | + | ||
575 | +.back { | ||
576 | + margin-top: 24px; | ||
577 | + width: 24px; | ||
578 | + height: 24px; | ||
579 | + background: url(~statics/image/order/back@3x.png) no-repeat; | ||
580 | + background-size: cover; | ||
581 | +} | ||
582 | +</style> |
@@ -3,5 +3,10 @@ import { get } from 'lodash'; | @@ -3,5 +3,10 @@ import { get } from 'lodash'; | ||
3 | import Vue from 'vue'; | 3 | import Vue from 'vue'; |
4 | 4 | ||
5 | export default { | 5 | export default { |
6 | + async fetchDetailById({ commit, state }, { skup = null }) { | ||
7 | + let { data: info = null } = await this.$api.post('/api/ufo/secondhand/productDetail', { skup }); | ||
6 | 8 | ||
9 | + console.log('====', info); | ||
10 | + commit(Types.UPDATE_PRODUCT_DETAIL, {info}); | ||
11 | + }, | ||
7 | }; | 12 | }; |
1 | import actions from './actions'; | 1 | import actions from './actions'; |
2 | import mutations from './mutations'; | 2 | import mutations from './mutations'; |
3 | +export function defaultState () { | ||
4 | + return { | ||
5 | + info: { | ||
6 | + imageList: [], | ||
7 | + price: '', | ||
8 | + sizeName: '', | ||
9 | + shoeBoxDesc: '', | ||
10 | + | ||
11 | + } | ||
12 | + }; | ||
13 | +} | ||
3 | 14 | ||
4 | export default function() { | 15 | export default function() { |
5 | return { | 16 | return { |
6 | namespaced: true, | 17 | namespaced: true, |
7 | - state: {}, | 18 | + state: defaultState(), |
8 | mutations, | 19 | mutations, |
9 | actions, | 20 | actions, |
10 | }; | 21 | }; |
@@ -2,7 +2,7 @@ import * as Types from './types'; | @@ -2,7 +2,7 @@ import * as Types from './types'; | ||
2 | import { find, set } from 'lodash'; | 2 | import { find, set } from 'lodash'; |
3 | 3 | ||
4 | export default { | 4 | export default { |
5 | - [Types.ENSURE_PRODUCT_DETAIL](state, { productId }) { | ||
6 | - | 5 | + [Types.UPDATE_PRODUCT_DETAIL](state, { info }) { |
6 | + state.info = { ...state.info, ...info }; | ||
7 | } | 7 | } |
8 | }; | 8 | }; |
@@ -10,6 +10,7 @@ const categoryApi = require('./category-api-map'); | @@ -10,6 +10,7 @@ const categoryApi = require('./category-api-map'); | ||
10 | const sellerAskApi = require('./sellerask-api-map'); | 10 | const sellerAskApi = require('./sellerask-api-map'); |
11 | const systemApi = require('./system-api-map'); | 11 | const systemApi = require('./system-api-map'); |
12 | const activitysApi = require('./activitys-api-map'); | 12 | const activitysApi = require('./activitys-api-map'); |
13 | +const secondHandApi = require('./second-hand-api-map'); | ||
13 | 14 | ||
14 | module.exports = { | 15 | module.exports = { |
15 | ...orderApi, | 16 | ...orderApi, |
@@ -23,5 +24,6 @@ module.exports = { | @@ -23,5 +24,6 @@ module.exports = { | ||
23 | ...categoryApi, | 24 | ...categoryApi, |
24 | ...sellerAskApi, | 25 | ...sellerAskApi, |
25 | ...systemApi, | 26 | ...systemApi, |
26 | - ...activitysApi | 27 | + ...activitysApi, |
28 | + ...secondHandApi, | ||
27 | }; | 29 | }; |
1 | module.exports = { | 1 | module.exports = { |
2 | '/api/ufo/secondhand/productDetail': { | 2 | '/api/ufo/secondhand/productDetail': { |
3 | ufo: true, | 3 | ufo: true, |
4 | + auth: false, | ||
4 | api: 'ufo.product.secondHand.data', | 5 | api: 'ufo.product.secondHand.data', |
5 | params: { | 6 | params: { |
6 | skup: { type: Number } // 商品池id | 7 | skup: { type: Number } // 商品池id |
-
Please register or login to post a comment