Authored by zhangxiaoru

分享优化

... ... @@ -17,9 +17,10 @@ let channels = {
exports.promotion = (req, res, next) => {
let uid = req.user.uid,
isApp = req.yoho.isApp;
isApp = req.yoho.isApp,
contentCode = 'fa046a09b7c2c0e06927162404d95111';
req.ctx(expandModel).promotionData(uid, isApp).then(result => {
req.ctx(expandModel).promotionData(uid, isApp, contentCode).then(result => {
res.render('expand-new/my-promotion', {
pageHeader: headerModel.setNav({
navTitle: '邀请好友',
... ... @@ -96,14 +97,11 @@ exports.friendInvite = (req, res, next) => {
(req.cookies._Channel && channels[req.cookies._Channel]) || 1;
let limit = 10;
let page = req.query.page || 1;
let uid = req.user.uid;
let isApp = req.yoho.isApp;
let name = req.query.friend;
let inciteCode = req.query.inviteCode;
let contentCode = 'bc31b5d58b5af4e3999e8b994fb2bbc1';
req.ctx(expandModel).friendInvite(uid, yhChannel, limit, page).then(result => {
if (name) {
result.name = '“' + name + '”';
}
req.ctx(expandModel).friendInvite(inciteCode, yhChannel, limit, page, contentCode).then(result => {
res.render('expand-new/friend-invite', {
pageHeader: headerModel.setNav({
navTitle: '好友邀请'
... ...
... ... @@ -40,9 +40,9 @@ module.exports = class extends global.yoho.BaseModel {
/**
* 资源位
*/
_getTrendPop() {
_getTrendPop(contentCode) {
return service.get('operations/api/v5/resource/get', {
content_code: 'fa046a09b7c2c0e06927162404d95111',
content_code: contentCode,
}).then(result => {
if (result && result.code === 200 && result.data) {
return result.data[0];
... ... @@ -52,12 +52,12 @@ module.exports = class extends global.yoho.BaseModel {
});
}
promotionData(uid, isApp) {
return api.all([this._getPromotionData(uid, isApp), this._getTrendPop()]).then(result => {
promotionData(uid, isApp, contentCode) {
return api.all([this._getPromotionData(uid, isApp), this._getTrendPop(contentCode)]).then(result => {
let friendPromotionData = {};
friendPromotionData = Object.assign(friendPromotionData, result[0]);
friendPromotionData.bannerSrc = _.get(result[7], 'data[0].src', '');
friendPromotionData.bannerSrc = _.get(result[1], 'data[0].src', '');
return friendPromotionData;
});
... ... @@ -159,21 +159,6 @@ module.exports = class extends global.yoho.BaseModel {
}
/**
* 好友邀请页
*/
friendInvite(uid, yhChannel, limit, page) {
return api.all([this._getPromotionData(uid), this._hotGoods(yhChannel, limit, page)]).then(result => {
let friendInviteData = {};
friendInviteData.hotGoods = result[1];
friendInviteData = Object.assign(friendInviteData, result[0]);
return friendInviteData;
});
}
/**
* 好友邀请信息
*/
inviteUserInfo(inviteCode) {
... ... @@ -185,4 +170,23 @@ module.exports = class extends global.yoho.BaseModel {
return result;
});
}
/**
* 好友邀请页
*/
friendInvite(inciteCode, yhChannel, limit, page, contentCode) {
return api.all([this.inviteUserInfo(inciteCode), this._hotGoods(yhChannel, limit, page),
this._getTrendPop(contentCode)]).then(result => {
let friendInviteData = {};
friendInviteData.hotGoods = result[1];
friendInviteData = Object.assign(friendInviteData, result[0].data);
friendInviteData.imgSrc = _.get(result[2], 'data[0].src', '');
return friendInviteData;
});
}
};
... ...
<div class="friend-invite-page yoho-page">
{{# friendInviteData}}
<div class="banner">
<span class="title">您的好友{{name}}<br><b>邀请您来有货玩潮流</b></span>
<div class="tip-text">{{{invitedFriendWelfare}}}</div>
<span class="title">您的好友{{nickname}}<br><b>邀请您来有货玩潮流</b></span>
<div class="tip-text">
<img src="{{image imgSrc 636 311}}">
</div>
<a class="btn"></a>
</div>
<div class="recommend-goods">
... ...
... ... @@ -3,8 +3,9 @@
<span class="close-invite">×</span>
<img class="head-ico" src="{{headIco}}http://img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png">
<span class="invite-name">"{{nickname}}"邀请你来有货玩潮流</span>
<p class="invite-trend">#{{trendWord}}#</p>
<a href="//m.yohobuy.com/activity/friend-invite?friend={{nickname}}" class="invite-go">现在就去</a>
<p class="invite-trend"># {{trendWord}} #</p>
<a href="//m.yohobuy.com/activity/friend-invite?inviteCode={{inviteCode}}" class="invite-go">现在就去</a>
</div>
<div id="no-download"></div>
<a class="share-packet" href="//m.yohobuy.com/activity/friend-invite?inviteCode={{inviteCode}}"></a>
{{/inviteShare}}
\ No newline at end of file
... ...
/**
* 邀请码分享头部
*/
require('common/_invite-share.css');
require('common');
let $ = require('yoho-jquery');
let inviteCode = window.queryString.inviteCode;
... ...
require('layout/_swiper.css');
require('product/search/list.page.css');
require('product/shop/redshop.page.css');
require('common/_invite-share.css');
const $ = require('yoho-jquery');
const allProduct = require('./shop/all-product');
... ...
... ... @@ -3,7 +3,6 @@
*/
require('product/shop/shop.page.css');
require('common/_invite-share.css');
require('./shop/coupon');
let $ = require('yoho-jquery'),
... ...
... ... @@ -27,11 +27,8 @@
}
.tip-text {
margin: 56px 56px 0;
line-height: 49px;
font-size: 24px;
text-align: left;
font-weight: 700;
width: 628px;
margin: 10px;
}
.btn {
... ...
... ... @@ -63,3 +63,17 @@
color: #fff;
}
}
.share-packet {
display: block;
width: 181px;
height: 246px;
background-image: resolve("activity/expand-new/share-packet.gif");
background-size: 100%;
background-repeat: no-repeat;
position: absolute;
z-index: 100;
right: 0;
top: 50%;
margin-top: -120px;
}
... ...
... ... @@ -9,4 +9,3 @@
@import "cart/chose-panel";
@import "common/suspend-home";
@import "bundle";
@import "common/invite-share";
... ...