Showing
7 changed files
with
105 additions
and
36 deletions
@@ -88,6 +88,7 @@ exports.fetchProducts = (req, res, next) => { | @@ -88,6 +88,7 @@ exports.fetchProducts = (req, res, next) => { | ||
88 | result.code = 200; | 88 | result.code = 200; |
89 | } | 89 | } |
90 | if (result.code === 200) { | 90 | if (result.code === 200) { |
91 | + prettyFilter(result.data.filter); | ||
91 | result.data.productList = processProductList(result.data.productList); | 92 | result.data.productList = processProductList(result.data.productList); |
92 | result = camelCase(result); | 93 | result = camelCase(result); |
93 | } | 94 | } |
@@ -7,19 +7,19 @@ $(function() { | @@ -7,19 +7,19 @@ $(function() { | ||
7 | return [ | 7 | return [ |
8 | { | 8 | { |
9 | txt: '默认', | 9 | txt: '默认', |
10 | - val: 1 | 10 | + val: '' |
11 | }, { | 11 | }, { |
12 | txt: '最新', | 12 | txt: '最新', |
13 | - val: 2 | 13 | + val: 's_t_desc' |
14 | }, { | 14 | }, { |
15 | type: 'updown', | 15 | type: 'updown', |
16 | txt: '价格', | 16 | txt: '价格', |
17 | - val: [3, 4] // [up, down] | 17 | + val: ['s_p_asc', 's_p_desc'] // [up, down] |
18 | }, | 18 | }, |
19 | { | 19 | { |
20 | type: 'updown', | 20 | type: 'updown', |
21 | txt: '折扣', | 21 | txt: '折扣', |
22 | - val: [5, 6] | 22 | + val: ['p_d_asc', 'p_d_desc'] |
23 | } | 23 | } |
24 | ]; | 24 | ]; |
25 | }; | 25 | }; |
@@ -3,33 +3,60 @@ | @@ -3,33 +3,60 @@ | ||
3 | <div class="drawer-main" v-el:main> | 3 | <div class="drawer-main" v-el:main> |
4 | <slot></slot> | 4 | <slot></slot> |
5 | </div> | 5 | </div> |
6 | + <div class="drawer-mask" @click="close"></div> | ||
6 | </div> | 7 | </div> |
7 | </template> | 8 | </template> |
8 | <script> | 9 | <script> |
9 | -module.exports = { | ||
10 | - props: { | ||
11 | - on: Boolean | ||
12 | - } | ||
13 | -}; | 10 | + module.exports = { |
11 | + props: { | ||
12 | + on: Boolean | ||
13 | + }, | ||
14 | + methods: { | ||
15 | + close() { | ||
16 | + this.on = false; | ||
17 | + } | ||
18 | + }, | ||
19 | + watch: { | ||
20 | + on(newVal) { | ||
21 | + if(newVal) { | ||
22 | + document.body.style.overflow = 'hidden'; | ||
23 | + } else { | ||
24 | + document.body.style.overflow = ''; | ||
25 | + } | ||
26 | + } | ||
27 | + } | ||
28 | + }; | ||
29 | + | ||
14 | </script> | 30 | </script> |
15 | <style> | 31 | <style> |
16 | -.drawer { | ||
17 | - position: fixed; | ||
18 | - top: 0; | ||
19 | - right: 0; | ||
20 | - bottom: 0; | ||
21 | - left: 0; | ||
22 | - background-color: rgba(0, 0, 0, 0.6); | ||
23 | -} | 32 | + .drawer { |
33 | + position: fixed; | ||
34 | + top: 0; | ||
35 | + right: 0; | ||
36 | + bottom: 0; | ||
37 | + left: 0; | ||
38 | + } | ||
39 | + | ||
40 | + .drawer-mask { | ||
41 | + position: absolute; | ||
42 | + z-index: 199; | ||
43 | + top: 0; | ||
44 | + right: 0; | ||
45 | + bottom: 0; | ||
46 | + left: 0; | ||
47 | + background-color: rgba(0, 0, 0, 0.6); | ||
48 | + } | ||
49 | + | ||
50 | + .drawer-main { | ||
51 | + position: absolute; | ||
52 | + z-index: 200; | ||
53 | + top: 0; | ||
54 | + right: 0%; | ||
55 | + bottom: 0; | ||
56 | + min-width: 80%; | ||
57 | + max-width: 100%; | ||
58 | + background-color: #fff; | ||
59 | + transition: all 0.3s 0.2s; | ||
60 | + } | ||
24 | 61 | ||
25 | -.drawer-main { | ||
26 | - position: absolute; | ||
27 | - top: 0; | ||
28 | - right: 0%; | ||
29 | - bottom: 0; | ||
30 | - min-width: 80%; | ||
31 | - max-width: 100%; | ||
32 | - background-color: #fff; | ||
33 | - transition: all 0.3s 0.2s; | ||
34 | -} | ||
35 | </style> | 62 | </style> |
1 | <template> | 1 | <template> |
2 | <div class="upload"> | 2 | <div class="upload"> |
3 | <form v-el:form v-on:change="upload"> | 3 | <form v-el:form v-on:change="upload"> |
4 | - <label class="label-input icon" for="{{inputId}}"> | ||
5 | <input id="{{inputId}}" type="file" name="filename"> | 4 | <input id="{{inputId}}" type="file" name="filename"> |
6 | - </label> | ||
7 | </form> | 5 | </form> |
8 | </div> | 6 | </div> |
9 | </template> | 7 | </template> |
@@ -45,4 +43,36 @@ | @@ -45,4 +43,36 @@ | ||
45 | 43 | ||
46 | <style> | 44 | <style> |
47 | /* 每个地方上传按钮可能不一样,使用的时候自己写样式 */ | 45 | /* 每个地方上传按钮可能不一样,使用的时候自己写样式 */ |
46 | + .upload { | ||
47 | + position: relative; | ||
48 | + border: 1px solid #b0b0b0; | ||
49 | + | ||
50 | + &:after, &:before { | ||
51 | + content: ""; | ||
52 | + position: absolute; | ||
53 | + top: 50%; | ||
54 | + left: 50%; | ||
55 | + width: 100px; | ||
56 | + height: 2px; | ||
57 | + margin-left: -50px; | ||
58 | + margin-top: -1px; | ||
59 | + background-color: #b0b0b0; | ||
60 | + } | ||
61 | + | ||
62 | + &:before { | ||
63 | + transform: rotate(90deg); | ||
64 | + } | ||
65 | + | ||
66 | + input { | ||
67 | + position: absolute; | ||
68 | + top: 0; | ||
69 | + right: 0; | ||
70 | + bottom: 0; | ||
71 | + left: 0; | ||
72 | + width: 100%; | ||
73 | + height: 100%; | ||
74 | + opacity: 0; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
48 | </style> | 78 | </style> |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <div class="list exchange-info"> | 11 | <div class="list exchange-info"> |
12 | <!--address--> | 12 | <!--address--> |
13 | <div class="list-item exchange-address" @click="changeAddress"> | 13 | <div class="list-item exchange-address" @click="changeAddress"> |
14 | - <div class="consignee"> | 14 | + <div class="co |
15 | <span class="mr50">{{address.consignee}}</span> | 15 | <span class="mr50">{{address.consignee}}</span> |
16 | <span>{{address.mobile}}</span> | 16 | <span>{{address.mobile}}</span> |
17 | </div> | 17 | </div> |
@@ -39,7 +39,9 @@ | @@ -39,7 +39,9 @@ | ||
39 | <script> | 39 | <script> |
40 | const $ = require('yoho-jquery'); | 40 | const $ = require('yoho-jquery'); |
41 | const qs = require('yoho-qs'); | 41 | const qs = require('yoho-qs'); |
42 | + const tip = require('common/tip'); | ||
42 | const bus = require('common/vue-bus'); | 43 | const bus = require('common/vue-bus'); |
44 | + const yoho = require('yoho'); | ||
43 | 45 | ||
44 | const productList = require('home/return/list.vue'); | 46 | const productList = require('home/return/list.vue'); |
45 | const exchangeItem = require('home/exchange/item.vue'); | 47 | const exchangeItem = require('home/exchange/item.vue'); |
@@ -127,7 +129,13 @@ | @@ -127,7 +129,13 @@ | ||
127 | }, | 129 | }, |
128 | methods: { | 130 | methods: { |
129 | changeAddress() { | 131 | changeAddress() { |
130 | - alert('TODO:更换地址'); | 132 | + yoho.goAddress({ |
133 | + type:'1' | ||
134 | + }, (address)=>{ | ||
135 | + | ||
136 | + }, () => { | ||
137 | + tip('更换地址失败~'); | ||
138 | + }); | ||
131 | }, | 139 | }, |
132 | 140 | ||
133 | // 商品 feature改变 | 141 | // 商品 feature改变 |
@@ -144,7 +152,6 @@ | @@ -144,7 +152,6 @@ | ||
144 | queryProductFeature(pid) { | 152 | queryProductFeature(pid) { |
145 | $.get(`/product/product_${pid}.json`).then(result => { | 153 | $.get(`/product/product_${pid}.json`).then(result => { |
146 | this.entity = result; | 154 | this.entity = result; |
147 | - this.entity.id = pid; | ||
148 | return result; | 155 | return result; |
149 | }); | 156 | }); |
150 | }, | 157 | }, |
@@ -28,12 +28,12 @@ | @@ -28,12 +28,12 @@ | ||
28 | el: '#product-list', | 28 | el: '#product-list', |
29 | data: function() { | 29 | data: function() { |
30 | return { | 30 | return { |
31 | - sortConfig: global.sortConfig, | ||
32 | - filterConfig: global.filterConfig, | 31 | + sortConfig: [], |
32 | + filterConfig: null, | ||
33 | 33 | ||
34 | // query | 34 | // query |
35 | url: '/product/list.json', | 35 | url: '/product/list.json', |
36 | - sort: null, | 36 | + sort: '', |
37 | filter: {}, | 37 | filter: {}, |
38 | page: 0, // 未搜索 page=0; 全部加载完 page = totalPage; 无数据: page !=0 && productList.length=0 | 38 | page: 0, // 未搜索 page=0; 全部加载完 page = totalPage; 无数据: page !=0 && productList.length=0 |
39 | totalPage: null, | 39 | totalPage: null, |
@@ -77,6 +77,10 @@ | @@ -77,6 +77,10 @@ | ||
77 | self.page = res.data.page; | 77 | self.page = res.data.page; |
78 | self.totalPage = res.data.pageTotal; | 78 | self.totalPage = res.data.pageTotal; |
79 | self.$set('productList', self.productList.concat(res.data.productList)); | 79 | self.$set('productList', self.productList.concat(res.data.productList)); |
80 | + | ||
81 | + if (!self.filterConfig) { | ||
82 | + self.$set('filterConfig', res.data.filter); | ||
83 | + } | ||
80 | } | 84 | } |
81 | }) | 85 | }) |
82 | .fail(error => { | 86 | .fail(error => { |
-
Please register or login to post a comment