Authored by 李靖

Merge branch 'feature/family' of git.yoho.cn:fe/yohobuywap-node into feature/family

@@ -39,9 +39,10 @@ exports.familyVip = (req, res, next) => { @@ -39,9 +39,10 @@ exports.familyVip = (req, res, next) => {
39 }; 39 };
40 40
41 exports.downLoadData = (req, res, next) => { 41 exports.downLoadData = (req, res, next) => {
42 - let params = req.query.codeArr; 42 + let codeArr = req.query.codeArr;
  43 + let yohoApp = req.yoho.isApp && !req.yoho.isMarsApp;
43 44
44 - req.ctx(family).downLoadData(params).then(result => { 45 + req.ctx(family).downLoadData(codeArr, yohoApp).then(result => {
45 res.json(result); 46 res.json(result);
46 }).catch(next); 47 }).catch(next);
47 }; 48 };
@@ -318,7 +318,7 @@ class familyModel extends global.yoho.BaseModel { @@ -318,7 +318,7 @@ class familyModel extends global.yoho.BaseModel {
318 /** 318 /**
319 * 下载弹窗数据处理 319 * 下载弹窗数据处理
320 */ 320 */
321 - _downLoadProce(data) { 321 + _downLoadProce(data, yohoApp) {
322 let singleData; 322 let singleData;
323 323
324 _.forEach(data, function(val) { 324 _.forEach(data, function(val) {
@@ -326,6 +326,22 @@ class familyModel extends global.yoho.BaseModel { @@ -326,6 +326,22 @@ class familyModel extends global.yoho.BaseModel {
326 appName: val.appName, 326 appName: val.appName,
327 imgList: val.data 327 imgList: val.data
328 }); 328 });
  329 +
  330 + if (yohoApp) {
  331 + if (val.appName === 'green') {
  332 + singleData = _.assign(singleData, {
  333 + winXinCode: 'YO_GREEN'
  334 + });
  335 + } else if (val.appName === 'coffee') {
  336 + singleData = _.assign(singleData, {
  337 + winXinCode: 'YoCoffeeCN'
  338 + });
  339 + } else if (val.appName === 'little') {
  340 + singleData = _.assign(singleData, {
  341 + winXinCode: 'YOLITTLE_CN'
  342 + });
  343 + }
  344 + }
329 }); 345 });
330 346
331 return singleData; 347 return singleData;
@@ -334,9 +350,9 @@ class familyModel extends global.yoho.BaseModel { @@ -334,9 +350,9 @@ class familyModel extends global.yoho.BaseModel {
334 /** 350 /**
335 * 下载弹窗信息 351 * 下载弹窗信息
336 */ 352 */
337 - downLoadData(params) { 353 + downLoadData(codeArr, yohoApp) {
338 354
339 - return Promise.map(params, (val) => { 355 + return Promise.map(codeArr, (val) => {
340 return this._getdownPop(val); 356 return this._getdownPop(val);
341 }).then((result) => { 357 }).then((result) => {
342 let finData = { 358 let finData = {
@@ -344,7 +360,7 @@ class familyModel extends global.yoho.BaseModel { @@ -344,7 +360,7 @@ class familyModel extends global.yoho.BaseModel {
344 }; 360 };
345 361
346 _.forEach(result, (val) => { 362 _.forEach(result, (val) => {
347 - finData.downLoadData.push(this._downLoadProce(val)); 363 + finData.downLoadData.push(this._downLoadProce(val, yohoApp));
348 }); 364 });
349 365
350 return finData; 366 return finData;
@@ -22,7 +22,7 @@ const domains = { @@ -22,7 +22,7 @@ const domains = {
22 imCs: 'http://im.yohobuy.com/api', 22 imCs: 'http://im.yohobuy.com/api',
23 global: 'http://api-global.yohobuy.com', 23 global: 'http://api-global.yohobuy.com',
24 store: 'http://192.168.102.47:8080/portal-gateway/', 24 store: 'http://192.168.102.47:8080/portal-gateway/',
25 - family: 'http://192.168.103.98:8026//yoho-family/' 25 + family: 'http://192.168.103.98:8026/yoho-family/'
26 }; 26 };
27 27
28 module.exports = { 28 module.exports = {
@@ -7,6 +7,10 @@ @@ -7,6 +7,10 @@
7 {{#imgList}} 7 {{#imgList}}
8 <img src="{{image src 640 1049}}"> 8 <img src="{{image src 640 1049}}">
9 {{/imgList}} 9 {{/imgList}}
  10 +
  11 + {{#if winXinCode}}
  12 + <a class="code-copy" href='//m.yohobuy.com/?openby:yohobuy={"action":"go.copy","params":{"text":"{{winXinCode}}","message":"复制成功"}}'>复制</a>
  13 + {{/if}}
10 </div> 14 </div>
11 {{/ downLoadData}} 15 {{/ downLoadData}}
12 </div> 16 </div>
@@ -33,7 +33,8 @@ class FamilyIndex extends Page { @@ -33,7 +33,8 @@ class FamilyIndex extends Page {
33 $wordOuter: $('.word-outer'), 33 $wordOuter: $('.word-outer'),
34 $bannerCenterSwiper: $('.banner-center-swiper'), 34 $bannerCenterSwiper: $('.banner-center-swiper'),
35 $back: $('.back'), 35 $back: $('.back'),
36 - $vipMore: $('more') 36 + $vipMore: $('more'),
  37 + $trendCode: $('.trend-code')
37 }; 38 };
38 39
39 this.view = { 40 this.view = {
@@ -229,7 +230,12 @@ class FamilyIndex extends Page { @@ -229,7 +230,12 @@ class FamilyIndex extends Page {
229 if (result.code === 200) { 230 if (result.code === 200) {
230 this.selector.$invition.show(); 231 this.selector.$invition.show();
231 this.selector.$invitonSet.hide(); 232 this.selector.$invitonSet.hide();
232 - this.selector.$invition.find('.trend-word').html(trendWord); 233 + if (this.selector.$invition.find('.trend-word') > 0) {
  234 + this.selector.$invition.find('.trend-word').html(trendWord);
  235 + } else {
  236 + this.selector.$trendCode.html('# <span class="word-outer"><span class="trend-word">' +
  237 + trendWord + '</span></span> #');
  238 + }
233 this.selector.$trendWord.css({ 239 this.selector.$trendWord.css({
234 width: 'auto' 240 width: 'auto'
235 }); 241 });
@@ -144,7 +144,7 @@ @@ -144,7 +144,7 @@
144 display: block; 144 display: block;
145 background-size: 100%; 145 background-size: 100%;
146 background-repeat: no-repeat; 146 background-repeat: no-repeat;
147 - background-image: resolve("home/index/family-entry.png"); 147 + background-image: resolve("home/index/family-entry.gif");
148 } 148 }
149 149
150 .login-btn { 150 .login-btn {
@@ -50,6 +50,41 @@ @@ -50,6 +50,41 @@
50 .green { 50 .green {
51 width: 670px; 51 width: 670px;
52 margin-left: -340px; 52 margin-left: -340px;
  53 +
  54 + .code-copy {
  55 + width: 64px;
  56 + height: 38px;
  57 + display: inline-block;
  58 + position: relative;
  59 + line-height: 38px;
  60 + text-align: center;
  61 + border: 1px solid;
  62 + color: #fff;
  63 + background-color: #444;
  64 + border-radius: 5px;
  65 + font-size: 24px;
  66 + }
  67 + }
  68 +
  69 + .green {
  70 + .code-copy {
  71 + top: -684px;
  72 + left: 356px;
  73 + }
  74 + }
  75 +
  76 + .little {
  77 + .code-copy {
  78 + top: -656px;
  79 + left: 380px;
  80 + }
  81 + }
  82 +
  83 + .coffee {
  84 + .code-copy {
  85 + top: -684px;
  86 + left: 356px;
  87 + }
53 } 88 }
54 89
55 .hide { 90 .hide {
@@ -11,12 +11,13 @@ @@ -11,12 +11,13 @@
11 .command-textarea { 11 .command-textarea {
12 height: 130px; 12 height: 130px;
13 width: 690px; 13 width: 690px;
14 - font-size: 44px; 14 + font-size: 40px;
15 border: none; 15 border: none;
16 resize: none; 16 resize: none;
17 background-color: #dfdfdf; 17 background-color: #dfdfdf;
18 margin: 20px 30px; 18 margin: 20px 30px;
19 border-radius: 10px; 19 border-radius: 10px;
  20 + padding: 15px 30px;
20 } 21 }
21 22
22 .world-number { 23 .world-number {