Authored by 陈峰

Merge branch 'grey' into 'master'

Grey



See merge request !210
@@ -295,6 +295,8 @@ const wechat = { @@ -295,6 +295,8 @@ const wechat = {
295 295
296 const sina = { 296 const sina = {
297 login: (req, res, next) => { 297 login: (req, res, next) => {
  298 + // 设置为原链接标识originalUrl
  299 + req.session.originalUrl = 'true';
298 req.session.authState = uuid.v4(); 300 req.session.authState = uuid.v4();
299 return passport.authenticate('sina', { 301 return passport.authenticate('sina', {
300 state: req.session.authState 302 state: req.session.authState
@@ -321,6 +323,8 @@ const sina = { @@ -321,6 +323,8 @@ const sina = {
321 323
322 const qq = { 324 const qq = {
323 login: (req, res, next) => { 325 login: (req, res, next) => {
  326 + // 设置为原链接标识originalUrl
  327 + req.session.originalUrl = 'true';
324 req.session.authState = uuid.v4(); 328 req.session.authState = uuid.v4();
325 return passport.authenticate('qq', { 329 return passport.authenticate('qq', {
326 state: req.session.authState 330 state: req.session.authState
@@ -348,6 +352,8 @@ const qq = { @@ -348,6 +352,8 @@ const qq = {
348 352
349 const alipay = { 353 const alipay = {
350 login: (req, res, next) => { 354 login: (req, res, next) => {
  355 + // 设置为原链接标识originalUrl
  356 + req.session.originalUrl = 'true';
351 return passport.authenticate('alipay')(req, res, next); 357 return passport.authenticate('alipay')(req, res, next);
352 }, 358 },
353 callback: (req, res, next) => { 359 callback: (req, res, next) => {
@@ -72,7 +72,15 @@ const _newGoods = (req, res, next) => { @@ -72,7 +72,15 @@ const _newGoods = (req, res, next) => {
72 let banner = _.get(result, 'ads[0]', {}); 72 let banner = _.get(result, 'ads[0]', {});
73 let handPick = _.get(result, 'ads[1]', {}); 73 let handPick = _.get(result, 'ads[1]', {});
74 74
75 - // console.log(handPick) 75 + if (handPick.data) {
  76 + if (handPick.data.length > 2) {
  77 + handPick.three = true;
  78 + } else if (handPick.data.length === 2) {
  79 + handPick.two = true;
  80 + } else if (handPick.data.length === 1) {
  81 + handPick.one = true;
  82 + }
  83 + }
76 84
77 res.render('new/index', { 85 res.render('new/index', {
78 module: 'product', 86 module: 'product',
@@ -38,8 +38,14 @@ @@ -38,8 +38,14 @@
38 {{/if}} 38 {{/if}}
39 39
40 {{!--精选抢先看--}} 40 {{!--精选抢先看--}}
41 - {{#if handPick.data}}  
42 - {{> 'new/handpick' swiper=handPick.data}} 41 + {{#if handPick.three}}
  42 + {{> 'new/handpick-three' swiper=handPick.data}}
  43 + {{/if}}
  44 + {{#if handPick.two}}
  45 + {{> 'new/handpick-two' swiper=handPick.data}}
  46 + {{/if}}
  47 + {{#if handPick.one}}
  48 + {{> 'new/handpick-one' swiper=handPick.data}}
43 {{/if}} 49 {{/if}}
44 50
45 {{!--最新上架--}} 51 {{!--最新上架--}}
@@ -8,17 +8,17 @@ @@ -8,17 +8,17 @@
8 </header> 8 </header>
9 <main class="panel-body"> 9 <main class="panel-body">
10 <!-- Slider main container --> 10 <!-- Slider main container -->
11 - <div class="handpick-swiper swiper-container"> 11 + <div class="handpick-swiper-one swiper-container">
12 <!-- Additional required wrapper --> 12 <!-- Additional required wrapper -->
13 <div class="swiper-wrapper"> 13 <div class="swiper-wrapper">
14 <!-- Slides --> 14 <!-- Slides -->
15 - {{#each swiper}} 15 + {{# swiper}}
16 <div class="swiper-slide"> 16 <div class="swiper-slide">
17 <a href="{{url}}"> 17 <a href="{{url}}">
18 - <img class="swiper-lazy" data-src="{{image2 src w=332 h=194 q=60}}" alt=""> 18 + <img src="{{image2 src w=690 h=220 q=60}}" alt="">
19 </a> 19 </a>
20 </div> 20 </div>
21 - {{/each}} 21 + {{/swiper}}
22 </div> 22 </div>
23 </div> 23 </div>
24 </main> 24 </main>
  1 +{{!-- 新品到着: 精选 --}}
  2 +<div id="handpick" class="panel handpick">
  3 + <header class="panel-header">
  4 + <h4>精选抢先看</h4>
  5 + {{!--<a href="#javascript" class="panel-header-r more">
  6 + <i class="iconfont">&#xe606;</i>
  7 + </a>--}}
  8 + </header>
  9 + <main class="panel-body">
  10 + <!-- Slider main container -->
  11 + <div class="handpick-swiper-three swiper-container">
  12 + <!-- Additional required wrapper -->
  13 + <div class="swiper-wrapper">
  14 + <!-- Slides -->
  15 + {{# swiper}}
  16 + <div class="swiper-slide">
  17 + <a href="{{url}}">
  18 + <img class="swiper-lazy" data-src="{{image2 src w=330 h=220 q=60}}" alt="">
  19 + </a>
  20 + </div>
  21 + {{/swiper}}
  22 + </div>
  23 + </div>
  24 + </main>
  25 +</div>
  1 +{{!-- 新品到着: 精选 --}}
  2 +<div id="handpick" class="panel handpick">
  3 + <header class="panel-header">
  4 + <h4>精选抢先看</h4>
  5 + {{!--<a href="#javascript" class="panel-header-r more">
  6 + <i class="iconfont">&#xe606;</i>
  7 + </a>--}}
  8 + </header>
  9 + <main class="panel-body">
  10 + <!-- Slider main container -->
  11 + <div class="handpick-swiper-two swiper-container">
  12 + <!-- Additional required wrapper -->
  13 + <div class="swiper-wrapper">
  14 + <!-- Slides -->
  15 + {{# swiper}}
  16 + <div class="swiper-slide">
  17 + <a href="{{url}}">
  18 + <img src="{{image2 src w=330 h=220 q=60}}" alt="">
  19 + </a>
  20 + </div>
  21 + {{/swiper}}
  22 + </div>
  23 + </div>
  24 + </main>
  25 +</div>
@@ -17,21 +17,21 @@ module.exports = { @@ -17,21 +17,21 @@ module.exports = {
17 assetUrl: '//127.0.0.1:5001', 17 assetUrl: '//127.0.0.1:5001',
18 testCode: 'yoho4946abcdef#$%&!@', 18 testCode: 'yoho4946abcdef#$%&!@',
19 domains: { 19 domains: {
20 - // api: 'http://api-test3.yohops.com:9999/',  
21 - // service: 'http://service-test3.yohops.com:9999/',  
22 - // liveApi: 'http://testapi.live.yohops.com:9999/',  
23 - // singleApi: 'http://api-test3.yohops.com:9999/',  
24 - // imSocket: 'ws://im.yohobuy.com:10240',  
25 - // imCs: 'http://im.yohobuy.com/api',  
26 - // imServer: 'http://im.yohobuy.com/server' 20 + api: 'http://api-test3.yohops.com:9999/',
  21 + service: 'http://service-test3.yohops.com:9999/',
  22 + liveApi: 'http://testapi.live.yohops.com:9999/',
  23 + singleApi: 'http://api-test3.yohops.com:9999/',
  24 + imSocket: 'ws://im.yohobuy.com:10240',
  25 + imCs: 'http://im.yohobuy.com/api',
  26 + imServer: 'http://im.yohobuy.com/server'
27 27
28 - api: 'http://api.yoho.cn/',  
29 - service: 'http://service.yoho.cn/',  
30 - liveApi: 'http://api.live.yoho.cn/',  
31 - singleApi: 'http://single.yoho.cn/',  
32 - imSocket: 'wss://imsocket.yohobuy.com:443',  
33 - imCs: 'https://imhttp.yohobuy.com/api',  
34 - imServer: 'https://imhttp.yohobuy.com/server' 28 + // api: 'http://api.yoho.cn/',
  29 + // service: 'http://service.yoho.cn/',
  30 + // liveApi: 'http://api.live.yoho.cn/',
  31 + // singleApi: 'http://single.yoho.cn/',
  32 + // imSocket: 'wss://imsocket.yohobuy.com:443',
  33 + // imCs: 'https://imhttp.yohobuy.com/api',
  34 + // imServer: 'https://imhttp.yohobuy.com/server'
35 }, 35 },
36 subDomains: { 36 subDomains: {
37 host: '.m.yohobuy.com', 37 host: '.m.yohobuy.com',
@@ -76,7 +76,7 @@ module.exports = { @@ -76,7 +76,7 @@ module.exports = {
76 port: '4444' // influxdb port 76 port: '4444' // influxdb port
77 }, 77 },
78 console: { 78 console: {
79 - level: 'debug', 79 + level: 'info',
80 colorize: 'all', 80 colorize: 'all',
81 prettyPrint: true 81 prettyPrint: true
82 } 82 }
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.4.3", 3 + "version": "5.4.4",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -14,7 +14,7 @@ let $callback = $.Callbacks(); // eslint-disable-line @@ -14,7 +14,7 @@ let $callback = $.Callbacks(); // eslint-disable-line
14 // 是否继续加载数据 14 // 是否继续加载数据
15 let isScroll = true; 15 let isScroll = true;
16 16
17 -new Swiper('.handpick-swiper', { 17 +new Swiper('.handpick-swiper-three', {
18 // Optional parameters 18 // Optional parameters
19 lazyLoading: true, 19 lazyLoading: true,
20 lazyLoadingInPrevNext: true, 20 lazyLoadingInPrevNext: true,
1 /* 精选抢先看 */ 1 /* 精选抢先看 */
2 .handpick { 2 .handpick {
  3 + .panel-body {
  4 + padding-top: 30px;
  5 + padding-bottom: 30px;
  6 + }
  7 +
3 .swiper-wrapper { 8 .swiper-wrapper {
4 align-items: center; 9 align-items: center;
5 } 10 }
6 11
7 .swiper-container { 12 .swiper-container {
8 - height: 220px; 13 + height: 185px;
9 } 14 }
10 15
11 .swiper-slide { 16 .swiper-slide {
12 width: 300px; 17 width: 300px;
13 - height: 173px; 18 + height: 185px;
14 background-color: #444; 19 background-color: #444;
15 border-radius: 6px; 20 border-radius: 6px;
16 overflow: hidden; 21 overflow: hidden;
17 } 22 }
18 } 23 }
  24 +
  25 +.handpick-swiper-two {
  26 + .swiper-slide {
  27 + margin-left: 30px;
  28 + width: 277px;
  29 + }
  30 +}
  31 +
  32 +.handpick-swiper-one {
  33 + .swiper-slide {
  34 + width: 580px;
  35 + margin-left: 30px;
  36 + }
  37 +}