Showing
23 changed files
with
327 additions
and
427 deletions
@@ -36,6 +36,7 @@ exports.index = (req, res, next) => { | @@ -36,6 +36,7 @@ exports.index = (req, res, next) => { | ||
36 | }), | 36 | }), |
37 | content: result, | 37 | content: result, |
38 | noLoginUrl: result.noLoginUrl, | 38 | noLoginUrl: result.noLoginUrl, |
39 | + localCss: true, | ||
39 | appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.couponCenter", "params":{"share":"/operations/api/v5/webshare/getShare","share_id":"1037","title":"领券中心"}}' //eslint-disable-line | 40 | appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.couponCenter", "params":{"share":"/operations/api/v5/webshare/getShare","share_id":"1037","title":"领券中心"}}' //eslint-disable-line |
40 | }); | 41 | }); |
41 | }).catch(next); | 42 | }).catch(next); |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | {{# content}} | 2 | {{# content}} |
3 | {{#if isSingleImage}} | 3 | {{#if isSingleImage}} |
4 | <div data-id="{{templateId}}" data-floor-name="{{templateName}}" class="floor"> | 4 | <div data-id="{{templateId}}" data-floor-name="{{templateName}}" class="floor"> |
5 | - <a href="{{url}}"><img src="{{image src 0 0}}" class="just-img"/></a> | 5 | + <a href="{{url}}"><img src="{{image2 src w=0 h=0 q=60}}" class="just-img"/></a> |
6 | </div> | 6 | </div> |
7 | {{/if}} | 7 | {{/if}} |
8 | {{#if isCarouselBanner}} | 8 | {{#if isCarouselBanner}} |
@@ -21,23 +21,28 @@ let index = (req, res, next) => { | @@ -21,23 +21,28 @@ let index = (req, res, next) => { | ||
21 | let responseData = { | 21 | let responseData = { |
22 | module: 'channel', | 22 | module: 'channel', |
23 | page: 'brand', | 23 | page: 'brand', |
24 | + localCss: true, | ||
24 | 25 | ||
25 | // title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停', | 26 | // title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停', |
26 | showFooterTab: footerModel.getUrlData('category') | 27 | showFooterTab: footerModel.getUrlData('category') |
27 | }; | 28 | }; |
28 | 29 | ||
29 | let param = { | 30 | let param = { |
30 | - | ||
31 | channel: req.query.channel || '1', | 31 | channel: req.query.channel || '1', |
32 | - | ||
33 | gender: req.query.gender || '1,3' | 32 | gender: req.query.gender || '1,3' |
34 | - | ||
35 | }; | 33 | }; |
36 | 34 | ||
37 | indexModel.getBrandByChannel(param.channel).then(result => { | 35 | indexModel.getBrandByChannel(param.channel).then(result => { |
38 | res.render('brand/index', Object.assign(responseData, result)); | 36 | res.render('brand/index', Object.assign(responseData, result)); |
39 | }).catch(next); | 37 | }).catch(next); |
38 | +}; | ||
40 | 39 | ||
40 | +let brandList = (req, res, next) => { | ||
41 | + var channel = req.query.channel || '1'; | ||
42 | + | ||
43 | + indexModel.getBrandListByChannel(channel).then(result => { | ||
44 | + res.json(result); | ||
45 | + }).catch(next); | ||
41 | }; | 46 | }; |
42 | 47 | ||
43 | /** | 48 | /** |
@@ -47,7 +52,6 @@ let index = (req, res, next) => { | @@ -47,7 +52,6 @@ let index = (req, res, next) => { | ||
47 | * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | 52 | * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 |
48 | */ | 53 | */ |
49 | let search = (req, res, next) => { | 54 | let search = (req, res, next) => { |
50 | - | ||
51 | let headerData = headerModel.setNav({ | 55 | let headerData = headerModel.setNav({ |
52 | navTitle: '品牌一览' | 56 | navTitle: '品牌一览' |
53 | }); | 57 | }); |
@@ -56,6 +60,7 @@ let search = (req, res, next) => { | @@ -56,6 +60,7 @@ let search = (req, res, next) => { | ||
56 | pageHeader: headerData, | 60 | pageHeader: headerData, |
57 | module: 'channel', | 61 | module: 'channel', |
58 | page: 'brand', | 62 | page: 'brand', |
63 | + localCss: true, | ||
59 | isWechat: req.yoho.isWechat, | 64 | isWechat: req.yoho.isWechat, |
60 | title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停', | 65 | title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停', |
61 | pageFooter: true | 66 | pageFooter: true |
@@ -144,6 +149,7 @@ let searchAsync = (req, res, next) => { | @@ -144,6 +149,7 @@ let searchAsync = (req, res, next) => { | ||
144 | module.exports = { | 149 | module.exports = { |
145 | index, | 150 | index, |
146 | search, | 151 | search, |
152 | + brandList, | ||
147 | delBrandHistory, | 153 | delBrandHistory, |
148 | addBrandSearch, | 154 | addBrandSearch, |
149 | searchAsync | 155 | searchAsync |
@@ -30,7 +30,6 @@ let CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; | @@ -30,7 +30,6 @@ let CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | const _packageAd = (params) => { | 32 | const _packageAd = (params) => { |
33 | - | ||
34 | return service.get('/operations/api/v5/resource/get', { | 33 | return service.get('/operations/api/v5/resource/get', { |
35 | content_code: params.contentCode, | 34 | content_code: params.contentCode, |
36 | gender: 1, | 35 | gender: 1, |
@@ -38,71 +37,48 @@ const _packageAd = (params) => { | @@ -38,71 +37,48 @@ const _packageAd = (params) => { | ||
38 | page: 1 | 37 | page: 1 |
39 | }, { | 38 | }, { |
40 | cache: true | 39 | cache: true |
41 | - }).then(result => { | ||
42 | - | ||
43 | - return result; | ||
44 | - | ||
45 | }); | 40 | }); |
46 | - | ||
47 | }; | 41 | }; |
48 | 42 | ||
49 | -const _packageList = (params) => { | 43 | +const _packageList = (channel) => { |
50 | return api.get('', { | 44 | return api.get('', { |
51 | method: 'app.brand.newBrandList', | 45 | method: 'app.brand.newBrandList', |
52 | - yh_channel: params.channel | ||
53 | - | 46 | + yh_channel: channel |
54 | }, { | 47 | }, { |
55 | cache: true, | 48 | cache: true, |
56 | code: 200 | 49 | code: 200 |
57 | - }).then(result => { | ||
58 | - | ||
59 | - return result; | ||
60 | - | ||
61 | }); | 50 | }); |
62 | }; | 51 | }; |
63 | 52 | ||
64 | const getBrandByChannel = (channel) => { | 53 | const getBrandByChannel = (channel) => { |
65 | - | ||
66 | let params = {}; | 54 | let params = {}; |
67 | 55 | ||
68 | /* 根据频道调用接口 */ | 56 | /* 根据频道调用接口 */ |
69 | switch (channel) { | 57 | switch (channel) { |
70 | case '1': // 男生 | 58 | case '1': // 男生 |
71 | params = { | 59 | params = { |
72 | - contentCode: CODE_TOPPOS_BOYS, | ||
73 | - channel: 1 | 60 | + contentCode: CODE_TOPPOS_BOYS |
74 | }; | 61 | }; |
75 | break; | 62 | break; |
76 | case '2': // 女生 | 63 | case '2': // 女生 |
77 | params = { | 64 | params = { |
78 | - contentCode: CODE_TOPPOS_GIRLS, | ||
79 | - channel: 2 | 65 | + contentCode: CODE_TOPPOS_GIRLS |
80 | }; | 66 | }; |
81 | break; | 67 | break; |
82 | case '3': // 潮童 | 68 | case '3': // 潮童 |
83 | params = { | 69 | params = { |
84 | - contentCode: CODE_TOPPOS_KIDS, | ||
85 | - channel: 3 | 70 | + contentCode: CODE_TOPPOS_KIDS |
86 | }; | 71 | }; |
87 | break; | 72 | break; |
88 | case '4': // 创意生活 | 73 | case '4': // 创意生活 |
89 | params = { | 74 | params = { |
90 | - contentCode: CODE_TOPPOS_LIFESTYLE, | ||
91 | - channel: 4 | 75 | + contentCode: CODE_TOPPOS_LIFESTYLE |
92 | }; | 76 | }; |
93 | break; | 77 | break; |
94 | default: | 78 | default: |
95 | - | ||
96 | - | ||
97 | } | 79 | } |
98 | 80 | ||
99 | - return api.all([ | ||
100 | - | ||
101 | - _packageAd(params), | ||
102 | - _packageList(params) | ||
103 | - | ||
104 | - ]).then(result => { | ||
105 | - | 81 | + return _packageAd(params).then(result => { |
106 | let resu = { | 82 | let resu = { |
107 | channel: { | 83 | channel: { |
108 | channels: [{ | 84 | channels: [{ |
@@ -120,24 +96,17 @@ const getBrandByChannel = (channel) => { | @@ -120,24 +96,17 @@ const getBrandByChannel = (channel) => { | ||
120 | }, | 96 | }, |
121 | searchUrl: helpers.urlFormat('/brands/search', null), | 97 | searchUrl: helpers.urlFormat('/brands/search', null), |
122 | brandPage: true, | 98 | brandPage: true, |
123 | - | ||
124 | brandType: '全部品牌', | 99 | brandType: '全部品牌', |
125 | secondBrandType: '新入驻品牌', | 100 | secondBrandType: '新入驻品牌', |
126 | - thirdBrandType: '热门品牌', | ||
127 | - brandList: [], | ||
128 | - newBrandWall: [], | ||
129 | - recommandBrandWall: [] | 101 | + thirdBrandType: '热门品牌' |
130 | } | 102 | } |
131 | }; | 103 | }; |
132 | 104 | ||
133 | resu.channel.channels[channel - 1].active = true; | 105 | resu.channel.channels[channel - 1].active = true; |
134 | - | ||
135 | - if (result && result[0] && result[0].data) { | ||
136 | - | ||
137 | - if (result[0].data[0] && result[0].data[0].data) { | 106 | + if (result && result.data) { |
107 | + if (result.data[0] && result.data[0].data) { | ||
138 | // 轮播图资源位 | 108 | // 轮播图资源位 |
139 | - let adList = result[0].data[0].data; | ||
140 | - | 109 | + let adList = result.data[0].data; |
141 | let build = []; | 110 | let build = []; |
142 | 111 | ||
143 | adList.forEach(ad => { | 112 | adList.forEach(ad => { |
@@ -146,15 +115,12 @@ const getBrandByChannel = (channel) => { | @@ -146,15 +115,12 @@ const getBrandByChannel = (channel) => { | ||
146 | url: ad.url | 115 | url: ad.url |
147 | }); | 116 | }); |
148 | }); | 117 | }); |
149 | - | ||
150 | resu.channel.topData.bannerTop.list = build; | 118 | resu.channel.topData.bannerTop.list = build; |
151 | - | ||
152 | } | 119 | } |
153 | 120 | ||
154 | - if (result[0].data[1] && result[0].data[1].data) { | 121 | + if (result.data[1] && result.data[1].data) { |
155 | // 推荐品牌资源位 | 122 | // 推荐品牌资源位 |
156 | - let brandList = result[0].data[1].data.list; | ||
157 | - | 123 | + let brandList = result.data[1].data.list || []; |
158 | let brand = []; | 124 | let brand = []; |
159 | 125 | ||
160 | brandList.forEach(ad => { | 126 | brandList.forEach(ad => { |
@@ -165,106 +131,76 @@ const getBrandByChannel = (channel) => { | @@ -165,106 +131,76 @@ const getBrandByChannel = (channel) => { | ||
165 | }); | 131 | }); |
166 | }); | 132 | }); |
167 | 133 | ||
168 | - resu.channel.topData.hotBrandsScroll.name = result[0].data[1].data.title.title; | ||
169 | - | 134 | + resu.channel.topData.hotBrandsScroll.name = result.data[1].data.title.title; |
170 | resu.channel.topData.hotBrandsScroll.list = brand; | 135 | resu.channel.topData.hotBrandsScroll.list = brand; |
171 | - | ||
172 | } | 136 | } |
173 | - | ||
174 | } | 137 | } |
138 | + return resu; | ||
139 | + }); | ||
140 | +}; | ||
175 | 141 | ||
176 | - /* 按字母'A-Z'分组的品牌列表 */ | ||
177 | - if (result && result[1] && result[1].data) { | 142 | +const getBrandListByChannel = (channel) => { |
143 | + return _packageList(channel).then(result => { | ||
144 | + let resu = { | ||
145 | + brandList: [], | ||
146 | + newBrandWall: [], | ||
147 | + recommandBrandWall: [] | ||
148 | + }; | ||
178 | 149 | ||
179 | - let allList = result[1].data.all_list; | 150 | + if (!result || !result.data) { |
151 | + return resu; | ||
152 | + } | ||
180 | 153 | ||
154 | + /* 按字母'A-Z'分组的品牌列表 */ | ||
155 | + let allList = result.data.all_list; | ||
181 | for (let key in allList) { | 156 | for (let key in allList) { |
182 | - | ||
183 | - let obj = {}; | ||
184 | - | ||
185 | - obj = Object.assign(obj, { | ||
186 | - title: key | ||
187 | - }); | ||
188 | - | ||
189 | - let list = []; | 157 | + let obj = { |
158 | + title: key, | ||
159 | + list: [] | ||
160 | + }; | ||
190 | 161 | ||
191 | allList[key].forEach(row => { | 162 | allList[key].forEach(row => { |
192 | - | ||
193 | - list.push({ | 163 | + obj.list.push({ |
194 | name: row.brand_name, | 164 | name: row.brand_name, |
195 | isHot: row.is_hot === 'Y' ? true : false, | 165 | isHot: row.is_hot === 'Y' ? true : false, |
196 | isNew: row.is_show_new === 'Y' ? true : false, | 166 | isNew: row.is_show_new === 'Y' ? true : false, |
197 | url: helpers.urlFormat('/product/index/brand?domain=' + row.brand_domain) | 167 | url: helpers.urlFormat('/product/index/brand?domain=' + row.brand_domain) |
198 | }); | 168 | }); |
199 | - | ||
200 | - }); | ||
201 | - | ||
202 | - obj = Object.assign(obj, { | ||
203 | - list | ||
204 | }); | 169 | }); |
205 | - | ||
206 | - resu.channel.brandList.push(obj); | ||
207 | - | ||
208 | - } | ||
209 | - | 170 | + resu.brandList.push(obj); |
210 | } | 171 | } |
211 | 172 | ||
212 | // 新入驻品牌 | 173 | // 新入驻品牌 |
213 | - if (result && result[1] && result[1].data) { | ||
214 | - | ||
215 | - let newList = result[1].data.new_list; | ||
216 | - | 174 | + let newList = result.data.new_list; |
217 | for (let key in newList) { | 175 | for (let key in newList) { |
176 | + let obj = { | ||
177 | + list: [] | ||
178 | + }; | ||
218 | 179 | ||
219 | - let obj = {}; | ||
220 | - | ||
221 | - let list = []; | ||
222 | - | ||
223 | - list.push({ | 180 | + obj.list.push({ |
224 | brandName: newList[key].brand_name, | 181 | brandName: newList[key].brand_name, |
225 | url: helpers.urlFormat('/product/index/brand?domain=' + newList[key].brand_domain), | 182 | url: helpers.urlFormat('/product/index/brand?domain=' + newList[key].brand_domain), |
226 | img: helpers.image(newList[key].brand_ico, 186, 115), | 183 | img: helpers.image(newList[key].brand_ico, 186, 115), |
227 | }); | 184 | }); |
228 | - | ||
229 | - obj = Object.assign(obj, { | ||
230 | - list | ||
231 | - }); | ||
232 | - | ||
233 | - resu.channel.newBrandWall.push(obj); | ||
234 | - | ||
235 | - } | ||
236 | - | 185 | + resu.newBrandWall.push(obj); |
237 | } | 186 | } |
238 | 187 | ||
239 | // 推荐品牌 | 188 | // 推荐品牌 |
240 | - if (result && result[1] && result[1].data) { | ||
241 | - | ||
242 | - let hotList = result[1].data.hot_list; | ||
243 | - | 189 | + let hotList = result.data.hot_list; |
244 | for (let key in hotList) { | 190 | for (let key in hotList) { |
191 | + let obj = { | ||
192 | + list: [] | ||
193 | + }; | ||
245 | 194 | ||
246 | - let obj = {}; | ||
247 | - | ||
248 | - let list = []; | ||
249 | - | ||
250 | - list.push({ | 195 | + obj.list.push({ |
251 | brandName: hotList[key].brand_name, | 196 | brandName: hotList[key].brand_name, |
252 | url: helpers.urlFormat('/product/index/brand?domain=' + hotList[key].brand_domain), | 197 | url: helpers.urlFormat('/product/index/brand?domain=' + hotList[key].brand_domain), |
253 | img: helpers.image(hotList[key].brand_ico, 186, 115), | 198 | img: helpers.image(hotList[key].brand_ico, 186, 115), |
254 | }); | 199 | }); |
255 | - | ||
256 | - obj = Object.assign(obj, { | ||
257 | - list | ||
258 | - }); | ||
259 | - | ||
260 | - resu.channel.recommandBrandWall.push(obj); | ||
261 | - | ||
262 | - } | ||
263 | - | 200 | + resu.recommandBrandWall.push(obj); |
264 | } | 201 | } |
265 | 202 | ||
266 | return resu; | 203 | return resu; |
267 | - | ||
268 | }); | 204 | }); |
269 | }; | 205 | }; |
270 | 206 | ||
@@ -602,6 +538,7 @@ const branchSearchHistoryAsync = (uid) => { | @@ -602,6 +538,7 @@ const branchSearchHistoryAsync = (uid) => { | ||
602 | 538 | ||
603 | module.exports = { | 539 | module.exports = { |
604 | getBrandByChannel, | 540 | getBrandByChannel, |
541 | + getBrandListByChannel, | ||
605 | branchSearch, | 542 | branchSearch, |
606 | delBrandSearchHistory, | 543 | delBrandSearchHistory, |
607 | addSearchHistory, | 544 | addSearchHistory, |
@@ -26,6 +26,7 @@ router.get('/(:channel)/bottomBanner', channel.bottomBanner); | @@ -26,6 +26,7 @@ router.get('/(:channel)/bottomBanner', channel.bottomBanner); | ||
26 | router.get('/cate', cate.index); | 26 | router.get('/cate', cate.index); |
27 | router.get('/brands', brandController.index); // 品牌首页 | 27 | router.get('/brands', brandController.index); // 品牌首页 |
28 | router.get('/brands/search', brandController.search); // 品牌搜索页 | 28 | router.get('/brands/search', brandController.search); // 品牌搜索页 |
29 | +router.get('/brands/getBrandList', brandController.brandList); // 获取品牌列表 | ||
29 | router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索异步数据 | 30 | router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索异步数据 |
30 | router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录 | 31 | router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录 |
31 | router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录 | 32 | router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录 |
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | </a> | 20 | </a> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | - <div class="hide-when-loading"> | 23 | + <div> |
24 | {{# topData}} | 24 | {{# topData}} |
25 | {{! 头部banner}} | 25 | {{! 头部banner}} |
26 | {{# bannerTop}} | 26 | {{# bannerTop}} |
@@ -49,56 +49,11 @@ | @@ -49,56 +49,11 @@ | ||
49 | </li> | 49 | </li> |
50 | </ul> | 50 | </ul> |
51 | </div> | 51 | </div> |
52 | - <div class="second-level-brand"> | ||
53 | - {{# brandList}} | ||
54 | - <div class="brand-list bar-{{@index}}"> | ||
55 | - <div class="title-bar"> | ||
56 | - <h2 style="position: static;">{{title}}</h2> | ||
57 | - </div> | ||
58 | - {{# list}} | ||
59 | - <p> | ||
60 | - <a href="{{url}}">{{name}} | ||
61 | - {{# isHot}} | ||
62 | - <i class="icon-hot">HOT</i> | ||
63 | - {{/ isHot}} | ||
64 | - {{# isNew}} | ||
65 | - <i class="icon-new">NEW</i> | ||
66 | - {{/ isNew}} | ||
67 | - </a> | ||
68 | - </p> | ||
69 | - {{/ list}} | ||
70 | - </div> | ||
71 | - {{/ brandList}} | ||
72 | - | ||
73 | - {{# newBrandWall}} | ||
74 | - <div class="new-brand-wall branding-wall hide"> | ||
75 | - {{# list}} | ||
76 | - <div class="brand-wall-box"> | ||
77 | - <a href="{{url}}"> | ||
78 | - <img class="lazy" data-original="{{img}}"></img> | ||
79 | - <div class="brand-name">{{brandName}}</div> | ||
80 | - </a> | ||
81 | - </div> | ||
82 | - {{/ list}} | ||
83 | - </div> | ||
84 | - {{/ newBrandWall}} | ||
85 | 52 | ||
86 | - {{# recommandBrandWall}} | ||
87 | - <div class="recommand-brand-wall branding-wall hide"> | ||
88 | - {{# list}} | ||
89 | - <div class="brand-wall-box"> | ||
90 | - <a href="{{url}}"> | ||
91 | - <img class="lazy" data-original="{{img}}"></img> | ||
92 | - <div class="brand-name">{{brandName}}</div> | ||
93 | - </a> | ||
94 | - </div> | ||
95 | - {{/ list}} | 53 | + {{!--占位: 品牌列表部分--}} |
54 | + <div id="placeholder-brandlist"> | ||
96 | </div> | 55 | </div> |
97 | - {{/ recommandBrandWall}} | ||
98 | </div> | 56 | </div> |
99 | - </div> | ||
100 | - | ||
101 | - | ||
102 | {{/channel}} | 57 | {{/channel}} |
103 | </div> | 58 | </div> |
104 | {{> footer-tab}} | 59 | {{> footer-tab}} |
@@ -13,7 +13,6 @@ | @@ -13,7 +13,6 @@ | ||
13 | <a href="{{url}}"> | 13 | <a href="{{url}}"> |
14 | <img class="swiper-lazy" data-src="{{image2 img q=60}}"> | 14 | <img class="swiper-lazy" data-src="{{image2 img q=60}}"> |
15 | </a> | 15 | </a> |
16 | - <div class="swiper-lazy-preloader"></div> | ||
17 | </li> | 16 | </li> |
18 | {{/if}} | 17 | {{/if}} |
19 | {{/each}} | 18 | {{/each}} |
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | <li class="swiper-slide"> | 6 | <li class="swiper-slide"> |
7 | <a href="{{url}}"> | 7 | <a href="{{url}}"> |
8 | <img src="{{image2 img q=60}}" alt=""> | 8 | <img src="{{image2 img q=60}}" alt=""> |
9 | - <span class="brands-title">{{textCn}}</span> | ||
10 | </a> | 9 | </a> |
10 | + <span class="brands-title">{{textCn}}</span> | ||
11 | </li> | 11 | </li> |
12 | {{/ list}} | 12 | {{/ list}} |
13 | </ul> | 13 | </ul> |
@@ -20,9 +20,9 @@ | @@ -20,9 +20,9 @@ | ||
20 | <div class="swiper-slide"> | 20 | <div class="swiper-slide"> |
21 | <a href="{{url}}"> | 21 | <a href="{{url}}"> |
22 | {{#if @first}} | 22 | {{#if @first}} |
23 | - <img src="{{image2 img width=200 height=100 q=60}}"> | 23 | + <img src="{{image2 img q=60}}"> |
24 | {{^}} | 24 | {{^}} |
25 | - <img class="swiper-lazy" data-src="{{image2 img width=200 height=100 q=60}}"> | 25 | + <img class="swiper-lazy" data-src="{{image2 img q=60}}"> |
26 | {{/if}} | 26 | {{/if}} |
27 | </a> | 27 | </a> |
28 | </div> | 28 | </div> |
apps/guang/views/action/info.bhs
deleted
100644 → 0
1 | -<div class="guang-info" data-id="{{id}}"> | ||
2 | - {{# author}} | ||
3 | - <a class="info-author clearfix" href={{url}}> | ||
4 | - <img class="lazy avatar" data-original={{avatar}}> | ||
5 | - <span class="name">{{name}}</span> | ||
6 | - </a> | ||
7 | - {{/ author}} | ||
8 | - | ||
9 | - <div class="info-img"> | ||
10 | - {{#if showTags}} | ||
11 | - <a href="javascript:;" class="info-match"> | ||
12 | - {{# isTip}} | ||
13 | - 小贴士 | ||
14 | - <div class="info-tag tip"></div> | ||
15 | - {{/ isTip}} | ||
16 | - {{# isCollocation}} | ||
17 | - 搭配 | ||
18 | - <div class="info-tag collocation"></div> | ||
19 | - {{/ isCollocation}} | ||
20 | - {{# isFashionMan}} | ||
21 | - 潮人 | ||
22 | - <div class="info-tag fashion-man"></div> | ||
23 | - {{/ isFashionMan}} | ||
24 | - {{# isFashionGood}} | ||
25 | - 潮品 | ||
26 | - <div class="info-tag fashion-good"></div> | ||
27 | - {{/ isFashionGood}} | ||
28 | - {{# isTopic}} | ||
29 | - 话题 | ||
30 | - <div class="info-tag topic"></div> | ||
31 | - {{/ isTopic}} | ||
32 | - {{# isSpecialTopic}} | ||
33 | - 专题 | ||
34 | - <div class="info-tag special-topic"></div> | ||
35 | - {{/ isSpecialTopic}} | ||
36 | - </a> | ||
37 | - {{/if}} | ||
38 | - <a href="{{url}}"> | ||
39 | - <img class="lazy" data-original="{{img}}" alt="{{alt}}"> | ||
40 | - </a> | ||
41 | - </div> | ||
42 | - | ||
43 | - <div class="info-deps"> | ||
44 | - <a class="info-title-container" href="{{url}}"> | ||
45 | - <h2 class="info-title">{{title}}</h2> | ||
46 | - </a> | ||
47 | - <p class="info-text">{{text}}</p> | ||
48 | - {{> guang/tvls}} | ||
49 | - </div> | ||
50 | -</div> |
@@ -100,6 +100,6 @@ | @@ -100,6 +100,6 @@ | ||
100 | <input id="brand-id" type="hidden" value="{{brandId}}"> | 100 | <input id="brand-id" type="hidden" value="{{brandId}}"> |
101 | <input id="product-limit" type="hidden" value="{{isLimitBuy}}"> | 101 | <input id="product-limit" type="hidden" value="{{isLimitBuy}}"> |
102 | <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}"> | 102 | <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}"> |
103 | - | 103 | + {{> common/suspend-home}} |
104 | </div> | 104 | </div> |
105 | {{/ result}} | 105 | {{/ result}} |
@@ -11,7 +11,6 @@ | @@ -11,7 +11,6 @@ | ||
11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
12 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | 12 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} |
13 | </div> | 13 | </div> |
14 | - <div class="swiper-lazy-preloader"></div> | ||
15 | </a> | 14 | </a> |
16 | {{/ recommendList}} | 15 | {{/ recommendList}} |
17 | </div> | 16 | </div> |
@@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
7 | <a href="{{#if url}}{{url}}{{else}}javascript:;{{/if}}"> | 7 | <a href="{{#if url}}{{url}}{{else}}javascript:;{{/if}}"> |
8 | <img class="swiper-lazy" data-src="{{image img 640 240}}"> | 8 | <img class="swiper-lazy" data-src="{{image img 640 240}}"> |
9 | </a> | 9 | </a> |
10 | - <div class="swiper-lazy-preloader"></div> | ||
11 | </li> | 10 | </li> |
12 | {{/ list}} | 11 | {{/ list}} |
13 | </ul> | 12 | </ul> |
@@ -11,7 +11,6 @@ | @@ -11,7 +11,6 @@ | ||
11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
12 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | 12 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} |
13 | </div> | 13 | </div> |
14 | - <div class="swiper-lazy-preloader"></div> | ||
15 | </a> | 14 | </a> |
16 | {{/recommendList}} | 15 | {{/recommendList}} |
17 | </div> | 16 | </div> |
@@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
16 | <a href="{{url}}"> | 16 | <a href="{{url}}"> |
17 | <img class="swiper-lazy" data-src="{{image2 default_images w=235 h=314 q=60}}" alt=""> | 17 | <img class="swiper-lazy" data-src="{{image2 default_images w=235 h=314 q=60}}" alt=""> |
18 | </a> | 18 | </a> |
19 | - <div class="swiper-lazy-preloader"></div> | ||
20 | </div> | 19 | </div> |
21 | <div class="fresh-info"> | 20 | <div class="fresh-info"> |
22 | <p class="fresh-name"><a href="{{url}}">{{product_name}}</a></p> | 21 | <p class="fresh-name"><a href="{{url}}">{{product_name}}</a></p> |
public/hbs/channel/brandlist.hbs
0 → 100644
1 | + <div class="second-level-brand"> | ||
2 | + {{# brandList}} | ||
3 | + <div class="brand-list bar-{{@index}}"> | ||
4 | + <div class="title-bar"> | ||
5 | + <h2 style="position: static;">{{title}}</h2> | ||
6 | + </div> | ||
7 | + {{# list}} | ||
8 | + <p> | ||
9 | + <a href="{{url}}">{{name}} | ||
10 | + {{# isHot}} | ||
11 | + <i class="icon-hot">HOT</i> | ||
12 | + {{/ isHot}} | ||
13 | + {{# isNew}} | ||
14 | + <i class="icon-new">NEW</i> | ||
15 | + {{/ isNew}} | ||
16 | + </a> | ||
17 | + </p> | ||
18 | + {{/ list}} | ||
19 | + </div> | ||
20 | + {{/ brandList}} | ||
21 | + | ||
22 | + {{# newBrandWall}} | ||
23 | + <div class="new-brand-wall branding-wall hide"> | ||
24 | + {{# list}} | ||
25 | + <div class="brand-wall-box"> | ||
26 | + <a href="{{url}}"> | ||
27 | + <img class="lazy" data-original="{{img}}"></img> | ||
28 | + <div class="brand-name">{{brandName}}</div> | ||
29 | + </a> | ||
30 | + </div> | ||
31 | + {{/ list}} | ||
32 | + </div> | ||
33 | + {{/ newBrandWall}} | ||
34 | + | ||
35 | + {{# recommandBrandWall}} | ||
36 | + <div class="recommand-brand-wall branding-wall hide"> | ||
37 | + {{# list}} | ||
38 | + <div class="brand-wall-box"> | ||
39 | + <a href="{{url}}"> | ||
40 | + <img class="lazy" data-original="{{img}}"></img> | ||
41 | + <div class="brand-name">{{brandName}}</div> | ||
42 | + </a> | ||
43 | + </div> | ||
44 | + {{/ list}} | ||
45 | + </div> | ||
46 | + {{/ recommandBrandWall}} | ||
47 | +</div> |
1 | /** | 1 | /** |
2 | * Created by Acgpiano on 2016/9/19. | 2 | * Created by Acgpiano on 2016/9/19. |
3 | */ | 3 | */ |
4 | +require('../../scss/activity/_coupon-floor.css'); | ||
5 | + | ||
4 | var $ = require('yoho-jquery'), | 6 | var $ = require('yoho-jquery'), |
5 | - Swiper = require('yoho-swiper'), | 7 | + Swiper = require('yoho-swiper2'), |
6 | $receive = $('.main-right-receive'), | 8 | $receive = $('.main-right-receive'), |
7 | $mask = $('.floor-mask'), | 9 | $mask = $('.floor-mask'), |
8 | $message = $('.floor-message'), | 10 | $message = $('.floor-message'), |
9 | $tooltip = $('.floor-tooltip'), | 11 | $tooltip = $('.floor-tooltip'), |
10 | tip = require('../plugin/tip'); | 12 | tip = require('../plugin/tip'); |
11 | 13 | ||
14 | +require('../common'); | ||
15 | + | ||
12 | // 获取url中的参数 | 16 | // 获取url中的参数 |
13 | function getUrlParam(name) { | 17 | function getUrlParam(name) { |
14 | - | ||
15 | - // 构造一个含有目标参数的正则表达式对象 | ||
16 | - var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); | ||
17 | - | ||
18 | - // 匹配目标参数 | ||
19 | - var r = window.location.search.substr(1).match(reg); | ||
20 | - | ||
21 | - // 返回参数值 | ||
22 | - if (r !== null) { | ||
23 | - return r[2]; | ||
24 | - } | ||
25 | - | ||
26 | - return null; | 18 | + return window.queryString[name]; |
27 | } | 19 | } |
28 | 20 | ||
29 | -require('../common'); | ||
30 | - | ||
31 | // 获取领券状态 | 21 | // 获取领券状态 |
32 | -function getCouponStatus() { | 22 | +setTimeout(function() { |
33 | var req = '', | 23 | var req = '', |
34 | code = getUrlParam('code'), | 24 | code = getUrlParam('code'), |
35 | version = getUrlParam('app_version'), | 25 | version = getUrlParam('app_version'), |
@@ -79,9 +69,7 @@ function getCouponStatus() { | @@ -79,9 +69,7 @@ function getCouponStatus() { | ||
79 | } | 69 | } |
80 | } | 70 | } |
81 | }); | 71 | }); |
82 | -} | ||
83 | - | ||
84 | -getCouponStatus(); | 72 | +}, 300); |
85 | 73 | ||
86 | $receive.on('click', function() { | 74 | $receive.on('click', function() { |
87 | var $curDom = $(this); | 75 | var $curDom = $(this); |
@@ -3,64 +3,77 @@ | @@ -3,64 +3,77 @@ | ||
3 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> | 3 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> |
4 | * @date: 2015/10/23 | 4 | * @date: 2015/10/23 |
5 | */ | 5 | */ |
6 | +require('../../scss/channel/_brand.css'); | ||
6 | 7 | ||
7 | var $ = require('yoho-jquery'), | 8 | var $ = require('yoho-jquery'), |
8 | - Hammer = require('yoho-hammer'), | 9 | + Hammer = require('../common/toy-hammer'), |
9 | Swiper = require('yoho-swiper'), | 10 | Swiper = require('yoho-swiper'), |
10 | - loading = require('../plugin/loading'), | ||
11 | lazyLoad = require('yoho-jquery-lazyload'); | 11 | lazyLoad = require('yoho-jquery-lazyload'); |
12 | 12 | ||
13 | var ranToken = ' ??++ '; | 13 | var ranToken = ' ??++ '; |
14 | var ranToken2 = ' ???--- '; | 14 | var ranToken2 = ' ???--- '; |
15 | 15 | ||
16 | -var swiper, | ||
17 | - $fixTitleBar, | ||
18 | - $brandList = $('.brand-list'), | 16 | +var $brandList, |
17 | + $newBrandWall, | ||
18 | + $recommandBrandWall, | ||
19 | $icon = $('.search-icon'), | 19 | $icon = $('.search-icon'), |
20 | $genderItem = $('.genderNav li'), | 20 | $genderItem = $('.genderNav li'), |
21 | $brandItem = $('.brandNav li'), | 21 | $brandItem = $('.brandNav li'), |
22 | - $newBrandWall = $('.new-brand-wall'), | ||
23 | - $recommandBrandWall = $('.recommand-brand-wall'), | ||
24 | $searchAction = $('.search-action'), | 22 | $searchAction = $('.search-action'), |
25 | $homebuttom = $('.homebuttom'), | 23 | $homebuttom = $('.homebuttom'), |
26 | - $genderNav = $('.genderNav'), | ||
27 | $newSearch = $('.newbrand-search'), | 24 | $newSearch = $('.newbrand-search'), |
28 | $netHistory = $('.net-history'), | 25 | $netHistory = $('.net-history'), |
29 | - $navBtn = $('.nav-home'), | ||
30 | - hotBrandsSwiper; | ||
31 | - | ||
32 | -var searchH = $('.newbrand-search').outerHeight(), | ||
33 | - headerH = $('.yoho-header').outerHeight(), | ||
34 | - brandSwipe = parseInt(searchH) + parseInt(headerH) - 1, | ||
35 | - minBrandListTop; | 26 | + $searchResult = $('.search-result'), |
27 | + $navBtn = $('.nav-home'); | ||
36 | 28 | ||
37 | var brandsData, | 29 | var brandsData, |
38 | - $keyword = $('#keyword'), | ||
39 | - clearTextHammer; | 30 | + $keyword = $('#keyword'); |
40 | 31 | ||
41 | var $history = $('.local-history'); | 32 | var $history = $('.local-history'); |
42 | var $searchPage = $('.search-brand-page'); | 33 | var $searchPage = $('.search-brand-page'); |
43 | var $historySearch = $('.history-search'); | 34 | var $historySearch = $('.history-search'); |
44 | var $hotSearch = $('.hot-search'); | 35 | var $hotSearch = $('.hot-search'); |
45 | - | ||
46 | var $clearHistory = $('#clear-history'); | 36 | var $clearHistory = $('#clear-history'); |
47 | - | ||
48 | -var chHammer; | 37 | +var isSearchPage = $('.brand-search-page').length > 0; |
49 | 38 | ||
50 | require('../common'); | 39 | require('../common'); |
51 | require('../footer'); | 40 | require('../footer'); |
52 | 41 | ||
42 | +function getBrandList() { | ||
43 | + var listHbs = require('channel/brandlist.hbs'); | ||
44 | + | ||
45 | + $.ajax({ | ||
46 | + url: '/brands/getBrandList', | ||
47 | + data: { | ||
48 | + channel: window.queryString.channel | ||
49 | + }, | ||
50 | + success: function(data) { | ||
51 | + $('#placeholder-brandlist').replaceWith(listHbs(data)); | ||
52 | + | ||
53 | + lazyLoad($('img.lazy')); | ||
54 | + | ||
55 | + // 改变背景色 | ||
56 | + changeBackground(); | ||
57 | + | ||
58 | + $brandList = $('.brand-list'); | ||
59 | + $newBrandWall = $('.new-brand-wall'); | ||
60 | + $recommandBrandWall = $('.recommand-brand-wall'); | ||
61 | + }, | ||
62 | + error: function() { | ||
63 | + } | ||
64 | + }); | ||
65 | +} | ||
66 | + | ||
53 | function changeBackground() { | 67 | function changeBackground() { |
54 | - var $brandList = $('.brand-list').find('p'); | 68 | + var brandList = $('.brand-list').find('p'); |
55 | 69 | ||
56 | - $brandList.on('touchstart', function() { | ||
57 | - $brandList.css('background', '#fff'); | 70 | + brandList.on('touchstart', function() { |
71 | + brandList.css('background', '#fff'); | ||
58 | $(this).css('background', '#eee'); | 72 | $(this).css('background', '#eee'); |
59 | }).on('touchend touchcancel', function() { | 73 | }).on('touchend touchcancel', function() { |
60 | $(this).css('background', '#fff'); | 74 | $(this).css('background', '#fff'); |
61 | }); | 75 | }); |
62 | } | 76 | } |
63 | -changeBackground(); | ||
64 | 77 | ||
65 | /** | 78 | /** |
66 | * 增加单条记录 | 79 | * 增加单条记录 |
@@ -70,7 +83,7 @@ function addHistory(brandName) { | @@ -70,7 +83,7 @@ function addHistory(brandName) { | ||
70 | type: 'POST', | 83 | type: 'POST', |
71 | url: '/brands/addBrandSearch', | 84 | url: '/brands/addBrandSearch', |
72 | data: 'brandName=' + encodeURIComponent(brandName), | 85 | data: 'brandName=' + encodeURIComponent(brandName), |
73 | - success: function(data) { | 86 | + success: function() { |
74 | }, | 87 | }, |
75 | error: function() { | 88 | error: function() { |
76 | } | 89 | } |
@@ -91,15 +104,16 @@ function sequence(a, b) { | @@ -91,15 +104,16 @@ function sequence(a, b) { | ||
91 | function searchInput() { | 104 | function searchInput() { |
92 | if ($keyword.val().length) { | 105 | if ($keyword.val().length) { |
93 | $icon.css('color', '#444'); | 106 | $icon.css('color', '#444'); |
107 | + $searchResult.css('margin-bottom', '6rem'); | ||
94 | 108 | ||
95 | // $(this).closest('.search-box').css('width', '11.25rem'); | 109 | // $(this).closest('.search-box').css('width', '11.25rem'); |
96 | $searchAction.show().find('.clear-text').show(); | 110 | $searchAction.show().find('.clear-text').show(); |
97 | } else { | 111 | } else { |
98 | $icon.css('color', '#b2b2b2'); | 112 | $icon.css('color', '#b2b2b2'); |
113 | + $searchResult.css('margin-bottom', '0'); | ||
99 | 114 | ||
100 | // $(this).closest('.search-box').css('width', '12.5rem'); | 115 | // $(this).closest('.search-box').css('width', '12.5rem'); |
101 | $searchAction.find('.clear-text').hide(); | 116 | $searchAction.find('.clear-text').hide(); |
102 | - | ||
103 | } | 117 | } |
104 | searchResult(); | 118 | searchResult(); |
105 | } | 119 | } |
@@ -241,47 +255,20 @@ function searchResult() { | @@ -241,47 +255,20 @@ function searchResult() { | ||
241 | } | 255 | } |
242 | 256 | ||
243 | // 插入 dom,绑定事件 | 257 | // 插入 dom,绑定事件 |
244 | - $('.search-result').html(html); | 258 | + $searchResult.html(html); |
245 | changeBackground(); | 259 | changeBackground(); |
246 | bindWriteLocal($('.brand-list'), true); | 260 | bindWriteLocal($('.brand-list'), true); |
247 | } | 261 | } |
248 | 262 | ||
249 | -loading.showLoadingMask(); | ||
250 | - | ||
251 | -lazyLoad($('img.lazy')); | ||
252 | -$('.yoho-header').css({ | ||
253 | - 'z-index': 2, | ||
254 | - position: 'fixed', | ||
255 | - top: 0 | ||
256 | -}); | ||
257 | - | ||
258 | -$homebuttom.css('top', '47px'); | ||
259 | -$homebuttom.css('position', 'fixed'); | ||
260 | - | ||
261 | -$navBtn.on('touchstart', function() { | ||
262 | - if ($homebuttom.hasClass('hide')) { | ||
263 | - $genderNav.css('top', '47px'); | ||
264 | - $newSearch.css('margin-top', '0px'); | ||
265 | - $searchPage.css('margin-top', '0px'); | ||
266 | - $('.banner-top').css('margin-top', '0px'); | ||
267 | - } else { | ||
268 | - $genderNav.css('top', '97px'); | ||
269 | - $newSearch.css('margin-top', '47px'); | ||
270 | - $searchPage.css('margin-top', '47px'); | ||
271 | - $('.banner-top').css('margin-top', '47px'); | ||
272 | - } | ||
273 | -}); | ||
274 | - | ||
275 | (function() { | 263 | (function() { |
276 | - if ($('.banner-top').length > 0) { | ||
277 | - $('.hot-brands').css('padding-top', '0'); | 264 | + if ($('.banner-top').length === 0) { |
265 | + var h1 = $('.genderNav').height(); | ||
266 | + var h2 = $('.newbrand-search').height(); | ||
267 | + $('.hot-brands').css('padding-top', (h1 + h2) + 'px'); | ||
278 | } | 268 | } |
279 | 269 | ||
280 | - $('.hide-when-loading').show(); | ||
281 | - loading.hideLoadingMask(); | ||
282 | - | ||
283 | // banner滑动 | 270 | // banner滑动 |
284 | - swiper = new Swiper('.swiper-container', { | 271 | + new Swiper('.swiper-container', { |
285 | lazyLoading: true, | 272 | lazyLoading: true, |
286 | loop: true, | 273 | loop: true, |
287 | autoplay: 3000, | 274 | autoplay: 3000, |
@@ -289,60 +276,67 @@ $navBtn.on('touchstart', function() { | @@ -289,60 +276,67 @@ $navBtn.on('touchstart', function() { | ||
289 | }); | 276 | }); |
290 | 277 | ||
291 | // 热门品牌滑动 | 278 | // 热门品牌滑动 |
292 | - hotBrandsSwiper = new Swiper('.brands-swiper', { | 279 | + new Swiper('.brands-swiper', { |
293 | grabCursor: true, | 280 | grabCursor: true, |
294 | slidesPerView: 'auto', | 281 | slidesPerView: 'auto', |
295 | wrapperClass: 'brands-list', | 282 | wrapperClass: 'brands-list', |
296 | slideElement: 'li' | 283 | slideElement: 'li' |
297 | }); | 284 | }); |
298 | -}()); | ||
299 | 285 | ||
300 | -$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>'); | ||
301 | -$fixTitleBar.css({ | ||
302 | - position: 'fixed', | ||
303 | - top: brandSwipe | ||
304 | -}).hide(); | ||
305 | -minBrandListTop = brandSwipe + $('.hot-brands').outerHeight() + $('.banner-top').outerHeight(); | ||
306 | -$brandList.last().append($fixTitleBar); | ||
307 | - | ||
308 | -function scrollHandler() { | ||
309 | - var scrTop = $(window).scrollTop(); | 286 | + $genderItem.on('touchstart', function() { |
287 | + var index = $(this).data('id') + 1; | ||
288 | + window.location.search = 'channel=' + index; | ||
289 | + }); | ||
310 | 290 | ||
311 | - if ($brandList.eq(0).offset().top < minBrandListTop) { | ||
312 | - $fixTitleBar.hide(); | 291 | + $brandItem.on('click', function() { |
292 | + var index = $(this).data('id'); | ||
293 | + $('.brandNav ul .active').removeClass('active'); | ||
294 | + $(this).addClass('active'); | ||
295 | + if (index === 0) { | ||
296 | + $recommandBrandWall.not('.hide').addClass('hide'); | ||
297 | + $newBrandWall.not('.hide').addClass('hide'); | ||
298 | + $brandList.removeClass('hide'); | ||
299 | + } else if (index === 1) { | ||
300 | + $newBrandWall.removeClass('hide'); | ||
301 | + $brandList.not('.hide').addClass('hide'); | ||
302 | + $recommandBrandWall.not('.hide').addClass('hide'); | ||
303 | + } else { | ||
304 | + $recommandBrandWall.removeClass('hide'); | ||
305 | + $brandList.not('.hide').addClass('hide'); | ||
306 | + $newBrandWall.not('.hide').addClass('hide'); | ||
313 | } | 307 | } |
308 | + }); | ||
314 | 309 | ||
315 | - $brandList.each(function() { | ||
316 | - var offTop = $(this).offset().top - brandSwipe; | ||
317 | - | ||
318 | - if (scrTop >= offTop) { | ||
319 | - $fixTitleBar.css({ | ||
320 | - display: 'block' | ||
321 | - }).find('h2').html($(this).find('.title-bar').text()); | 310 | + if (!isSearchPage) { |
311 | + setTimeout(getBrandList, 50); | ||
322 | } | 312 | } |
313 | +}()); | ||
323 | 314 | ||
315 | +// 搜索页面 | ||
316 | +if (isSearchPage) { | ||
317 | + $('.yoho-header').css({ | ||
318 | + 'z-index': 2, | ||
319 | + position: 'fixed', | ||
320 | + top: 0 | ||
324 | }); | 321 | }); |
325 | -} | ||
326 | 322 | ||
327 | -if ($('.brand-index-page').length > 0) { | ||
328 | - /** | ||
329 | - * srcoll to load more | ||
330 | - */ | ||
331 | - $(window).scroll(function() { | ||
332 | - window.requestAnimationFrame(scrollHandler); | 323 | + $homebuttom.css('top', '45px'); |
324 | + $homebuttom.css('position', 'fixed'); | ||
325 | + $navBtn.on('touchstart', function() { | ||
326 | + if ($homebuttom.hasClass('hide')) { | ||
327 | + $searchResult.css('margin-top', '0px'); | ||
328 | + $newSearch.css('margin-top', '0px'); | ||
329 | + $searchPage.css('margin-top', '0px'); | ||
330 | + } else { | ||
331 | + $searchResult.css('margin-top', '45px'); | ||
332 | + $newSearch.css('margin-top', '45px'); | ||
333 | + $searchPage.css('margin-top', '45px'); | ||
334 | + } | ||
333 | }); | 335 | }); |
334 | -} | ||
335 | 336 | ||
337 | + bindWriteLocal($historySearch, false); | ||
338 | + bindWriteLocal($hotSearch, false); | ||
336 | 339 | ||
337 | -if ($('.history-search').length > 0) { | ||
338 | - bindWriteLocal($('.history-search'), false); | ||
339 | -} | ||
340 | - | ||
341 | -if ($('.hot-search').length > 0) { | ||
342 | - bindWriteLocal($('.hot-search'), false); | ||
343 | -} | ||
344 | - | ||
345 | -if ($('.brand-search-page').length > 0) { | ||
346 | brandsData = $.parseJSON($('#brands-data').html()); | 340 | brandsData = $.parseJSON($('#brands-data').html()); |
347 | 341 | ||
348 | $keyword.on('input', function() { | 342 | $keyword.on('input', function() { |
@@ -354,86 +348,35 @@ if ($('.brand-search-page').length > 0) { | @@ -354,86 +348,35 @@ if ($('.brand-search-page').length > 0) { | ||
354 | $keyword.closest('.search-box').css('width', '13rem'); | 348 | $keyword.closest('.search-box').css('width', '13rem'); |
355 | $searchAction.show().find('.clear-text').hide(); | 349 | $searchAction.show().find('.clear-text').hide(); |
356 | 350 | ||
357 | - clearTextHammer = new Hammer($('.clear-text')[0]); | 351 | + var clearTextHammer = new Hammer($('.clear-text')[0]); |
358 | clearTextHammer.on('tap', function(e) { | 352 | clearTextHammer.on('tap', function(e) { |
359 | - $('.search-result').html(''); | 353 | + $searchResult.html(''); |
360 | $('#keyword').val('').trigger('input'); | 354 | $('#keyword').val('').trigger('input'); |
361 | - e.preventDefault(); | 355 | + e.srcEvent.preventDefault(); |
362 | e.srcEvent.stopPropagation(); | 356 | e.srcEvent.stopPropagation(); |
363 | }); | 357 | }); |
364 | 358 | ||
365 | $('form.search-box').on('submit', function() { | 359 | $('form.search-box').on('submit', function() { |
366 | return false; | 360 | return false; |
367 | }); | 361 | }); |
368 | - | ||
369 | -} | ||
370 | - | ||
371 | -if ($genderItem.length > 0) { | ||
372 | - $genderItem.on('touchstart', function() { | ||
373 | - var index = $(this).data('id') + 1; | ||
374 | - | ||
375 | - $('.genderNav ul .active').removeClass('active'); | ||
376 | - $(this).addClass('active'); | ||
377 | - $('.hide-when-loading').hide(); | ||
378 | - loading.showLoadingMask(); | ||
379 | - function reload() { | ||
380 | - window.location.search = 'channel=' + index; | ||
381 | - } | ||
382 | - setTimeout(reload.bind(this), 100); | ||
383 | - }); | ||
384 | -} | ||
385 | - | ||
386 | -if ($brandItem.length > 0) { | ||
387 | - $brandItem.on('click', function() { | ||
388 | - var index = $(this).data('id'); | ||
389 | - | ||
390 | - $('.brandNav ul .active').removeClass('active'); | ||
391 | - $(this).addClass('active'); | ||
392 | - | ||
393 | - | ||
394 | - if (index === 0) { | ||
395 | - | ||
396 | - $recommandBrandWall.not('.hide').addClass('hide'); | ||
397 | - $newBrandWall.not('.hide').addClass('hide'); | ||
398 | - $brandList.removeClass('hide'); | ||
399 | - | ||
400 | - } else if (index === 1) { | ||
401 | - | ||
402 | - $newBrandWall.removeClass('hide'); | ||
403 | - $brandList.not('.hide').addClass('hide'); | ||
404 | - $recommandBrandWall.not('.hide').addClass('hide'); | ||
405 | - | ||
406 | - } else { | ||
407 | - | ||
408 | - $recommandBrandWall.removeClass('hide'); | ||
409 | - $brandList.not('.hide').addClass('hide'); | ||
410 | - $newBrandWall.not('.hide').addClass('hide'); | ||
411 | - | ||
412 | - } | ||
413 | - | ||
414 | - }); | ||
415 | } | 362 | } |
416 | 363 | ||
417 | -/** | ||
418 | - * 清除记录 | ||
419 | - */ | ||
420 | -function removeHistory() { | 364 | +// 初始化历史搜索的内容 |
365 | +if (isSearchPage) { | ||
366 | + require('./brand-render')(function() { | ||
367 | + // 清除记录 | ||
368 | + function removeHistory() { | ||
421 | $.ajax({ | 369 | $.ajax({ |
422 | type: 'GET', | 370 | type: 'GET', |
423 | url: '/brands/delBrandHistory', | 371 | url: '/brands/delBrandHistory', |
424 | data: '', | 372 | data: '', |
425 | - success: function(data) { | ||
426 | - }, | ||
427 | - error: function() { | ||
428 | - } | 373 | + success: function() {}, |
374 | + error: function() {} | ||
429 | }); | 375 | }); |
430 | -} | 376 | + } |
431 | 377 | ||
432 | -// 初始化历史搜索的内容 | ||
433 | -require('./brand-render')(function() { | ||
434 | $netHistory = $('.net-history'); | 378 | $netHistory = $('.net-history'); |
435 | - if ($('.brand-search-page').length > 0) { | ||
436 | - chHammer = new Hammer($clearHistory[0]); | 379 | + var chHammer = new Hammer($clearHistory[0]); |
437 | chHammer.on('tap', function() { | 380 | chHammer.on('tap', function() { |
438 | if (isLocalStorageSupported()) { | 381 | if (isLocalStorageSupported()) { |
439 | localStorage.removeItem('historys-brand'); | 382 | localStorage.removeItem('historys-brand'); |
@@ -450,7 +393,6 @@ require('./brand-render')(function() { | @@ -450,7 +393,6 @@ require('./brand-render')(function() { | ||
450 | }); | 393 | }); |
451 | 394 | ||
452 | // 搜索页面 | 395 | // 搜索页面 |
453 | - | ||
454 | (function() { | 396 | (function() { |
455 | var html = '', | 397 | var html = '', |
456 | history, | 398 | history, |
@@ -465,7 +407,6 @@ require('./brand-render')(function() { | @@ -465,7 +407,6 @@ require('./brand-render')(function() { | ||
465 | netArr = []; | 407 | netArr = []; |
466 | 408 | ||
467 | $netHistory.find('li').each(function() { | 409 | $netHistory.find('li').each(function() { |
468 | - | ||
469 | brand = $(this).find('a').attr('brandName'); | 410 | brand = $(this).find('a').attr('brandName'); |
470 | time = $(this).find('a').attr('collectTime'); | 411 | time = $(this).find('a').attr('collectTime'); |
471 | dict = { | 412 | dict = { |
@@ -568,9 +509,6 @@ require('./brand-render')(function() { | @@ -568,9 +509,6 @@ require('./brand-render')(function() { | ||
568 | } else { | 509 | } else { |
569 | $history.addClass('hide'); | 510 | $history.addClass('hide'); |
570 | } | 511 | } |
571 | - | ||
572 | }()); | 512 | }()); |
573 | - | ||
574 | - } | ||
575 | -}); | ||
576 | - | 513 | + }); |
514 | +} |
1 | +@import "../layout/_swiper.css"; | ||
2 | + | ||
1 | .coupon-area-page { | 3 | .coupon-area-page { |
2 | max-width: 640px; | 4 | max-width: 640px; |
3 | overflow: hidden; | 5 | overflow: hidden; |
4 | 6 | ||
7 | + .banner-top { | ||
8 | + position: relative; | ||
9 | + margin-bottom: -2PX; | ||
10 | + | ||
11 | + .swiper-pagination { | ||
12 | + position: absolute; | ||
13 | + left: 0; | ||
14 | + right: 0; | ||
15 | + bottom: 20px; | ||
16 | + text-align: center; | ||
17 | + z-index: 1; | ||
18 | + | ||
19 | + .pagination-inner { | ||
20 | + display: inline-block; | ||
21 | + padding: 0 8px 4px; | ||
22 | + background: rgba(0, 0, 0, 0.2); | ||
23 | + border-radius: 50px; | ||
24 | + line-height: 1.2; | ||
25 | + | ||
26 | + span { | ||
27 | + display: inline-block; | ||
28 | + width: 14px; | ||
29 | + height: 14px; | ||
30 | + background: #fff; | ||
31 | + opacity: 0.5; | ||
32 | + margin: 0 9px; | ||
33 | + border-radius: 50%; | ||
34 | + | ||
35 | + &.swiper-pagination-bullet-active { | ||
36 | + background: #fff; | ||
37 | + opacity: 1; | ||
38 | + } | ||
39 | + } | ||
40 | + } | ||
41 | + } | ||
42 | + } | ||
43 | + | ||
5 | .swiper-slide { | 44 | .swiper-slide { |
6 | img { | 45 | img { |
7 | max-width: 640px; | 46 | max-width: 640px; |
@@ -10,11 +49,12 @@ | @@ -10,11 +49,12 @@ | ||
10 | } | 49 | } |
11 | } | 50 | } |
12 | 51 | ||
13 | -.just-img{ | 52 | +.just-img { |
14 | width: 100%; | 53 | width: 100%; |
15 | float: left; | 54 | float: left; |
16 | - margin:0; | 55 | + margin: 0; |
17 | } | 56 | } |
57 | + | ||
18 | .coupon-floor { | 58 | .coupon-floor { |
19 | float: left; | 59 | float: left; |
20 | width: 100%; | 60 | width: 100%; |
@@ -42,7 +82,9 @@ | @@ -42,7 +82,9 @@ | ||
42 | height: 160px; | 82 | height: 160px; |
43 | } | 83 | } |
44 | 84 | ||
45 | - .main-right-receive, .main-right-use, .main-right-go { | 85 | + .main-right-receive, |
86 | + .main-right-use, | ||
87 | + .main-right-go { | ||
46 | float: right; | 88 | float: right; |
47 | width: 18%; | 89 | width: 18%; |
48 | height: 160px; | 90 | height: 160px; |
@@ -64,13 +106,13 @@ | @@ -64,13 +106,13 @@ | ||
64 | display: inline-block; | 106 | display: inline-block; |
65 | width: 52px; | 107 | width: 52px; |
66 | height: 54px; | 108 | height: 54px; |
67 | - background-image: resolve('activity/click-txt.png'); | 109 | + background-image: resolve("activity/click-txt.png"); |
68 | } | 110 | } |
69 | 111 | ||
70 | &.received { | 112 | &.received { |
71 | width: 100%; | 113 | width: 100%; |
72 | height: 132px; | 114 | height: 132px; |
73 | - background-image: resolve('activity/received.png'); | 115 | + background-image: resolve("activity/received.png"); |
74 | position: absolute; | 116 | position: absolute; |
75 | top: 0; | 117 | top: 0; |
76 | right: 0; | 118 | right: 0; |
@@ -79,7 +121,7 @@ | @@ -79,7 +121,7 @@ | ||
79 | &.zero { | 121 | &.zero { |
80 | width: 100%; | 122 | width: 100%; |
81 | height: 132px; | 123 | height: 132px; |
82 | - background-image: resolve('activity/zero.png'); | 124 | + background-image: resolve("activity/zero.png"); |
83 | position: absolute; | 125 | position: absolute; |
84 | top: 0; | 126 | top: 0; |
85 | right: 0; | 127 | right: 0; |
@@ -130,7 +172,7 @@ | @@ -130,7 +172,7 @@ | ||
130 | } | 172 | } |
131 | } | 173 | } |
132 | 174 | ||
133 | -.floor-tooltip{ | 175 | +.floor-tooltip { |
134 | position: fixed; | 176 | position: fixed; |
135 | top: 50%; | 177 | top: 50%; |
136 | left: 50%; | 178 | left: 50%; |
@@ -144,13 +186,13 @@ | @@ -144,13 +186,13 @@ | ||
144 | border-radius: 8px; | 186 | border-radius: 8px; |
145 | color: #fff; | 187 | color: #fff; |
146 | 188 | ||
147 | - .icon-box{ | 189 | + .icon-box { |
148 | height: 84px; | 190 | height: 84px; |
149 | line-height: 84px; | 191 | line-height: 84px; |
150 | text-align: center; | 192 | text-align: center; |
151 | } | 193 | } |
152 | 194 | ||
153 | - .icon-msg{ | 195 | + .icon-msg { |
154 | height: 56px; | 196 | height: 56px; |
155 | text-align: center; | 197 | text-align: center; |
156 | } | 198 | } |
1 | @import "search"; | 1 | @import "search"; |
2 | +@import "floor-header"; | ||
3 | +@import "footer-tab"; | ||
4 | +@import "hot-brands"; | ||
5 | +@import "../layout/_swiper.css"; | ||
2 | .brand-page { | 6 | .brand-page { |
3 | .re-pos-search { | 7 | .re-pos-search { |
4 | top: 80px !important; | 8 | top: 80px !important; |
5 | } | 9 | } |
6 | 10 | ||
7 | - .hide-when-loading { | ||
8 | - display: none; | 11 | + .banner-top { |
12 | + position: relative; | ||
13 | + margin-bottom: -2PX; | ||
14 | + | ||
15 | + .swiper-pagination { | ||
16 | + position: absolute; | ||
17 | + left: 0; | ||
18 | + right: 0; | ||
19 | + bottom: 20px; | ||
20 | + text-align: center; | ||
21 | + z-index: 1; | ||
22 | + | ||
23 | + .pagination-inner { | ||
24 | + display: inline-block; | ||
25 | + padding: 0 8px 4px; | ||
26 | + background: rgba(0, 0, 0, 0.2); | ||
27 | + border-radius: 50px; | ||
28 | + line-height: 1.2; | ||
29 | + | ||
30 | + span { | ||
31 | + display: inline-block; | ||
32 | + width: 14px; | ||
33 | + height: 14px; | ||
34 | + background: #fff; | ||
35 | + opacity: 0.5; | ||
36 | + margin: 0 9px; | ||
37 | + border-radius: 50%; | ||
38 | + | ||
39 | + &.swiper-pagination-bullet-active { | ||
40 | + background: #fff; | ||
41 | + opacity: 1; | ||
42 | + } | ||
43 | + } | ||
44 | + } | ||
45 | + } | ||
9 | } | 46 | } |
10 | 47 | ||
11 | .genderNav { | 48 | .genderNav { |
@@ -212,13 +249,17 @@ | @@ -212,13 +249,17 @@ | ||
212 | } | 249 | } |
213 | } | 250 | } |
214 | 251 | ||
252 | + .second-level-brand { | ||
253 | + overflow: hidden; | ||
254 | + margin-bottom: 100px; | ||
255 | + } | ||
256 | + | ||
215 | .banner-top { | 257 | .banner-top { |
216 | padding-top: 168px; | 258 | padding-top: 168px; |
217 | background-color: #f8f8f8; | 259 | background-color: #f8f8f8; |
218 | } | 260 | } |
219 | 261 | ||
220 | .hot-brands { | 262 | .hot-brands { |
221 | - padding-top: 178px; | ||
222 | border-top: 30px solid #f4f4f4; | 263 | border-top: 30px solid #f4f4f4; |
223 | 264 | ||
224 | .floor-header { | 265 | .floor-header { |
@@ -97,8 +97,10 @@ | @@ -97,8 +97,10 @@ | ||
97 | li { | 97 | li { |
98 | float: left; | 98 | float: left; |
99 | padding-left: 5%; | 99 | padding-left: 5%; |
100 | + padding-bottom: 5%; | ||
100 | width: 21.875%; | 101 | width: 21.875%; |
101 | height: 140px; | 102 | height: 140px; |
103 | + position: relative; | ||
102 | 104 | ||
103 | a { | 105 | a { |
104 | position: relative; | 106 | position: relative; |
@@ -113,14 +115,13 @@ | @@ -113,14 +115,13 @@ | ||
113 | display: inline-block; | 115 | display: inline-block; |
114 | max-width: 100%; | 116 | max-width: 100%; |
115 | max-height: 100%; | 117 | max-height: 100%; |
116 | - vertical-align: middle; | ||
117 | } | 118 | } |
118 | 119 | ||
119 | .brands-title { | 120 | .brands-title { |
120 | position: absolute; | 121 | position: absolute; |
121 | - left: 8px; | 122 | + left: 40px; |
122 | right: 8px; | 123 | right: 8px; |
123 | - bottom: 8px; | 124 | + bottom: -5px; |
124 | height: 28px; | 125 | height: 28px; |
125 | line-height: 28px; | 126 | line-height: 28px; |
126 | text-align: center; | 127 | text-align: center; |
-
Please register or login to post a comment