Showing
12 changed files
with
933 additions
and
8 deletions
@@ -89,9 +89,27 @@ const detail = (req, res, next) => { | @@ -89,9 +89,27 @@ const detail = (req, res, next) => { | ||
89 | }).catch(next); | 89 | }).catch(next); |
90 | }; | 90 | }; |
91 | 91 | ||
92 | +const gethtml = (req, res, next) => { | ||
93 | + let skn = req.query.skn; | ||
94 | + if (!skn) { | ||
95 | + return next(); | ||
96 | + } | ||
97 | + | ||
98 | + let params = { | ||
99 | + product_skn: skn, | ||
100 | + uid: req.user.uid || 0, | ||
101 | + client_type: 'iphone' // todo | ||
102 | + }; | ||
103 | + | ||
104 | + model.gethtml(params).then((html) => { | ||
105 | + res.send(html); | ||
106 | + }).catch(next); | ||
107 | +} | ||
108 | + | ||
92 | 109 | ||
93 | module.exports = { | 110 | module.exports = { |
94 | list, | 111 | list, |
95 | search, | 112 | search, |
96 | - detail | 113 | + detail, |
114 | + gethtml | ||
97 | }; | 115 | }; |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | const utils = '../../../utils'; | 3 | const utils = '../../../utils'; |
4 | const productProcess = require(`${utils}/product-process`); | 4 | const productProcess = require(`${utils}/product-process`); |
5 | const globalapi = global.yoho.GlobalAPI; | 5 | const globalapi = global.yoho.GlobalAPI; |
6 | +const $ = require('cheerio'); | ||
6 | 7 | ||
7 | exports.list = (param) => { | 8 | exports.list = (param) => { |
8 | return globalapi.get('product/api/v2/detail/getlist', param).then((result) => { | 9 | return globalapi.get('product/api/v2/detail/getlist', param).then((result) => { |
@@ -35,7 +36,58 @@ exports.getBrand = (param) => { | @@ -35,7 +36,58 @@ exports.getBrand = (param) => { | ||
35 | }; | 36 | }; |
36 | 37 | ||
37 | exports.detail = (param) => { | 38 | exports.detail = (param) => { |
38 | - return globalapi.get('product/api/v2/detail/get', param).then((data) => { | ||
39 | - return data.data || {}; | 39 | + return globalapi.get('product/api/v2/detail/get', param).then((result) => { |
40 | + if (!result || !result.data) { | ||
41 | + return {}; | ||
42 | + } | ||
43 | + result = result.data; | ||
44 | + | ||
45 | + let goods = result.goods_list || []; | ||
46 | + if (goods.length === 1) { | ||
47 | + result.bannerTop = { | ||
48 | + img: (goods[0].images_list[0] || {}).image_url | ||
49 | + }; | ||
50 | + } else { | ||
51 | + result.bannerTop = { | ||
52 | + list: goods.map((g) => { | ||
53 | + return { | ||
54 | + img: (g.images_list[0] || {}).image_url | ||
55 | + } | ||
56 | + }) | ||
57 | + } | ||
58 | + } | ||
59 | + | ||
60 | + result.show_final_price = result.formart_final_price; | ||
61 | + if (result.formart_final_price !== result.formart_orign_price) { | ||
62 | + result.show_orign_price = result.formart_orign_price; | ||
63 | + } | ||
64 | + | ||
65 | + result.show_sales_price = result.format_sales_price; | ||
66 | + if (result.format_market_price !== result.format_sales_price) { | ||
67 | + result.show_market_price = result.format_market_price; | ||
68 | + } | ||
69 | + | ||
70 | + if (result.brand_info && result.brand_info.brand_id) { | ||
71 | + result.brand_info.brand_url = `//m.yohobuy.com/product/global/list?brand=${result.brand_info.brand_id}`; | ||
72 | + } | ||
73 | + | ||
74 | + return result; | ||
40 | }); | 75 | }); |
41 | }; | 76 | }; |
77 | + | ||
78 | +exports.gethtml = (param) => { | ||
79 | + return globalapi.get('product/api/v1/detail/gethtml', param,{ | ||
80 | + cache: true | ||
81 | + }).then((result) => { | ||
82 | + result = result || ''; | ||
83 | + result = $.load(result); | ||
84 | + result = result('.good-detail-page'); | ||
85 | + | ||
86 | + return (result.html() || '').replace(/<img src=/g, '<img class="lazy" src="data:image/gif;' + | ||
87 | + 'base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
88 | + ' data-original=').replace(/<img border="0" src=/g, '<img border="0" class="lazy" ' + | ||
89 | + 'src="data:image/gif;base64,' + | ||
90 | + 'R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
91 | + ' data-original='); | ||
92 | + }); | ||
93 | +} |
@@ -206,5 +206,6 @@ router.get('/index/allBrand', newShop.allBrand); // 店铺全部品牌 | @@ -206,5 +206,6 @@ router.get('/index/allBrand', newShop.allBrand); // 店铺全部品牌 | ||
206 | router.get('/global/list', globalPro.list); // 全球购列表页 | 206 | router.get('/global/list', globalPro.list); // 全球购列表页 |
207 | router.get('/global/search', globalPro.search); // 全球购列表页搜索数据 | 207 | router.get('/global/search', globalPro.search); // 全球购列表页搜索数据 |
208 | router.get(/^\/global\/(\d+)\.html/, globalPro.detail); // 全球购店铺详情页 | 208 | router.get(/^\/global\/(\d+)\.html/, globalPro.detail); // 全球购店铺详情页 |
209 | +router.get('/global/gethtml', globalPro.gethtml); // 全球购商品信息 | ||
209 | 210 | ||
210 | module.exports = router; | 211 | module.exports = router; |
apps/product/views/action/global/detail.hbs
0 → 100644
1 | +{{# result}} | ||
2 | +<div id="global-detail-page" class="global-detail-page yoho-page" data-skn="{{product_skn}}"> | ||
3 | + <div class="banner-container"> | ||
4 | + <div class="global-tag"> | ||
5 | + <div class="global-country"> | ||
6 | + {{#isEqualOr is_plane 'Y'}} | ||
7 | + <span class="global-plane"></span> | ||
8 | + {{/isEqualOr}} | ||
9 | + <span>{{country_name}}</span> | ||
10 | + </div> | ||
11 | + {{#isEqualOr is_limited 'Y'}} | ||
12 | + <div class="global-limited"> | ||
13 | + <span>限量</span> | ||
14 | + </div> | ||
15 | + {{/isEqualOr}} | ||
16 | + </div> | ||
17 | + | ||
18 | + {{# bannerTop}} | ||
19 | + {{> detail/banner-swiper-arrow}} | ||
20 | + {{/ bannerTop}} | ||
21 | + </div> | ||
22 | + | ||
23 | + <div class="goods-name"><span class="name">{{product_name}}</span></div> | ||
24 | + | ||
25 | + <div class="price-date"> | ||
26 | + <div> | ||
27 | + <span class="final-price">{{show_final_price}}</span> | ||
28 | + {{# show_orign_price}} | ||
29 | + <span class="orign-price">{{.}}</span> | ||
30 | + {{/ show_orign_price}} | ||
31 | + </div> | ||
32 | + <div> | ||
33 | + <span class="sales-price">当前价:{{show_sales_price}}</span> | ||
34 | + {{# show_market_price}} | ||
35 | + <span class="market-price">原价:{{.}}</span> | ||
36 | + {{/ show_market_price}} | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + | ||
40 | + <div class="country"> | ||
41 | + <span class="country-name">{{country_name}}</span> | ||
42 | + <span class="product-source">{{product_source}}</span> | ||
43 | + </div> | ||
44 | + | ||
45 | + <div class="illustrate"> | ||
46 | + <div class="illustrate-title"></div> | ||
47 | + <div class="illustrate-contents"></div> | ||
48 | + </div> | ||
49 | + | ||
50 | + {{# brand_info}} | ||
51 | + <div class="enter-store"> | ||
52 | + {{#if brand_ico}} | ||
53 | + <a class="store-logo" href="{{brand_url}}"> | ||
54 | + <img class="lazy" src="{{image2 brand_ico w=47 h=47 q=60}}" alt="{{brand_name}}"> | ||
55 | + </a> | ||
56 | + {{/if}} | ||
57 | + <a class="store-name" href="{{brand_url}}">{{brand_name}}</a> | ||
58 | + <a class="store-link" href="{{brand_url}}">进入店铺<span class="iconfont"></span></a> | ||
59 | + </div> | ||
60 | + {{/ brand_info}} | ||
61 | + | ||
62 | + <div class="customer-service"> | ||
63 | + <a href="{{customer_service}}"> | ||
64 | + <span class="customer-name">全球购购物须知</span> | ||
65 | + <span class="customer-link iconfont"></span> | ||
66 | + </a> | ||
67 | + </div> | ||
68 | + | ||
69 | + <div id="productDesc" class="product-desc"></div> | ||
70 | + | ||
71 | + <div class="cart-bar"> | ||
72 | + <a href="javascript:;" class="num-incart iconfont"></a> | ||
73 | + <a href="javascript:;" class="addto-cart add-to-cart-url">下载APP购买</a> | ||
74 | + </div> | ||
75 | +</div> | ||
76 | +{{/ result}} |
1 | +'use strict'; | ||
2 | + | ||
3 | +import { | ||
4 | + Controller | ||
5 | +} from 'yoho-mvc'; | ||
6 | + | ||
7 | +import { | ||
8 | + DetailView | ||
9 | +} from './view'; | ||
10 | + | ||
11 | +import { | ||
12 | + globalSearch as search | ||
13 | +} from '../models'; | ||
14 | + | ||
15 | +class ListController extends Controller { | ||
16 | + constructor() { | ||
17 | + super(); | ||
18 | + | ||
19 | + this.detail = new DetailView(); | ||
20 | + | ||
21 | + this.created(); | ||
22 | + } | ||
23 | + | ||
24 | + created() { | ||
25 | + let skn = this.detail.getSkn(); | ||
26 | + if (!skn) { | ||
27 | + return; | ||
28 | + } | ||
29 | + | ||
30 | + setTimeout(()=> { | ||
31 | + search('//m.yohobuy.com/product/global/gethtml', { | ||
32 | + skn: skn | ||
33 | + }).then((html)=>{ | ||
34 | + this.detail.setDetailHtml(html) | ||
35 | + }) | ||
36 | + }, 500); | ||
37 | + } | ||
38 | +} | ||
39 | + | ||
40 | +module.exports = ListController; |
public/js/product/global-detail/index.js
0 → 100644
public/js/product/global-detail/view.js
0 → 100644
1 | +import { | ||
2 | + View | ||
3 | +} from 'yoho-mvc'; | ||
4 | + | ||
5 | +let Swiper = require('yoho-swiper'); | ||
6 | +let lazyLoad = require('yoho-jquery-lazyload'); | ||
7 | + | ||
8 | +export class DetailView extends View { | ||
9 | + constructor() { | ||
10 | + super('#global-detail-page'); | ||
11 | + | ||
12 | + setTimeout(() => { | ||
13 | + new Swiper('.banner-swiper', { | ||
14 | + preloadImages: false, | ||
15 | + lazyLoading: true, | ||
16 | + lazyLoadingInPrevNext: true, | ||
17 | + lazyLoadingOnTransitionStart: true, | ||
18 | + paginationClickable: true, | ||
19 | + pagination: '.banner-top .pagination-inner', | ||
20 | + nextButton: '.my-swiper-button-next', | ||
21 | + prevButton: '.my-swiper-button-prev', | ||
22 | + spaceBetween: 3 | ||
23 | + }); | ||
24 | + }, 500); | ||
25 | + | ||
26 | + let $cartBar = $('.cart-bar'); | ||
27 | + let timer = setInterval(function() { | ||
28 | + if ($cartBar) { | ||
29 | + window.reMarginFooter('.cart-bar'); | ||
30 | + clearInterval(timer); | ||
31 | + } else { | ||
32 | + $cartBar = $('.cart-bar'); | ||
33 | + } | ||
34 | + }, 500); | ||
35 | + } | ||
36 | + | ||
37 | + setDetailHtml(htmldata) { | ||
38 | + let $productDesc = $('#productDesc'); | ||
39 | + $productDesc.append(htmldata); | ||
40 | + | ||
41 | + window.rePosFooter && window.rePosFooter(); | ||
42 | + | ||
43 | + lazyLoad($productDesc.find('img.lazy')); | ||
44 | + | ||
45 | + this.productDescStyle(); | ||
46 | + } | ||
47 | + | ||
48 | + productDescStyle() { | ||
49 | + new Swiper('#swiper-recommend', { | ||
50 | + slidesPerView: 'auto', | ||
51 | + grabCursor: true, | ||
52 | + slideElement: 'a', | ||
53 | + lazyLoading: true, | ||
54 | + watchSlidesVisibility: true | ||
55 | + }); | ||
56 | + | ||
57 | + var $service = $('.service-cont'), | ||
58 | + serviceH = $service.height(), | ||
59 | + serviceLi = $service.find('li'), | ||
60 | + showH = parseInt(serviceLi.eq(0).height()) + parseInt(serviceLi.eq(1).height()) - parseInt(serviceLi.eq(1).find('.service-answer').height()) / 2; | ||
61 | + | ||
62 | + $service.css({ | ||
63 | + height: showH, | ||
64 | + overflow: 'hidden' | ||
65 | + }); | ||
66 | + | ||
67 | + this.operation = { | ||
68 | + showH, | ||
69 | + serviceH | ||
70 | + } | ||
71 | + this.on('click', '.service-operation', this.serviceOperation.bind(this)); | ||
72 | + } | ||
73 | + | ||
74 | + serviceOperation(e,) { | ||
75 | + function serviceState(opt) { | ||
76 | + opt.dom.html(opt.txt + '<i class="service-icon shrink-btn-' + opt.btnClass + '"></i>'); | ||
77 | + | ||
78 | + $('.service-cont').animate({ | ||
79 | + height: opt.height | ||
80 | + }, 0, function() { | ||
81 | + $(this).css({ | ||
82 | + overflow: opt.of | ||
83 | + }); | ||
84 | + }); | ||
85 | + } | ||
86 | + | ||
87 | + let $this = $(e.currentTarget); | ||
88 | + let curState = $this.find('i').hasClass('shrink-btn-up'); | ||
89 | + | ||
90 | + if (curState) { | ||
91 | + serviceState({ | ||
92 | + 'dom': $this, | ||
93 | + 'txt': '展开', | ||
94 | + 'btnClass': 'down', | ||
95 | + 'height': this.operation.showH, | ||
96 | + 'of': 'hidden' | ||
97 | + }); | ||
98 | + } else { | ||
99 | + serviceState({ | ||
100 | + 'dom': $this, | ||
101 | + 'txt': '收起', | ||
102 | + 'btnClass': 'up', | ||
103 | + 'height': this.operation.serviceH, | ||
104 | + 'of': 'visible' | ||
105 | + }); | ||
106 | + } | ||
107 | + } | ||
108 | + | ||
109 | + getSkn() { | ||
110 | + return this.$base.data('skn'); | ||
111 | + } | ||
112 | +}; |
@@ -9,7 +9,7 @@ import { | @@ -9,7 +9,7 @@ import { | ||
9 | } from './view'; | 9 | } from './view'; |
10 | 10 | ||
11 | import { | 11 | import { |
12 | - search | 12 | + globalSearch as search |
13 | } from '../models'; | 13 | } from '../models'; |
14 | 14 | ||
15 | let filter = require('plugin/filter'); | 15 | let filter = require('plugin/filter'); |
@@ -107,7 +107,7 @@ class ListController extends Controller { | @@ -107,7 +107,7 @@ class ListController extends Controller { | ||
107 | }); | 107 | }); |
108 | 108 | ||
109 | this.searching = true; | 109 | this.searching = true; |
110 | - search(params).then(data => { | 110 | + search('//m.yohobuy.com/product/global/search', params).then(data => { |
111 | this.nav.page = page; | 111 | this.nav.page = page; |
112 | 112 | ||
113 | if (!data) { | 113 | if (!data) { |
@@ -4,10 +4,10 @@ import { | @@ -4,10 +4,10 @@ import { | ||
4 | http | 4 | http |
5 | } from 'yoho-mvc'; | 5 | } from 'yoho-mvc'; |
6 | 6 | ||
7 | -function search(data) { | 7 | +function globalSearch(url, data) { |
8 | return http({ | 8 | return http({ |
9 | type: 'GET', | 9 | type: 'GET', |
10 | - url: location.protocol + '//m.yohobuy.com/product/global/search', | 10 | + url: location.protocol + url, |
11 | data: data, | 11 | data: data, |
12 | xhrFields: { | 12 | xhrFields: { |
13 | withCredentials: true | 13 | withCredentials: true |
@@ -16,5 +16,5 @@ function search(data) { | @@ -16,5 +16,5 @@ function search(data) { | ||
16 | } | 16 | } |
17 | 17 | ||
18 | export { | 18 | export { |
19 | - search | 19 | + globalSearch |
20 | }; | 20 | }; |
public/scss/product/global/_detail.css
0 → 100644
1 | +.global-detail-page { | ||
2 | + background: rgb(244, 244, 244); | ||
3 | + | ||
4 | + .global-tag { | ||
5 | + position: absolute; | ||
6 | + top: 10px; | ||
7 | + left: 10px; | ||
8 | + z-index: 2; | ||
9 | + } | ||
10 | + | ||
11 | + .global-country { | ||
12 | + float: left; | ||
13 | + background: rgb(70, 46, 61); | ||
14 | + color: #fff; | ||
15 | + padding: 2px 8px; | ||
16 | + font-size: 16px; | ||
17 | + | ||
18 | + span { | ||
19 | + float: left; | ||
20 | + } | ||
21 | + } | ||
22 | + | ||
23 | + .global-plane { | ||
24 | + width: 21px; | ||
25 | + height: 21px; | ||
26 | + background-image: resolve("product/airplane.png"); | ||
27 | + background-repeat: no-repeat; | ||
28 | + background-size: cover; | ||
29 | + margin-right: 10px; | ||
30 | + margin-top: 2px; | ||
31 | + } | ||
32 | + | ||
33 | + .global-limited { | ||
34 | + float: left; | ||
35 | + top: 10px; | ||
36 | + border: 1px solid rgb(70, 46, 61); | ||
37 | + margin-left: 5px; | ||
38 | + padding: 0 5px; | ||
39 | + font-size: 16px; | ||
40 | + } | ||
41 | + | ||
42 | + .banner-container { | ||
43 | + position: relative; | ||
44 | + background-color: #fff; | ||
45 | + min-height: 660px; | ||
46 | + } | ||
47 | + | ||
48 | + .banner-top-single { | ||
49 | + overflow: hidden; | ||
50 | + margin: 0 auto; | ||
51 | + | ||
52 | + img { | ||
53 | + margin-top: 30px; | ||
54 | + margin-bottom: 30px; | ||
55 | + width: 448px; | ||
56 | + } | ||
57 | + | ||
58 | + &.hover { | ||
59 | + position: fixed; | ||
60 | + width: 100%; | ||
61 | + background-color: black; | ||
62 | + height: 100%; | ||
63 | + top: 0; | ||
64 | + left: 0; | ||
65 | + right: 0; | ||
66 | + border: 0; | ||
67 | + z-index: 999; | ||
68 | + display: -webkit-flex; | ||
69 | + display: -moz-flex; | ||
70 | + display: -ms-flex; | ||
71 | + display: -o-flex; | ||
72 | + display: flex; | ||
73 | + -ms-align-items: center; | ||
74 | + align-items: center; | ||
75 | + | ||
76 | + img { | ||
77 | + margin-top: initial; | ||
78 | + margin-bottom: initial; | ||
79 | + width: 100%; | ||
80 | + } | ||
81 | + } | ||
82 | + } | ||
83 | + | ||
84 | + .banner-top { | ||
85 | + position: relative; | ||
86 | + overflow: hidden; | ||
87 | + min-height: 660px; | ||
88 | + display: flex; | ||
89 | + align-items: center; | ||
90 | + | ||
91 | + &.hover { | ||
92 | + position: fixed; | ||
93 | + width: 100%; | ||
94 | + background-color: black; | ||
95 | + height: 100%; | ||
96 | + top: 0; | ||
97 | + left: 0; | ||
98 | + right: 0; | ||
99 | + border: 0; | ||
100 | + z-index: 999; | ||
101 | + | ||
102 | + .banner-swiper { | ||
103 | + width: 100%; | ||
104 | + height: auto; | ||
105 | + margin: 0 !important; | ||
106 | + overflow: initial !important; | ||
107 | + max-height: initial !important; | ||
108 | + | ||
109 | + ul { | ||
110 | + max-height: initial !important; | ||
111 | + } | ||
112 | + } | ||
113 | + | ||
114 | + .swiper-pagination-bullet-active { | ||
115 | + background-color: #fff !important; | ||
116 | + } | ||
117 | + } | ||
118 | + | ||
119 | + .swiper-pagination { | ||
120 | + position: absolute; | ||
121 | + bottom: 40px; | ||
122 | + z-index: 2; | ||
123 | + | ||
124 | + .pagination-inner { | ||
125 | + span { | ||
126 | + background-color: #b0b0b0; | ||
127 | + } | ||
128 | + | ||
129 | + .swiper-pagination-bullet { | ||
130 | + margin-right: 2PX; | ||
131 | + } | ||
132 | + | ||
133 | + .swiper-pagination-bullet-active { | ||
134 | + background-color: #000; | ||
135 | + } | ||
136 | + } | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + .banner-swiper { | ||
141 | + overflow: hidden; | ||
142 | + margin: 30px 96px; | ||
143 | + width: 448px; | ||
144 | + min-height: 600px; | ||
145 | + | ||
146 | + ul { | ||
147 | + position: relative; | ||
148 | + height: auto; | ||
149 | + | ||
150 | + li { | ||
151 | + float: left; | ||
152 | + | ||
153 | + img { | ||
154 | + height: auto; | ||
155 | + } | ||
156 | + } | ||
157 | + } | ||
158 | + } | ||
159 | + | ||
160 | + .goods-name { | ||
161 | + box-sizing: border-box; | ||
162 | + padding: 20px 28px; | ||
163 | + width: 100%; | ||
164 | + background-color: #515150; | ||
165 | + color: #fff; | ||
166 | + | ||
167 | + .name { | ||
168 | + font-size: 28px; | ||
169 | + line-height: 48px; | ||
170 | + } | ||
171 | + } | ||
172 | + | ||
173 | + .price-date { | ||
174 | + height: 112px; | ||
175 | + border-bottom: 1px solid #eee; | ||
176 | + padding: 15px 30px; | ||
177 | + background: #fff; | ||
178 | + | ||
179 | + .final-price { | ||
180 | + font-size: 34px; | ||
181 | + color: #d0021b; | ||
182 | + margin-right: 5px; | ||
183 | + } | ||
184 | + | ||
185 | + .orign-price { | ||
186 | + text-decoration: line-through; | ||
187 | + color: #b0b0b0; | ||
188 | + } | ||
189 | + | ||
190 | + .sales-price, | ||
191 | + .market-price { | ||
192 | + font-size: 24px; | ||
193 | + color: #b0b0b0; | ||
194 | + } | ||
195 | + | ||
196 | + .market-price { | ||
197 | + text-decoration: line-through; | ||
198 | + margin-left: 5px; | ||
199 | + } | ||
200 | + } | ||
201 | + | ||
202 | + .country { | ||
203 | + height: 88px; | ||
204 | + padding: 30px; | ||
205 | + border-bottom: 1px solid #eee; | ||
206 | + background: #fff; | ||
207 | + | ||
208 | + .country-name { | ||
209 | + float: left; | ||
210 | + height: 28px; | ||
211 | + background: rgb(70, 46, 61); | ||
212 | + color: #fff; | ||
213 | + font-size: 18px; | ||
214 | + line-height: 28px; | ||
215 | + padding: 0 10px; | ||
216 | + margin-right: 15px; | ||
217 | + } | ||
218 | + | ||
219 | + .product-source { | ||
220 | + float: left; | ||
221 | + height: 28px; | ||
222 | + line-height: 28px; | ||
223 | + font-size: 28px; | ||
224 | + } | ||
225 | + } | ||
226 | + | ||
227 | + .enter-store { | ||
228 | + position: relative; | ||
229 | + margin-top: 30px; | ||
230 | + overflow: hidden; | ||
231 | + padding: 0 180px 0 114px; | ||
232 | + background-color: #fff; | ||
233 | + text-overflow: ellipsis; | ||
234 | + white-space: nowrap; | ||
235 | + line-height: 84px; | ||
236 | + border-top: 1px solid #eee; | ||
237 | + border-bottom: 1px solid #eee; | ||
238 | + | ||
239 | + .store-logo { | ||
240 | + position: absolute; | ||
241 | + top: 1px; | ||
242 | + left: 0; | ||
243 | + margin-left: 30px; | ||
244 | + width: 68px; | ||
245 | + height: 84px; | ||
246 | + text-align: center; | ||
247 | + font-size: 0; | ||
248 | + | ||
249 | + img { | ||
250 | + display: inline-block; | ||
251 | + width: auto; | ||
252 | + height: 68px; | ||
253 | + vertical-align: middle; | ||
254 | + } | ||
255 | + } | ||
256 | + | ||
257 | + .store-name { | ||
258 | + color: #444; | ||
259 | + font-size: 34px; | ||
260 | + } | ||
261 | + | ||
262 | + .store-link { | ||
263 | + position: absolute; | ||
264 | + top: 1px; | ||
265 | + right: 0; | ||
266 | + padding-right: 30px; | ||
267 | + color: #b0b0b0; | ||
268 | + text-align: right; | ||
269 | + | ||
270 | + span { | ||
271 | + font-size: inherit; | ||
272 | + } | ||
273 | + } | ||
274 | + } | ||
275 | + | ||
276 | + .customer-service { | ||
277 | + margin-top: 30px; | ||
278 | + height: 110px; | ||
279 | + line-height: 110px; | ||
280 | + background-color: #fff; | ||
281 | + padding-left: 30px; | ||
282 | + font-size: 28px; | ||
283 | + border-top: 1px solid #eee; | ||
284 | + border-bottom: 1px solid #eee; | ||
285 | + | ||
286 | + a { | ||
287 | + display: block; | ||
288 | + height: 100%; | ||
289 | + width: 100%; | ||
290 | + overflow: hidden; | ||
291 | + } | ||
292 | + | ||
293 | + .customer-name { | ||
294 | + float: left; | ||
295 | + color: #444; | ||
296 | + } | ||
297 | + | ||
298 | + .customer-link { | ||
299 | + float: right; | ||
300 | + padding-right: 30px; | ||
301 | + color: #b0b0b0; | ||
302 | + } | ||
303 | + } | ||
304 | + | ||
305 | + .cart-bar { | ||
306 | + position: fixed; | ||
307 | + bottom: 0; | ||
308 | + z-index: 2; | ||
309 | + height: 120px; | ||
310 | + width: 100%; | ||
311 | + border-top: 1px solid #e0e0e0; | ||
312 | + background-color: #fff; | ||
313 | + text-align: center; | ||
314 | + overflow: hidden; | ||
315 | + | ||
316 | + .num-incart { | ||
317 | + position: absolute; | ||
318 | + color: #444; | ||
319 | + font-size: 47px; | ||
320 | + top: 50%; | ||
321 | + left: 28px; | ||
322 | + transform: translateY(-50%); | ||
323 | + } | ||
324 | + | ||
325 | + .addto-cart { | ||
326 | + position: absolute; | ||
327 | + top: 50%; | ||
328 | + left: 50%; | ||
329 | + transform: translate(-50%, -50%); | ||
330 | + width: 260px; | ||
331 | + height: 80px; | ||
332 | + background-color: #eb0313; | ||
333 | + color: #fff; | ||
334 | + text-align: center; | ||
335 | + font-size: 32px; | ||
336 | + line-height: 80px; | ||
337 | + } | ||
338 | + | ||
339 | + .num-tag { | ||
340 | + position: absolute; | ||
341 | + top: 0; | ||
342 | + right: -15px; | ||
343 | + display: block; | ||
344 | + width: 30px; | ||
345 | + height: 30px; | ||
346 | + border-radius: 50%; | ||
347 | + background: #eb0313; | ||
348 | + color: #fff; | ||
349 | + text-align: center; | ||
350 | + font-size: 20px; | ||
351 | + line-height: 30px; | ||
352 | + | ||
353 | + &.hide { | ||
354 | + display: none; | ||
355 | + } | ||
356 | + } | ||
357 | + } | ||
358 | + | ||
359 | +} |
1 | +.global-detail-page .product-desc { | ||
2 | + margin-top: 30px; | ||
3 | + font-size: 12px; | ||
4 | + | ||
5 | + .info { | ||
6 | + margin: 20px 0; | ||
7 | + padding: 0 10px 20px; | ||
8 | + background: #fff; | ||
9 | + border-top: 1px solid #e0e0e0; | ||
10 | + border-bottom: 1px solid #e0e0e0; | ||
11 | + } | ||
12 | + | ||
13 | + .service-info { | ||
14 | + padding-bottom: 0; | ||
15 | + } | ||
16 | + | ||
17 | + .brand-intro { | ||
18 | + font-size: 21px; | ||
19 | + } | ||
20 | + | ||
21 | + .info:first-child { | ||
22 | + margin-top: 0; | ||
23 | + } | ||
24 | + | ||
25 | + .info h2 { | ||
26 | + text-align: left; | ||
27 | + margin-bottom: 5px; | ||
28 | + font-size: 28px; | ||
29 | + font-weight: normal; | ||
30 | + margin: 0; | ||
31 | + height: 93px; | ||
32 | + line-height: 93px; | ||
33 | + border-bottom: 1px solid #f0f0f0; | ||
34 | + margin-bottom: 10px; | ||
35 | + } | ||
36 | + | ||
37 | + .info h2 span { | ||
38 | + font-size: 12px; | ||
39 | + text-transform: uppercase; | ||
40 | + color: #c0c0c0; | ||
41 | + } | ||
42 | + | ||
43 | + .good-sure { | ||
44 | + padding-top: 5px; | ||
45 | + margin-bottom: -20px; | ||
46 | + border-bottom: none; | ||
47 | + } | ||
48 | + | ||
49 | + .description { | ||
50 | + border-top: none; | ||
51 | + } | ||
52 | + | ||
53 | + .description table { | ||
54 | + background: #fff; | ||
55 | + width: 100%; | ||
56 | + border-collapse: collapse; | ||
57 | + border-spacing: 0; | ||
58 | + } | ||
59 | + | ||
60 | + .description td { | ||
61 | + text-align: left; | ||
62 | + padding: 5px 10px; | ||
63 | + border: 1px solid #fff; | ||
64 | + background: #eee; | ||
65 | + font-size: 12px; | ||
66 | + } | ||
67 | + | ||
68 | + .details { | ||
69 | + overflow-x: hidden; | ||
70 | + } | ||
71 | + | ||
72 | + .details p { | ||
73 | + width: 100%; | ||
74 | + line-height: 45px; | ||
75 | + font-size: 25px; | ||
76 | + } | ||
77 | + | ||
78 | + .details img, .size img, .good-sure img, .brand-intro img { | ||
79 | + width: 100%; | ||
80 | + } | ||
81 | + | ||
82 | + .table-wrap { | ||
83 | + width: 100%; | ||
84 | + overflow-x: auto; | ||
85 | + } | ||
86 | + | ||
87 | + .size table { | ||
88 | + width: 100%; | ||
89 | + border-collapse: collapse; | ||
90 | + border-spacing: 2; | ||
91 | + } | ||
92 | + | ||
93 | + .size th, | ||
94 | + .size td { | ||
95 | + font-weight: normal; | ||
96 | + height: 30px; | ||
97 | + background: #eee; | ||
98 | + padding-left: 10px; | ||
99 | + padding-right: 10px; | ||
100 | + border: 1px solid #fff; | ||
101 | + min-width: 50px; | ||
102 | + text-align: center; | ||
103 | + } | ||
104 | + | ||
105 | + .details table{ | ||
106 | + display: none; | ||
107 | + } | ||
108 | + | ||
109 | + .recommend-for-you { | ||
110 | + border-bottom: none; | ||
111 | + } | ||
112 | + | ||
113 | + .recommend-for-you { | ||
114 | + padding: 30px 0; | ||
115 | + border-top: 1px solid #e0e0e0; | ||
116 | + border-bottom: 1px solid #e0e0e0; | ||
117 | + background: #fff; | ||
118 | + } | ||
119 | + | ||
120 | + .recommend-for-you .title { | ||
121 | + font-size: 32px; | ||
122 | + line-height: 88px; | ||
123 | + text-align: center; | ||
124 | + color: #444; | ||
125 | + } | ||
126 | + .recommend-for-you .swiper-container { | ||
127 | + padding: 30px 0 20px; | ||
128 | + width: 100%; | ||
129 | + } | ||
130 | + .recommend-for-you .swiper-container .swiper-slide { | ||
131 | + padding: 0 10px; | ||
132 | + float: left; | ||
133 | + width: 156px; | ||
134 | + } | ||
135 | + .recommend-for-you .swiper-container .swiper-slide:first-child { | ||
136 | + padding-left: 30px; | ||
137 | + } | ||
138 | + .recommend-for-you .swiper-container .swiper-slide:last-child { | ||
139 | + padding-right: 30px; | ||
140 | + } | ||
141 | + .recommend-for-you .swiper-container .swiper-slide img { | ||
142 | + width: 100%; | ||
143 | + height: 208px; | ||
144 | + } | ||
145 | + .recommend-for-you .sale-name { | ||
146 | + overflow: hidden; | ||
147 | + text-overflow: ellipsis; | ||
148 | + width: 100%; | ||
149 | + white-space: nowrap; | ||
150 | + margin-top: 20px; | ||
151 | + color: gray; | ||
152 | + } | ||
153 | + .recommend-for-you .price { | ||
154 | + position: relative; | ||
155 | + margin-top: 8px; | ||
156 | + font-size: 24px; | ||
157 | + line-height: 1; | ||
158 | + } | ||
159 | + .recommend-for-you .price .sale-price { | ||
160 | + display: block; | ||
161 | + color: #d9134f; | ||
162 | + margin-right: 8px; | ||
163 | + } | ||
164 | + .recommend-for-you .price .old-price { | ||
165 | + display: block; | ||
166 | + color: #b0b0b0; | ||
167 | + text-decoration: line-through; | ||
168 | + } | ||
169 | + .recommend-for-you .price .no-price { | ||
170 | + color: #444; | ||
171 | + } | ||
172 | + | ||
173 | + .service-cont p { | ||
174 | + line-height: 30px; | ||
175 | + text-indent: 0; | ||
176 | + position: relative; | ||
177 | + padding:0 20px 0 42px; | ||
178 | + margin: 20px 0; | ||
179 | + } | ||
180 | + | ||
181 | + .service-cont>li { | ||
182 | + padding: 10px 0 0 0; | ||
183 | + margin-left: 20px; | ||
184 | + border-bottom: 1px solid #e0e0e0; | ||
185 | + } | ||
186 | + | ||
187 | + .service-cont>li:last-child { | ||
188 | + border-bottom: none; | ||
189 | + } | ||
190 | + | ||
191 | + .service-cont .service-prob:before, | ||
192 | + .service-cont .service-answer:before { | ||
193 | + content: ''; | ||
194 | + width: 30.8px; | ||
195 | + height: 30.8px; | ||
196 | + float: left; | ||
197 | + margin-right: 20px; | ||
198 | + position: absolute; | ||
199 | + left: 0px; | ||
200 | + background-size: contain; | ||
201 | + } | ||
202 | + | ||
203 | + .service-cont .service-prob:before { | ||
204 | + background-image: url('http://cdn.yoho.cn/global/images/service-q.png'); | ||
205 | + background-repeat: no-repeat; | ||
206 | + } | ||
207 | + | ||
208 | + .service-cont .service-answer:before { | ||
209 | + background-image: url('http://cdn.yoho.cn/global/images/service-a.png'); | ||
210 | + background-repeat: no-repeat; | ||
211 | + } | ||
212 | + | ||
213 | + .service-cont .service-prob { | ||
214 | + font-size: 24px; | ||
215 | + color: #444344; | ||
216 | + } | ||
217 | + | ||
218 | + .service-cont .service-answer { | ||
219 | + font-size: 22px; | ||
220 | + color: #b0b0b0; | ||
221 | + line-height: 36px; | ||
222 | + } | ||
223 | + | ||
224 | + .service-operation { | ||
225 | + border-top: 1px solid #e0e0e0; | ||
226 | + text-align: center; | ||
227 | + height: 80px; | ||
228 | + line-height: 80px; | ||
229 | + font-size: 24px; | ||
230 | + color: #b0b0b0; | ||
231 | + } | ||
232 | + | ||
233 | + .service-icon { | ||
234 | + display: inline-block; | ||
235 | + } | ||
236 | + | ||
237 | + .shrink-btn-down { | ||
238 | + background-image: url('http://cdn.yoho.cn/global/images/service_down.png'); | ||
239 | + background-repeat: no-repeat; | ||
240 | + } | ||
241 | + | ||
242 | + .shrink-btn-up { | ||
243 | + background-image: url('http://cdn.yoho.cn/global/images/service_up.png'); | ||
244 | + background-repeat: no-repeat; | ||
245 | + } | ||
246 | + | ||
247 | + .shrink-btn-up, | ||
248 | + .shrink-btn-down { | ||
249 | + width: 16px; | ||
250 | + height: 9px; | ||
251 | + vertical-align: middle; | ||
252 | + margin-left: 10px; | ||
253 | + cursor: pointer; | ||
254 | + background-size: contain; | ||
255 | + } | ||
256 | +} |
public/scss/product/global/detail.page.css
0 → 100644
-
Please register or login to post a comment