Authored by zhangxiaoru

Merge branch 'feature/family' of git.yoho.cn:fe/yohobuywap-node into feature/family

... ... @@ -128,7 +128,7 @@ exports.getCity = (req, res, next) => {
}).catch(next);
};
exports.coinMall = (req, res) => {
exports.coinMall = (req, res, next) => {
let responseData = {
module: 'home',
page: 'family-coinMall',
... ... @@ -140,7 +140,15 @@ exports.coinMall = (req, res) => {
localCss: true
};
res.render('family/coin-mall', Object.assign(responseData, ''));
let params = {
uid: req.user.uid,
isMarsApp: req.yoho.isMarsApp,
isNowApp: req.yoho.isNowApp
};
req.ctx(family).coinMall(params).then(result => {
res.render('family/coin-mall', Object.assign(responseData, result));
}).catch(next);
};
exports.getList = (req, res, next) => {
... ...
... ... @@ -620,6 +620,32 @@ class familyModel extends global.yoho.BaseModel {
});
}
coinMall(params) {
return family.get('user/getUserCoin', {
uid: params.uid
}, {
code: 200
}).then(result => {
let resu = {
coinNum: {},
isMarsApp: params.isMarsApp,
isNowApp: params.isNowApp
};
if (_.get(result, 'data.data')) {
_.forEach(result.data.data, (val) => {
let name = this.checkType(parseInt(val.type, 10));
resu.coinNum[name] = {
num: val.num,
source: val.source
};
});
}
return resu;
});
}
checkType(params) {
switch (params) {
case 1:
... ...
<div class="coin-mall-c">
<div class="coin">
<span class="coin-pic"></span>
<span>567890</span>
<div class="coin{{#if isNowApp}} now{{/if}}">
{{#if isNowApp}}
<span class="coin-pic yohonow"></span>
{{else if isMarsApp}}
<span class="coin-pic mars"></span>
{{else}}
<span class="coin-pic yohobuy"></span>
{{/if}}
<span>
{{#if isNowApp}}
{{coinNum/yohonow/num}}
{{else if isMarsApp}}
{{coinNum/mars/num}}
{{else}}
{{coinNum/yohobuy/num}}
{{/if}}
</span>
</div>
<div class="btn-c">
<a>如何获取有货币</a>
<a>有货币明细</a>
{{#if isNowApp}}
<a>如何获取Yoho!Coins</a>
<a>Yoho!Coins明细</a>
{{else if isMarsApp}}
<a>如何获取mars points</a>
<a>mars points明细</a>
{{else}}
<a>如何获取有货币</a>
<a>有货币明细</a>
{{/if}}
</div>
<div class="tab-fixed">
<div class="tab">
... ...
... ... @@ -74,7 +74,7 @@
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}} installment-body{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}">
<body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}} installment-body{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}{{#if @root.isNowApp}} is-now-app{{/if}}">
<div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{{appPath}}}'{{/if}}>
{{#if systemUpdate}}
{{> updata}}
... ...
... ... @@ -17,12 +17,23 @@ html {
.coin-pic {
width: 60px;
height: 60px;
background: resolve("home/family/yoho.png");
display: inline-block;
margin-right: 20px;
background-size: 100% 100%;
}
.coin-pic.yohobuy {
display: none;
}
.coin-pic.yohonow {
background-image: resolve("home/family/yoho.png") !important;
}
.coin-pic.mars {
background-image: resolve("home/family/mars-s.png") !important;
}
.coin-pic-s {
width: 34px;
height: 34px;
... ... @@ -68,7 +79,7 @@ html {
background-color: #fff;
font-size: 50px;
text-align: center;
color: #fece02;
color: #000;
line-height: 160px;
height: 160px;
clear: both;
... ... @@ -77,6 +88,10 @@ html {
align-items: center;
}
.coin.now {
color: #fece02;
}
.btn-c {
background-color: #fff;
padding: 0 44px 60px;
... ... @@ -215,18 +230,10 @@ html {
}
#mars {
.coin {
color: #000;
}
.coin-pic-s {
background-image: resolve("home/family/mars-s.png") !important;
}
.coin-pic {
background-image: resolve("home/family/mars-s.png") !important;
}
.act-item {
.pic {
.level {
... ... @@ -264,3 +271,21 @@ html {
}
}
}
.is-now-app {
#mars-tab {
.go-btn {
background-color: #ccc;
color: #fff;
}
}
}
.is-mars-app {
#yohonow-tab {
.go-btn {
background-color: #ccc;
color: #fff;
}
}
}
... ...
... ... @@ -5,15 +5,16 @@
position: fixed;
bottom: 0;
left: 0;
background-color: #ececec;
background-color: #d2d5da;
border-top: solid 1px #939598;
.swiper-header {
height: 70px;
background-color: #f5f5f5;
background-color: #f0f0f1;
div {
line-height: 70px;
color: #005bff;
color: #3478f6;
font-size: 30px;
padding: 0 20px;
}
... ... @@ -44,7 +45,7 @@
text-align: center;
transform: rotateX(45deg);
-webkit-transform: rotateX(45deg);
color: #cecfcf;
color: #aeb0b5;
font-size: 30px;
display: -webkit-flex;
display: flex;
... ... @@ -58,19 +59,19 @@
.swiper-slide-prev {
transform: rotateX(30deg);
-webkit-transform: rotateX(30deg);
color: #aeb0b1;
color: #888a8e;
}
.swiper-slide-next {
transform: rotateX(30deg);
-webkit-transform: rotateX(30deg);
color: #aeb0b1;
color: #888a8e;
}
.swiper-slide-active {
transform: rotateX(0);
-webkit-transform: rotateX(0);
color: #000;
color: #2a2a2b;
}
.swiper-line {
... ... @@ -78,8 +79,8 @@
top: 50%;
left: 0;
width: 750px;
border-top: solid 1px #bdbdbd;
border-bottom: solid 1px #bdbdbd;
border-top: solid 1px #a8abae;
border-bottom: solid 1px #a8abae;
z-index: -1;
}
}
... ...