Authored by zzzzzzz

会员日完成

... ... @@ -17,7 +17,7 @@ function humanNum_wan(num) {
}
exports.checkIsStudent = (req, res, next) => {
let uid = req.user.uid;
let uid = req.user.uid || req.query.uid;
vipDayModel.checkIsStudent(uid).then(result => {
res.json(result);
... ... @@ -70,10 +70,10 @@ exports.index = (req, res, next) => {
let isStudent = false;
// 获取学生信息
if (req.user.uid) {
let result = yield vipDayModel.checkIsStudent(req.user.uid);
if (req.user.uid || req.query.uid) {
let result = yield vipDayModel.checkIsStudent(req.user.uid || req.query.uid);
result.data && result.data.isStudent === 1 && (isStudent = true);
result.data && Number(result.data.isStudent) === 1 && (isStudent = true);
}
// 获取商品信息
... ... @@ -151,11 +151,10 @@ exports.signin = (req, res, next) => {
};
exports.wheelResult = (req, res, next) => {
let uid = req.user.uid;
let uid = req.user.uid || req.query.uid;
let prize_type = 3;
return vipDayModel.addPrizeLog(uid, prize_type).then(result => {
console.log(result);
return res.json(result);
}).catch(next);
... ...
... ... @@ -7,7 +7,6 @@
{{! 玩转有货币 }}
<section class="vip-day10-coin" id="play-coin">
<a href='/home/mycurrency{{#if isApp}}?openby:yohobuy={"action":"go.signin"}{{/if}}' class="checkin"></a>
<a href='http://m.yohobuy.com/activity/vip-day10/crazy-luck{{#if isApp}}?openby:yohobuy={"action":"go.h5","params":{"islogin":"Y","url":"http://m.yohobuy.com/activity/vip-day10/crazy-luck"}}{{/if}}' class="crazy-luck"></a>
</section>
{{! vip翻倍升级}}
... ...
... ... @@ -29,7 +29,6 @@ function appJump(where, option) {
$anchor.delay(2000).remove();
}
var page = {
rollTimer: null,
init: function() {
... ... @@ -62,10 +61,29 @@ var page = {
$student.on('click', '.in-button-bg1', function(e) {
var url;
e.preventDefault();
$.post('/activity/vip-day10/isStudent').done(result => {
if (yoho.isApp) {
url = '/activity/vip-day1028/isStudent?app_version=1&uid=' + (yoho.getUid() || 0);
} else {
url = '/activity/vip-day1028/isStudent';
}
$.post(url).done(result => {
if (result.code === 401) {
window.location = '/signin.html?refer=' + location.href;
if (yoho.isApp && !yoho.getUid()) {
appJump('m.yohobuy.com/signin.html', {
action: 'go.weblogin',
params: {
url: 'http://m.yohobuy.com/signin.html',
jumpurl: {
url: 'http://m.yohobuy.com/activity/vip-day1028'
}
}
});
} else if (!yoho.isApp && !yoho.getUid()) {
window.location = '/signin.html?refer=' + location.href;
}
} else {
$.yAlert({
content: '请至APP“我的”页面,右上角点击“学生认证”进行认证',
... ... @@ -78,15 +96,15 @@ var page = {
$student.on('click', '.in-button-bg2', function(e) {
e.preventDefault();
if (yoho.isApp) {
return appJump('/activity/vip-day10/crazy-wheel', {
return appJump('/activity/vip-day1028/crazy-wheel', {
action: 'go.h5',
params: {
url: 'http://m.yohobuy.com/activity/vip-day10/crazy-wheel',
url: 'http://m.yohobuy.com/activity/vip-day1028/crazy-wheel',
islogin: 'Y'
}
});
}
window.location = '/activity/vip-day10/crazy-wheel';
window.location = '/activity/vip-day1028/crazy-wheel';
});
},
... ... @@ -98,14 +116,14 @@ var page = {
params: {
url: 'http://m.yohobuy.com/signin.html',
jumpurl: {
url: 'http://m.yohobuy.com/activity/vip-day10'
url: 'http://m.yohobuy.com/activity/vip-day1028'
}
}
});
return false;
}
$.post('/activity/vip-day10/signin.json?app_version=1&uid=' + yoho.getUid()).done(function(res) {
$.post('/activity/vip-day1028/signin.json?app_version=1&uid=' + yoho.getUid()).done(function(res) {
if (res.code !== 200) {
tip.show(res.message || '签到失败');
if (res.redirect) {
... ...
... ... @@ -11,7 +11,7 @@ $(function() {
var $gameNotify = $('#js-game-notify');
var $playerNum = $('#js-join-num');
var game = new Game('#js-stage', {
url: '/activity/vip-day10/crazy-wheel/award.json?app_version=1&uid=' + yoho.getUid(),
url: '/activity/vip-day1028/crazy-wheel/award.json?app_version=1&uid=' + yoho.getUid(),
awards: [999, 2, 4, 999, 1, 6, 3, 5]
});
... ...