Authored by 郝肖肖

'有赚列表'

... ... @@ -5,6 +5,24 @@ const headerModel = require('../../../doraemon/models/header');
* 有货-有赚
*/
class HaveGain {
// 列表
index(req, res, next) {
return req.ctx(haveGainModel).index({}).then(result => {
return res.render('have-gain/index', {
module: 'activity',
page: 'have-gain-index',
width750: true,
localCss: true,
title: '有货有赚',
result,
pageHeader: headerModel.setNav({
navTitle: '有货有赚',
navBtn: false
}),
});
}).catch(next);
}
// 申请开通
apply(req, res) {
return res.render('have-gain/apply', {
... ... @@ -20,6 +38,24 @@ class HaveGain {
});
}
// 审核中
verify(req, res, next) {
return req.ctx(haveGainModel).index({}).then(result => {
return res.render('have-gain/verify', {
module: 'activity',
page: 'have-gain-verify',
width750: true,
localCss: true,
title: '有货有赚',
result,
pageHeader: headerModel.setNav({
navTitle: '有货有赚',
navBtn: false
}),
});
}).catch(next);
}
submitApply(req, res, next) {
let uid = req.user.uid;
... ...
'use strict';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
index(params) {
return Promise.resolve(params);
}
submitApply(params) {
let options = {
data: {
... ...
... ... @@ -330,7 +330,9 @@ router.get('/grade/droit', auth, grade.droit); // 权益说明
router.get('/grouth-new/init', auth, grouthNew.grouthInit); // 成长值初始化
router.get('/have-gain/apply', auth, haveGain.apply); // 有货有赚
router.get('/have-gain/index', auth, haveGain.index); // 有货有赚列表
router.get('/have-gain/apply', auth, haveGain.apply); // 有货有赚申请
router.get('/have-gain/verify', auth, haveGain.verify); // 有货有赚审核趾
router.post('/have-gain/submitApply', auth, haveGain.submitApply); // 有货有赚-申请开通
module.exports = router;
... ...
<div class="have-gain-index">
<div class="have-gain-item">
<div class="item-img">
<img class="lazy" data-original="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp" src="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp">
</div>
<div class="item-footer">
<div class="eps es-left">
<span class="num">7637321</span>
<span class="people">参与人数</span>
</div>
<div class="eps">
<span class="num">7637321</span>
<span class="people">获得优惠券</span>
</div>
<div class="eps">
<div class="accede-btn">立即加入</div>
</div>
</div>
</div>
<div class="have-gain-item">
<div class="item-img">
<img class="lazy" data-original="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp" src="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp">
</div>
<div class="item-footer">
<div class="eps">
邀请好友购物返现金
</div>
<div class="eps">
<div class="accede-btn">立即加入</div>
</div>
</div>
</div>
<div class="have-gain-item">
<div class="item-img">
<img class="lazy" data-original="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp" src="//img10.static.yhbimg.com/article/2017/06/20/12/01a50a1f45b97365e758d6890858998310.jpg?imageView2/2/w/690/h/430/q/60/format/webp">
</div>
<div class="item-footer">
<div class="eps es-left">
<span class="num">7637321</span>
<span class="people">参与人数</span>
</div>
<div class="eps">
<span class="num">7637321</span>
<span class="people">获得优惠券</span>
</div>
<div class="eps">
<div class="accede-btn">立即加入</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -23,4 +23,7 @@ class HaveGainApplyPage extends Page {
}
}
export default HaveGainApplyPage;
$(() => {
new HaveGainApplyPage();
});
... ...
import 'activity/have-gain-index.page.css';
import Page from 'yoho-page';
import $ from 'yoho-jquery';
import tip from 'plugin/tip';
class HaveGainIndexPage extends Page {
constructor() {
super();
this.selector = {
$accedeBtn: $('.accede-btn')
};
this.init();
}
init() {
this.bindEvents();
}
bindEvents() {
this.selector.$accedeBtn.on('click', this.tapAccede.bind(this));
}
tapAccede() {
window.location.href = '//m.yohobuy.com/activity/have-gain/apply';
}
apply() {
return this.ajax({
url: '/activity/grade/graph'
}).then(res => {
if (res.code !== 200) {
return tip.show(res.message);
}
});
}
}
$(() => {
new HaveGainIndexPage();
});
... ...
import 'activity/have-gain-verify.page.css';
import Page from 'yoho-page';
import $ from 'yoho-jquery';
import tip from 'plugin/tip';
class HaveGainVerifyPage extends Page {
constructor() {
super();
this.view = {
header: $('.user-defined-header')
};
}
apply() {
return this.ajax({
url: '/activity/grade/graph'
}).then(res => {
if (res.code !== 200) {
return tip.show(res.message);
}
});
}
}
$(() => {
new HaveGainVerifyPage();
});
... ...
.have-gain-index {
background-color: #f0f0f0;
.have-gain-item {
padding: 30px;
margin-bottom: 20px;
background-color: #fff;
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
height: 120px;
margin-bottom: -30px;
.es-left {
padding-left: 20px;
}
.eps {
font-family: PingFangSC-Regular, sans-serif;
font-size: 28px;
color: #444;
span {
display: block;
}
.num {
font-family: SanFranciscoText-Medium, sans-serif;
font-size: 32px;
color: #444;
}
.people {
font-family: PingFangSC-Regular, sans-serif;
font-size: 24px;
color: #b0b0b0;
}
.accede-btn {
font-family: PingFang-SC-Medium, sans-serif;
font-size: 28px;
color: #444;
letter-spacing: 0;
border: 1px solid #444;
border-radius: 4px;
padding: 10px 30px;
}
}
}
}
... ...