Authored by htoooth

add css

/**
* Created by TaoHuang on 2016/11/30.
*/
'use strict';
const api = require('./detail-product-api');
const type = {
package: 'package', // 套餐
bundle: 'bundle' // 量贩
};
const _getBundle = (data) => {
};
const getPackage = (data) => {
};
module.exports = {
}
... ...
... ... @@ -166,11 +166,17 @@ const _getVipDataByProductBaseInfo = (data, vipLevel, uid) => {
vipData.normalUser = isNormalUser();
if (isVipUser()) {
vipData.prices = data.vip.map(value => ({
price: value.price,
name: value.caption,
cur: detailHelper.vipLevel(value.caption + '会员') === vipLevel
}));
vipData.prices = {};
_.some(data.vip, (vip) => {
if (detailHelper.vipLevel(vip.caption + '会员') === vipLevel) {
vipData.prices = {
price: vip.price,
name: vip.caption,
vipLevel: vipLevel
};
return true;
}
});
}
vipData.vipSchedualUrl = helpers.urlFormat('/home/vip', {
... ... @@ -194,13 +200,8 @@ const _getProductActivityBanner = (additionalData) => {
};
};
const _getActivityDataByProductBaseInfo = (data, additionalData) => {
const _getActivityDataByProductBaseInfo = (data) => {
let result = [];
let activityBanner = _getProductActivityBanner(additionalData);
if (!_.isEmpty(activityBanner)) {
result.push(activityBanner);
}
_.get(data, 'data', []).forEach(value => {
result.push({
... ... @@ -291,6 +292,8 @@ const _getSkuDataByProductBaseInfo = (data) => {
return acc;
}
console.log(cur);
if (cur.images_list) {
// 商品列表
goodsGroup.productSkc = cur.product_skc;
... ... @@ -1174,7 +1177,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
// 促销活动banner,虚拟商品无促销
if (propOrigin('attribute') !== 3) {
result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
result.activity = _getActivityDataByProductBaseInfo(promotionData);
}
// 优惠券
... ...
{{#if activity}}
<ul class="activity">
{{#if_cond activity.length '>=' 3}}
<div class="activity-title">展开全部促销</div>
<div class="activity-container"></div>
{{/if_cond}}
{{#each activity}}
<li>
<li class="activity-item {{#if_cond @index '>=' 3}}hide{{/if_cond}}">
{{#if activityImg}}
<a class="img-link" href="{{url}}">
<img src="{{activityImg}}">
... ...
... ... @@ -4,7 +4,7 @@
{{#each colors}}
<li class="{{#if focus}}focus{{/if}} {{#if disable}}disable{{/if}} pull-left"
title="{{title}}" data-color="{{name}}" data-total="{{total}}">
<img src="{{src}}">
<img src="{{src}}"><span class="color-name">{{name}}</span>
</li>
{{/each}}
</ul>
... ...
<span class="minus-plus pull-left">
<i id="minus-num" class="minus dis iconfont">&#xe60b;</i>
</span>
<span id="num" class="num pull-left">1</span>
<span class="minus-plus pull-left">
<i id="plus-num" class="plus iconfont">&#xe607;</i>
<i id="minus-num" class="minus dis iconfont">&#xe60b;</i>
<i id="plus-num" class="plus iconfont">&#xe607;</i>
</span>
... ...
... ... @@ -27,28 +27,28 @@
{{# vipPrice}}
<span class="vip-price">
{{#if unLogin}}
登录后即可查看vip价格
<a class="login-url" href="{{unLogin}}">立即登录</a>
{{/if}}
{{#if unLogin}}
登录后即可查看vip价格
<a class="login-url" href="{{unLogin}}">立即登录</a>
{{/if}}
{{#if normalUser}}
<span class="vip-price-item">您当前是普通会员,成为VIP享受更多优惠!</span>
<a class="vip-schedual" href="{{vipSchedualUrl}}">查看我的VIP进度</a>
{{/if}}
<div class="vip-level-1"></div>
{{# prices}}
<span class="vip-price-item{{#if cur}} cur{{/if}}">
{{name}}
<em>
{{price}}
</em>
</span>
<span class="vip-level-{{vipLevel}}">
</span>
<em class="cur">
{{price}}
</em>
{{/ prices}}
{{#unless unLogin}}
<a class="vip-schedual" href="{{vipSchedualUrl}}">查看我的VIP进度</a>
{{/unless}}
</span>
</span>
{{/ vipPrice}}
{{#if presalePrice}}
... ...
<div class="chose-size row clearfix">
<span class="title pull-left">
&nbsp;&nbsp;码:
</span>
<span class="title pull-left">&nbsp;&nbsp;码: </span>
<div id="sizes" class="size-wrapper pull-left">
{{#each colors}}
<ul class="size{{#unless focus}} hide{{/unless}}">
{{#each size}}
<li {{#unless num}}class="disable"{{/unless}} data-sku="{{sku}}"
data-num="{{num}}" data-name="{{name}}">{{name}}</li>
data-num="{{num}}" data-name="{{name}}" data-title="{{title}}">{{name}}</li>
{{/each}}
{{#unless virtualGoods}}
<span class="size-ruler"></span>
{{/unless}}
<span class="size-warn warn-tip hide">
<i class="iconfont">&#xe61f;</i>
请选择尺码
</span>
<span class="size-warn warn-tip hide"> <i class="iconfont">&#xe61f;</i> 请选择尺码 </span>
</ul>
{{/each}}
... ...
... ... @@ -221,6 +221,7 @@
.login-url,
.cur {
color: #f02200;
font-weight: bold;
}
.vip-price-item {
... ... @@ -232,6 +233,38 @@
text-decoration: underline;
margin-left: 5px;
}
//普通会员
.vip-level-0 {
display: inline-block;
width: 22px;
height: 22px;
background-color: red;
}
// 银卡会员
.vip-level-1 {
display: inline-block;
width: 22px;
height: 22px;
background-color: red;
}
// 金卡会员
.vip-level-2 {
display: inline-block;
width: 22px;
height: 22px;
background-color: red;
}
// 白金会员
.vip-level-3 {
display: inline-block;
width: 22px;
height: 22px;
background-color: red;
}
}
.students-price {
... ... @@ -258,10 +291,24 @@
.activity {
margin-top: 12px;
position: relative;
width: 100%;
li {
line-height: 20px;
}
.activity-title {
height: 22px;
position: absolute;
right: 0;
top: 0;
background-color: red;
}
.activity-container {
position: absolute;
}
}
.small-coupon-list {
... ... @@ -347,6 +394,8 @@
.row {
margin-top: 10px;
border-bottom: 1px solid #eaeceb;
}
.trade-content {
... ... @@ -363,20 +412,26 @@
}
img {
display: block;
height: 36px;
width: 36px;
border: 2px solid #fff;
}
.focus img {
border-color: #222;
float: left;
display: inline-block;
height: 34px;
width: 34px;
}
li {
margin-right: 5px;
margin-bottom: 5px;
cursor: pointer;
border: 2px solid black;
height: 34px;
}
.color-name {
float:left;
height: 34px;
line-height: 34px;
text-align: center;
margin-left: 5px;
margin-right: 5px;
}
}
... ... @@ -391,8 +446,8 @@
li {
float: left;
display: block;
height: 22px;
line-height: 22px;
height: 24px;
line-height: 24px;
margin-right: 5px;
margin-bottom: 5px;
padding: 0 5px;
... ... @@ -450,32 +505,34 @@
.num {
display: block;
width: 38px;
height: 23px;
line-height: 23px;
width: 50px;
height: 25px;
line-height: 25px;
text-align: center;
border: 1px solid #eaeceb;
color: #333;
border: 1px solid black;
color: black;
font-size: 12px;
background: #ebebe4;
margin-left: 5px;
margin-right: 5px;
}
.minus-plus {
display: block;
width: 14px;
height: 23px;
border: 1px solid #eaeceb;
border-left: none;
width: 25px;
height: 25px;
border: 1px solid #b0b0b0;
text-align: center;
cursor: pointer;
background-color: #e0e0e0;
i {
display: block;
width: 13px;
height: 11px;
width: 25px;
height: 25px;
line-height: 8px;
font-size: 12px;
-moz-user-select: none;
color: black;
}
.dis {
... ... @@ -513,6 +570,7 @@
.num-wraper {
position: relative;
border-bottom: 1px solid #eaeceb;
}
$arrowTop: 40px;
... ...