|
|
/* eslint no-unused-vars: ["error", { "args": "none" }]*/
|
|
|
/* eslint-disable no-shadow, camelcase */
|
|
|
'use strict';
|
|
|
const url = require('url');
|
|
|
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');
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -38,49 +40,28 @@ exports.index = (req, res, next) => { |
|
|
res.locals.page = 'vipday_entry';
|
|
|
res.locals.width750 = true;
|
|
|
|
|
|
let cate = {
|
|
|
goods1: [51203592, 51228151, 51315660],
|
|
|
goods2: [51338322, 51299644, 51344316],
|
|
|
goods3: [51374524, 51333192, 51311138]
|
|
|
};
|
|
|
|
|
|
res.render('vip_day/index', {
|
|
|
pageStyle: 'vip-day entry',
|
|
|
goods1: [{
|
|
|
skn: 51281322,
|
|
|
link: 'http://item.yohobuy.com/product/pro_479436_600840/MADNESSNAPOXFORDSHIRTOSD006_NV.html?from=search-s-51281322_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51281322"}}',
|
|
|
label: '余文乐同款MADNESS NAPOXFORD'
|
|
|
}, {
|
|
|
skn: 51228151,
|
|
|
link: 'http://item.yohobuy.com/product/pro_416307_697688/SMGOBLIQUEZIPPERJACKETJ1609Hei.html?from=search-s-51228151_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51228151"}}',
|
|
|
label: '林俊杰同款SMG Oblique Zipper Jacket 斜拉链丹宁夹克'
|
|
|
}, {
|
|
|
skn: 51315660,
|
|
|
link: 'http://item.yohobuy.com/product/pro_513734_640162/AKOPChangXiuTXuAKOPA603LT03.html?from=search-s-51315660_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51315660"}}',
|
|
|
label: '韩火火同款AKOP. 插肩长袖T恤',
|
|
|
}],
|
|
|
goods2: [{
|
|
|
skn: 51338322,
|
|
|
link: 'http://item.yohobuy.com/product/pro_536266_665692/IZZUEIZXJKJ7501F67WOMENJACKETS.html?from=sale-s-7_1_12&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51338322"}}',
|
|
|
label: 'izzue 磨毛短款牛仔夹克'
|
|
|
}, {
|
|
|
skn: 51299644,
|
|
|
link: 'http://item.yohobuy.com/product/pro_497636_622252/ONITSUKATIGERMEXICO66XiuXianYunDongXieDL4081659.html?from=sale-s-7_1_29&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51299644"}}',
|
|
|
label: 'Onitsuka Tiger MEXICO 66 女 休闲运动鞋'
|
|
|
}, {
|
|
|
skn: 51344316,
|
|
|
link: 'http://item.yohobuy.com/product/pro_530006_658340/LEVIQuanS519LINE8WuDaiKuanNiuZaiKu187200012HeiSe.html?from=sale-s-7_1_8&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51344316"}}',
|
|
|
label: 'Levi’s Line8系列 519 女士窄脚修身牛仔裤'
|
|
|
}],
|
|
|
goods3: [{
|
|
|
skn: 51374524,
|
|
|
link: 'http://item.yohobuy.com/product/pro_570070_704384/STAYREALShuGeZiLianMaoChenShanUS16010K1.html?from=sale-s-7_1_3&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51374524"}}',
|
|
|
label: 'STAYREAL 数格子连帽衬衫',
|
|
|
}, {
|
|
|
skn: 51333192,
|
|
|
link: 'http://item.yohobuy.com/product/pro_531262_660006/PHANTACIChenShanPH16PS28G.html?from=search-s-51333192_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51333192"}}',
|
|
|
label: 'PHANTACi FANTASY LONG SHIRT-Green'
|
|
|
}, {
|
|
|
skn: 51311138,
|
|
|
link: 'http://item.yohobuy.com/product/pro_509230_635258/OVKLABBangQiuMaoOVKA6FWBP88BKX.html?from=sale-s-7_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"51311138"}}',
|
|
|
label: 'OVKLAB 图案字母刺绣棒球帽'
|
|
|
}]
|
|
|
});
|
|
|
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) => {
|
...
|
...
|
@@ -94,6 +75,7 @@ exports.crazyWheel = (req, res, next) => { |
|
|
|
|
|
vipDayModel.getJoinNum(1).then(result => {
|
|
|
res.render('vip_day/crazy_wheel', {
|
|
|
title: '会员日-疯狂大转盘',
|
|
|
pageStyle: 'vip-day game',
|
|
|
isWheel: true,
|
|
|
joinNum: result && result.data || 0,
|
...
|
...
|
@@ -113,6 +95,7 @@ exports.crazyLuck = (req, res, next) => { |
|
|
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),
|
...
|
...
|
@@ -202,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: '有货币不够...' };
|
|
|
}
|
...
|
...
|
|