Authored by 张孝茹

好友邀请验收修改

1 'use strict'; 1 'use strict';
2 2
3 const expandModel = require('../models/expand-new'), 3 const expandModel = require('../models/expand-new'),
4 - headerModel = require('../../../doraemon/models/header'); 4 + headerModel = require('../../../doraemon/models/header'),
  5 + stringProcess = require(`${global.utils}/string-process`);
5 6
6 let yhchannels = { 7 let yhchannels = {
7 '1,3': 1, 8 '1,3': 1,
@@ -100,7 +101,7 @@ exports.friendInvite = (req, res, next) => { @@ -100,7 +101,7 @@ exports.friendInvite = (req, res, next) => {
100 let isApp = req.yoho.isApp; 101 let isApp = req.yoho.isApp;
101 let inciteCode = req.query.inviteCode; 102 let inciteCode = req.query.inviteCode;
102 let contentCode = '319f92c4b072c3c40ea4cb4499b78bb4'; 103 let contentCode = '319f92c4b072c3c40ea4cb4499b78bb4';
103 - let token = req.query.token ? decodeURIComponent(req.query.token) : req.query.token; 104 + let token = req.query.token ? stringProcess.decodeURIComponent(req.query.token) : '';
104 105
105 req.ctx(expandModel).friendInvite(inciteCode, yhChannel, limit, page, contentCode, token).then(result => { 106 req.ctx(expandModel).friendInvite(inciteCode, yhChannel, limit, page, contentCode, token).then(result => {
106 res.render('expand-new/friend-invite', { 107 res.render('expand-new/friend-invite', {
@@ -179,6 +179,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -179,6 +179,8 @@ module.exports = class extends global.yoho.BaseModel {
179 }).then((result) => { 179 }).then((result) => {
180 if (result && result.code === 200) { 180 if (result && result.code === 200) {
181 return result.data; 181 return result.data;
  182 + } else {
  183 + return Promise.resolve({});
182 } 184 }
183 }); 185 });
184 } 186 }
@@ -195,7 +197,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -195,7 +197,7 @@ module.exports = class extends global.yoho.BaseModel {
195 197
196 _getOrderGoods(token) { 198 _getOrderGoods(token) {
197 if (!token) { 199 if (!token) {
198 - return; 200 + return Promise.resolve({});
199 } 201 }
200 return api.get('', { 202 return api.get('', {
201 method: 'app.SpaceOrders.getProductList', 203 method: 'app.SpaceOrders.getProductList',
1 <div class="friend-invite-page yoho-page"> 1 <div class="friend-invite-page yoho-page">
2 {{# friendInviteData}} 2 {{# friendInviteData}}
3 <div class="banner"> 3 <div class="banner">
4 - <span class="title">您的好友{{nickname}}<br><b>{{#if payText}}发现了好物并完成下单{{else}}邀请您来有货玩潮流{{/if}}</b></span> 4 + <span class="title">您的好友{{nickname}}<br><b>{{#if payText}}发现了好物并推荐给您{{else}}邀请您来有货玩潮流{{/if}}</b></span>
5 <span class="ico-left"></span> 5 <span class="ico-left"></span>
6 <span class="ico-right"></span> 6 <span class="ico-right"></span>
7 {{#if friendsGoods}} 7 {{#if friendsGoods}}
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 {{# friendsGoods}} 11 {{# friendsGoods}}
12 <li class="order-good swiper-slide"> 12 <li class="order-good swiper-slide">
13 <a href="{{goodUrl}}"> 13 <a href="{{goodUrl}}">
14 - <img class="" src="{{image imgSrc 240 320}}"> 14 + <img src="{{image imgSrc 240 320}}">
15 </a> 15 </a>
16 <li> 16 <li>
17 {{/ friendsGoods}} 17 {{/ friendsGoods}}
@@ -38,7 +38,7 @@ $('.goods-info').click(function() { @@ -38,7 +38,7 @@ $('.goods-info').click(function() {
38 } 38 }
39 }); 39 });
40 40
41 -if (bannerLen > 0) { 41 +if (bannerLen > 0 && bannerLen < 3) {
42 new Swiper($avatarWrap.find('.avatar-swiper')[0], { 42 new Swiper($avatarWrap.find('.avatar-swiper')[0], {
43 lazyLoading: true, 43 lazyLoading: true,
44 lazyLoadingInPrevNextAmount: 3, 44 lazyLoadingInPrevNextAmount: 3,
@@ -50,4 +50,17 @@ if (bannerLen > 0) { @@ -50,4 +50,17 @@ if (bannerLen > 0) {
50 watchSlidesVisibility: true, 50 watchSlidesVisibility: true,
51 spaceBetween: 6 51 spaceBetween: 6
52 }); 52 });
  53 +} else if (bannerLen >= 3) {
  54 + new Swiper($avatarWrap.find('.avatar-swiper')[0], {
  55 + lazyLoading: true,
  56 + lazyLoadingInPrevNextAmount: 3,
  57 + initialSlide: 1,
  58 + centeredSlides: true,
  59 + slidesPerView: 'auto',
  60 + loopedSlides: bannerLen,
  61 + watchSlidesProgress: true,
  62 + watchSlidesVisibility: true,
  63 + spaceBetween: 6,
  64 + loop: true
  65 + });
53 } 66 }
@@ -18,9 +18,10 @@ @@ -18,9 +18,10 @@
18 18
19 .title { 19 .title {
20 display: inline-block; 20 display: inline-block;
21 - transform: rotate(-2deg); 21 + transform: rotate(-1.6deg);
22 font-size: 32px; 22 font-size: 32px;
23 font-weight: 700; 23 font-weight: 700;
  24 + margin-top: 3px;
24 25
25 b { 26 b {
26 font-size: 37px; 27 font-size: 37px;
@@ -103,7 +104,7 @@ @@ -103,7 +104,7 @@
103 background-image: resolve("activity/expand-new/recommed-title.png"); 104 background-image: resolve("activity/expand-new/recommed-title.png");
104 background-size: 100%; 105 background-size: 100%;
105 background-repeat: no-repeat; 106 background-repeat: no-repeat;
106 - margin: 0 auto 30px; 107 + margin: 50px auto 30px;
107 } 108 }
108 } 109 }
109 110