Authored by zzzzzzz

添加人数接口,新增分享

... ... @@ -52,9 +52,12 @@ exports.crazyWheel = (req, res, next) => {
return res.redirect('/activity/vip-day');
}
res.render('vip_day/crazy_wheel', {
pageStyle: 'vip-day game',
isWheel: true
vipDayModel.getJoinNum(1).then(result => {
res.render('vip_day/crazy_wheel', {
pageStyle: 'vip-day game',
isWheel: true,
joinNum: result && result.data || 0,
});
});
};
... ... @@ -65,15 +68,16 @@ exports.crazyLuck = (req, res, next) => {
res.locals.page = 'vipday_luck';
res.locals.width750 = true;
vipDayModel.getCoins(uid)
.then(result => {
res.render('vip_day/crazy_luck', {
pageStyle: 'vip-day game',
isLuck: true,
coin: result.data.total > 9999 ? (result.data.total / 10000).toFixed(2) + '万' : result.data.total
});
})
.catch(next);
co(function* (){
let coins = yield vipDayModel.getCoins(uid);
let joinNum = yield vipDayModel.getJoinNum(2);
res.render('vip_day/crazy_luck', {
pageStyle: 'vip-day game',
isLuck: true,
coin: coins && coins.data && (coins.data.total > 9999 ? (coins.data.total / 10000).toFixed(2) + '万' : coins.data.total),
joinNum: joinNum && joinNum.data || 0,
});
})().catch(next);
};
... ...
... ... @@ -60,3 +60,13 @@ exports.getCoins = uid => {
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
exports.getJoinNum = prize_type => {
const url = '/activity/UserdayPrizeLogController/queryPrizeLogNum';
return serviceAPI.get(url, {
prize_type,
});
}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@
</div>
<div class="info-item player-num">
<div>
已有:<span id="player-num" class="player-num-val">12345</span>
已有:<span id="player-num" class="player-num-val">{{joinNum}}</span>
</div>
<span>参加抽奖</span>
</div>
... ...
... ... @@ -3,7 +3,7 @@
{{> vip_day/game-main}}
<div class="info">
<div class="info-item">
已有<span class="game-val game-rect">29870</span>人参与抽奖
已有<span class="game-val game-rect">{{joinNum}}</span>人参与抽奖
</div>
</div>
<div class="explain">
... ...
... ... @@ -30,6 +30,9 @@ var page = {
this.fetchMsg();
share({
title: 'YOHO!BUY有货【会员日】潮集狂欢,限时六大福利,震撼开启,仅此一天,每月28日,尽情释放',
link: location.href,
desc: 'YOHO!BUY',
imgUrl: 'http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png'
});
},
... ...
... ... @@ -26,7 +26,7 @@ if (/MicroMessenger/i.test(navigator.userAgent)) {
cache: true,
success: function() {
$.ajax({
url: '/api/wechat/share/token',
url: '/activity/wechat/share',
data: {
url: location.href
},
... ...