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) => {
};
exports.downLoadData = (req, res, next) => {
let params = req.query.codeArr;
let codeArr = req.query.codeArr;
let yohoApp = req.yoho.isApp && !req.yoho.isMarsApp;
req.ctx(family).downLoadData(params).then(result => {
req.ctx(family).downLoadData(codeArr, yohoApp).then(result => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -318,7 +318,7 @@ class familyModel extends global.yoho.BaseModel {
/**
* 下载弹窗数据处理
*/
_downLoadProce(data) {
_downLoadProce(data, yohoApp) {
let singleData;
_.forEach(data, function(val) {
... ... @@ -326,6 +326,22 @@ class familyModel extends global.yoho.BaseModel {
appName: val.appName,
imgList: val.data
});
if (yohoApp) {
if (val.appName === 'green') {
singleData = _.assign(singleData, {
winXinCode: 'YO_GREEN'
});
} else if (val.appName === 'coffee') {
singleData = _.assign(singleData, {
winXinCode: 'YoCoffeeCN'
});
} else if (val.appName === 'little') {
singleData = _.assign(singleData, {
winXinCode: 'YOLITTLE_CN'
});
}
}
});
return singleData;
... ... @@ -334,9 +350,9 @@ class familyModel extends global.yoho.BaseModel {
/**
* 下载弹窗信息
*/
downLoadData(params) {
downLoadData(codeArr, yohoApp) {
return Promise.map(params, (val) => {
return Promise.map(codeArr, (val) => {
return this._getdownPop(val);
}).then((result) => {
let finData = {
... ... @@ -344,7 +360,7 @@ class familyModel extends global.yoho.BaseModel {
};
_.forEach(result, (val) => {
finData.downLoadData.push(this._downLoadProce(val));
finData.downLoadData.push(this._downLoadProce(val, yohoApp));
});
return finData;
... ...
... ... @@ -22,7 +22,7 @@ const domains = {
imCs: 'http://im.yohobuy.com/api',
global: 'http://api-global.yohobuy.com',
store: 'http://192.168.102.47:8080/portal-gateway/',
family: 'http://192.168.103.98:8026//yoho-family/'
family: 'http://192.168.103.98:8026/yoho-family/'
};
module.exports = {
... ...
... ... @@ -7,6 +7,10 @@
{{#imgList}}
<img src="{{image src 640 1049}}">
{{/imgList}}
{{#if winXinCode}}
<a class="code-copy" href='//m.yohobuy.com/?openby:yohobuy={"action":"go.copy","params":{"text":"{{winXinCode}}","message":"复制成功"}}'>复制</a>
{{/if}}
</div>
{{/ downLoadData}}
</div>
... ...
... ... @@ -33,7 +33,8 @@ class FamilyIndex extends Page {
$wordOuter: $('.word-outer'),
$bannerCenterSwiper: $('.banner-center-swiper'),
$back: $('.back'),
$vipMore: $('more')
$vipMore: $('more'),
$trendCode: $('.trend-code')
};
this.view = {
... ... @@ -229,7 +230,12 @@ class FamilyIndex extends Page {
if (result.code === 200) {
this.selector.$invition.show();
this.selector.$invitonSet.hide();
this.selector.$invition.find('.trend-word').html(trendWord);
if (this.selector.$invition.find('.trend-word') > 0) {
this.selector.$invition.find('.trend-word').html(trendWord);
} else {
this.selector.$trendCode.html('# <span class="word-outer"><span class="trend-word">' +
trendWord + '</span></span> #');
}
this.selector.$trendWord.css({
width: 'auto'
});
... ...
... ... @@ -144,7 +144,7 @@
display: block;
background-size: 100%;
background-repeat: no-repeat;
background-image: resolve("home/index/family-entry.png");
background-image: resolve("home/index/family-entry.gif");
}
.login-btn {
... ...
... ... @@ -50,6 +50,41 @@
.green {
width: 670px;
margin-left: -340px;
.code-copy {
width: 64px;
height: 38px;
display: inline-block;
position: relative;
line-height: 38px;
text-align: center;
border: 1px solid;
color: #fff;
background-color: #444;
border-radius: 5px;
font-size: 24px;
}
}
.green {
.code-copy {
top: -684px;
left: 356px;
}
}
.little {
.code-copy {
top: -656px;
left: 380px;
}
}
.coffee {
.code-copy {
top: -684px;
left: 356px;
}
}
.hide {
... ...
... ... @@ -11,12 +11,13 @@
.command-textarea {
height: 130px;
width: 690px;
font-size: 44px;
font-size: 40px;
border: none;
resize: none;
background-color: #dfdfdf;
margin: 20px 30px;
border-radius: 10px;
padding: 15px 30px;
}
.world-number {
... ...