Merge branch 'release/5.2' of git.yoho.cn:fe/yohobuywap-node into release/5.2
Showing
20 changed files
with
206 additions
and
240 deletions
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | 8 | ||
9 | const indexModel = require('../models/market'); | 9 | const indexModel = require('../models/market'); |
10 | +const _ = require('lodash'); | ||
10 | 11 | ||
11 | exports.index = (req, res, next) => { | 12 | exports.index = (req, res, next) => { |
12 | 13 | ||
@@ -21,3 +22,26 @@ exports.index = (req, res, next) => { | @@ -21,3 +22,26 @@ exports.index = (req, res, next) => { | ||
21 | }).catch(next); | 22 | }).catch(next); |
22 | 23 | ||
23 | }; | 24 | }; |
25 | + | ||
26 | +/** | ||
27 | + * 市场推广活动升级版,自定义下载渠道 | ||
28 | + * @param req | ||
29 | + * @param res | ||
30 | + * @param next | ||
31 | + */ | ||
32 | +exports.v2 = (req, res, next) => { | ||
33 | + | ||
34 | + indexModel.index({ | ||
35 | + | ||
36 | + }).then((result) => { | ||
37 | + if (_.has(result, 'download[0].url') && req.query.union_type) { | ||
38 | + result.download[0].url = result.download[0].url.split('?')[0] + | ||
39 | + '?union_type=' + req.query.union_type; | ||
40 | + } | ||
41 | + res.render('market/market', Object.assign(result, { | ||
42 | + title: 'Yoho!Buy 有货' | ||
43 | + })); | ||
44 | + | ||
45 | + }).catch(next); | ||
46 | + | ||
47 | +}; |
@@ -17,19 +17,19 @@ const getPageInfo = (pageInfo) => { | @@ -17,19 +17,19 @@ const getPageInfo = (pageInfo) => { | ||
17 | dest.activityID = pageInfo.id; | 17 | dest.activityID = pageInfo.id; |
18 | dest.title = pageInfo.data.h5Title; | 18 | dest.title = pageInfo.data.h5Title; |
19 | dest.activityDesc = pageInfo.data.activityDesc; | 19 | dest.activityDesc = pageInfo.data.activityDesc; |
20 | + dest.formatActivityDesc = pageInfo.data.formatActivityDesc; | ||
20 | dest.couponPic = pageInfo.data.couponPic; | 21 | dest.couponPic = pageInfo.data.couponPic; |
21 | dest.oldUserCouponPic = pageInfo.data.oldUserCouponPic; | 22 | dest.oldUserCouponPic = pageInfo.data.oldUserCouponPic; |
22 | dest.mobile = pageInfo.data.mobile; | 23 | dest.mobile = pageInfo.data.mobile; |
23 | dest.wechatShare = true; | 24 | dest.wechatShare = true; |
24 | dest.secondScreenPic = pageInfo.data.secondScreenPic; | 25 | dest.secondScreenPic = pageInfo.data.secondScreenPic; |
25 | 26 | ||
26 | - // 强制活动开始,活动上线产品要求这样设置 | ||
27 | - pageInfo.data.flag = 1; | ||
28 | - if (pageInfo.data.flag === 1) { | ||
29 | - dest.bgImg = pageInfo.data.activityNormalPic; | ||
30 | - } else { | 27 | + if (pageInfo.data.flag === 3 || pageInfo.data.flag === 4) { |
28 | + // flag为3 表示活动结束 , 4 表示未开始 | ||
31 | dest.bgImg = pageInfo.data.activityEndPic; | 29 | dest.bgImg = pageInfo.data.activityEndPic; |
32 | dest.ended = true; | 30 | dest.ended = true; |
31 | + } else { | ||
32 | + dest.bgImg = pageInfo.data.activityNormalPic; | ||
33 | } | 33 | } |
34 | dest.message = pageInfo.data.returnMsg; | 34 | dest.message = pageInfo.data.returnMsg; |
35 | } | 35 | } |
@@ -115,4 +115,4 @@ exports.registerAndSendCoupon = (data) => { | @@ -115,4 +115,4 @@ exports.registerAndSendCoupon = (data) => { | ||
115 | return api.get('', verifyData).then(result => { | 115 | return api.get('', verifyData).then(result => { |
116 | return getUserStatus(result); | 116 | return getUserStatus(result); |
117 | }); // 所有数据返回一个 Promise,方便 Promise.all 调用 | 117 | }); // 所有数据返回一个 Promise,方便 Promise.all 调用 |
118 | -}; | ||
118 | +}; |
@@ -71,6 +71,7 @@ router.get('/invite', invite.checkType, invite.index); | @@ -71,6 +71,7 @@ router.get('/invite', invite.checkType, invite.index); | ||
71 | router.get('/invite/index', invite.checkType, invite.index); | 71 | router.get('/invite/index', invite.checkType, invite.index); |
72 | 72 | ||
73 | router.get('/market', market.index); // 市场推广活动 | 73 | router.get('/market', market.index); // 市场推广活动 |
74 | +router.get('/market/v2', market.v2); // 市场推广活动升级版,自定义下载渠道 | ||
74 | 75 | ||
75 | router.get(/\/invite\/share_([\d]+)_([\d]+)_([\d]+).html/, invite.checkType, invite.share); | 76 | router.get(/\/invite\/share_([\d]+)_([\d]+)_([\d]+).html/, invite.checkType, invite.share); |
76 | 77 |
@@ -60,6 +60,7 @@ | @@ -60,6 +60,7 @@ | ||
60 | </div> | 60 | </div> |
61 | 61 | ||
62 | <div class="tip-wrap hidden"> | 62 | <div class="tip-wrap hidden"> |
63 | + <img src="{{image bgImg 640 1136}}"> | ||
63 | <div class="tip fail"> | 64 | <div class="tip fail"> |
64 | <div class="header"> | 65 | <div class="header"> |
65 | </div> | 66 | </div> |
@@ -81,7 +82,12 @@ | @@ -81,7 +82,12 @@ | ||
81 | <div class="mask hidden"></div> | 82 | <div class="mask hidden"></div> |
82 | <div class="dialog hidden" id="message"> | 83 | <div class="dialog hidden" id="message"> |
83 | <span class="close"></span> | 84 | <span class="close"></span> |
84 | - {{{activityDesc}}} | 85 | + <div class="activity-message"> |
86 | + <h3>活动说明</h3> | ||
87 | + <div class="message"> | ||
88 | + {{{formatActivityDesc}}} | ||
89 | + </div> | ||
90 | + </div> | ||
85 | </div> | 91 | </div> |
86 | 92 | ||
87 | 93 |
@@ -60,13 +60,14 @@ exports.ensure = (req, res, next) => { | @@ -60,13 +60,14 @@ exports.ensure = (req, res, next) => { | ||
60 | let view; | 60 | let view; |
61 | 61 | ||
62 | if (paymentInfo.code !== 200) { | 62 | if (paymentInfo.code !== 200) { |
63 | - if (paymentInfo.message) { | ||
64 | - view = { | ||
65 | - orderEnsure: false, | ||
66 | - message: paymentInfo.message | ||
67 | - }; | ||
68 | - } else { | ||
69 | - return Promise.reject(paymentInfo); | 63 | + view = { |
64 | + orderEnsure: false, | ||
65 | + message: paymentInfo.message | ||
66 | + }; | ||
67 | + | ||
68 | + // hotfix: nginx 接口限流, code:9999991时没message 信息 | ||
69 | + if (!view.message) { | ||
70 | + view.message = '挤爆啦,系统繁忙'; | ||
70 | } | 71 | } |
71 | } else { | 72 | } else { |
72 | // 渲染 | 73 | // 渲染 |
@@ -12,10 +12,6 @@ | @@ -12,10 +12,6 @@ | ||
12 | {{/if}} | 12 | {{/if}} |
13 | <!--/tab-nav--> | 13 | <!--/tab-nav--> |
14 | 14 | ||
15 | - {{#if isApp}} | ||
16 | - <div class='empty-height'></div> | ||
17 | - {{/if}} | ||
18 | - | ||
19 | <div class="plusstar-resources"> | 15 | <div class="plusstar-resources"> |
20 | <!--资源位数据模板--> | 16 | <!--资源位数据模板--> |
21 | </div><!--/plusstar-resources--> | 17 | </div><!--/plusstar-resources--> |
@@ -490,6 +490,9 @@ const userCoupon = (req, res, next) => { | @@ -490,6 +490,9 @@ const userCoupon = (req, res, next) => { | ||
490 | let isApp = req.body.app_version || req.body.appVersion || false; | 490 | let isApp = req.body.app_version || req.body.appVersion || false; |
491 | let data = {}; | 491 | let data = {}; |
492 | 492 | ||
493 | + cryptCouponId = parseInt(cryptCouponId, 10); | ||
494 | + uid = parseInt(uid, 10); | ||
495 | + | ||
493 | if (uid) { | 496 | if (uid) { |
494 | listModel.receiveCoupon( | 497 | listModel.receiveCoupon( |
495 | uid, | 498 | uid, |
@@ -25,106 +25,109 @@ const list = (req, res, next) => { | @@ -25,106 +25,109 @@ const list = (req, res, next) => { | ||
25 | let isQuerySecondClass = false; // 标识用户搜的是不是二级品类 | 25 | let isQuerySecondClass = false; // 标识用户搜的是不是二级品类 |
26 | let domain = null; | 26 | let domain = null; |
27 | 27 | ||
28 | - if (params.query) { | ||
29 | - let activity = _.get(searchModel.searchKeyActivity(params.query), 'data.urlobj.appUrl', ''); | ||
30 | - | ||
31 | - if (activity) { | ||
32 | - res.redirect(activity); | ||
33 | - } | ||
34 | - } | ||
35 | - | ||
36 | if (params.shop_id) { | 28 | if (params.shop_id) { |
37 | params.shopId = params.shop_id; | 29 | params.shopId = params.shop_id; |
38 | } | 30 | } |
39 | 31 | ||
40 | - /* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */ | ||
41 | - Promise.all([ | ||
42 | - searchModel.getAllBrandNames(), | ||
43 | - searchModel.getClassNames() | ||
44 | - ]).then(result => { | ||
45 | - if (query) { | ||
46 | - query = query.toLowerCase(); | ||
47 | - _.forEach(result[0], obj => { | ||
48 | - | ||
49 | - if (query === obj.brandDomain) { // 精确查品牌域名 | ||
50 | - domain = query; | ||
51 | - return false; | ||
52 | - } | ||
53 | - | ||
54 | - if (query === obj.brandName || query === obj.brandName || query === obj.brandName) { // 精确查品牌名称 | ||
55 | - domain = obj.brandDomain; | ||
56 | - return false; | ||
57 | - } | ||
58 | - | ||
59 | - // if (obj.brandDomain.indexOf(query) > 0) { // 模糊查品牌域名 | ||
60 | - // domain = obj.brandDomain; | ||
61 | - // return false; | ||
62 | - // } | ||
63 | - }); | ||
64 | - | ||
65 | - // 跳转到品牌商品列表页 | ||
66 | - if (domain !== null && !params.shop_id) { | ||
67 | - let url = helpers.urlFormat('', { | ||
68 | - from: 'search', | ||
69 | - query: query | ||
70 | - | ||
71 | - }, domain); | ||
72 | - | ||
73 | - return res.redirect(url); | ||
74 | - } | ||
75 | - | ||
76 | - // 品类名称为空时跳出 | ||
77 | - if (!result[1]) { | ||
78 | - return; | ||
79 | - } | ||
80 | - | ||
81 | - _.forEach(result[1].first, (obj) => { | ||
82 | - // 精确查一级品类 | ||
83 | - if (obj === query) { | ||
84 | - isQueryFirstClass = true; | ||
85 | - return false; | ||
86 | - } | ||
87 | - }); | ||
88 | - | ||
89 | - _.forEach(result[1].second, (obj) => { | ||
90 | - // 精确查二级品类 | ||
91 | - if (obj === query) { | ||
92 | - isQuerySecondClass = true; | ||
93 | - return false; | ||
94 | - } | ||
95 | - }); | ||
96 | - } else { | ||
97 | - params.query = ''; | ||
98 | - } | ||
99 | - | ||
100 | - // 搜索是一级品类 | ||
101 | - if (isQueryFirstClass) { | ||
102 | - title = '全部' + query; | ||
103 | - } else if (isQuerySecondClass) { // 搜索是二级品类 | ||
104 | - title = query; | ||
105 | - } else { // 搜索其它内容 | ||
106 | - if (query || params.form) { | ||
107 | - params.search = { | ||
108 | - default: query === '' ? false : query, | ||
109 | - url: helpers.urlFormat('', null, 'search') | ||
110 | - }; | 32 | + if (params.query) { |
33 | + return searchModel.searchKeyActivity(params.query).then(activityResult => { | ||
34 | + let activity = _.get(activityResult, 'urlobj.appUrl', ''); | ||
35 | + | ||
36 | + if (activity) { | ||
37 | + return res.redirect(activity); | ||
38 | + } else { | ||
39 | + | ||
40 | + /* 判断是不是品牌, 是品牌跳到品牌列表页(显示搜索框),判断是不是品类, 是品类加导航标题(不显示搜索框) */ | ||
41 | + return Promise.all([ | ||
42 | + searchModel.getAllBrandNames(), | ||
43 | + searchModel.getClassNames() | ||
44 | + ]).then(result => { | ||
45 | + if (query) { | ||
46 | + query = query.toLowerCase(); | ||
47 | + _.forEach(result[0], obj => { | ||
48 | + | ||
49 | + if (query === obj.brandDomain) { // 精确查品牌域名 | ||
50 | + domain = query; | ||
51 | + return false; | ||
52 | + } | ||
53 | + | ||
54 | + if (query === obj.brandName || query === obj.brandName || query === obj.brandName) { // 精确查品牌名称 | ||
55 | + domain = obj.brandDomain; | ||
56 | + return false; | ||
57 | + } | ||
58 | + | ||
59 | + // if (obj.brandDomain.indexOf(query) > 0) { // 模糊查品牌域名 | ||
60 | + // domain = obj.brandDomain; | ||
61 | + // return false; | ||
62 | + // } | ||
63 | + }); | ||
64 | + | ||
65 | + // 跳转到品牌商品列表页 | ||
66 | + if (domain !== null && !params.shop_id) { | ||
67 | + let url = helpers.urlFormat('', { | ||
68 | + from: 'search', | ||
69 | + query: query | ||
70 | + | ||
71 | + }, domain); | ||
72 | + | ||
73 | + return res.redirect(url); | ||
74 | + } | ||
75 | + | ||
76 | + // 品类名称为空时跳出 | ||
77 | + if (!result[1]) { | ||
78 | + return; | ||
79 | + } | ||
80 | + | ||
81 | + _.forEach(result[1].first, (obj) => { | ||
82 | + // 精确查一级品类 | ||
83 | + if (obj === query) { | ||
84 | + isQueryFirstClass = true; | ||
85 | + return false; | ||
86 | + } | ||
87 | + }); | ||
88 | + | ||
89 | + _.forEach(result[1].second, (obj) => { | ||
90 | + // 精确查二级品类 | ||
91 | + if (obj === query) { | ||
92 | + isQuerySecondClass = true; | ||
93 | + return false; | ||
94 | + } | ||
95 | + }); | ||
96 | + } else { | ||
97 | + params.query = ''; | ||
98 | + } | ||
99 | + | ||
100 | + // 搜索是一级品类 | ||
101 | + if (isQueryFirstClass) { | ||
102 | + title = '全部' + query; | ||
103 | + } else if (isQuerySecondClass) { // 搜索是二级品类 | ||
104 | + title = query; | ||
105 | + } else { // 搜索其它内容 | ||
106 | + if (query || params.form) { | ||
107 | + params.search = { | ||
108 | + default: query === '' ? false : query, | ||
109 | + url: helpers.urlFormat('', null, 'search') | ||
110 | + }; | ||
111 | + } | ||
112 | + title = '搜索'; | ||
113 | + } | ||
114 | + | ||
115 | + title = params.title ? params.title : title; | ||
116 | + | ||
117 | + res.render('search/list', { | ||
118 | + module: 'product', | ||
119 | + page: 'search-list', | ||
120 | + pageHeader: headerModel.setNav({ | ||
121 | + navTitle: title | ||
122 | + }), | ||
123 | + title: title, | ||
124 | + goodList: params, | ||
125 | + pageFooter: true | ||
126 | + }); | ||
127 | + }).catch(next); | ||
111 | } | 128 | } |
112 | - title = '搜索'; | ||
113 | - } | ||
114 | - | ||
115 | - title = params.title ? params.title : title; | ||
116 | - | ||
117 | - res.render('search/list', { | ||
118 | - module: 'product', | ||
119 | - page: 'search-list', | ||
120 | - pageHeader: headerModel.setNav({ | ||
121 | - navTitle: title | ||
122 | - }), | ||
123 | - title: title, | ||
124 | - goodList: params, | ||
125 | - pageFooter: true | ||
126 | }); | 129 | }); |
127 | - }).catch(next); | 130 | + } |
128 | }; | 131 | }; |
129 | 132 | ||
130 | /** | 133 | /** |
@@ -132,6 +135,7 @@ const list = (req, res, next) => { | @@ -132,6 +135,7 @@ const list = (req, res, next) => { | ||
132 | */ | 135 | */ |
133 | const index = (req, res, next) => { | 136 | const index = (req, res, next) => { |
134 | let title = '搜索'; | 137 | let title = '搜索'; |
138 | + | ||
135 | ((render) => { | 139 | ((render) => { |
136 | if (_.get(req, 'app.locals.wap.search.removeHotSearch', false)) { | 140 | if (_.get(req, 'app.locals.wap.search.removeHotSearch', false)) { |
137 | render([]); | 141 | render([]); |
@@ -182,18 +182,8 @@ $mask.on('click', function() { | @@ -182,18 +182,8 @@ $mask.on('click', function() { | ||
182 | }); | 182 | }); |
183 | 183 | ||
184 | // 埋点 | 184 | // 埋点 |
185 | -getChannel = function functionName() { | ||
186 | - var name = window.cookie('_Channel'); | ||
187 | - | ||
188 | - return { | ||
189 | - boys: 1, | ||
190 | - girls: 2, | ||
191 | - kids: 3, | ||
192 | - lifestyle: 4 | ||
193 | - }[name] || 1; | ||
194 | -}; | ||
195 | - | ||
196 | -C_ID = getChannel(); | 185 | + |
186 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
197 | 187 | ||
198 | $('.floor-focus').find('li').on('click', function() { | 188 | $('.floor-focus').find('li').on('click', function() { |
199 | // event.preventDefault(); | 189 | // event.preventDefault(); |
@@ -19,8 +19,7 @@ var $mobileWrap = $('.mobile-wrap'), | @@ -19,8 +19,7 @@ var $mobileWrap = $('.mobile-wrap'), | ||
19 | swiperClass, | 19 | swiperClass, |
20 | isen = true; | 20 | isen = true; |
21 | 21 | ||
22 | -var getChannel, | ||
23 | - C_ID; | 22 | +var C_ID; |
24 | 23 | ||
25 | require('../common'); | 24 | require('../common'); |
26 | fastclick.attach(document.body); | 25 | fastclick.attach(document.body); |
@@ -257,7 +256,7 @@ var checkShop = function() { | @@ -257,7 +256,7 @@ var checkShop = function() { | ||
257 | for (var i = 0, elem; | 256 | for (var i = 0, elem; |
258 | (elem = result.data[i]) != null; i++) { | 257 | (elem = result.data[i]) != null; i++) { |
259 | var a = $('.recom-shop[shopId = ' + elem.id + ']'); | 258 | var a = $('.recom-shop[shopId = ' + elem.id + ']'); |
260 | - a.find('.faved-num').text(elem.collectionNum + "人已收藏"); | 259 | + a.find('.faved-num').text(elem.collectionNum + '人已收藏'); |
261 | if (elem.favorite) { | 260 | if (elem.favorite) { |
262 | a.find('.fav-no').hide(); | 261 | a.find('.fav-no').hide(); |
263 | a.find('.fav-yes').show(); | 262 | a.find('.fav-yes').show(); |
@@ -265,7 +264,7 @@ var checkShop = function() { | @@ -265,7 +264,7 @@ var checkShop = function() { | ||
265 | } | 264 | } |
266 | } | 265 | } |
267 | }); | 266 | }); |
268 | -} | 267 | +}; |
269 | checkShop(); | 268 | checkShop(); |
270 | 269 | ||
271 | // 店铺收藏 || 取消收藏 | 270 | // 店铺收藏 || 取消收藏 |
@@ -353,26 +352,16 @@ var saleTime = function(elem, offsetTime) { | @@ -353,26 +352,16 @@ var saleTime = function(elem, offsetTime) { | ||
353 | } | 352 | } |
354 | } | 353 | } |
355 | 354 | ||
356 | -} | 355 | +}; |
357 | let endTime = $('.sale-floor-time').attr('data-time'), | 356 | let endTime = $('.sale-floor-time').attr('data-time'), |
357 | + | ||
358 | // ~~两次取反位运算就是取整 | 358 | // ~~两次取反位运算就是取整 |
359 | - limit = ~~((endTime*1000 - Date.now()) / 1000); | 359 | + limit = ~~((endTime * 1000 - Date.now()) / 1000); |
360 | saleTime('.sale-floor-time', limit); | 360 | saleTime('.sale-floor-time', limit); |
361 | 361 | ||
362 | require('./maybe-like')(); | 362 | require('./maybe-like')(); |
363 | 363 | ||
364 | -getChannel = function functionName() { | ||
365 | - var name = window.cookie('_Channel'); | ||
366 | - | ||
367 | - return { | ||
368 | - boys: 1, | ||
369 | - girls: 2, | ||
370 | - kids: 3, | ||
371 | - lifestyle: 4 | ||
372 | - }[name] || 1; | ||
373 | -}; | ||
374 | - | ||
375 | -C_ID = getChannel(); | 364 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; |
376 | 365 | ||
377 | $('.search-btn').click(function() { | 366 | $('.search-btn').click(function() { |
378 | if (window._yas && window._yas.sendCustomInfo) { | 367 | if (window._yas && window._yas.sendCustomInfo) { |
@@ -4,8 +4,7 @@ var $ = require('yoho-jquery'), | @@ -4,8 +4,7 @@ var $ = require('yoho-jquery'), | ||
4 | loading = require('../plugin/loading'), | 4 | loading = require('../plugin/loading'), |
5 | debounce = require('lodash/debounce'); | 5 | debounce = require('lodash/debounce'); |
6 | 6 | ||
7 | -var plusstar = {}, | ||
8 | - $footer = $('#yoho-footer'); | 7 | +var plusstar = {}; |
9 | 8 | ||
10 | var windowHeight = $(window).height(); | 9 | var windowHeight = $(window).height(); |
11 | var scrollFn, | 10 | var scrollFn, |
@@ -186,6 +185,9 @@ plusstar = { | @@ -186,6 +185,9 @@ plusstar = { | ||
186 | return true; | 185 | return true; |
187 | } | 186 | } |
188 | 187 | ||
188 | + // 固定底部去除 | ||
189 | + window.rePosFooter(); | ||
190 | + | ||
189 | // 记录切换tab位置 | 191 | // 记录切换tab位置 |
190 | $(document).scrollTop(window.cookie(code) || 0); | 192 | $(document).scrollTop(window.cookie(code) || 0); |
191 | 193 | ||
@@ -303,23 +305,17 @@ $(function() { | @@ -303,23 +305,17 @@ $(function() { | ||
303 | apt: window.queryString.client_type || '', | 305 | apt: window.queryString.client_type || '', |
304 | sid: window.queryString.session_id || '', | 306 | sid: window.queryString.session_id || '', |
305 | }; | 307 | }; |
306 | - } | ||
307 | - | ||
308 | - // 男:1,女:2,潮童:3,创意生活:4 | ||
309 | - speckParamApp.CID = window.queryString.yh_channel || window._ChannelVary[window.cookie('_Channel')] || 1; | ||
310 | 308 | ||
311 | - if (!isApp) { | 309 | + $('.plusstar-resources').css({'margin-top': $('.tab-nav').height()}); |
310 | + } else { | ||
312 | $('.tab-nav').css({ | 311 | $('.tab-nav').css({ |
313 | position: 'relative' | 312 | position: 'relative' |
314 | }); | 313 | }); |
315 | - | ||
316 | - $footer.css({ | ||
317 | - 'max-width': '650px' | ||
318 | - }).before( | ||
319 | - '<div style="height: ' + parseInt($footer.css('height'), 0) + 'px"></div>' | ||
320 | - ); | ||
321 | } | 314 | } |
322 | 315 | ||
316 | + // 男:1,女:2,潮童:3,创意生活:4 | ||
317 | + speckParamApp.CID = window.queryString.yh_channel || window._ChannelVary[window.cookie('_Channel')] || 1; | ||
318 | + | ||
323 | plusstar.init(); | 319 | plusstar.init(); |
324 | 320 | ||
325 | // 滚动翻页 | 321 | // 滚动翻页 |
@@ -109,7 +109,12 @@ function search() { | @@ -109,7 +109,12 @@ function search() { | ||
109 | // 视频埋点 | 109 | // 视频埋点 |
110 | $('video').on('play', function() { | 110 | $('video').on('play', function() { |
111 | var _channel = cookie('_Channel'); | 111 | var _channel = cookie('_Channel'); |
112 | - var cid = _channel ? _channel : 'boys'; | 112 | + var cid = { |
113 | + boys: 1, | ||
114 | + girls: 2, | ||
115 | + kids: 3, | ||
116 | + lifestyle: 4 | ||
117 | + }[(_channel ? _channel : 'boys')]; | ||
113 | var pid = $('#productId').val(); | 118 | var pid = $('#productId').val(); |
114 | 119 | ||
115 | window._yas.sendCustomInfo({ | 120 | window._yas.sendCustomInfo({ |
@@ -14,21 +14,9 @@ var productId = $('#productId').val(); | @@ -14,21 +14,9 @@ var productId = $('#productId').val(); | ||
14 | var skn = $('#productSkn').val(), | 14 | var skn = $('#productSkn').val(), |
15 | productCode = $('#limitProductCode').val(); | 15 | productCode = $('#limitProductCode').val(); |
16 | 16 | ||
17 | -var getChannel, | ||
18 | - C_ID, | 17 | +var C_ID = window._ChannelVary[window.cookie('_Channel')], |
19 | PRD_ID; | 18 | PRD_ID; |
20 | 19 | ||
21 | -getChannel = function functionName() { | ||
22 | - var name = window.cookie('_Channel'); | ||
23 | - | ||
24 | - return { | ||
25 | - boys: 1, | ||
26 | - girls: 2, | ||
27 | - kids: 3, | ||
28 | - lifestyle: 4 | ||
29 | - }[name] || 1; | ||
30 | -}; | ||
31 | - | ||
32 | $('#likeBtn').on('touchstart', function() { | 20 | $('#likeBtn').on('touchstart', function() { |
33 | var opt, | 21 | var opt, |
34 | favorite; | 22 | favorite; |
@@ -36,7 +24,6 @@ $('#likeBtn').on('touchstart', function() { | @@ -36,7 +24,6 @@ $('#likeBtn').on('touchstart', function() { | ||
36 | var $this = $(this); | 24 | var $this = $(this); |
37 | 25 | ||
38 | PRD_ID = productId; | 26 | PRD_ID = productId; |
39 | - C_ID = getChannel(); | ||
40 | 27 | ||
41 | if ($this.hasClass('liked')) { | 28 | if ($this.hasClass('liked')) { |
42 | opt = 'cancel'; | 29 | opt = 'cancel'; |
@@ -17,20 +17,9 @@ var $recommendForYou = $('.recommend-for-you'), | @@ -17,20 +17,9 @@ var $recommendForYou = $('.recommend-for-you'), | ||
17 | var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) + | 17 | var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) + |
18 | '_' + Math.floor(Math.random() * 1000000 + 1000000)); | 18 | '_' + Math.floor(Math.random() * 1000000 + 1000000)); |
19 | 19 | ||
20 | -var getChannel, C_ID, uuidVal, goodid, goodIds = [], prdLoad; | 20 | +var C_ID, goodid, goodIds = [], prdLoad; |
21 | 21 | ||
22 | -getChannel = function functionName() { | ||
23 | - var name = window.cookie('_Channel'); | ||
24 | - | ||
25 | - return { | ||
26 | - boys: 1, | ||
27 | - girls: 2, | ||
28 | - kids: 3, | ||
29 | - lifestyle: 4 | ||
30 | - }[name] || 1; | ||
31 | -}; | ||
32 | - | ||
33 | -C_ID = getChannel(); | 22 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; |
34 | 23 | ||
35 | function yasRequest(PRD_ID, PRD_NUM, ACTION_ID) { | 24 | function yasRequest(PRD_ID, PRD_NUM, ACTION_ID) { |
36 | if (window._yas && window._yas.sendCustomInfo) { | 25 | if (window._yas && window._yas.sendCustomInfo) { |
@@ -33,7 +33,7 @@ var now = new Date(), | @@ -33,7 +33,7 @@ var now = new Date(), | ||
33 | month = now.getMonth() + 1, | 33 | month = now.getMonth() + 1, |
34 | date = now.getDate(); | 34 | date = now.getDate(); |
35 | 35 | ||
36 | -var getChannel, C_ID, argument; | 36 | +var C_ID, argument; |
37 | 37 | ||
38 | require('../../common/footer'); | 38 | require('../../common/footer'); |
39 | 39 | ||
@@ -79,18 +79,7 @@ if ($('.swiper-container .swiper-slide').length > 1) { | @@ -79,18 +79,7 @@ if ($('.swiper-container .swiper-slide').length > 1) { | ||
79 | }); | 79 | }); |
80 | } | 80 | } |
81 | 81 | ||
82 | -getChannel = function functionName() { | ||
83 | - var name = window.cookie('_Channel'); | ||
84 | - | ||
85 | - return { | ||
86 | - boys: 1, | ||
87 | - girls: 2, | ||
88 | - kids: 3, | ||
89 | - lifestyle: 4 | ||
90 | - }[name] || 1; | ||
91 | -}; | ||
92 | - | ||
93 | -C_ID = getChannel(); | 82 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; |
94 | 83 | ||
95 | /** | 84 | /** |
96 | * 筛选注册的回调,筛选子项点击后逻辑 | 85 | * 筛选注册的回调,筛选子项点击后逻辑 |
@@ -273,7 +262,7 @@ function search(opt) { | @@ -273,7 +262,7 @@ function search(opt) { | ||
273 | op: 'YB_NEW_GOODS_LIST_L', | 262 | op: 'YB_NEW_GOODS_LIST_L', |
274 | param: JSON.stringify(Object.assign(yasparm, { | 263 | param: JSON.stringify(Object.assign(yasparm, { |
275 | RES_QTY: $container.find('.total').data('id'), | 264 | RES_QTY: $container.find('.total').data('id'), |
276 | - PRD_LIST: goodIds | 265 | + PRD_LIST: JSON.stringify(goodIds).replace(/\[|\]/g, '') |
277 | })) | 266 | })) |
278 | }, true); | 267 | }, true); |
279 | } | 268 | } |
@@ -301,7 +290,7 @@ function search(opt) { | @@ -301,7 +290,7 @@ function search(opt) { | ||
301 | op: 'YB_NEW_GOODS_LIST_L', | 290 | op: 'YB_NEW_GOODS_LIST_L', |
302 | param: JSON.stringify(Object.assign(yasparm, { | 291 | param: JSON.stringify(Object.assign(yasparm, { |
303 | RES_QTY: $container.find('.total').data('id'), | 292 | RES_QTY: $container.find('.total').data('id'), |
304 | - PRD_LIST: goodIds | 293 | + PRD_LIST: JSON.stringify(goodIds).replace(/\[|\]/g, '') |
305 | })) | 294 | })) |
306 | }, true); | 295 | }, true); |
307 | } | 296 | } |
@@ -31,7 +31,7 @@ var historyval = writeSearch.getHistoryval(); | @@ -31,7 +31,7 @@ var historyval = writeSearch.getHistoryval(); | ||
31 | 31 | ||
32 | var chHammer, cHammer; | 32 | var chHammer, cHammer; |
33 | 33 | ||
34 | -var getChannel, C_ID, POS_ID, FLR_INDEX; | 34 | +var C_ID, POS_ID, FLR_INDEX; |
35 | 35 | ||
36 | require('../../common'); | 36 | require('../../common'); |
37 | 37 | ||
@@ -125,18 +125,7 @@ function inputAction() { | @@ -125,18 +125,7 @@ function inputAction() { | ||
125 | }); | 125 | }); |
126 | } | 126 | } |
127 | 127 | ||
128 | -getChannel = function functionName() { | ||
129 | - var name = window.cookie('_Channel'); | ||
130 | - | ||
131 | - return { | ||
132 | - boys: 1, | ||
133 | - girls: 2, | ||
134 | - kids: 3, | ||
135 | - lifestyle: 4 | ||
136 | - }[name] || 1; | ||
137 | -}; | ||
138 | - | ||
139 | -C_ID = getChannel(); | 128 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; |
140 | 129 | ||
141 | // 热门搜索、最近搜索事件 | 130 | // 热门搜索、最近搜索事件 |
142 | $('.search-items .search-group').on('click', 'li', function(event) { | 131 | $('.search-items .search-group').on('click', 'li', function(event) { |
@@ -84,7 +84,7 @@ var $listNav = $('#list-nav'), | @@ -84,7 +84,7 @@ var $listNav = $('#list-nav'), | ||
84 | introHammer, | 84 | introHammer, |
85 | brandColHammer; | 85 | brandColHammer; |
86 | 86 | ||
87 | -var getChannel, C_ID, RES_QTY, argument, optype; | 87 | +var C_ID, RES_QTY, argument, optype; |
88 | 88 | ||
89 | var category = $('#category-point').val(); | 89 | var category = $('#category-point').val(); |
90 | 90 | ||
@@ -233,18 +233,7 @@ specialoffer = getQueryString('specialoffer'); | @@ -233,18 +233,7 @@ specialoffer = getQueryString('specialoffer'); | ||
233 | specialsale_id = getQueryString('specialsale_id'); | 233 | specialsale_id = getQueryString('specialsale_id'); |
234 | promotion = getQueryString('promotion'); | 234 | promotion = getQueryString('promotion'); |
235 | 235 | ||
236 | -getChannel = function functionName() { | ||
237 | - var name = window.cookie('_Channel'); | ||
238 | - | ||
239 | - return { | ||
240 | - boys: 1, | ||
241 | - girls: 2, | ||
242 | - kids: 3, | ||
243 | - lifestyle: 4 | ||
244 | - }[name] || 1; | ||
245 | -}; | ||
246 | - | ||
247 | -C_ID = getChannel(); | 236 | +C_ID = window._ChannelVary[window.cookie('_Channel')]; |
248 | 237 | ||
249 | /** | 238 | /** |
250 | * 筛选注册的回调,筛选子项点击后逻辑 | 239 | * 筛选注册的回调,筛选子项点击后逻辑 |
@@ -552,12 +541,14 @@ function search(opt) { | @@ -552,12 +541,14 @@ function search(opt) { | ||
552 | FILTER_VALUE: FILTER_VALUE | 541 | FILTER_VALUE: FILTER_VALUE |
553 | }); | 542 | }); |
554 | 543 | ||
555 | - if (window._yas && window._yas.sendCustomInfo) { | ||
556 | - window._yas.sendCustomInfo({ | ||
557 | - op: optype, | ||
558 | - param: JSON.stringify(yasparm) | ||
559 | - }, true); | ||
560 | - } | 544 | + setTimeout(function() { |
545 | + if (window._yas && window._yas.sendCustomInfo) { | ||
546 | + window._yas.sendCustomInfo({ | ||
547 | + op: optype, | ||
548 | + param: JSON.stringify(yasparm) | ||
549 | + }, true); | ||
550 | + } | ||
551 | + }, 200); | ||
561 | } else { | 552 | } else { |
562 | num = $container.find('.good-info').length; | 553 | num = $container.find('.good-info').length; |
563 | $container.append(data); | 554 | $container.append(data); |
@@ -585,12 +576,14 @@ function search(opt) { | @@ -585,12 +576,14 @@ function search(opt) { | ||
585 | FILTER_VALUE: FILTER_VALUE | 576 | FILTER_VALUE: FILTER_VALUE |
586 | }); | 577 | }); |
587 | 578 | ||
588 | - if (window._yas && window._yas.sendCustomInfo) { | ||
589 | - window._yas.sendCustomInfo({ | ||
590 | - op: optype, | ||
591 | - param: JSON.stringify(yasparm) | ||
592 | - }, true); | ||
593 | - } | 579 | + setTimeout(function() { |
580 | + if (window._yas && window._yas.sendCustomInfo) { | ||
581 | + window._yas.sendCustomInfo({ | ||
582 | + op: optype, | ||
583 | + param: JSON.stringify(yasparm) | ||
584 | + }, true); | ||
585 | + } | ||
586 | + }, 200); | ||
594 | 587 | ||
595 | // lazy good-infos who append in | 588 | // lazy good-infos who append in |
596 | lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy')); | 589 | lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy')); |
@@ -277,17 +277,20 @@ | @@ -277,17 +277,20 @@ | ||
277 | .tip-wrap { | 277 | .tip-wrap { |
278 | width: 100%; | 278 | width: 100%; |
279 | height: 100%; | 279 | height: 100%; |
280 | - background: #9d1a15; | ||
281 | position: fixed; | 280 | position: fixed; |
282 | top: 0; | 281 | top: 0; |
283 | left: 0; | 282 | left: 0; |
284 | z-index: 3; | 283 | z-index: 3; |
284 | + | ||
285 | + img { | ||
286 | + width: 100%; | ||
287 | + height: 100%; | ||
288 | + } | ||
285 | } | 289 | } |
286 | 290 | ||
287 | .tip { | 291 | .tip { |
288 | width: 100%; | 292 | width: 100%; |
289 | height: 100%; | 293 | height: 100%; |
290 | - background: #9d1a15; | ||
291 | position: absolute; | 294 | position: absolute; |
292 | top: 0; | 295 | top: 0; |
293 | left: 0; | 296 | left: 0; |
@@ -18,12 +18,13 @@ | @@ -18,12 +18,13 @@ | ||
18 | position: fixed; | 18 | position: fixed; |
19 | z-index: 10; | 19 | z-index: 10; |
20 | background-color: #fff; | 20 | background-color: #fff; |
21 | + top: 0; | ||
21 | 22 | ||
22 | li { | 23 | li { |
23 | display: block; | 24 | display: block; |
24 | float: left; | 25 | float: left; |
25 | height: 100%; | 26 | height: 100%; |
26 | - width: 33.33%; | 27 | + width: 50%; |
27 | line-height: 60px; | 28 | line-height: 60px; |
28 | color: #999; | 29 | color: #999; |
29 | white-space: nowrap; | 30 | white-space: nowrap; |
-
Please register or login to post a comment