Merge branch 'master' into release/5.9.2
Showing
20 changed files
with
271 additions
and
82 deletions
@@ -11,7 +11,7 @@ const suggestFeedBackModel = require('../models/suggestFeedBack-service'); | @@ -11,7 +11,7 @@ const suggestFeedBackModel = require('../models/suggestFeedBack-service'); | ||
11 | 11 | ||
12 | const getFeedBack = (req, res, next) => { | 12 | const getFeedBack = (req, res, next) => { |
13 | 13 | ||
14 | - suggestFeedBackModel.suggestFeedBack().then((result) => { | 14 | + suggestFeedBackModel.suggestFeedBack(req.user.uid).then((result) => { |
15 | res.jsonp(result); | 15 | res.jsonp(result); |
16 | }).catch(next); | 16 | }).catch(next); |
17 | }; | 17 | }; |
@@ -14,9 +14,9 @@ const URL_ACTIVITY_QUESTION = '/activity/question/'; | @@ -14,9 +14,9 @@ const URL_ACTIVITY_QUESTION = '/activity/question/'; | ||
14 | * @param uid | 14 | * @param uid |
15 | * @return string | 15 | * @return string |
16 | */ | 16 | */ |
17 | -const feedBackApi = () => { | 17 | +const feedBackApi = (uid) => { |
18 | 18 | ||
19 | - return service.get(URL_ACTIVITY_QUESTION + 'questionList', {}); | 19 | + return service.get(URL_ACTIVITY_QUESTION + 'questionList', {uid: uid}); |
20 | }; | 20 | }; |
21 | 21 | ||
22 | module.exports = { | 22 | module.exports = { |
@@ -9,9 +9,9 @@ const api = require('./suggestFeedBack-api'); | @@ -9,9 +9,9 @@ const api = require('./suggestFeedBack-api'); | ||
9 | const helpers = global.yoho.helpers; | 9 | const helpers = global.yoho.helpers; |
10 | const _ = require('lodash'); | 10 | const _ = require('lodash'); |
11 | 11 | ||
12 | -const suggestFeedBack = () => { | 12 | +const suggestFeedBack = (uid) => { |
13 | 13 | ||
14 | - return api.feedBackApi().then((result) => { | 14 | + return api.feedBackApi(uid).then((result) => { |
15 | let suggestData = []; | 15 | let suggestData = []; |
16 | 16 | ||
17 | if (result && result.code === 200 && _.get(result, 'data.rows')) { | 17 | if (result && result.code === 200 && _.get(result, 'data.rows')) { |
@@ -210,28 +210,29 @@ const keyId = (req, res, next) => { | @@ -210,28 +210,29 @@ const keyId = (req, res, next) => { | ||
210 | let params = req.query; | 210 | let params = req.query; |
211 | let id = req.params.id; | 211 | let id = req.params.id; |
212 | 212 | ||
213 | - return search.getSearchKeywordDataById(id, params, req.yoho.channel).then(result => { | 213 | + return search.getSearchKeywordDataById(id, Object.assign({stocknumber: -1}, params), |
214 | + req.yoho.channel).then(result => { | ||
214 | 215 | ||
215 | - if (!result) { | ||
216 | - return next(); | ||
217 | - } | 216 | + if (!result) { |
217 | + return next(); | ||
218 | + } | ||
218 | 219 | ||
219 | - let query = result.queryKey; | 220 | + let query = result.queryKey; |
220 | 221 | ||
221 | - Object.assign(result, { | ||
222 | - pageNoFollow: true, | ||
223 | - title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`, | ||
224 | - keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`, | ||
225 | - description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result, | 222 | + Object.assign(result, { |
223 | + pageNoFollow: true, | ||
224 | + title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`, | ||
225 | + keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`, | ||
226 | + description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result, | ||
226 | 'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货` | 227 | 'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货` |
227 | - }); | 228 | + }); |
228 | 229 | ||
229 | - if (!_.get(result, 'search.goods') || !_.get(result, 'search.goods').length) { | ||
230 | - _.set(result, 'search.keyWord', query); | ||
231 | - return res.render('search/no-result', result); | ||
232 | - } | ||
233 | - res.render('search/index', result); | ||
234 | - }).catch(next); | 230 | + if (!_.get(result, 'search.goods') || !_.get(result, 'search.goods').length) { |
231 | + _.set(result, 'search.keyWord', query); | ||
232 | + return res.render('search/no-result', result); | ||
233 | + } | ||
234 | + res.render('search/index', result); | ||
235 | + }).catch(next); | ||
235 | }; | 236 | }; |
236 | 237 | ||
237 | module.exports = { | 238 | module.exports = { |
@@ -56,7 +56,7 @@ const indexAsync = pid => { | @@ -56,7 +56,7 @@ const indexAsync = pid => { | ||
56 | marketPrice: cur.product.productPriceBo.formatMarketPrice, | 56 | marketPrice: cur.product.productPriceBo.formatMarketPrice, |
57 | productName: cur.product.productName, | 57 | productName: cur.product.productName, |
58 | href: helpers.getUrlBySkc( | 58 | href: helpers.getUrlBySkc( |
59 | - _.get(goods, 'goodsImagesList[0].productSkn', '')) | 59 | + _.get(cur.product, 'productPriceBo.productSkn', '')) |
60 | }; | 60 | }; |
61 | acc.push(point); | 61 | acc.push(point); |
62 | 62 |
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | 6 | ||
7 | const api = global.yoho.API; | 7 | const api = global.yoho.API; |
8 | const config = global.yoho.config; | 8 | const config = global.yoho.config; |
9 | +const redis = global.yoho.redis; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 商品的 banner | 12 | * 商品的 banner |
@@ -131,8 +132,8 @@ const getShopRecommendAsync = (skn, page, limit) => { | @@ -131,8 +132,8 @@ const getShopRecommendAsync = (skn, page, limit) => { | ||
131 | return api.get('', { | 132 | return api.get('', { |
132 | method: 'web.product.shopRecommend', | 133 | method: 'web.product.shopRecommend', |
133 | product_skn: skn, | 134 | product_skn: skn, |
134 | - page: page, | ||
135 | - limit: limit | 135 | + page: page || 1, |
136 | + limit: limit || 20 | ||
136 | }); | 137 | }); |
137 | }; | 138 | }; |
138 | 139 | ||
@@ -146,6 +147,24 @@ const getBundleAsync = (skn) => { | @@ -146,6 +147,24 @@ const getBundleAsync = (skn) => { | ||
146 | }); | 147 | }); |
147 | }; | 148 | }; |
148 | 149 | ||
150 | +/** | ||
151 | + * 找相似 | ||
152 | + */ | ||
153 | +const getLikeAsync = (skn, limit) => { | ||
154 | + return api.get('', { | ||
155 | + method: 'app.search.findLike', | ||
156 | + limit: limit || 10, | ||
157 | + product_skn: skn | ||
158 | + }); | ||
159 | +}; | ||
160 | + | ||
161 | +// 根据small_sort从redis获取分类下的关键词 | ||
162 | +const getRecommendKeywords = (smallSort) => { | ||
163 | + return redis.all([['get', `golobal:yoho:seo:keywords:sortId:${smallSort}`]]).then(res => { | ||
164 | + return res[0]; | ||
165 | + }); | ||
166 | +}; | ||
167 | + | ||
149 | module.exports = { | 168 | module.exports = { |
150 | getProductBannerAsync, | 169 | getProductBannerAsync, |
151 | sizeInfoAsync, | 170 | sizeInfoAsync, |
@@ -156,5 +175,7 @@ module.exports = { | @@ -156,5 +175,7 @@ module.exports = { | ||
156 | isSupportReturnedSale, | 175 | isSupportReturnedSale, |
157 | getLimitedProductStatusAsync, | 176 | getLimitedProductStatusAsync, |
158 | getShopRecommendAsync, | 177 | getShopRecommendAsync, |
159 | - getBundleAsync | 178 | + getBundleAsync, |
179 | + getLikeAsync, | ||
180 | + getRecommendKeywords | ||
160 | }; | 181 | }; |
@@ -36,6 +36,7 @@ const BLANK_STR = ' '; | @@ -36,6 +36,7 @@ const BLANK_STR = ' '; | ||
36 | const BUNDLE_PRODUCE = 2; // 量贩 | 36 | const BUNDLE_PRODUCE = 2; // 量贩 |
37 | const BUNDLE_PACKAGE = 1; // 套餐 | 37 | const BUNDLE_PACKAGE = 1; // 套餐 |
38 | const tdk = require('../../../utils/getTDK'); | 38 | const tdk = require('../../../utils/getTDK'); |
39 | +const Helpers = global.yoho.helpers; | ||
39 | 40 | ||
40 | const _getProductAdditionInfoAsync = (data) => { | 41 | const _getProductAdditionInfoAsync = (data) => { |
41 | return co(function * () { | 42 | return co(function * () { |
@@ -1010,6 +1011,19 @@ const _getIntroInfo = (productSkn, maxSortId, additionalData)=> { | @@ -1010,6 +1011,19 @@ const _getIntroInfo = (productSkn, maxSortId, additionalData)=> { | ||
1010 | return result; | 1011 | return result; |
1011 | }; | 1012 | }; |
1012 | 1013 | ||
1014 | +// 返回6条推荐关键词页面 | ||
1015 | +const getKeywordsInfo = (keywords) => { | ||
1016 | + let res = []; | ||
1017 | + | ||
1018 | + _.forEach(_.slice(_.shuffle(keywords), 0, 12), val => { | ||
1019 | + res.push({ | ||
1020 | + url: Helpers.urlFormat(`/chanpin/${val.id}.html`), | ||
1021 | + keyword: val.keyword | ||
1022 | + }); | ||
1023 | + }); | ||
1024 | + return res; | ||
1025 | +}; | ||
1026 | + | ||
1013 | /** | 1027 | /** |
1014 | * 获取seo信息 | 1028 | * 获取seo信息 |
1015 | * | 1029 | * |
@@ -1104,6 +1118,9 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1104,6 +1118,9 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1104 | return result; | 1118 | return result; |
1105 | } | 1119 | } |
1106 | 1120 | ||
1121 | + // sku商品信息,尺寸信息 | ||
1122 | + let skuData = _getSkuDataByProductBaseInfo(origin); | ||
1123 | + | ||
1107 | result.name = propOrigin('product_name'); | 1124 | result.name = propOrigin('product_name'); |
1108 | result.skn = propOrigin('product_skn'); | 1125 | result.skn = propOrigin('product_skn'); |
1109 | result.productId = propOrigin('product_id'); | 1126 | result.productId = propOrigin('product_id'); |
@@ -1146,6 +1163,17 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1146,6 +1163,17 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1146 | requestApi.bundle = productAPI.getBundleAsync(result.skn); // 量贩 | 1163 | requestApi.bundle = productAPI.getBundleAsync(result.skn); // 量贩 |
1147 | } | 1164 | } |
1148 | 1165 | ||
1166 | + // 找相似 | ||
1167 | + if (skuData.totalStorageNum === 0) { | ||
1168 | + requestApi.alike = productAPI.getLikeAsync(result.skn); | ||
1169 | + } | ||
1170 | + | ||
1171 | + // 相关推荐词 | ||
1172 | + requestApi.recommendKeywords = productAPI.getRecommendKeywords(result.smallSortId); | ||
1173 | + | ||
1174 | + // 店铺推荐直出(seo需要) | ||
1175 | + requestApi.shopRecommend = productAPI.getShopRecommendAsync(result.skn); | ||
1176 | + | ||
1149 | let requestData = yield Promise.props(requestApi); | 1177 | let requestData = yield Promise.props(requestApi); |
1150 | 1178 | ||
1151 | let additionalData = requestData.addition; | 1179 | let additionalData = requestData.addition; |
@@ -1154,6 +1182,20 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1154,6 +1182,20 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1154 | let coupon = requestData.coupon; | 1182 | let coupon = requestData.coupon; |
1155 | let limitedInfo = requestData.limited; | 1183 | let limitedInfo = requestData.limited; |
1156 | let bundle = requestData.bundle; | 1184 | let bundle = requestData.bundle; |
1185 | + let recommendKeywords = requestData.recommendKeywords ? JSON.parse(requestData.recommendKeywords) : []; | ||
1186 | + | ||
1187 | + // 处理相似商品 | ||
1188 | + result.alike = _.map(_.get(requestData, 'alike.data.product_list', ''), val =>{ | ||
1189 | + return Object.assign({url: Helpers.getUrlBySkc(val.product_skn)}, val); | ||
1190 | + }); | ||
1191 | + | ||
1192 | + // 推荐关键词页面 | ||
1193 | + result.recommendKeywords = getKeywordsInfo(recommendKeywords); | ||
1194 | + | ||
1195 | + // 处理店铺推荐 | ||
1196 | + result.shopRecommend = _.map(_.get(requestData, 'shopRecommend.data.product_list', ''), val =>{ | ||
1197 | + return Object.assign({url: Helpers.getUrlBySkc(val.product_skn)}, val); | ||
1198 | + }); | ||
1157 | 1199 | ||
1158 | // 商品标签 | 1200 | // 商品标签 |
1159 | result.tags = _getTagsDataByProductInfo(origin); | 1201 | result.tags = _getTagsDataByProductInfo(origin); |
@@ -1241,9 +1283,6 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1241,9 +1283,6 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1241 | result.presale = 'Y'; | 1283 | result.presale = 'Y'; |
1242 | } | 1284 | } |
1243 | 1285 | ||
1244 | - // sku商品信息,尺寸信息 | ||
1245 | - let skuData = _getSkuDataByProductBaseInfo(origin); | ||
1246 | - | ||
1247 | result.img = skuData.defaultImage; | 1286 | result.img = skuData.defaultImage; |
1248 | result.colors = skuData.skuGoods; | 1287 | result.colors = skuData.skuGoods; |
1249 | let totalStorageNum = skuData.totalStorageNum; | 1288 | let totalStorageNum = skuData.totalStorageNum; |
@@ -1723,7 +1762,6 @@ const getPackage = co(function * (skn) { | @@ -1723,7 +1762,6 @@ const getPackage = co(function * (skn) { | ||
1723 | return resData; | 1762 | return resData; |
1724 | }); | 1763 | }); |
1725 | 1764 | ||
1726 | - | ||
1727 | module.exports = { | 1765 | module.exports = { |
1728 | getShareOrderListAsync: commentService.getShareOrderListAsync, // 获取评论列表 | 1766 | getShareOrderListAsync: commentService.getShareOrderListAsync, // 获取评论列表 |
1729 | indexConsultAsync: consultService.indexAsync, // 获取咨询列表 | 1767 | indexConsultAsync: consultService.indexAsync, // 获取咨询列表 |
@@ -23,6 +23,8 @@ | @@ -23,6 +23,8 @@ | ||
23 | 23 | ||
24 | <div id="package" class="package-box clearfix hide"></div> | 24 | <div id="package" class="package-box clearfix hide"></div> |
25 | 25 | ||
26 | + {{> product/alike}} | ||
27 | + | ||
26 | <div class="total-content"> | 28 | <div class="total-content"> |
27 | <div class="other-infos"> | 29 | <div class="other-infos"> |
28 | {{> product/description}} | 30 | {{> product/description}} |
@@ -39,6 +41,8 @@ | @@ -39,6 +41,8 @@ | ||
39 | 41 | ||
40 | {{> product/after-service}} | 42 | {{> product/after-service}} |
41 | 43 | ||
44 | + {{> product/recommend-keywords}} | ||
45 | + | ||
42 | {{> product/recommend-receiveview}} | 46 | {{> product/recommend-receiveview}} |
43 | 47 | ||
44 | </div> | 48 | </div> |
apps/product/views/partial/product/alike.hbs
0 → 100644
1 | +{{#if goodsInfo.alike}} | ||
2 | + <div class="bottom-tab alike-title"> | ||
3 | + <p> | ||
4 | + <span class="bottom-title bottom-cur">相似商品</span> | ||
5 | + <span class="bottom-title change">换一批 | ||
6 | + <span class="iconfont change-icon"></span> | ||
7 | + </span> | ||
8 | + </p> | ||
9 | + </div> | ||
10 | + | ||
11 | + <div class="individual-comment info-block info-bottom alike"> | ||
12 | + <div> | ||
13 | + <div class="recommend-content clearfix"> | ||
14 | + <div class="recommend-slider-alike"> | ||
15 | + <ul class=" img-list"> | ||
16 | + {{# goodsInfo.alike}} | ||
17 | + <li class="img-item"> | ||
18 | + <span class="hide goods-id">{{goods_id}}</span> | ||
19 | + <div class="good"> | ||
20 | + <a href="{{url}}" target="_blank"> | ||
21 | + <img class="lazy" src="{{image2 default_images w=280 h=382}}"/> | ||
22 | + </a> | ||
23 | + <a class="name" href="{{url}}" target="_blank">{{product_name}}</a> | ||
24 | + <p class="price"> | ||
25 | + <span class="market-price">¥{{market_price}}</span> | ||
26 | + <span class="sale-price">¥{{sales_price}}</span> | ||
27 | + </p> | ||
28 | + </div> | ||
29 | + </li> | ||
30 | + {{/goodsInfo.alike}} | ||
31 | + </ul> | ||
32 | + <div class="img-brand-switch"> | ||
33 | + <a class="prev iconfont" href="javascript:;"></a> | ||
34 | + <a class="next iconfont" href="javascript:;"></a> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | +{{/if}} |
@@ -25,17 +25,34 @@ | @@ -25,17 +25,34 @@ | ||
25 | {{> product/latest-walk-tpl}} | 25 | {{> product/latest-walk-tpl}} |
26 | </div> | 26 | </div> |
27 | {{/if}} | 27 | {{/if}} |
28 | - | ||
29 | - <div id="recommend-shop" class="hide"> | ||
30 | - <div class="recommend-content clearfix"> | ||
31 | - <div class="recommend-slider"> | ||
32 | - <ul class=" img-list" id="recommend-content"></ul> | ||
33 | - <div class="img-brand-switch"> | ||
34 | - <a class="prev iconfont" href="javascript:;"></a> | ||
35 | - <a class="next iconfont" href="javascript:;"></a> | 28 | + {{#if goodsInfo.shopRecommend}} |
29 | + <div id="recommend-shop"> | ||
30 | + <div class="recommend-content clearfix"> | ||
31 | + <div class="recommend-slider"> | ||
32 | + <ul class=" img-list" id="recommend-content"> | ||
33 | + {{# goodsInfo.shopRecommend}} | ||
34 | + <li class="img-item"> | ||
35 | + <span class="hide goods-id">{{goods_id}}</span> | ||
36 | + <div class="good"> | ||
37 | + <a href="{{url}}" target="_blank"> | ||
38 | + <img class="lazy" src="{{image2 default_images w=280 h=382}}"/> | ||
39 | + </a> | ||
40 | + <a class="name" href="{{url}}" target="_blank">{{product_name}}</a> | ||
41 | + <p class="price"> | ||
42 | + <span class="market-price">¥{{market_price}}</span> | ||
43 | + <span class="sale-price">¥{{sales_price}}</span> | ||
44 | + </p> | ||
45 | + </div> | ||
46 | + </li> | ||
47 | + {{/ goodsInfo.shopRecommend}} | ||
48 | + </ul> | ||
49 | + <div class="img-brand-switch"> | ||
50 | + <a class="prev iconfont" href="javascript:;"></a> | ||
51 | + <a class="next iconfont" href="javascript:;"></a> | ||
52 | + </div> | ||
36 | </div> | 53 | </div> |
37 | </div> | 54 | </div> |
38 | </div> | 55 | </div> |
39 | - </div> | 56 | + {{/if}} |
40 | </div> | 57 | </div> |
41 | {{/unless}} | 58 | {{/unless}} |
@@ -3,6 +3,8 @@ const _ = require('lodash'); | @@ -3,6 +3,8 @@ const _ = require('lodash'); | ||
3 | const redis = require('redis'); | 3 | const redis = require('redis'); |
4 | const bluebird = require('bluebird'); | 4 | const bluebird = require('bluebird'); |
5 | const config = require('../../config/common'); | 5 | const config = require('../../config/common'); |
6 | +const logger = global.yoho.logger; | ||
7 | +const timeout = 200; // redis 操作超时时间 | ||
6 | let client; | 8 | let client; |
7 | 9 | ||
8 | try { | 10 | try { |
@@ -20,9 +22,14 @@ try { | @@ -20,9 +22,14 @@ try { | ||
20 | } | 22 | } |
21 | } | 23 | } |
22 | 24 | ||
23 | - return client.multi.call(client, args).execAsync(); | 25 | + return client.multi.call(client, args).execAsync().timeout(timeout).catch(()=>{ |
26 | + logger.err('redis exe time out'); | ||
27 | + return false; | ||
28 | + }); | ||
24 | }; | 29 | }; |
25 | 30 | ||
31 | + | ||
32 | + | ||
26 | client.on('error', function() { | 33 | client.on('error', function() { |
27 | global.yoho.redis = ''; | 34 | global.yoho.redis = ''; |
28 | }); | 35 | }); |
@@ -293,6 +293,10 @@ | @@ -293,6 +293,10 @@ | ||
293 | <a href="//www.yohobuy.com/privacy.html" rel="nofollow">隐私条款</a> | 293 | <a href="//www.yohobuy.com/privacy.html" rel="nofollow">隐私条款</a> |
294 | <span>|</span> | 294 | <span>|</span> |
295 | <a href="//www.yohobuy.com/link.html">友情链接</a> | 295 | <a href="//www.yohobuy.com/link.html">友情链接</a> |
296 | + <span>|</span> | ||
297 | + <a class="police" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=32010502010132"> | ||
298 | + 苏公网安备 32010502010132号 | ||
299 | + </a> | ||
296 | </p> | 300 | </p> |
297 | <p> | 301 | <p> |
298 | CopyRight © 2007-2016 南京新与力文化传播有限公司 | 302 | CopyRight © 2007-2016 南京新与力文化传播有限公司 |
public/img/layout/police.png
0 → 100644

18.8 KB
@@ -160,8 +160,14 @@ function bindHoverEvent() { | @@ -160,8 +160,14 @@ function bindHoverEvent() { | ||
160 | $brand.unbind('mouseenter').unbind('mouseleave').hover(function() { | 160 | $brand.unbind('mouseenter').unbind('mouseleave').hover(function() { |
161 | var $this = $(this); | 161 | var $this = $(this); |
162 | var key = $this.attr('data-key'); | 162 | var key = $this.attr('data-key'); |
163 | + var options; | ||
163 | 164 | ||
164 | - var options = { | 165 | + // 全球购品牌不展示品牌简介 |
166 | + if (+key < 0) { | ||
167 | + return; | ||
168 | + } | ||
169 | + | ||
170 | + options = { | ||
165 | url: '/brands/brandinfo', | 171 | url: '/brands/brandinfo', |
166 | type: 'get', | 172 | type: 'get', |
167 | data: { | 173 | data: { |
@@ -114,7 +114,7 @@ function getShoppingKey() { | @@ -114,7 +114,7 @@ function getShoppingKey() { | ||
114 | a.src = j; | 114 | a.src = j; |
115 | m.parentNode.insertBefore(a, m); | 115 | m.parentNode.insertBefore(a, m); |
116 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//' + // eslint-disable-line | 116 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//' + // eslint-disable-line |
117 | - 'cdn.yoho.cn/yas-jssdk/2.4.1/yas.js', '_yas')); // eslint-disable-line | 117 | + 'cdn.yoho.cn/yas-jssdk/2.4.2/yas.js', '_yas')); // eslint-disable-line |
118 | 118 | ||
119 | (function() { | 119 | (function() { |
120 | var uid = getUid(); | 120 | var uid = getUid(); |
@@ -124,7 +124,7 @@ function getShoppingKey() { | @@ -124,7 +124,7 @@ function getShoppingKey() { | ||
124 | window._ozuid = uid; // 暴露ozuid | 124 | window._ozuid = uid; // 暴露ozuid |
125 | 125 | ||
126 | if (window._yas) { | 126 | if (window._yas) { |
127 | - window._yas(1 * new Date(), '2.4.1', 'yohobuy_web', uid, '', ''); | 127 | + window._yas(1 * new Date(), '2.4.2', 'yohobuy_web', uid, '', ''); |
128 | } | 128 | } |
129 | }()); | 129 | }()); |
130 | 130 |
@@ -1519,45 +1519,29 @@ function initPageYas() { | @@ -1519,45 +1519,29 @@ function initPageYas() { | ||
1519 | yas.givePoint('YB_CHOOSE_FOR_YOU_Y', loadYas); | 1519 | yas.givePoint('YB_CHOOSE_FOR_YOU_Y', loadYas); |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | -// 店铺推荐 | 1522 | +// 店铺推荐 改为后台直出 |
1523 | function loadRecommend() { | 1523 | function loadRecommend() { |
1524 | - return $.ajax({ | ||
1525 | - type: 'GET', | ||
1526 | - url: '/product/detail/recommend', | ||
1527 | - data: { | ||
1528 | - skn: skn, | ||
1529 | - size: 20, | ||
1530 | - num: 1 | ||
1531 | - } | ||
1532 | - }).then(function(data) { | ||
1533 | - var pro = data.data.products; | ||
1534 | - var recommendTpl = require('hbs/product/recommend.hbs'); | ||
1535 | - var html = recommendTpl(data.data); | ||
1536 | - | ||
1537 | - if (data.code === 200 && pro.length !== 0) { | ||
1538 | - $('#recommend-shop').removeClass('hide'); | ||
1539 | - $('#recommend-content').append(html); | ||
1540 | - $('.recommend-slider').slider2({ | ||
1541 | - shownum: 5, | ||
1542 | - isCircle: true | ||
1543 | - }); | ||
1544 | 1524 | ||
1545 | - $('.recommend-slider .img-item .goods-id').each(function() { | ||
1546 | - $goodsIdArr.push($(this).html()); | ||
1547 | - }); | ||
1548 | - } else { | ||
1549 | - $('.bottom-title').eq(0).removeClass('bottom-cur').addClass('hide'); | ||
1550 | - $('.bottom-title').eq(1).addClass('bottom-cur'); | ||
1551 | - $('.bottom-title').filter('.change').addClass('hide'); | 1525 | + var imgItem = $('.recommend-slider .img-item'), |
1526 | + $bottomTitle = $('.bottom-tab .bottom-title'); | ||
1552 | 1527 | ||
1553 | - $('#recommend-shop').remove(); | ||
1554 | - $('.individual-comment .latest-walk').show(); | ||
1555 | - fetchLatestWalk(); // eslint-disable-line | ||
1556 | - } | 1528 | + if (imgItem.length !== 0) { |
1557 | 1529 | ||
1558 | - // 页面加载完,埋点 | ||
1559 | - initPageYas(); | ||
1560 | - }); | 1530 | + $('.recommend-slider .img-item .goods-id').each(function() { |
1531 | + $goodsIdArr.push($(this).html()); | ||
1532 | + }); | ||
1533 | + } else { | ||
1534 | + $bottomTitle.eq(0).removeClass('bottom-cur').addClass('hide'); | ||
1535 | + $bottomTitle.eq(1).addClass('bottom-cur'); | ||
1536 | + $bottomTitle.filter('.change').addClass('hide'); | ||
1537 | + | ||
1538 | + $('#recommend-shop').remove(); | ||
1539 | + $('.individual-comment .latest-walk').show(); | ||
1540 | + fetchLatestWalk(); // eslint-disable-line | ||
1541 | + } | ||
1542 | + | ||
1543 | + // 页面加载完,埋点 | ||
1544 | + initPageYas(); | ||
1561 | } | 1545 | } |
1562 | 1546 | ||
1563 | // 点击为您推荐商品埋点 | 1547 | // 点击为您推荐商品埋点 |
@@ -1859,14 +1843,14 @@ $('.bottom-tab').on('click', '.bottom-title', function() { | @@ -1859,14 +1843,14 @@ $('.bottom-tab').on('click', '.bottom-title', function() { | ||
1859 | $recommendComment.slideDown(SLIDETIME); | 1843 | $recommendComment.slideDown(SLIDETIME); |
1860 | $latestWalk.slideUp(SLIDETIME); | 1844 | $latestWalk.slideUp(SLIDETIME); |
1861 | 1845 | ||
1862 | - $('.change').removeClass('hide'); | 1846 | + $(this).siblings('.change').removeClass('hide'); |
1863 | } else { | 1847 | } else { |
1864 | // 最近游览 | 1848 | // 最近游览 |
1865 | window.fetchLatestWalk(); // eslint-disable-line | 1849 | window.fetchLatestWalk(); // eslint-disable-line |
1866 | $recommendComment.slideUp(SLIDETIME); | 1850 | $recommendComment.slideUp(SLIDETIME); |
1867 | $latestWalk.slideDown(SLIDETIME); | 1851 | $latestWalk.slideDown(SLIDETIME); |
1868 | 1852 | ||
1869 | - $('.change').addClass('hide'); | 1853 | + $(this).siblings('.change').addClass('hide'); |
1870 | } | 1854 | } |
1871 | 1855 | ||
1872 | }); | 1856 | }); |
@@ -1983,6 +1967,16 @@ $(function() { | @@ -1983,6 +1967,16 @@ $(function() { | ||
1983 | } | 1967 | } |
1984 | }); | 1968 | }); |
1985 | }); | 1969 | }); |
1970 | + | ||
1971 | + // 猜你喜欢、店铺推荐初始化, | ||
1972 | + $('.recommend-slider-alike').slider2({ | ||
1973 | + shownum: 5, | ||
1974 | + isCircle: true | ||
1975 | + }); | ||
1976 | + $('.recommend-slider').slider2({ | ||
1977 | + shownum: 5, | ||
1978 | + isCircle: true | ||
1979 | + }); | ||
1986 | }); | 1980 | }); |
1987 | 1981 | ||
1988 | yasAtBottom.yasBottom(); | 1982 | yasAtBottom.yasBottom(); |
@@ -346,6 +346,13 @@ | @@ -346,6 +346,13 @@ | ||
346 | padding: 0 10px; | 346 | padding: 0 10px; |
347 | } | 347 | } |
348 | } | 348 | } |
349 | + | ||
350 | + .police { | ||
351 | + background: resolve(layout/police.png) no-repeat; | ||
352 | + height: 20px; | ||
353 | + display: inline-block; | ||
354 | + padding-left: 25px; | ||
355 | + } | ||
349 | } | 356 | } |
350 | 357 | ||
351 | .right-floating-layer { | 358 | .right-floating-layer { |
@@ -1009,7 +1009,8 @@ | @@ -1009,7 +1009,8 @@ | ||
1009 | } | 1009 | } |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | - .bottom-tab { | 1012 | + .bottom-tab, |
1013 | + .alike-title { | ||
1013 | .bottom-title { | 1014 | .bottom-title { |
1014 | font-size: 15px; | 1015 | font-size: 15px; |
1015 | display: inline-block; | 1016 | display: inline-block; |
@@ -1804,6 +1805,31 @@ | @@ -1804,6 +1805,31 @@ | ||
1804 | } | 1805 | } |
1805 | } | 1806 | } |
1806 | 1807 | ||
1808 | + .recommend-keywords { | ||
1809 | + margin-top: 30px; | ||
1810 | + margin-bottom: 20px; | ||
1811 | + border: 1px #e0e0e0 solid; | ||
1812 | + | ||
1813 | + h3 { | ||
1814 | + height: 46px; | ||
1815 | + border-bottom: 1px #e0e0e0 solid; | ||
1816 | + line-height: 44px; | ||
1817 | + background: #f5f5f5; | ||
1818 | + text-align: center; | ||
1819 | + font-size: 15px; | ||
1820 | + } | ||
1821 | + | ||
1822 | + p { | ||
1823 | + padding: 10px; | ||
1824 | + | ||
1825 | + a { | ||
1826 | + display: inline-block; | ||
1827 | + margin: 5px 15px; | ||
1828 | + font-size: 12px; | ||
1829 | + } | ||
1830 | + } | ||
1831 | + } | ||
1832 | + | ||
1807 | .support-salereturned-service { | 1833 | .support-salereturned-service { |
1808 | $service: product/service.png; | 1834 | $service: product/service.png; |
1809 | 1835 | ||
@@ -2083,6 +2109,20 @@ | @@ -2083,6 +2109,20 @@ | ||
2083 | } | 2109 | } |
2084 | } | 2110 | } |
2085 | } | 2111 | } |
2112 | + | ||
2113 | + .alike-title { | ||
2114 | + margin-top: 30px; | ||
2115 | + } | ||
2116 | + | ||
2117 | + .alike { | ||
2118 | + .recommend-content { | ||
2119 | + height: 340px; | ||
2120 | + | ||
2121 | + li { | ||
2122 | + height: 340px; | ||
2123 | + } | ||
2124 | + } | ||
2125 | + } | ||
2086 | } | 2126 | } |
2087 | 2127 | ||
2088 | .coupon-big { | 2128 | .coupon-big { |
-
Please register or login to post a comment