Authored by ccbikai

Merge branch 'develop' into feature/sale

@@ -40,7 +40,6 @@ const getUserStatus = (param) => { @@ -40,7 +40,6 @@ const getUserStatus = (param) => {
40 var dest = {}; 40 var dest = {};
41 41
42 dest.code = param.code; 42 dest.code = param.code;
43 - dest.title = param.data.h5Title;  
44 dest.returnCode = param.data.returnCode; 43 dest.returnCode = param.data.returnCode;
45 dest.mobile = param.data.mobile; 44 dest.mobile = param.data.mobile;
46 if (param.data.returnCode === 0) { 45 if (param.data.returnCode === 0) {
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <div class="page"> 18 <div class="page">
19 <div class="gain-coupon-centent hidden"> 19 <div class="gain-coupon-centent hidden">
20 <div class="coupon"> 20 <div class="coupon">
21 - <img src={{couponPic}}> 21 + <img src={{image couponPic}}>
22 </div> 22 </div>
23 <p class="phone" id="mobile"></p> 23 <p class="phone" id="mobile"></p>
24 <p>登录Yoho!Buy有货客户端即可使用</p> 24 <p>登录Yoho!Buy有货客户端即可使用</p>
1 <div class="star-page yoho-page"> 1 <div class="star-page yoho-page">
2 {{> star/head-tab}} 2 {{> star/head-tab}}
3 - <div class="swiper-num swiper-num1"></div>  
4 - <div class="swiper-num swiper-num2"></div>  
5 - <div class="swiper-num swiper-num3"></div>  
6 <div class="loading-tip">下拉刷新</div> 3 <div class="loading-tip">下拉刷新</div>
7 <div class="star-main"> 4 <div class="star-main">
8 <div class="main-content"> 5 <div class="main-content">
@@ -26,7 +26,7 @@ function doPassportCallback(openId, nickname, sourceType, req, res) { @@ -26,7 +26,7 @@ function doPassportCallback(openId, nickname, sourceType, req, res) {
26 refer = `${config.siteUrl}/home`; 26 refer = `${config.siteUrl}/home`;
27 } 27 }
28 28
29 - if (/sign|login/.test(refer)) { 29 + if (/signin|login/.test(refer)) {
30 refer = `${config.siteUrl}/home`; 30 refer = `${config.siteUrl}/home`;
31 } 31 }
32 if (openId && nickname) { 32 if (openId && nickname) {
@@ -55,7 +55,7 @@ const common = { @@ -55,7 +55,7 @@ const common = {
55 if (!refer) { 55 if (!refer) {
56 refer = req.get('Referer'); 56 refer = req.get('Referer');
57 } 57 }
58 - refer && res.cookie('refer', encodeURI(refer), { 58 + refer && !/signin|login/.test(refer) && res.cookie('refer', encodeURI(refer), {
59 domain: 'yohobuy.com' 59 domain: 'yohobuy.com'
60 }); 60 });
61 next(); 61 next();
@@ -54,14 +54,16 @@ class Auth { @@ -54,14 +54,16 @@ class Auth {
54 let uidCookie = `${data.profile_name}::${data.uid}::${data.vip_info.title}::${token}`; 54 let uidCookie = `${data.profile_name}::${data.uid}::${data.vip_info.title}::${token}`;
55 55
56 res.cookie('_UID', uidCookie, { 56 res.cookie('_UID', uidCookie, {
57 - domain: 'yohobuy.com' 57 + domain: 'yohobuy.com',
  58 + expires: new Date(Date.now() + 2592000000) // 有效期一年
58 }); 59 });
59 } 60 }
60 req.session._TOKEN = token; 61 req.session._TOKEN = token;
61 req.session._LOGIN_UID = uid; 62 req.session._LOGIN_UID = uid;
62 res.cookie('_TOKEN', token, { 63 res.cookie('_TOKEN', token, {
63 - domain: 'yohobuy.com'  
64 - }); 64 + domain: 'yohobuy.com',
  65 + expires: new Date(Date.now() + 2592000000) // 有效期一年
  66 + }); // esline-disable-line
65 }); 67 });
66 } 68 }
67 } 69 }
@@ -78,7 +78,7 @@ if (isProduction) { @@ -78,7 +78,7 @@ if (isProduction) {
78 Object.assign(module.exports, { 78 Object.assign(module.exports, {
79 appName: 'm.yohobuy.com for test', 79 appName: 'm.yohobuy.com for test',
80 domains: { 80 domains: {
81 - api: 'http://testapi.yoho.cn:28078/', 81 + api: 'http://devapi.yoho.cn:58078/',
82 service: 'http://testservice.yoho.cn:28077/' 82 service: 'http://testservice.yoho.cn:28077/'
83 }, 83 },
84 memcache: { 84 memcache: {
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "0.1.9", 3 + "version": "0.1.11",
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": {
@@ -18,7 +18,9 @@ var $window = $(window), @@ -18,7 +18,9 @@ var $window = $(window),
18 $headTab = $('.head-tab'), 18 $headTab = $('.head-tab'),
19 headTabH = $headTab.height(), 19 headTabH = $headTab.height(),
20 scrollH = $(window).height() - headTabH, 20 scrollH = $(window).height() - headTabH,
21 - $loadingTip = $('.loading-tip'); 21 + $loadingTip = $('.loading-tip'),
  22 + u = navigator.userAgent,
  23 + isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
22 24
23 /* 25 /*
24 $swiperView = $('.swiper-view'), 26 $swiperView = $('.swiper-view'),
@@ -33,8 +35,11 @@ var mySwiper; @@ -33,8 +35,11 @@ var mySwiper;
33 var avatarKey, bannerLen, res, avatarSwiper, avatarSwiperClone, getIndexHtml, 35 var avatarKey, bannerLen, res, avatarSwiper, avatarSwiperClone, getIndexHtml,
34 $avatarClone, $starArticle, $avatarWrap, starIScroll; 36 $avatarClone, $starArticle, $avatarWrap, starIScroll;
35 37
36 -var swiperNum = ($('.swiper-num2').width() - $('.swiper-num1').width()) +  
37 - ($('.swiper-num3').width() - $('.swiper-num1').width()) / 2; 38 +var swiperNum = $('.avatar-wrap .swiper-slide').width() / 2;
  39 +
  40 +if ($window.width() === 375 && isiOS) {
  41 + swiperNum = 32;
  42 +}
38 43
39 require('../common'); 44 require('../common');
40 45
@@ -101,6 +106,7 @@ function setIndexAction() { @@ -101,6 +106,7 @@ function setIndexAction() {
101 if (bannerLen > 1) { 106 if (bannerLen > 1) {
102 avatarSwiper = new Swiper('.avatar-1', { 107 avatarSwiper = new Swiper('.avatar-1', {
103 loop: true, 108 loop: true,
  109 + initialSlide: 0,
104 centeredSlides: true, 110 centeredSlides: true,
105 slidesPerView: 'auto', 111 slidesPerView: 'auto',
106 loopedSlides: bannerLen, 112 loopedSlides: bannerLen,
@@ -147,10 +147,8 @@ @@ -147,10 +147,8 @@
147 margin-top: 36px; 147 margin-top: 36px;
148 background: #000; 148 background: #000;
149 149
150 - span {  
151 - display: block;  
152 - width: 100%;  
153 - height: 100%; 150 + a {
  151 + border-radius: 5px;
154 } 152 }
155 } 153 }
156 154
@@ -416,18 +414,6 @@ @@ -416,18 +414,6 @@
416 top: 0; 414 top: 0;
417 z-index: -1; 415 z-index: -1;
418 } 416 }
419 -  
420 - .swiper-num1 {  
421 - width: 110px;  
422 - }  
423 -  
424 - .swiper-num2 {  
425 - width: 130px;  
426 - }  
427 -  
428 - .swiper-num3 {  
429 - width: 180px;  
430 - }  
431 } 417 }
432 418
433 .star-index-bg { 419 .star-index-bg {
@@ -438,3 +424,31 @@ @@ -438,3 +424,31 @@
438 background: #000; 424 background: #000;
439 } 425 }
440 } 426 }
  427 +
  428 +@media screen and (max-width: 375px) and (min-width: 375px) {
  429 + .star-page {
  430 + .avatar-wrap {
  431 + height: 105PX;
  432 + }
  433 +
  434 + .avatar-swiper {
  435 + li {
  436 + width: 64PX;
  437 + height: 64PX;
  438 + margin-top: 20.5PX;
  439 + }
  440 +
  441 + .swiper-slide-active {
  442 + width: 105PX;
  443 + height: 105PX;
  444 + }
  445 +
  446 + .swiper-slide-prev,
  447 + .swiper-slide-next {
  448 + width: 76PX;
  449 + height: 76PX;
  450 + margin-top: 14.5PX;
  451 + }
  452 + }
  453 + }
  454 +}
1 -// 获取 UID  
2 -exports.getUid = (req) => {  
3 - var _uid = 0,  
4 - cookie = req.cookies._UID,  
5 - cookieList;  
6 -  
7 - if (req.isApp) {  
8 - return req.query.uid || 0;  
9 - }  
10 -  
11 - if (cookie) {  
12 - cookieList = cookie.split('::');  
13 - if (cookieList[1] && !isNaN(cookieList[1])) {  
14 - _uid = cookieList[1];  
15 - }  
16 - }  
17 -  
18 - return _uid;  
19 -};