Authored by weiqingting

gerenzhongxin

/**
* 个人中心二维码 controller
* 我的优惠券 controller
* @author: weiqingting<qingting.wei@yoho.cn>
* @date: 2016/05/16
*/
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const helpers = global.yoho.helpers;
const FavoriteModel=require('../models/FavoriteModel');
const index=(req, res, next)=>{
co(function*(){
let page=req.query.page||1;
let type=req.query.type||'product';
let sort=req.query.sort_id||0;
let reduction=req.query.is_reduction||'N';
let promotion=req.query.is_promotion||'N';
let limit=10,data={};
data.tabs= FavoriteModel.getFavoriteTabs(type);
switch(+type){
case 'brand':data.favBrands=yield FavoriteModel.favoriteBrandList(uid,page,limit,type);break;
case 'article':data.favArticles=yield FavoriteModel.favoriteArticleList(uid,udid,page,limit,type);break;
default:data.favProducts=yield FavoriteModel.favoriteProductList(uid,page,limit,type,sort,'N',reduction,promotion);break;
}
res.render("favorite",{
meFavoritePage:true,
meFavorite:data
});
})();
}
module.exports ={
index
}
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const RedenvelopesModel = require('../models/RedenvelopesModel');
const index = (req, res, next)=>{
let $uid = '8041246';// req.user.uid;
let $udid = 'abcdrf';// req.sessionID;
co(function*(){
let result = yield RedenvelopesModel.redenvelopesList($uid);
res.render('Redenvelopes',{
meRedEnvelopes:result
});
})().catch(next);
};
module.exports = {
index
};
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
let CouponsModel=require('../models/CouponsModel');
const helpers = global.yoho.helpers;
const index=(req,res,next)=>{
let uid='8041246';
let type=req.query.type||CouponsModel.UNUSED;
let page='';
let limit='';
co(function*(){
let coupons= yield CouponsModel.getCouponsList(uid,type,page,limit);
let data={};
data.pager={
hasCheckAll:false,
count:coupons.pager.total||0,
curPage:coupons.pager.page||0,
totalPages:coupons.pager.pageTotal||0
};
if(type===CouponsModel.UNUSED){
if(!coupons.list.length){
data.unUseCoupons={empty:'您没有优惠券'};
}else{
data.unUseCoupons=coupons.list;
}
data.unUse=true;
}else if(type===CouponsModel.USED){
if(!coupons.list.length){
data.usedCoupons={empty:'您没有优惠券'};
}else{
data.usedCoupons=coupons.list;
}
data.used=true;
}
else if(type===CouponsModel.INVALID){
if(!coupons.list.length){
data.noValidCoupons={empty:'您没有优惠券'};
}else{
data.noValidCoupons=coupons.list;
}
data.noValid=true;
}
data.tabs=[
{
active:type===CouponsModel.UNUSED?true:false,
url:helpers.urlFormat('/home/coupons',{type:CouponsModel.UNUSED}),
name:'未使用优惠券'
},
{
ctive:type===CouponsModel.USED?true:false,
url:helpers.urlFormat('/home/coupons',{type:CouponsModel.USED}),
name:'已使用优惠券'
},
{
ctive:type===CouponsModel.INVALID?true:false,
url:helpers.urlFormat('/home/coupons',{type:CouponsModel.INVALID}),
name:'已失效优惠券'
}
];
res.render("coupons",data);
})();
}
module.exports = {
index
};
... ...
/**
* 个人中心二维码 controller
* @author: weiqingting<qingting.wei@yoho.cn>
* @date: 2016/05/16
*/
'use strict';
const QRcodeModel = require('../models/qrcode');
const helpers = global.yoho.helpers;
exports.QRcode = (req, res, next) => {
let id = req.query.orderCode || 0;
let bg={
'16-1':'//img13.static.yhbimg.com/yhb-img02/2016/07/28/14/02509790c87f7b26fc523fc81cdd2ee684.jpg',
'17-1':'//img13.static.yhbimg.com/yhb-img02/2016/07/28/14/02509790c87f7b26fc523fc81cdd2ee684.jpg',
'16-2':'//img13.static.yhbimg.com/yhb-img02/2016/07/28/14/0243ee8b76d1af13fe546b3538036ab3a9.jpg',
'17-2':'//img13.static.yhbimg.com/yhb-img02/2016/07/28/14/028d1fa99a0a22d882587aa0a309b41637.jpg'
}
let bgkey='16-1',ticktypeName='展览票';
QRcodeModel.getQRcodeData(id,req.user.uid).then((result)=>{
if (result) {
result.ticks = result.ticks.map(item=>{
if (+item.ticket_type === 2) {
item.isgroup = true;
}
return item;
});
if(result.ticks.length){
bgkey=[/月(\d+)/g.exec(result.ticks[0].entrance_time)[1],result.ticks[0].ticket_type].join('-');
ticktypeName=result.ticks[0].ticket_type==='2'?'套票':'展览票';
}
}
let vm = {
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'},{name: '订单中心'}, {name: '查看二维码'}],
qrcodeData: result,
code: id,
bgsrc:bg[bgkey],
ticktypeName:ticktypeName,
returnOrder: helpers.urlFormat('/home/orders')
};
res.render('QRcode', vm);
}).catch(next);
};
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const UserData=require('../models/UserData');
const moment =require('moment');
const helpers = global.yoho.helpers;
const index=(req, res, next)=>{
let uid = '8041246';// req.user.uid;
co(function*(){
let vipInfo=yield UserData.getVIPInfoByUid(uid);
let data=vipInfo.data,proportion='0%';
if(+data.next_need_cost!=0){
proportion=data.current_year_cost*100/data.next_need_cost;
proportion=proportion>100?100:proportion;
proportion=proportion+'%';
}
let remainDays=Math.floor((Date.now()-(+data.vip_end_time)*1000)/86400);
// let preferences={};
// enjoyPreferences=data.enjoy_preferential;
if(data.enjoy_preferential){
data.enjoy_preferential=data.enjoy_preferential.map(function(item,inex){
return {
id:item.id,
favTxt:item.title,
imgType:helpers.https(item.pic),
description:item.description
}
});
}
let vip={
title:data.current_vip_title,
level:data.current_vip_level,
totalCost:(+data.current_total_cost).toFixed(2),
nextTitle:data.next_vip_title,
nextLevel:data.next_vip_level,
nextCost:data.next_need_cost,
enjoyPreferences:data.enjoy_preferential,
yearCost:data.current_year_cost,
upgradeCost:data.upgrade_need_cost,
proportion:proportion,
reach:moment(data.vip_reach_time*1000).format("YYYY-MM-DD"),
start:moment(data.vip_start_time*1000).format("YYYY-MM-DD"),
end:moment(data.vip_end_time*1000).format("YYYY-MM-DD"),
remainDays:remainDays,
platinum:data.upgrade_need_cost>0?false:true,
isVip:data.current_vip_level>0?true:false
}
res.render("vip",vip);
})().catch(next);
}
module.exports = {
index
};
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const UserData=require('./UserData');
const helpers = global.yoho.helpers;
const UNUSED='notuse';
const USED='use';
const INVALID='overtime';
const getCouponsList=(uid,type,page,limit)=>{
return co(function*(){
let couponsInfo= yield UserData.getCouponsList(uid,type,page,limit);
let result=[];
if(!couponsInfo.data.couponList){
return result;
}
let coupons=couponsInfo.data.couponList;
if(coupons){
coupons.forEach(function(item,i){
result[i]={};
result[i].id=item.couponId;
result[i].code=item.couponCode;
// 格式化有效日期 "couponValidity": "2016.03.15-2016.03.31"
let dates=item.couponValidity.split('-');
result[i].beginTime=dates[0].replace('.','-');
result[i].endTime=dates[1].replace('.','-');
if(!item.couponImageUrl){
result[i].img='//static.yohobuy.com/images/v2/activity/default_coupon.jpg';
}else{
result[i].img=item.couponImageUrl;
}
if((item.overTime-Date.now())<259200){
result[i].endSoon=true;
}else{
result[i].endSoon=false;
}
result[i].value=item.couponValue.toFixed(2);
result[i].validity=item.couponValidity;
result[i].useRemark=item.couponDetailInfomation;
if(type===USED){
result[i].orderNum=item.orderCode?item.orderCode:'';
result[i].orderDetailUrl=helpers.urlFormat('/home/orders/detail',{orderCode:item.orderCode||''});
result[i].orderSum=item.orderPrice.toFixed(2)?item.orderPrice:0;
result[i].payment=item.actuallyPaid.toFixed(2)?item.actuallyPaid:0;
let data=result[i].usedTime?moment(result[i].usedTime).format("YYYY-MM-DD"):0;
if(data){
result[i].useTime=new Date(date).getTime();
}else{
result[i].useTime='';
}
}else{
result[i].status=item.isValidity?'可使用' : '已过期';
}
if(item.couponType){
result[i].type=item.couponType;
if(item.couponType==5){
result[i].value='免邮';
}
}
});
}
return {list:result,pager:{
total:couponsInfo.data.total,
pageTotal:couponsInfo.data.totalPageNum,
page:page
}};
})();
}
module.exports = {
getCouponsList,
UNUSED,
USED,
INVALID
};
... ...
'use strict';
const api = global.yoho.API;
const URL_PRODUCT_FAVORITE = 'shops/service/v1/favorite/';
const URL_ARTICLE_FAVORITE = '/guang/api/v1/favorite/';
const URL_ARTICLE_FAVORITE_BRAND = '/guang/service/v2/favorite/toggleBrand';
/**
* 根据uid和商品的id查询是否被用户收藏
* @param int $uid
* @param int $productId
* @param boolean $isOnlyUrl 是否指返回链接
* @return boolean 收藏 true 未收藏 false
*/
const getUidProductFav=(uid,productId,isOnlyUrl)=>{
isOnlyUrl=(isOnlyUrl===undefined)?false:isOnlyUrl;
let options = {
method: 'web.favorite.isFavorite',
id: productId,
uid: uid,
type:'product'
};
return api.get('', options);
}
const getFavoriteProductList = (uid, limit)=>{
let options = {
method: 'web.favorite.product',
uid: uid,
limit: limit
};
return api.get('', options);
};
const redutionCount=(uid)=>{
let options={
method:'web.redution.count',
uid:uid
};
return api.get('',options);
}
module.exports = {
getUidProductFav,
getFavoriteProductList,
redutionCount
};
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const helpers = global.yoho.helpers;
const path=require('path');
const pagerPath = path.join(global.appRoot, '/apps/product/models/public-handler.js');
const pager = require(pagerPath).handlePagerData;
const TABS=[
{type:'product',name:'商品收藏'},
{type:'brand',name:'品牌收藏'},
{type:'article',name:'文章收藏'}
];
const getFavoriteTabs=type=>{
type=type||'product';
return TABS.map((item)=>{
if(item.type===type){
item.active=true;
}
item.url=helpers.urlFormat('/home/favorite',{type:item['type']});
return item;
})
}
const favoriteProductList=(uid,page,limit,type,sort,subscribe,reduction,promotion)=>{
co(function*(){
let data={},product={},result={
sort:{},reduction:{},filter:{},goods:{},pager:{}
};
product=yield FavoriteData.getFavoriteProductList(uid);
if(product.data.category_list){
result.sort=yield getSortInfo(product.data.category_list,sort);
}
result.reduction=yield redutionCount(uid);
let productList=[];
if(product.data.product_list){
product.data.product_list.forEach(function(product){
if(
(reduction==='Y'&&promotion=='Y'&&product.is_price_down=='Y'&&promotion=='Y')||
(sort&&product.category_id==sort)||
(subscribe&&product.is_subscribe_reduction=='Y')||
(reduction=='Y'&&product.is_price_down=='Y')||
(promotion=='Y'&&product.is_join_promotion=='Y')
){
productList.push(product);
}
});
productList=product.data.product_list;
}
if(reduction=='N'&&promotion=='N'){
result.filter={
reductionUrl:helpers.urlFormat('/home/favorite',{is_reduction:'Y'}),
reductionChecked:'',
activityUrl:helpers.urlFormat('/home/favorite',{is_promotion:'Y'}),
activityChecked:''
};
}else
if(reduction=='N'&&promotion=='Y'){
result.filter={
reductionUrl:helpers.urlFormat('/home/favorite',{is_reduction:'Y',is_promotion:'Y'}),
reductionChecked:'',
activityUrl:helpers.urlFormat('/home/favorite',{is_promotion:'Y'}),
activityChecked:''
};
}else
if(reduction=='Y'&&promotion=='N'){
result.filter={
reductionUrl:helpers.urlFormat('/home/favorite',{is_reduction:'Y',is_promotion:'Y'}),
reductionChecked:'',
activityUrl:helpers.urlFormat('/home/favorite',{is_promotion:'Y',is_promotion:'Y'}),
activityChecked:''
}
}else{
result.filter={
reductionUrl:helpers.urlFormat('/home/favorite',{is_reduction:'Y',is_promotion:'Y'}),
reductionChecked:'',
activityUrl:helpers.urlFormat('/home/favorite',{is_promotion:'Y',is_promotion:'Y'}),
activityChecked:''
}
}
let total=productList;
let pageTotal=Math.ceil(total/limit);
result.pager=getPager(page,total,pageTotal);
result.goods=getGoodsInfo(productList,page,limit);
return result;
})();
}
const favoriteBrandList=(uid,page,limit,type)=>{
let result={
brands:{
empty:'您没有收藏品牌',
pager:{}
}
};
let brand=FavoriteData.favoriteBrandData(uid,page,limit);
if(!brand.data||!brand.data.page_total){
return result;
}
if(brand.data.page_total<page){
page=brand.data.page_total;
brand=FavoriteData.favoriteBrandData(uid,page,limit);
}
if(!brand.data.brand_list){
return result;
}
let brands=[];
brand.data.brand_list.forEach((item,i)=>{
brands.push({
id:item.brand_id,
brandOrShopType:item.brandOrShopType||'',
shop_id:item.shop_id||'',
img:helpers.image(item.brand_ico,100,100),
url:helpers.urlFormat('',{shopId:item.shop_id||''},item.brand_domain),
name:item.brand_name,
naCount:item.new_product_num,
colCount:item.brand_favorite_num
});
});
result.brands=brands;
let total=brand.data.total||0;
let pageTotal=brand.data.page_total||0;
page=brand.data.page||0;
result.pager=getPager(page,total,pageTotal);
return result;
}
const favoriteArticleList=(uid,udid,page,limit,type)=>{
let result={articles:[],pager:{}};
let articles=FavoriteData.favoriteArticleData(uid,udid,page,limit);
if(!article.data&&!article.data.data){
article.data.data.forEach((item,i)=>{
result.articles.push({
id:item.id,
name:item.title,
img:helpers.image(item.src,146,96),
desc:item.intro,
url:helpers.urlFormat('/'+item.id+'.html','','guang')
});
});
let total=article.data.total||0;
let pageTotal=article.data.totalPage||0;
let page=article.data.page||0;
result.pager=getPager(page,total,pageTotal);
}else{
result.articles={empty:'你尚未收藏任何文章!'};
}
return result;
}
const getPager=(page,total,totalPage,size,type)=>{
let result={};
if(page&&total&&totalPage){
result={
count:total,
curPage:page,
totalPages:totalPage,
hasCheckAll:true
};
}
return result;
}
const getGoodsInfo=(data,page,limit)=>{
let result=[];
let begin=(page-1)*limit;
if(!data){
data=data.slice(begin,limit);
data.forEach((item,i)=>{
let obj={
skn:item.product_id,
img:helpers.img(item.image,100,100),
name:item.product_name,
url:helpers.getUrlBySkc(item.product_id,item.goodsId,item.cnAlphabet),
price:item.sales_price,
priceDown:item.price_down,
buyNow:helpers.getUrlBySkc(item.product_id,item.goodsId,item.cnAlphabet),
soldOut:item.storage==0?true:'',
hadNoticed:item.is_subscribe_reduction=='Y'?true:'',
count:item.promotion_list?item.promotion_list.length:0
}
if(item.promotion_list){
item.promotion_list.forEach(function(item1){
obj.activites.list.push({
type:item1.promotion_type,
name:item1.promotion_title
});
});
}
result.push(obj);
});
}else{
result={empty:'您没有收藏商品'};
}
return result;
}
const redutionCount=(uid)=>{
return co(function*(){
let result={count:0,url:'/home/favorite/reduction',phone:''};
let data=FavoriteData.redutionCount(uid);
if(data.data.num){
result.count=+data.data.num;
result.phone=data.data.mobile;
}
return result;
})();
}
const getSortInfo=(categoryList,sort)=>{
let result={default:{},all:[]};
let defaultCategory={name:'全部',url:helpers.urlFormat('/home/favorite'),count:0,focus:''};
categoryList.forEach(function(category){
result.all.push({
name:category.category_name,
url:helpers.urlFormat('/home/favorite',{sort_id:category.category_id}),
count:category.num,
focus:category.category_id==sort?true:''
});
defaultCategory.count+=category.num;
defaultCategory.focus=sort==0?true:'';
});
result.all.unshift(defaultCategory);
result.default=result.all.slice(result.all,0,7);
return result;
}
module.exports ={
getFavoriteTabs
}
... ...
'use strict';
const helpers = global.yoho.helpers;
const api = global.yoho.API;
/**
* 获取红包列表
* $uid 用户ID
*/
const getRedenvelopes=uid=>{
let options = {
method: 'app.yoho.redpacketList',
uid: uid
};
return api.get('', options);
}
/**
* 获取红包列表
* uid 用户ID
*/
const getRedenvelopesTotal=uid=>{
let options = {
method: 'app.yoho.redpacketInfo',
uid: uid
};
return api.get('', options);
}
module.exports = {
getRedenvelopes,
getRedenvelopesTotal
};
... ...
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const RedenvelopesData=require('./RedenvelopesData.js');
const redenvelopesList=uid=>{
return co(function*(){
let result={};
let data= yield RedenvelopesData.getRedenvelopesTotal(uid);
if(data.code && data.code==200 && data.data.redpacket_num){
result.money=data.data.redpacket_num;
result.termOfValidity=data.data.useable_time;
}
result.useRemark="1.红包活动,全场通用(预售商品除外);<br>2.结算时折抵现金使用,可以和优惠券叠加使用;<br>3.限有效期内使用,过期清零";
return [result];
})();
}
module.exports = {
redenvelopesList
}
... ...
'use strict';
const api = global.yoho.API;
const privateKeyList={
'android':'fd4ad5fcfa0de589ef238c0e7331b585',
'iphone':'a85bb0674e08986c6b115d5e3a4884fa',
'ipad':'ad9fcda2e679cf9229e37feae2cdcf80',
'web':'0ed29744ed318fd28d2c07985d3ba633',
'h5':'fd4ad5fcfa0de589ef238c0e7331b585'
}
const getVIPInfoByUid = (uid)=>{
let options = {
method: 'app.passport.vip',
uid: uid,
private_key:"0ed29744ed318fd28d2c07985d3ba633"
};
return api.get('', options);
};
const getCouponsList=(uid,type,page,limit)=>{
page=page||1;
type=type||'notuse';
limit=limit||10;
let options = {
method: 'app.coupons.lists',
uid: uid,
type:type,
page:page,
limit:limit
};
return api.get('', options);
}
module.exports = {
getVIPInfoByUid,
getCouponsList
};
... ...
... ... @@ -19,12 +19,16 @@ const returnsController = require(`${cRoot}/returns`);
const IndexController = require(`${cRoot}/Index`);
const CurrencyController = require(`${cRoot}/Currency`);
const personalController = require(`${cRoot}/qrcode`);
const RedenvelopesController=require(`${cRoot}/Redenvelopes`);
const VipController=require(`${cRoot}/vip`);
const FavoriteController=require(`${cRoot}/Favorite`);
const CouponsController=require(`${cRoot}/coupons`);
const homeNav = [
{
title: '交易管理',
subNav: [
{name: '我的订单', href: '/home/orders'},
{name: '我的订单', href: '/home/orders',catchs:['/home/orders','/home/index']},
{name: '我的收藏', href: '/home/favorite'},
{name: '我的YOHO币', href: '/home/currency'},
{name: '我的红包', href: '/home/redenvelopes'},
... ... @@ -57,12 +61,21 @@ const homeNav = [
const getActiveNav=(req)=>{
return homeNav.map((item,index)=>{
item.subNav=item.subNav.map((nav)=>{
if(req.path===nav.href){
nav.active=true;
if(nav.catchs){
console.log(nav.catchs);
if(nav.catchs.indexOf(req.originalUrl)>-1){
nav.active=true;
}
}else{
if(req.originalUrl===nav.href){
nav.active=true;
}
}
nav.href=nav.href.indexOf("http://")>-1?nav.href:helpers.urlFormat(nav.href);
return nav;
});
return item;
});
}
... ... @@ -123,8 +136,14 @@ router.get('/returns', returnsController.index);
router.get('/index', [getCommonHeader, getHomeNav], IndexController.index);
router.get('/currency', CurrencyController.index);
/*我的红包*/
router.get('/redenvelopes',RedenvelopesController.index);
/*我的VIP*/
router.get('/vip',VipController.index);
router.get('/favorite',FavoriteController.index);
router.get('/coupons',CouponsController.index);
module.exports = router;
... ...
<div class="me-coupons-page me-page yoho-page clearfix">
{{> path}}
{{> navigation}}
<div class="me-main">
<div class="coupons{{#if unUse}} un-use-coupons{{/if}}{{#if used}} used-coupons{{/if}}{{#if noValid}} no-valid-coupons{{/if}} block">
<h2 class="title">优惠券</h2>
{{> tabs}}
<p class="coupons-header clearfix">
{{#if unUse}}
<span class="coupons-img">优惠券图片</span>
<span class="value">面值</span>
<span class="term-of-validity">有效期</span>
<span class="use-remark">适用说明</span>
<span class="status">状态</span>
{{/if}}
{{#if used}}
<span class="coupons-img">优惠券图片</span>
<span class="value">面值</span>
<span class="order-num">订单编号</span>
<span class="order-sum">订单金额</span>
<span class="payment">实付金额</span>
<span class="use-time">使用时间</span>
{{/if}}
{{#if noValid}}
<span class="coupons-img">优惠券图片</span>
<span class="value">面值</span>
<span class="term-of-validity">有效期</span>
<span class="use-remark">适用说明</span>
{{/if}}
</p>
{{# unUseCoupons}}
{{#unless empty}}
<div class="coupon">
<div class="coupons-img">
<img src="{{img}}">
</div>
<span class="value">{{value}}</span>
<div class="term-of-validity{{#if endSoon}} end-soon{{/if}}">
{{beginTime}}
-
<br>
{{endTime}}&nbsp;&nbsp;
<br>
<span>即将过期</span>
</div>
<span class="use-remark">{{useRemark}}</span>
<span class="status">{{status}}</span>
</div>
{{/unless}}
{{/ unUseCoupons}}
{{# usedCoupons}}
{{#unless empty}}
<div class="coupon">
<div class="coupons-img">
<img src="{{img}}">
</div>
<span class="value">{{value}}</span>
<span class="order-num"><a href="{{orderDetailUrl}}">{{orderNum}}</a></span>
<span class="order-sum">{{orderSum}}</span>
<span class="payment">{{payment}}</span>
<span class="use-time">{{useTime}}</span>
</div>
{{/unless}}
{{/ usedCoupons}}
{{# noValidCoupons}}
{{#unless empty}}
<div class="coupon">
<div class="coupons-img">
<img src="{{img}}">
</div>
<span class="value">{{value}}</span>
<div class="term-of-validity{{#if endSoon}} end-soon{{/if}}">
{{beginTime}}
-
<br>
{{endTime}}&nbsp;&nbsp;&nbsp;
</div>
<span class="use-remark">{{useRemark}}</span>
</div>
{{/unless}}
{{/ noValidCoupons}}
{{#if unUseCoupons}}
{{#unless unUseCoupons.empty}}
{{> pager}}
{{^}}
{{#with unUseCoupons}}
{{> empty}}
{{/with}}
{{/unless}}
{{/if}}
{{#if usedCoupons}}
{{#unless usedCoupons.empty}}
{{> pager}}
{{^}}
{{#with usedCoupons}}
{{> empty}}
{{/with}}
{{/unless}}
{{/if}}
{{#if noValidCoupons}}
{{#unless noValidCoupons.empty}}
{{> pager}}
{{^}}
{{#with noValidCoupons}}
{{> empty}}
{{/with}}
{{/unless}}
{{/if}}
</div>
{{> help-us}}
</div>
</div>
... ...
{{> layout/header}}
<div class="me-favorite-page me-page yoho-page clearfix">
{{# meFavorite}}
{{> path}}
{{> navigation}}
<div class="me-main">
{{# meFavorite}}
<div class="favorite block{{#if favProducts}} fav-products{{/if}}{{#if favBrands}} fav-brands{{/if}}{{#if favArticles}} fav-articles{{/if}}">
<h2 class="title"></h2>
{{> tabs}}
... ... @@ -16,13 +15,11 @@
{{> favorite/article}}
</div>
{{/meFavorite}}
{{> help-us}}
</div>
{{#if favProducts}}
{{> favorite/price-notice}}
{{/if}}
{{/ meFavorite}}
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="me-coupons-page me-page yoho-page clearfix">
{{# meCoupons}}
{{> path}}
{{> navigation}}
... ... @@ -125,6 +123,4 @@
{{> help-us}}
</div>
{{/ meCoupons}}
</div>
{{> layout/footer}}
... ...
<div class="red-envelopes-page me-page yoho-page clearfix">
{{# meRedEnvelopes}}
{{> path}}
{{> navigation}}
<div class="me-main">
<div class="red-envelopes block">
<h2 class="title">我的红包</h2>
<p class="re-header">
<span>红包金额</span>
<span>有效期</span>
<span>使用说明</span>
</p>
<ul class="red-envelopes-list">
{{#each redEnvelopes}}
<li>
<div class="money">
<span class="re-icon"></span>
¥{{money}}
</div>
<span class="term-of-validity">
{{termOfValidity}}
</span>
<span class="use-remark">
{{{useRemark}}}
</span>
</li>
{{/each}}
</ul>
</div>
{{> help-us}}
</div>
{{/ meRedEnvelopes}}
</div>
... ...
<div class="vip-me-page me-page yoho-page clearfix">
{{> path}}
{{> navigation}}
<div class="me-main">
<div class="my-vip block">
<h2 class="title"></h2>
{{#unless commonVip}}
<div class="vip-level">
<span class="level">您的会员级别:</span>
<div class="vipimg{{level}}"></div>
</div>
<div class="vip-level">
<span class="level">当前可享优惠:</span>
<div class="favimg">
{{#each list}}
<div class="list">
<img src="{{imgType}}" class="imgsrc"/>
<div class="fav-font">{{favTxt}}</div>
</div>
{{/each}}
</div>
</div>
{{/unless}}
<div class="vip-level">
<span class="level">年度累计金额:</span>
<div class="year-amount">
<div class="amount">{{yearCost}}</div>
<span class="ps">VIP金额累计需要订单成功签收且无退换货</span>
{{#if platinum}}
<div class="plalevel"></div>
{{else}}
<div class="amount-length">
<div class="img-length">
<div class="amount-left">
<div class="img-left" style="width:{{proportion}}"></div>
<div class="img-right"></div>
</div>
<div class="letter">
{{yearCost}}/<span class="sum">{{nextCost}}</span>
</div>
</div>
</div>
<div class="change-img{{level}}"></div>
<div class="balance">
<p>还差¥<span class="balan">{{balan}}</span>元就可以升级为{{vipLevel}}</p>
<a href="{{morePreferences}}">更多优惠</a>
</div>
{{/if}}
</div>
</div>
<div class="history">
<div class="level">历史消费总额:
<span class="hisamout">{{totalCost}}</span>
</div>
</div>
<div class="line"></div>
{{#unless commonVip}}
<div class="valid">
<div class="level">当前有效期:</div>
<div class="valid-time">
<div class="time-line"></div>
<div class="time1">
<div class="time1-img"></div>
</div>
<div class="time2">
<div class="time-top">
<span>{{reach}}</span><br>条件达成日期
</div>
<div class="time2-img"></div>
</div>
<div class="time3">
<div class="time-left">
<span>{{valid}}</span><br>生效日期
</div>
<div class="time-right">
<span>{{end}}</span><br>优惠截止日期
</div>
<div class="time3-img">VIP有效期{{remainDays}}天(数字年)</div>
</div>
<div class="time4">
<div class="time-top">
<a href="{{morePreferences}}">延长有效期></a>
</div>
<div class="time4-img"></div>
</div>
</div>
</div>
<div class="line"></div>
{{/unless}}
<div class="doubt">
</div>
</div>
{{> help-us}}
</div>
</div>
... ...

918 Bytes | W: | H:

180 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -257,9 +257,10 @@
@import "consult";
@import "returns";
@import "currency";
/*
@import "red-envelopes";
@import "my-vip";
@import "coupons";
/*
@import "favorite";
@import "user-info";
@import "returns-detail";
... ... @@ -268,4 +269,4 @@
@import "complaints";
@import "message";
@import "message-content";
@import "my-vip"; */
*/
... ...
.vip-me-page {
.title {
background-image: resolve(/home/vip-img/vip-title.png);
background-image: resolve(home/vip-img/vip-title.png);
}
.vip-level {
... ... @@ -9,7 +9,7 @@
}
.level {
margin: 20px 15px 0 40px;
margin: 20px 15px 0 40px;
line-height: 31px;
float: left;
clear: both;
... ... @@ -22,40 +22,40 @@
width: 138px;
height: 31px;
float: left;
background-image: resolve(/home/vip-img/silver-vip.png);
}
background-image: resolve(home/vip-img/silver-vip.png);
}
.vipimg2 {
margin-top: 20px;
width: 138px;
height: 31px;
float: left;
background-image: resolve(/home/vip-img/gold-vip.png);
}
background-image: resolve(home/vip-img/gold-vip.png);
}
.vipimg3 {
margin-top: 20px;
width: 138px;
height: 31px;
float: left;
background-image: resolve(/home/vip-img/platinum-vip.png);
}
background-image: resolve(home/vip-img/platinum-vip.png);
}
.favimg {
float: left;
width: 645px;
margin-top: 20px;
overflow: hidden;
}
}
.list {
.list {
width: 145px;
float: left;
margin: 0 10px 8px 0;
}
}
.imgsrc {
width: 25px;
width: 25px;
float: left;
margin-top: 5px;
}
... ... @@ -79,7 +79,7 @@
float: left;
line-height: 31px;
}
.ps {
margin-left: 30px;
font-size: 14px;
... ... @@ -91,13 +91,13 @@
margin-top: 7px;
width: 160px;
height: 21px;
background-image: resolve(/home/vip-img/platinum.png);
background-image: resolve(home/vip-img/platinum.png);
}
.amount-length {
width: 400px;
height: 15px;
margin-bottom: 5px;
margin-bottom: 5px;
}
.img-length {
... ... @@ -125,7 +125,7 @@
height: 12px;
float: left;
z-index: 10;
background-image: url(/home/vip-img/vip-length-left.png);
background-image: url(home/vip-img/vip-length-left.png);
margin-left: -5px;
}
... ... @@ -140,23 +140,23 @@
.change-img0 {
width: 293px;
height: 18px;
background-image: resolve(/home/vip-img/vip-change1.png);
background-image: resolve(home/vip-img/vip-change1.png);
}
.change-img1 {
width: 293px;
height: 18px;
background-image: resolve(/home/vip-img/vip-change2.png);
background-image: resolve(home/vip-img/vip-change2.png);
}
.change-img2 {
width: 293px;
height: 18px;
background-image: resolve(/home/vip-img/vip-change3.png);
background-image: resolve(home/vip-img/vip-change3.png);
}
.balance {
.balance {
margin-top: 7px;
font-size: 13px;
font-weight: bold;
... ... @@ -202,7 +202,7 @@
clear: both;
width: 720px;
height: 175px;
margin-left: 40px;
margin-left: 40px;
position: relative;
font-size: 14px;
}
... ... @@ -212,13 +212,13 @@
width: 135px;
height: 135px;
border-right: 2px dashed black;
}
}
.time1-img {
margin-top: 95px;
width: 130px;
height: 33px;
background-image: resolve(/home/vip-img/time1.png);
background-image: resolve(home/vip-img/time1.png);
}
.time2 {
... ... @@ -248,7 +248,7 @@
margin-top: 10px;
margin-left: 10px;
line-height: 18px;
span {
font-weight: bold;
}
... ... @@ -301,7 +301,7 @@
background-color: #cda16d;
text-align: center;
}
.time4-img {
margin-top: 65px;
width: 62px;
... ... @@ -327,7 +327,7 @@
.tell {
color: red;
}
.time-line {
position: absolute;
width: 703px;
... ... @@ -337,4 +337,4 @@
}
}
... ...
... ... @@ -19,7 +19,7 @@
width: 33%;
}
}
.money {
color: #d52c29;
font-family:'微软雅黑';
... ... @@ -28,11 +28,10 @@
}
.re-icon {
$img: /home/red-envelopes.png;
display: inline-block;
width: width($img);
height: height($img);
background: url($img);
width: 20px;
height: 18px;
background: resolve(home/red-envelopes.png);
}
.red-envelopes-list {
... ... @@ -63,4 +62,4 @@
line-height: 18px;
}
}
}
\ No newline at end of file
}
... ...