Authored by 陈轩

Merge branch 'feature/VIP_DAY' into release/5.0.0

Showing 51 changed files with 486 additions and 288 deletions
/* eslint no-unused-vars: ["error", { "args": "none" }]*/
/* eslint-disable no-shadow, camelcase */
'use strict';
const url = require('url');
const moment = require('moment');
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
const vipDayModel = require('../models/vipDay');
const auth = require('../../passport/models/auth-helper');
const co = require('bluebird').coroutine;
const util = require(global.utils + '/product-process');
exports.beforeIn = (req, res, next) => {
if (req.user.uid) {
return next();
// 将APP登录状态正常化
if (req.yoho.isApp && req.query.uid) {
req.user.uid = Number(req.user.uid || req.query.uid);
}
if (req.xhr) {
return res.json({
msg: '请先登录'
});
} else {
let jumpTo = new url.Url();
jumpTo.pathname = '/signin.html';
req.yoho.isApp && (jumpTo.search = 'yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http://m.yohobuy.com/activity/vip-day"}}}');
// 未登录
if (!req.user.uid) {
if (req.xhr) {
return res.json({
code: 401,
message: '抱歉,您还未登录',
redirect: '/signin.html'
});
}
jumpTo = url.format(jumpTo);
return res.redirect(jumpTo);
return res.redirect(helpers.urlFormat('/signin.html', {
refer: req.originalUrl
}));
}
next();
};
exports.index = (req, res, next) => {
... ... @@ -33,14 +40,28 @@ exports.index = (req, res, next) => {
res.locals.page = 'vipday_entry';
res.locals.width750 = true;
res.render('vip_day/index', {
pageStyle: 'vip-day entry',
vipgoods: [
[1, 2, 3],
[1, 2, 3],
[1, 2, 3]
]
});
let cate = {
goods1: [51203592, 51228151, 51315660],
goods2: [51338322, 51299644, 51344316],
goods3: [51374524, 51333192, 51311138]
};
vipDayModel.getGoods(cate)
.then(result => {
// console.log(result.data)
if (result.code !== 200) {
return Promise.reject('error');
}
res.render('vip_day/index', {
title: '会员日活动',
pageStyle: 'vip-day entry',
goods1: result.data.goods1,
goods2: result.data.goods2,
goods3: result.data.goods3
});
return;
}).catch(next);
};
exports.crazyWheel = (req, res, next) => {
... ... @@ -48,12 +69,13 @@ exports.crazyWheel = (req, res, next) => {
res.locals.page = 'vipday_wheel';
res.locals.width750 = true;
if (!res.session.playwheel) {
if (!req.session.playwheel) {
return res.redirect('/activity/vip-day');
}
vipDayModel.getJoinNum(1).then(result => {
res.render('vip_day/crazy_wheel', {
title: '会员日-疯狂大转盘',
pageStyle: 'vip-day game',
isWheel: true,
joinNum: result && result.data || 0,
... ... @@ -68,10 +90,12 @@ exports.crazyLuck = (req, res, next) => {
res.locals.page = 'vipday_luck';
res.locals.width750 = true;
co(function* (){
co(function* () {
let coins = yield vipDayModel.getCoins(uid);
let joinNum = yield vipDayModel.getJoinNum(2);
res.render('vip_day/crazy_luck', {
title: '拼手气',
pageStyle: 'vip-day game',
isLuck: true,
coin: coins && coins.data && (coins.data.total > 9999 ? (coins.data.total / 10000).toFixed(2) + '万' : coins.data.total),
... ... @@ -95,7 +119,6 @@ exports.signin = (req, res, next) => {
exports.saveMsg = (req, res, next) => {
let uid = req.user.uid;
let content = req.body.content;
auth.profile(uid)
.then(profile => {
// 1. get nick_name
... ... @@ -107,7 +130,7 @@ exports.saveMsg = (req, res, next) => {
})
.then(result => {
if (result.code === 200 && result.data === 1) {
res.session.playwheel = true;
req.session.playwheel = true;
}
res.json(result);
... ... @@ -117,7 +140,15 @@ exports.saveMsg = (req, res, next) => {
// 获取 会员日的 用户留言
exports.fetchMsg = (req, res, next) => {
let uid = req.user.uid;
let uid;
if (global.yoho.isApp) {
uid = req.query.uid;
} else {
uid = req.user.uid;
}
uid = uid || 0;
vipDayModel.queryLeaveWordsList(uid).then(result => {
return res.json(result);
... ... @@ -154,7 +185,7 @@ exports.luckResult = (req, res, next) => {
let coin = r1.data.total;
console.log(coin);
// console.log(coin);
if (coin < 20) {
return { code: 400, message: '有货币不够...' };
}
... ...
/* eslint-disable camelcase */
'use strict';
const _ = require('lodash');
const API = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const utils = require(global.utils + '/product-process');
const helpers = global.yoho.helpers;
// 签到
// doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/%E4%BC%9A%E5%91%98%E6%97%A5%E6%B4%BB%E5%8A%A8/%E4%BC%9A%E5%91%98%E6%97%A5%E7%AD%BE%E5%88%B0.md
... ... @@ -61,12 +64,69 @@ exports.getCoins = uid => {
});
};
//获取抽奖人数
//doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/%E4%BC%9A%E5%91%98%E6%97%A5%E6%B4%BB%E5%8A%A8/%E6%9F%A5%E8%AF%A2%E5%8F%82%E4%B8%8E%E6%8A%BD%E5%A5%96%E4%BA%BA%E6%95%B0.md
// 获取抽奖人数
// doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/%E4%BC%9A%E5%91%98%E6%97%A5%E6%B4%BB%E5%8A%A8/%E6%9F%A5%E8%AF%A2%E5%8F%82%E4%B8%8E%E6%8A%BD%E5%A5%96%E4%BA%BA%E6%95%B0.md
exports.getJoinNum = prize_type => {
const url = '/activity/UserdayPrizeLogController/queryPrizeLogNum';
return serviceAPI.get(url, {
prize_type,
});
}
\ No newline at end of file
};
/**
* cate [object Object]
*/
exports.getGoods = cate => {
let skns = '';
let cates = Object.keys(cate);
_.forEach(cate, function(val, key) {
skns = skns.concat(',').concat(val.join(','));
});
skns = skns.slice(1);
return API.get('', {
method: 'h5.product.batch',
productSkn: skns
}).then(result => {
if (result.code !== 200) {
return {
code: result.code,
message: result.message
};
}
let productList = utils.processProductList(result.data.product_list);
let data = {};
productList.forEach(product=> {
let skn = product.productSkn;
product.url = helpers.appUrlFormat(product.url, 'go.productDetail', {
product_skn: skn
});
for (let c of cates) {
let index = cate[c].indexOf(skn);
if (index !== -1) {
cate[c].splice(index, 1);
data[c] || (data[c] = []);
data[c].push(product);
break;
}
}
});
// console.log(data.goods1.length)
// console.log(data.goods2.length)
// console.log(data.goods3.length)
return {
code: 200,
data
};
});
};
... ...
... ... @@ -65,15 +65,14 @@ router.get('/invite/getwxinfo', invite.getwxinfo);
router.get('/invite/shareover', invite.shareover);
router.get('/invite/over', invite.over);
// router.use('/vip-day', vipDay.beforeIn);
router.get('/vip-day', vipDay.index);
router.get('/vip-day/crazy-wheel', vipDay.crazyWheel);
router.post('/vip-day/crazy-wheel/award.json', vipDay.wheelResult);
router.post('/vip-day/crazy-luck/award.json', vipDay.luckResult);
router.get('/vip-day/crazy-luck/award-list.json', vipDay.luckResultCollect);
router.get('/vip-day/crazy-luck', vipDay.crazyLuck);
router.post('/vip-day/signin.json', vipDay.signin);
router.post('/vip-day/msg/save.json', vipDay.saveMsg);
router.get('/vip-day/crazy-wheel', vipDay.beforeIn, vipDay.crazyWheel);
router.post('/vip-day/crazy-wheel/award.json', vipDay.beforeIn, vipDay.wheelResult);
router.post('/vip-day/crazy-luck/award.json', vipDay.beforeIn, vipDay.luckResult);
router.get('/vip-day/crazy-luck/award-list.json', vipDay.beforeIn, vipDay.luckResultCollect);
router.get('/vip-day/crazy-luck', vipDay.beforeIn, vipDay.crazyLuck);
router.post('/vip-day/signin.json', vipDay.beforeIn, vipDay.signin);
router.post('/vip-day/msg/save.json', vipDay.beforeIn, vipDay.saveMsg);
router.get('/vip-day/msg/fetch.json', vipDay.fetchMsg);
... ...
{{! header }}
<header class="vip-day-header"></header>
<h4 class="vip-day-slogan">每月28日 尽情釋放</h4>
<div class="vip-day-slogan"></div>
<section class="vip-day-sec qiangjuan">
<ul class="chits">
<li class="chit chit10"></li>
<li class="chit chit30"></li>
<li class="chit chit60"></li>
</ul>
<button class="qiangjuan-foucs" data-toggle="ymodal" data-target="#chit-qcode">立刻关注抢优惠券</button>
<section class="vip-day-sec qiangjuan" id="qiangquan">
<div class="content">
<ul class="chits">
<li class="chit chit10"></li>
<li class="chit chit30"></li>
<li class="chit chit60"></li>
</ul>
<button class="qiangjuan-foucs" data-toggle="ymodal" data-target="#chit-qcode">立刻关注抢优惠券</button>
</div>
</section>
{{! section: 玩转有货币 }}
<section class="vip-day-sec play-coin">
<section class="vip-day-sec play-coin" id="play-coin">
<header class="header">
<h5 class="title">[ 玩转有货币 ]</h5>
<i class="title-pic"></i>
</header>
<ul class="clearfix">
<li class="item item-1 pull-left" id="js-qiandao">
<img class="play-icon-flag" src="{{imgSrc '/img/activity/vip_day/play-icon-1.png'}}" alt="签到福利">
</li>
<li class="item item-2 pull-right">
<a href="/activity/vip-day/crazy-luck">
<img class="play-icon-flag" src="{{imgSrc '/img/activity/vip_day/play-icon-2.png'}}" alt="拼手气">
</a>
</li>
</ul>
<div class="content">
<i class="d-chit-more"></i>
<ul class="clearfix">
<li class="item item-1 pull-left" id="js-qiandao">
<!--<a href="http://m.yohobuy.com/home/mycurrency?openby:yohobuy={'action':'go.h5','params':{'islogin':'Y','url':'http://m.yohobuy.com/home/mycurrency'}}">-->
<img class="play-icon-flag" src="{{imgSrc 'img/activity/vip_day/play-coin-1.png'}}" alt="签到福利">
<!--</a>-->
</li>
<li class="play-coin-div"></li>
<li class="item item-2 pull-right" id="js-game-luck">
<a href='http://m.yohobuy.com/activity/vip-day/crazy-luck?openby:yohobuy={"action":"go.h5","params":{"islogin":"Y","url":"http://m.yohobuy.com/activity/vip-day/crazy-luck"}}'>
<img class="play-icon-flag" src="{{imgSrc 'img/activity/vip_day/play-coin-2.png'}}" alt="拼手气">
</a>
</li>
</ul>
</div>
</section>
{{! section: vip等级加速 }}
<section class="vip-day-sec vip-rocket">
<section class="vip-day-sec vip-rocket" id="vip-rocket">
<header class="header">
<h5 class="title">[ VIP等级加速 ]</h5>
<i class="title-pic"></i>
</header>
<div class="content text-center">
<p>会员日当天消费的会员将获得<strong>翻倍</strong>VIP积分奖励</p>
<button type="button" class="vip-rocket-privilege" data-toggle="ymodal" data-target="#vip-privilege">VIP 专享权</button><br>
<button type="button" class="vip-rocket-buynow">立即买</button>
<div class="content text-center" data-toggle="ymodal" data-target="#vip-privilege">
<i class="vip-rocket-point"></i>
</div>
</section>
{{! section: 会员日专享商品 }}
<section class="vip-day-sec vip-goods">
<section class="vip-day-sec vip-goods" id="vip-goods">
<header class="header">
<h5 class="title">[ 会员日专享商品 ]</h5>
<i class="title-pic"></i>
</header>
<div class="content">
<div class="vip-goods-sec">
{{#each vipgoods}}
<!-- good class 1-->
<h5 class="vip-goods-sec-label">潮牌尖货</h5>
<ul class="vip-goods-list clearfix">
{{#each this}}
<li class="vip-good">
<img class="vip-good-show" src="" alt="">
<div class="vip-good-price">
{{!--
<div class="text-right">
<sup>¥</sup><span>539</span>
</div>
<div class="text-left">
<span class="disable-price">¥539</span>
</div>
--}}
<sup>¥</sup><span>539</span><span class="disable-price">¥539</span>
</div>
<div class="vip-good-bottom">
<h6 class="vip-good-name">The Hundreds</h6>
<button class="vip-good-fav" type="button">马上收藏</button>
</div>
</li>
{{#each goods1}}
{{> vip_day/vip-good}}
{{/each}}
</ul>
<!-- good class 2-->
<h5 class="vip-goods-sec-label">新品示出</h5>
<ul class="vip-goods-list clearfix">
{{#each goods2}}
{{> vip_day/vip-good}}
{{/each}}
</ul>
{{/each}}
<a href="javascript:;" class="vip-goods-more">点击查看更多</a>
<!-- good class 3-->
<h5 class="vip-goods-sec-label">VIP独享</h5>
<ul class="vip-goods-list clearfix">
{{#each goods3}}
{{> vip_day/vip-good}}
{{/each}}
</ul>
<div class="text-center">
<a href="http://sale.yohobuy.com/?channel=&specialsale_id=7?openby:yohobuy={'action':'go.sale','params':{'specialsale_id':'7','channel':''}}" class="vip-goods-more">点击查看更多</a>
</div>
</div>
</div>
</section>
{{! section: 欢乐福利加倍区 }}
<section id="js-msg-sec" class="vip-day-sec">
<section id="js-msg-sec" class="vip-day-sec vip-day-fuli">
<header class="header">
<h5 class="title">[ 欢乐福利加倍区 ]</h5>
<i class="title-pic"></i>
</header>
<div class="content vip-day-msg">
<div class="clearfix">
<div class="mirror" data-toggle="ymodal" data-target="#vipday-msg-input">
<span>填写留言~</span>
<div class="mirror">
<textarea class="vip-msg-content"></textarea>
<button class="vip-msg-send" type="button">写好啦!</button>
</div>
<p class="label">
<strong>写留言去抽奖!</strong>
... ... @@ -101,13 +106,13 @@
</section>
{{! section: 召唤神龙}}
<a href="/activity/invite">
<p class="vip-day-sec friends">"呼朋唤友一起玩!更多福利,欢乐加倍"</p>
<a href="/activity/invite?act_id=29&openby:yohobuy={'action':'go.h5','params':{url:'http://m.yohobuy.com/activity/invite?act_id=29'}}">
<div class="vip-day-sec friends">"呼朋唤友一起玩!更多福利,欢乐加倍"</div>
</a>
{{! footer }}
<footer class="vip-day-footer">
<a href="javascript:;" class="app-download"></a>
<a href="http://www.yohoshow.com/about/index/yohobuyqr/" class="app-download"></a>
</footer>
{{> vip_day/footer-nav }}
... ... @@ -128,8 +133,4 @@
<div class="vh-center ymodal-dialog" data-dismiss="ymodal">
<img src="{{imgSrc 'img/activity/vip_day/privilege.png'}}" alt="VIP 权益">
</div>
</div>
<div class="ymodal" id="vipday-msg-input">
<textarea class="msg-text" placeholder="写些啥呢~"></textarea>
</div>
</div>
\ No newline at end of file
... ...
<nav class="footer-nav">
<ul>
<li data-toggle="ymodal" data-target="#chit-qcode">
<li>
<i class="bg-chit"></i>
<br>
<span>立刻抢券</span>
<a href="#qiangquan"></a>
</li>
<li>
<i class="bg-coin"></i>
<br>
<span>玩转有货币</span>
<a href="#play-coin"></a>
</li>
<li>
<i class="bg-level"></i>
<br>
<span>翻倍升级</span>
<a href="#vip-rocket"></a>
</li>
<li>
<i class="bg-goods"></i>
<br>
<span>专享产品</span>
<a href="#vip-goods"></a>
</li>
<li data-toggle="ymodal" data-target="#vipday-msg-input">
<li>
<i class="bg-fuli"></i>
<br>
<span>福利加倍</span>
<a href="#js-msg-sec"></a>
</li>
</ul>
</nav>
\ No newline at end of file
... ...
<li class="vip-good">
<img class="vip-good-show" src="{{image defaultImages 220 115}}" alt="">
<div class="vip-good-price">
{{!--
<div class="text-right">
<sup>¥</sup><span>539</span>
</div>
<div class="text-left">
<span class="disable-price">¥539</span>
</div>
--}}
{{#if marketPrice}}
<sup>¥</sup><span>{{salesPrice}}</span><span class="disable-price">¥{{marketPrice}}</span>
{{else}}
<sup>¥</sup><span>{{salesPrice}}</span>
{{/if}}
</div>
<div class="vip-good-bottom">
<h6 class="vip-good-name line-clamp-2">{{productName}}</h6>
<button class="vip-good-fav" type="button">马上购买</button>
</div>
<a class="vip-good-link" href="{{url}}"></a>
</li>
\ No newline at end of file
... ...
... ... @@ -84,7 +84,7 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets/',
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
... ... @@ -106,7 +106,7 @@ if (isProduction) {
} else if (isTest) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com for test',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets/',
domains: {
api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
... ...

111 KB | W: | H:

260 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.55 KB | W: | H:

5.39 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.07 KB | W: | H:

4.97 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

170 KB | W: | H:

64.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.63 KB | W: | H:

3.51 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.19 KB | W: | H:

4.56 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.34 KB | W: | H:

4.24 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -8,22 +8,39 @@ require('../common.js');
var yoho = require('../yoho-app');
var share = require('../common/share');
var tip = require('plugin/tip');
window.tip = tip;
var KEY_CODE = {
ENTER: 13
};
var $punch,
$msgRoll, $msgModal, $msg;
var $msgRoll, $msgBox, $msgContent, $msgSend;
var $punch, $punchModal;
function appJump(where, option, checkLogin) {
var $anchor = $(document.createElement('a'));
where = [location.protocol, '//', location.hostname, where].join('');
option.params || (option.params = {});
option.params.url = where;
var $punchModal;
if (checkLogin && !window.getUid()) {
option.params.islogin = 'Y';
} else {
option.params.islogin = 'N';
}
$anchor.attr('href', [where, '?openby:yohobuy=', JSON.stringify(option)].join(''));
// alert($anchor.attr('href'))
$anchor.appendTo('body');
$anchor[0].click();
$anchor.delay(2000).remove();
}
var page = {
init: function() {
yoho.checkLogin();
this.domInit();
this.bindEvents();
... ... @@ -40,64 +57,91 @@ var page = {
$punch = $('#js-qiandao');
$punchModal = $('#qiandao-modal');
$msgRoll = $('.vip-day-msg-input');
$msgModal = $('#vipday-msg-input');
$msg = $msgModal.find('.msg-text');
$msgBox = $('.vip-day-fuli');
$msgContent = $msgBox.find('.vip-msg-content');
$msgSend = $msgBox.find('.vip-msg-send');
},
bindEvents: function() {
var self = this;
$punch.on('click', $.proxy(this.punchFuli, this));
$msgModal
.on('shown.yoho.modal', function() {
yoho.checkLogin();
$msg.focus();
})
.on('keydown', '.msg-text', function(event) {
var textArea = event.target;
var content = $.trim(textArea.value);
$msgSend
.on('click', function() {
if (yoho.isApp && !yoho.getUid()) {
appJump('http://m.yohobuy.com/signin.html', {
action: 'go.weblogin',
params: {
jumpurl: {
url: 'http://m.yohobuy.com/activity/vip-day'
}
}
});
return false;
}
var content = $.trim($msgContent.val());
if (content.length && event.which === KEY_CODE.ENTER) {
if (content.length) {
event.preventDefault();
self.leaveMsg(content);
}
})
.on('hiden.yoho.modal', function() {
$msg.val('');
});
},
// 签到福利
punchFuli: function() {
yoho.checkLogin();
$.post('/activity/vip-day/signin.json').done(function(res) {
if (res.code !== 200) {
tip.show(res.message || '签到失败');
return;
if (yoho.isApp && !yoho.getUid()) {
appJump('http://m.yohobuy.com/signin.html', {
action: 'go.weblogin',
params: {
jumpurl: {
url: 'http://m.yohobuy.com/activity/vip-day'
}
}
});
return false;
}
$.post('/activity/vip-day/signin.json?app_version=1&uid=' + yoho.getUid()).done(function(res) {
if (res.code !== 200) {
tip.show(res.message || '签到失败');
if (res.redirect) {
location.href = res.redirect;
}
return;
}
$punchModal.yModal('show');
})
$punchModal.yModal('show');
})
.fail(function() {
tip.show('签到失败 >_<');
});
},
leaveMsg: function(content) {
$.post('/activity/vip-day/msg/save.json', {
content: content
})
console.log('hi')
$.post('/activity/vip-day/msg/save.json?app_version=1&uid=' + yoho.getUid(), {
content: content
})
.done(function(res) {
if (res.code !== 200) {
tip.show('留言失败~稍后再试');
return;
}
$msgModal.yModal('hide');
if (res.data === 1) {
tip.show('恭喜你~获得一次疯狂大转盘抽奖机会');
setTimeout(function() {
if (yoho.isApp) {
return appJump('/activity/vip-day/crazy-wheel', {
action: 'go.h5',
params: {
url: '/activity/vip-day/crazy-wheel'
}
}, true);
}
window.location = '/activity/vip-day/crazy-wheel';
}, 2000);
return;
... ... @@ -111,7 +155,7 @@ var page = {
},
fetchMsg: function() {
$.get('/activity/vip-day/msg/fetch.json')
$.get('/activity/vip-day/msg/fetch.json?app_version=1&uid=' + yoho.getUid())
.done(function(res) {
if (res.code !== 200) {
// TODO return;
... ... @@ -132,8 +176,8 @@ var page = {
$fragClone = $frag.clone();
$msgRoll
.append($frag, $frag.clone())
.css({ visibility: 'visible' });
.append($frag, $frag.clone());
// .css({ visibility: 'visible' });
var oneMsgH, onePageH;
... ...
... ... @@ -2,7 +2,7 @@
'use strict';
require('plugin/modal.alert');
require('../common');
require('../yoho-app').checkLogin();
var yoho = require('js/yoho-app');
var tip = require('plugin/tip');
var Game = require('./vip_day/game');
... ... @@ -17,7 +17,7 @@ function coinNumReadable(coin) {
}
function getAwards($container) {
$.get('/activity/vip-day/crazy-luck/award-list.json')
$.get('/activity/vip-day/crazy-luck/award-list.json?app_version=1&uid=' + yoho.getUid())
.done(function(res) {
if (res.code !== 200) {
return tip.show('获取失败,稍后再试..');
... ... @@ -47,7 +47,7 @@ $(function() {
var $awardsModal = $('#js-awards');
var $awardsList = $awardsModal.find('.ymodal-body');
var game = new Game('#js-stage', {
url: '/activity/vip-day/crazy-luck/award.json',
url: '/activity/vip-day/crazy-luck/award.json?app_version=1&uid=' + yoho.getUid(),
prize_type: 1,
awards: [20, 2000, 100, 50, 200, 5000, 0, 10000],
cost: 20
... ...
... ... @@ -2,7 +2,7 @@
'use strict';
require('plugin/modal.alert');
require('../common');
require('../yoho-app').checkLogin();
var yoho = require('js/yoho-app');
var Game = require('./vip_day/game');
window.$ = $;
... ... @@ -10,7 +10,7 @@ window.$ = $;
$(function() {
var $gameNotify = $('#js-game-notify');
var game = new Game('#js-stage', {
url: '/activity/vip-day/crazy-wheel/award.json',
url: '/activity/vip-day/crazy-wheel/award.json?app_version=1&uid=' + yoho.getUid(),
awards: [50, 5, 10, 100, 20, 28, 1, 80]
});
... ...
... ... @@ -11,7 +11,7 @@
var tip = require('./plugin/tip');
/* 空方法 */
var emptyFn = function() {};
var emptyFn = function() { };
/* 提示信息 */
var tipInfo = '暂不支持,请在YOHO!BUY应用中打开';
... ... @@ -73,18 +73,13 @@ var yoho = {
}, 500);
},
/**
* 判断是否登录并跳转app对应登录
*/
checkLogin: function() {
var url = window.location.protocol + '//m.yohobuy.com/signin.html?refer=' + encodeURIComponent(window.location.href) + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http://m.yohobuy.com/activity/vip-day"}}}';
if (!window.getUid()) {
$('body').append('<a href=\'' + url +'\' style="display:none;" id="collocation-link">' +
'<span class="collocation-link"></span></a>');
$('.collocation-link').click();
getUid: function() {
if (window.queryString.app_version) {
return window.queryString.uid;
}
},
return window.getUid() || 0;
}
};
module.exports = yoho;
... ...
.vip-day.entry {
background-color: #f2613c;
background-color: #262992;
}
.vip-day-header {
background: resolve("activity/vip_day/activity.png");
background-size: cover;
height: 362px;
box-shadow: 0 4px 25px rgba(0, 0, 0, 0.28);
background-size: 100% 100%;
height: 466px;
/*box-shadow: inset -6px -6px 7px rgba(15, 5, 10, 0.32);*/
}
.vip-day-footer {
position: relative;
height: 451px;
height: 466px;
background: resolve("activity/vip_day/foot-app.png");
background-size: cover;
margin-bottom: 116px;
... ... @@ -19,74 +19,56 @@
.app-download {
position: absolute;
right: 45px;
bottom: 187px;
width: 176px;
height: 54px;
bottom: 185px;
width: 169px;
height: 52px;
}
}
.vip-day-slogan {
width: 310px;
margin: 30px auto 28px;
border: 2PX solid #fff;
font-size: 28px;
line-height: 45px;
color: #fff;
font-weight: bold;
text-align: center;
height: 107px;
background: no-repeat center center resolve("activity/vip_day/slogan.png");
background-size: 322px 107px;
}
.vip-day-sec {
margin-left: 19px;
margin-right: 19px;
.header {
position: relative;
height: 80px;
line-height: 80px;
background-color: #000;
text-align: center;
&:after {
position: absolute;
top: 50%;
left: 50%;
content: "";
width: 680px;
height: 1PX;
margin-left: -340px;
background-color: #fff;
}
.title-pic {
display: inline-block;
background-repeat: no-repeat
}
.title {
.header {
position: relative;
z-index: 1;
display: inline-block;
padding-left: 20px;
padding-right: 20px;
font-size: 42px;
color: #fff;
background-color: #000;
text-align: center;
}
.content {
position: relative;
background-color: #fff;
overflow: hidden;
padding-left: 15px;
padding-right: 15px;
border-radius: 16px;
box-shadow: inset -6px -6px 7px rgba(15, 5, 10, 0.32);
&:after,
&:before {
display: table;
content: '';
clear: both;
}
}
}
.vip-day {
/* 福利: 抢券 */
.qiangjuan {
padding-top: 35px;
margin-bottom: 65px;
text-align: center;
background-color: #fff;
.chits {
margin-top: 31px;
margin-bottom: 25px;
overflow: hidden;
}
... ... @@ -113,77 +95,116 @@
font-size: 34px;
background-color: #000;
color: #fff;
box-shadow: 4px 4px #f2613c;
box-shadow: 8px 8px #929191;
border-radius: 16px;
margin-bottom: 40px;
}
/* 福利: 玩转有货币 */
.play-coin {
margin-bottom: 60px;
.d-chit-more {
display: inline-block;
position: absolute;
left: 23px;
top: -60px;
width: 140px;
height: 90px;
background: no-repeat center center url("/activity/vip_day/chit-more.png");
}
ul {
position: relative;
margin-top: 50px;
margin-bottom: 30px;
}
.title-pic {
width: 243px;
height: 109px;
background-image: url("/activity/vip_day/play-coin-txt.png");
}
.item {
width: 355px;
padding-top: 20px;
padding-bottom: 25px;
width: 50%;
text-align: center;
background-color: #fff;
}
}
.play-coin-div {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 50%;
width: 4px;
margin-left: -2px;
background-color: #e95d3f;
}
.play-icon-flag {
width: 204px;
height: 190px;
width: 218px;
height: 170px;
}
/* VIP 等级加速 */
.vip-rocket {
margin-bottom: 30px;
p {
font-size: 24px;
font-weight: bold;
margin-top: 25px;
margin-bottom: 30px;
.title-pic {
width: 223px;
height: 103px;
background-image: url('/activity/vip_day/vip-boot.png');
}
strong {
font-size: 48px;
.content {
height: 224px;
background: no-repeat center center resolve('activity/vip_day/vip-boot-pic.png');
background-size: 100% 100%;
}
button {
width: 190px;
height: 54px;
}
}
.vip-rocket-privilege {
margin-bottom: 20px;
background-color: #000;
color: #fff;
}
.vip-rocket-buynow {
margin-bottom: 40px;
border: 2PX solid #000;
background-color: #fff;
.vip-rocket-point {
position: absolute;
left: 50%;
bottom: -50px;
margin-left: -38px;
width: 76px;
height: 107px;
background: no-repeat center center url('/activity/vip_day/point.png');
}
/* 福利 会员日专享商品 */
.vip-goods {
margin-bottom: 65px;
.title-pic {
width: 330px;
height: 126px;
background-image: url("/activity/vip_day/vip-day-goods.png");
}
}
.vip-goods-sec {
overflow: hidden;
}
.vip-goods-more {
display: block;
margin: 47px auto;
width: 186px;
height: 44px;
line-height: 44px;
background-color: #000;
color: #fff;
box-shadow: 8px 8px #929191;
border-radius: 16px;
}
.vip-goods-sec-label {
width: 200px;
height: 57px;
line-height: 57px;
margin: 50px auto 25px;
background-color: #e95d3f;
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.28);
box-shadow: -4px -4px 4px rgba(0, 0, 0, 0.28);
font-size: 40px;
color: #fff;
text-align: center;
... ... @@ -191,6 +212,7 @@
}
.vip-good {
position: relative;
float: left;
width: 222px;
border: 1PX solid #000;
... ... @@ -201,6 +223,14 @@
}
}
.vip-good-link {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.vip-good-show {
width: 220px;
height: 155px;
... ... @@ -263,6 +293,7 @@
.vip-good-name {
font-size: 20px;
color: #fff;
height: 53px;
}
.vip-good-fav {
... ... @@ -272,68 +303,56 @@
color: #000;
}
.vip-goods-more {
position: relative;
display: block;
width: 245px;
height: 60px;
margin: 56px auto 50px;
line-height: 60px;
font-size: 26px;
text-align: center;
background-color: #e95d3f;
color: #fff;
&:after,
&:before {
content: "";
width: 60px;
height: 4px;
position: absolute;
top: 50%;
margin-top: -2px;
background-color: #e95d3f;
}
&:before {
left: -80px;
}
&:after {
right: -80px;
}
}
/* 福利6: 召唤朋友 */
.friends {
font-size: 36px;
padding-top: 50px;
padding-bottom: 50px;
margin-top: 15px;
margin-bottom: 40px;
color: #fff;
background-color: #000;
text-align: center;
margin-top: 64px;
margin-bottom: 56px;
color: transparent;
height: 297px;
background-image: resolve('activity/vip_day/invite.png');
background-size: 100% 100%;
}
}
/* 福利5: 福利加倍 */
.vip-day-fuli {
.title-pic {
width: 329px;
height: 135px;
background-image: url("/activity/vip_day/happy-fuli.png");
}
}
.vip-day-msg {
padding-top: 15px;
.mirror {
float: left;
width: 400px;
height: 200px;
margin-right: 35px;
color: #fff;
background-color: #000;
color: block;
padding: 5px;
background-color: #e9e9ea;
border-radius: 4px;
}
.vip-msg-content {
display: block;
height: 128px;
background-color: #e9e9ea;
border: none;
outline: none;
width: 100%;
resize: none;
}
span {
display: inline-block;
margin-top: 10px;
margin-left: 10px;
}
.vip-msg-send {
display: block;
height: 42px;
line-height: 42px;
background-color: #e95d3f;
color: #fff;
width: 100%;
border-radius: 8px;
}
.label {
... ... @@ -343,6 +362,7 @@
strong {
font-size: 27px;
color: #e95d3f;
}
}
}
... ... @@ -350,11 +370,11 @@
.vip-day-msg-input {
position: relative;
display: block;
visibility: hidden;
// visibility: hidden;
height: 51PX;
margin-top: 15px;
margin-bottom: 15px;
border: 3PX solid #000;
border: 3PX solid #e9e9ea;
box-sizing: content-box;
overflow: hidden;
... ... @@ -408,20 +428,31 @@
bottom: 0;
left: 0;
z-index: 1;
background-color: #e95d3f;
background-color: #131313;
color: #345abc;
text-shadow: 0px 0px 5px #0919f5;
li {
position: relative;
padding-top: 15px;
float: left;
width: 20%;
height: 115px;
text-align: center;
color: #fff;
a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
i {
display: inline-block;
width: 73px;
height: 48px;
width: 76px;
height: 47px;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
... ...
... ... @@ -36,6 +36,14 @@
text-overflow: ellipsis;
}
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical
}
.vh-center {
text-align: center;
... ...
... ... @@ -49,6 +49,7 @@ module.exports = {
js: path.join(__dirname, './js'),
common: path.join(__dirname, 'js/common'),
plugin: path.join(__dirname, 'js/plugin'),
js: path.join(__dirname, 'js/'),
template: path.join(__dirname, './template')
}
},
... ...