Authored by 郝肖肖

'消费明细类型筛选'

... ... @@ -5,7 +5,7 @@
*/
'use strict';
const meGiftModel = require('../models/me-gift-service');
const meGiftService = require('../models/me-gift-service');
/**
* 礼品卡列表
... ... @@ -17,7 +17,7 @@ exports.index = (req, res, next) => {
page: 'me-gift'
};
req.ctx(meGiftModel).getList(req.query, uid).then(result => {
req.ctx(meGiftService).getList(req.query, uid).then(result => {
responseData.meGiftPage = true;
Object.assign(responseData, result);
res.render('home/gift/me-gift', responseData);
... ... @@ -34,7 +34,7 @@ exports.detail = (req, res, next) => {
page: 'me-gift'
};
req.ctx(meGiftModel).detailList(req.query, uid).then(result => {
req.ctx(meGiftService).detailList(req.query, uid).then(result => {
responseData.meGiftPage = true;
Object.assign(responseData, result);
res.render('home/gift/me-detail', responseData);
... ...
'use strict';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
/**
* [获取礼品卡列表]
* @param {[type]} uid [用户id]
* @param {[type]} status [1-可使用,2-已冻结,3-已过期,4-已用完]
* @return {[type]} [{}]
*/
getList(uid, status) {
let options = {
method: 'app.giftcard.pagelist',
uid: uid,
status: status
};
return this.get({data: options});
}
/**
* [获取礼品卡消费记录]
* @param {[type]} cardCode [礼品卡号]
* @param {[type]} uid [用户id]
* @param {[type]} page [当前页]
* @param {[type]} limit [页大小]
* @return {[type]} [{}]
*/
consumeList(cardCode, uid, page, limit) {
let options = {
method: 'app.giftcard.consumelist',
cardCode: cardCode,
uid: uid,
page: page,
limit: limit
};
return this.get({data: options});
}
/**
* [发送邮箱验证码]
* @param {[type]} email [邮箱]
* @param {[type]} uid [用户id]
* @return {[type]} [{}]
*/
emailCode(email, uid) {
let options = {
method: 'app.giftcard.emailcode',
email: email,
uid: uid
};
return this.get({data: options});
}
/**
* [验证邮箱验证码]
* @param {[type]} uid [用户id]
* @param {[type]} email [邮箱]
* @return {[type]} [{}]
*/
verifyEmail(uid, code) {
let options = {
method: 'app.giftcard.verifyemail',
uid: uid,
code: code
};
return this.get({data: options});
}
/**
* [激活礼品卡]
* @param {[type]} uid [用户id]
* @param {[type]} cardCode [礼品卡卡号]
* @param {[type]} cardPwd [礼品卡卡密]
* @return {[type]} [{}]
*/
activateGift(uid, cardCode, cardPwd) {
let options = {
method: 'app.giftcard.activate',
uid: uid,
cardCode: cardCode,
cardPwd: cardPwd
};
return this.get({data: options});
}
/**
* [检查是否绑定手机号]
* @param {[type]} area [区号]
* @param {[type]} mobile [手机号]
* @return {[type]} [{}]
*/
checkIsCanBind(area, mobile) {
let options = {
method: 'app.passport.checkIsCanBind',
area: area,
mobile: mobile
};
return this.get({data: options});
}
/**
* [发验证码]
* @param {[type]} area [区号]
* @param {[type]} mobile [手机号]
* @return {[type]} [{}]
*/
smsbind(area, mobile) {
let options = {
method: 'app.passport.smsbind',
area: area,
mobile: mobile
};
return this.get({data: options});
}
/**
* [修改绑定的手机号]
* @param {[type]} area [区号]
* @param {[type]} mobile [手机号]
* @param {[type]} code [验证码]
* @param {[type]} uid [用户id]
* @return {[type]} [{}]
*/
changeMobile(area, mobile, code, uid) {
let options = {
method: 'app.passport.changeMobile',
area: area,
mobile: mobile,
code: code,
uid: uid
};
return this.get({data: options});
}
};
... ...
... ... @@ -6,10 +6,12 @@
'use strict';
const Promise = require('bluebird');
const helpers = global.yoho.helpers;
const MeGiftAPi = require('./me-gift-api');
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
this.meGiftAPi = new MeGiftAPi(this.ctx);
}
headTab(params) {
... ...
... ... @@ -41,22 +41,6 @@
<div>2017-12-36</div>
<div class="info-list">消费明细</div>
</div>
<div class="me-gift-tr">
<div>L242353456436456</div>
<div>2000</div>
<div>1980</div>
<div>2017-12-36</div>
<div>2017-12-36</div>
<div class="info-list">消费明细</div>
</div>
<div class="me-gift-tr">
<div>L242353456436456</div>
<div>2000</div>
<div>1980</div>
<div>2017-12-36</div>
<div>2017-12-36</div>
<div class="info-list">消费明细</div>
</div>
<div class="cart-list-empty"></div>
</div>
</div>
... ... @@ -84,7 +68,7 @@
<span class="mobile-area left">
<em>+86</em>
<i class="iconfont">&#xe60b;</i>
<ul class="mobile-area-list">
<ul class="ul-list mobile-area-list">
<li data-cc="+61">澳大利亚 +61</li>
<li data-cc="+82">韩国 +82</li>
<li data-cc="+1">加拿大 +1</li>
... ... @@ -134,10 +118,18 @@
</table>
<div class="me-gift-info-table">
<div class="me-gift-header">
<div class="card-number">时间</div>
<div class="card-price">订单编号</div>
<div class="card-balance">类型</div>
<div class="activate-time">金额()</div>
<div>时间</div>
<div>订单编号</div>
<div>
<span class="gift-filter">
<em class="gift-type">类型</em>
<ul class="ul-list">
<li data-cc="1">消费</li>
<li data-cc="2">退款</li>
</ul>
</span>
</div>
<div>金额()</div>
</div>
<div class="me-gift-tr">
<div>2017-12-21 09:30</div>
... ...
... ... @@ -35,9 +35,9 @@ meGift = {
that.infoList();
});
// 显示手机区号列表
$('body').on('click', '.mobile-area', function() {
$(this).find('.mobile-area-list').toggle();
// 显示手机区号或类型下拉列表
$('body').on('click', '.mobile-area,.gift-filter', function() {
$(this).find('.ul-list').toggle();
});
// 选择手机区号
... ... @@ -46,6 +46,13 @@ meGift = {
$('.mobile-area').find('em').text($li.data('cc'));
});
// 选择类型筛选
$('body').on('click', '.gift-filter ul', function(event) {
var $li = $(event.target).closest('li');
$('.gift-filter').find('em').text($li.text());
});
},
// 我的礼品卡列表
... ...
... ... @@ -167,22 +167,25 @@
border-right: none;
background-color: #fff;
cursor: pointer;
}
.mobile-area-list {
position: absolute;
width: 139px;
margin-left: -35px;
background-color: #fff;
margin-top: -3px;
border: 1px solid #e6e6e6;
display: none;
.ul-list {
position: absolute;
width: 139px;
margin-left: -35px;
background-color: #fff;
margin-top: -3px;
border: 1px solid #e6e6e6;
display: none;
cursor: pointer;
li {
border-bottom: 1px solid #e6e6e6;
li {
border-bottom: 1px solid #e6e6e6;
height: 30px;
line-height: 30px;
&:hover {
color: #4a90e2;
}
&:hover {
color: #4a90e2;
}
}
}
... ... @@ -222,4 +225,20 @@
width: 360px;
}
}
.gift-type {
background: resolve("home/gift-filter.png") no-repeat center;
background-size: 69px 21px;
width: 69px;
height: 21px;
line-height: 21px;
display: inline-block;
cursor: pointer;
}
.gift-filter .ul-list {
width: 69px;
margin-left: 51px;
margin-top: 0;
}
}
... ...