Merge branch 'hotfix/flex' into 'release/5.7'
Hotfix/flex See merge request !558
Showing
9 changed files
with
37 additions
and
11 deletions
@@ -55,11 +55,11 @@ | @@ -55,11 +55,11 @@ | ||
55 | {{#unless @root.isApp}} | 55 | {{#unless @root.isApp}} |
56 | {{#if productList}} | 56 | {{#if productList}} |
57 | <div class="product-list-box"> | 57 | <div class="product-list-box"> |
58 | - <div class="product-list"> | 58 | + <ul class="product-list"> |
59 | {{#productList}} | 59 | {{#productList}} |
60 | {{> index/product-list}} | 60 | {{> index/product-list}} |
61 | {{/productList}} | 61 | {{/productList}} |
62 | - </div> | 62 | + </ul> |
63 | </div> | 63 | </div> |
64 | {{/if}} | 64 | {{/if}} |
65 | {{/unless}} | 65 | {{/unless}} |
1 | -<div class="goods-box"> | 1 | +<li class="goods-box"> |
2 | <div class="goods-img"> | 2 | <div class="goods-img"> |
3 | <a href="{{href}}"> | 3 | <a href="{{href}}"> |
4 | <img class="lazy" data-original="{{image2 pic_url w=106 h=138}}" /> | 4 | <img class="lazy" data-original="{{image2 pic_url w=106 h=138}}" /> |
@@ -10,4 +10,4 @@ | @@ -10,4 +10,4 @@ | ||
10 | <p class="price">¥{{price}}</p> | 10 | <p class="price">¥{{price}}</p> |
11 | </a> | 11 | </a> |
12 | </div> | 12 | </div> |
13 | -</div> | ||
13 | +</li> |
@@ -13,7 +13,6 @@ const _ = require('lodash'); | @@ -13,7 +13,6 @@ const _ = require('lodash'); | ||
13 | const webpack = require('webpack'); | 13 | const webpack = require('webpack'); |
14 | const HappyPack = require('happypack'); | 14 | const HappyPack = require('happypack'); |
15 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); | 15 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
16 | -const scss = require('postcss-scss'); | ||
17 | const postcssConfig = require('./postcss.config.js'); | 16 | const postcssConfig = require('./postcss.config.js'); |
18 | 17 | ||
19 | const happyThreadPool = HappyPack.ThreadPool({ // eslint-disable-line | 18 | const happyThreadPool = HappyPack.ThreadPool({ // eslint-disable-line |
@@ -46,7 +45,7 @@ const cssLoader = (env, type) => { | @@ -46,7 +45,7 @@ const cssLoader = (env, type) => { | ||
46 | loader: 'postcss-loader', | 45 | loader: 'postcss-loader', |
47 | options: { | 46 | options: { |
48 | plugins: postcssConfig.postcssPlugin(env), | 47 | plugins: postcssConfig.postcssPlugin(env), |
49 | - parser: scss | 48 | + parser: 'postcss-scss' |
50 | } | 49 | } |
51 | }); | 50 | }); |
52 | } | 51 | } |
@@ -109,7 +108,7 @@ module.exports = (env) => { | @@ -109,7 +108,7 @@ module.exports = (env) => { | ||
109 | options: { | 108 | options: { |
110 | postcss: { | 109 | postcss: { |
111 | plugins: postcssConfig.postcssPlugin(env), | 110 | plugins: postcssConfig.postcssPlugin(env), |
112 | - parser: scss | 111 | + parser: 'postcss-scss' |
113 | }, | 112 | }, |
114 | autoprefixer: false, | 113 | autoprefixer: false, |
115 | loaders: { | 114 | loaders: { |
@@ -26,6 +26,7 @@ let setting = { | @@ -26,6 +26,7 @@ let setting = { | ||
26 | 26 | ||
27 | let $infos = $('#info-list'); | 27 | let $infos = $('#info-list'); |
28 | let getDynamicData = require('./list-dynamic'); | 28 | let getDynamicData = require('./list-dynamic'); |
29 | +let productlistWith = require('./index/product-list'); | ||
29 | 30 | ||
30 | require('common'); | 31 | require('common'); |
31 | 32 | ||
@@ -93,3 +94,5 @@ $('.info-list').on('click', function(e) { | @@ -93,3 +94,5 @@ $('.info-list').on('click', function(e) { | ||
93 | }, true); | 94 | }, true); |
94 | } | 95 | } |
95 | }); | 96 | }); |
97 | + | ||
98 | +productlistWith(); |
@@ -23,6 +23,7 @@ let $infoList = $('#info-list'), | @@ -23,6 +23,7 @@ let $infoList = $('#info-list'), | ||
23 | curType = $curNav.data('type'); | 23 | curType = $curNav.data('type'); |
24 | 24 | ||
25 | let getDynamicData = require('./list-dynamic'); | 25 | let getDynamicData = require('./list-dynamic'); |
26 | +let productlistWith = require('./index/product-list'); | ||
26 | 27 | ||
27 | let state = {}; | 28 | let state = {}; |
28 | 29 | ||
@@ -128,3 +129,5 @@ $nav.on('touchstart', function(e) { | @@ -128,3 +129,5 @@ $nav.on('touchstart', function(e) { | ||
128 | }).on('touchend touchcancel', function() { | 129 | }).on('touchend touchcancel', function() { |
129 | $nav.find('li').removeClass('bytouch'); | 130 | $nav.find('li').removeClass('bytouch'); |
130 | }); | 131 | }); |
132 | + | ||
133 | +productlistWith(); |
public/js/guang/index/product-list.js
0 → 100644
1 | +const $ = require('yoho-jquery'); | ||
2 | + | ||
3 | +function productlistWith($data) { | ||
4 | + let $productList = $('.product-list'); | ||
5 | + | ||
6 | + if ($data) { | ||
7 | + $productList = $data.find('.product-list'); | ||
8 | + } | ||
9 | + | ||
10 | + $productList.each(function() { | ||
11 | + $(this).css('width', $(this).children().length * 8.5 + 'rem'); | ||
12 | + }); | ||
13 | +} | ||
14 | + | ||
15 | +module.exports = productlistWith; |
@@ -21,6 +21,7 @@ let searching = false; | @@ -21,6 +21,7 @@ let searching = false; | ||
21 | let mySwiper = {}; | 21 | let mySwiper = {}; |
22 | 22 | ||
23 | let getDynamicData = require('./list-dynamic'); | 23 | let getDynamicData = require('./list-dynamic'); |
24 | +let productlistWith = require('./index/product-list'); | ||
24 | 25 | ||
25 | require('common'); | 26 | require('common'); |
26 | 27 | ||
@@ -222,7 +223,10 @@ function loadMore($container, opt, url) { | @@ -222,7 +223,10 @@ function loadMore($container, opt, url) { | ||
222 | return; | 223 | return; |
223 | } | 224 | } |
224 | 225 | ||
225 | - $container.append(data); | 226 | + let $data = $(data); |
227 | + | ||
228 | + productlistWith($data); | ||
229 | + $container.append($data); | ||
226 | 230 | ||
227 | $swiper = $container.find('.swiper-container'); | 231 | $swiper = $container.find('.swiper-container'); |
228 | if ($swiper.length) { | 232 | if ($swiper.length) { |
@@ -2,11 +2,13 @@ | @@ -2,11 +2,13 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-05-03 14:08:52 | 3 | * @Date: 2017-05-03 14:08:52 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-05-09 11:13:08 | 5 | + * @Last Modified time: 2017-05-15 19:22:38 |
6 | */ | 6 | */ |
7 | .guang-list-page { | 7 | .guang-list-page { |
8 | .product-list-box { | 8 | .product-list-box { |
9 | - margin: 40px 20px 0; | 9 | + width: 100%; |
10 | + margin-top: 40px; | ||
11 | + padding: 0 20px; | ||
10 | overflow-x: scroll; | 12 | overflow-x: scroll; |
11 | overflow-y: hidden; | 13 | overflow-y: hidden; |
12 | } | 14 | } |
@@ -14,7 +16,6 @@ | @@ -14,7 +16,6 @@ | ||
14 | .product-list { | 16 | .product-list { |
15 | height: 138px; | 17 | height: 138px; |
16 | overflow-y: hidden; | 18 | overflow-y: hidden; |
17 | - display: inline-flex; | ||
18 | 19 | ||
19 | .goods-box { | 20 | .goods-box { |
20 | width: 320px; | 21 | width: 320px; |
-
Please register or login to post a comment