Authored by lijing

开发完成

... ... @@ -392,12 +392,17 @@ exports.verifystudent = (req, res, next) => {
prompt = datas[2].data.prompt;
//添加分享成功记录
if (req.query.refer) {
if (req.query.refer && req.query.shareId) {
let code = datas[3].code;
res.cookie('promotion', code, {
domain: 'yohobuy.com',
path: '/'
});
} else if (!req.query.shareId) {
res.cookie('promotion', 'own-succ', {
domain: 'yohobuy.com',
path: '/'
});
};
}
} else {
... ... @@ -406,6 +411,10 @@ exports.verifystudent = (req, res, next) => {
} else {
prompt = datas[2].message;
}
res.cookie('promotion', 'own-fail', {
domain: 'yohobuy.com',
path: '/'
});
}
datas[1].data.product_list = (datas[1].data.product_list || []).map(function(value) {
value.goodsId = value.goods_list[0].goods_id;
... ...
... ... @@ -97,8 +97,8 @@ const _schoolTotal = () => {
// 资源位
const _resource = () => {
return service.get('/operations/api/v5/resource/home', {
content_code: '201504091403002',
return service.get('/operations/api/v5/resource/get', {
content_code: '2daa99e69c27aba77ed3884814b78014',
});
};
... ... @@ -187,21 +187,52 @@ const index = (params) => {
resu = Object.assign(resu, result[3]);
}
if (result && result[4] && result[4].data) {
let picList = result[4].data.list;
_.forEach(picList, function(val) {
obj = {
};
resu.picList.push(obj);
});
// 图片可配,调用资源位
if (result && result[4] && result[4].data && result[4].data[0] && result[4].data[0].data) {
let pList = result[4].data[0].data;
resu.picList = {
bannerPic: helpers.image(pList[0].src, 750, 701),
title1: helpers.image(pList[1].src, 750, 114),
title2: helpers.image(pList[2].src, 750, 114),
title3: helpers.image(pList[3].src, 750, 114),
title4: helpers.image(pList[4].src, 750, 114),
pri1: helpers.image(pList[5].src, 345, 154),
pri2: helpers.image(pList[6].src, 345, 154),
pri3: helpers.image(pList[7].src, 345, 154),
pri4: helpers.image(pList[8].src, 345, 154),
act1: {
src: helpers.image(pList[9].src, 375, 444),
url: pList[9].url
},
act2: {
src: helpers.image(pList[10].src, 375, 444),
url: pList[10].url
},
invite: helpers.image(pList[11].src, 750, 444),
dia1: {
src: helpers.image(pList[12].src, 560, 567),
url: pList[12].url
},
dia2: {
src: helpers.image(pList[13].src, 560, 567),
url: pList[13].url
},
dia3: {
src: helpers.image(pList[14].src, 560, 697),
url: pList[14].url
},
dia4: {
src: helpers.image(pList[15].src, 560, 488),
url: pList[15].url
},
dia5: {
src: helpers.image(pList[16].src, 560, 416),
url: pList[16].url
},
}
}
return resu;
});
... ...
<div class="student-promotion">
<div class="big-pic">
<div class="big-pic" style="background-image: url({{picList.bannerPic}});">
<span class="total-school">{{totalSchool}}</span>
<span class="total-student">
{{# studentArr}}
... ... @@ -10,34 +10,34 @@
</div>
<div class="privilege clearfix">
<div class="privilege-item open-dia">
<img src="{{imgSrc 'img/activity/promotion/privilege-1.png'}}" />
<img src="{{picList.pri1}}" />
</div>
<div class="privilege-item open-dia">
<img src="{{imgSrc 'img/activity/promotion/privilege-2.png'}}" />
<img src="{{picList.pri2}}" />
</div>
<div class="privilege-item open-dia">
<img src="{{imgSrc 'img/activity/promotion/privilege-3.png'}}" />
<img src="{{picList.pri3}}" />
</div>
<div class="privilege-item open-dia">
<img src="{{imgSrc 'img/activity/promotion/privilege-4.png'}}" />
<img src="{{picList.pri4}}" />
</div>
</div>
<div class="title" style="background-image:url('{{imgSrc "img/activity/promotion/title-1.png"}}')"></div>
<div class="title" style="background-image: url({{picList.title1}});"></div>
<div class="activity clearfix">
<a class="activity-item">
<img src="{{imgSrc 'img/activity/promotion/activity-1.png'}}" />
<a class="activity-item" href="{{picList.act1.url}}">
<img src="{{picList.act1.src}}" />
</a>
<a class="activity-item">
<img src="{{imgSrc 'img/activity/promotion/activity-2.png'}}" />
<a class="activity-item" href="{{picList.act2.url}}">
<img src="{{picList.act2.src}}" />
</a>
</div>
<div class="title" style="background-image:url('{{imgSrc "img/activity/promotion/title-2.png"}}')"></div>
<div class="invite">
<div class="title" style="background-image: url({{picList.title2}});"></div>
<div class="invite" style="background-image:url('{{picList.invite}}')">
<a class="invite-now"></a>
<a class="more-rule open-dia"></a>
</div>
{{#if shareLog}}
<div class="title" style="background-image:url('{{imgSrc "img/activity/promotion/title-3.png"}}')"></div>
<div class="title" style="background-image: url({{picList.title3}});"></div>
<div class="student">
{{# shareLog}}
<div class="student-item">
... ... @@ -51,7 +51,7 @@
{{/ shareLog}}
</div>
{{/if}}
<div class="title" id="university" style="background-image:url('{{imgSrc "img/activity/promotion/title-4.png"}}')"></div>
<div class="title" id="university" style="background-image: url({{picList.title4}});"></div>
<div class="university">
<a class="university-item" data-aslider-in="province|fade">
<input type="text" placeholder="请选择省份" readonly="readonly" id="s-province-tb" name="s-province-tb" / >
... ... @@ -90,24 +90,23 @@
<div class="dia-bg"></div>
<div class="dia-main">
<div class="pic">
<img src='{{imgSrc "img/activity/promotion/privilege-1.jpg"}}' />
<a></a>
<img src="{{picList.dia1.src}}" />
<a href="{{picList.dia1.url}}"></a>
</div>
<div class="pic">
<img src='{{imgSrc "img/activity/promotion/privilege-2.jpg"}}' />
<a></a>
<img src="{{picList.dia2.src}}" />
<a href="{{picList.dia2.url}}"></a>
</div>
<div class="pic">
<img src='{{imgSrc "img/activity/promotion/privilege-3.jpg"}}' />
<a></a>
<img src="{{picList.dia3.src}}" />
<a href="{{picList.dia3.url}}"></a>
</div>
<div class="pic">
<img src='{{imgSrc "img/activity/promotion/privilege-4.jpg"}}' />
<a></a>
<img src="{{picList.dia4.src}}" />
<a href="{{picList.dia4.url}}"></a>
</div>
<div class="pic">
<img src='{{imgSrc "img/activity/promotion/rule.jpg"}}' />
<a></a>
<img src="{{picList.dia5.src}}" />
</div>
<div class="close-btn"></div>
</div>
... ...
... ... @@ -17,21 +17,21 @@ module.exports = {
assetUrl: '//127.0.0.1:5001',
testCode: 'yoho4946abcdef#$%&!@',
domains: {
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
// imSocket: 'ws://im.yohobuy.com:10240',
// imCs: 'http://im.yohobuy.com/api',
// imServer: 'http://im.yohobuy.com/server'
api: 'http://api-test2.yohops.com:9999/',
service: 'http://service-test2.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test2.yohops.com:9999/',
imSocket: 'ws://im.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
imServer: 'http://im.yohobuy.com/server'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
imSocket: 'wss://imsocket.yohobuy.com:443',
imCs: 'https://imhttp.yohobuy.com/api',
imServer: 'https://imhttp.yohobuy.com/server'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
// imSocket: 'wss://imsocket.yohobuy.com:443',
// imCs: 'https://imhttp.yohobuy.com/api',
// imServer: 'https://imhttp.yohobuy.com/server'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -290,6 +290,14 @@ $(
tip.show('邀请失败');
setCookie('promotion', '', { path: '/' });
break;
case 'own-succ':
tip.show('认证成功');
setCookie('promotion', '', { path: '/' });
break;
case 'own-fail':
tip.show('认证失败');
setCookie('promotion', '', { path: '/' });
break;
default: ;
}
... ... @@ -315,7 +323,11 @@ function checkStudent() {
url: '/activity/promotion/checkStudent',
success: function(data) {
if (data === 0) {
location.href = './student/register?shareId=' + window.queryString.uid + '&refer=' + location.href;
if (window.queryString.uid) {
location.href = './student/register?shareId=' + window.queryString.uid + '&refer=' + location.href;
} else {
location.href = './student/register?refer=' + location.href;
};
} else {
tip.show('您已经认证过了');
}
... ...
... ... @@ -10,7 +10,6 @@
position: relative;
width: 100%;
height: 701px;
background-image: resolve("activity/promotion/bg-1.png");
background-size: 100%;
background-repeat: no-repeat;
... ... @@ -96,7 +95,6 @@
.invite {
height: 444px;
background-image: resolve("activity/promotion/invite.png");
background-size: 100%;
background-repeat: no-repeat;
position: relative;
... ... @@ -287,6 +285,11 @@
.pic {
display: none;
img {
width: 100%;
height: 100%;
}
a {
width: 462px;
height: 88px;
... ...