Authored by 李奇

Merge remote-tracking branch 'origin/release/4.0' into feature/new-category

# Conflicts:
#	src/components/resources/index.js
... ... @@ -133,8 +133,6 @@ Session.vim
# auto-generated tag files
tags
### VS Code ###
.vscode/
### YOHO ###
public/dist/
... ...
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/test-app.js"
}
]
}
\ No newline at end of file
... ...
// 将设置放入此文件中以覆盖默认值和用户设置。
{
"files.exclude": {
"public/dist/": true,
"logs/": true
},
"vetur.grammar.customBlocks": {
"client": "js"
}
}
\ No newline at end of file
... ...
... ... @@ -2,19 +2,18 @@ const webpack = require('webpack');
const path = require('path');
const merge = require('webpack-merge');
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const pkg = require('../package.json');
const shelljs = require('shelljs');
// const shelljs = require('shelljs');
let baseConfig = require('./webpack.base.conf');
const postcssConfig = require('./postcss.config.js');
const isProd = process.env.NODE_ENV === 'production';
if (process.env.NODE_ENV === 'production') {
shelljs.exec(`cp -R ${path.join(__dirname, '../public/font/')} ${path.join(__dirname, '../src/statics/font/')}`, {async: true});
shelljs.exec(`cp -R ${path.join(__dirname, '../public/img/')} ${path.join(__dirname, '../src/statics/img/')}`, {async: true});
}
// if (process.env.NODE_ENV === 'production') {
// shelljs.exec(`cp -R ${path.join(__dirname, '../public/font/')} ${path.join(__dirname, '../src/statics/font/')}`, {async: true});
// shelljs.exec(`cp -R ${path.join(__dirname, '../public/img/')} ${path.join(__dirname, '../src/statics/img/')}`, {async: true});
// }
const webpackConfig = merge(baseConfig, {
entry: {
... ... @@ -66,11 +65,22 @@ const webpackConfig = merge(baseConfig, {
});
if (process.env.NODE_ENV === 'production') {
webpackConfig.plugins.push(new UglifyJSPlugin({
webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
parallel: true,
sourceMap: true
sourceMap: true,
uglifyOptions: {
compress: {
warnings: false
},
comments: false
}
}));
webpackConfig.output.publicPath = '//cdn.yoho.cn/yohoblk-wap/bundle/';
}
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
module.exports = webpackConfig;
... ...
... ... @@ -129,7 +129,7 @@
"vue-touch": "2.0.0-beta.3",
"vuex": "^3.0.1",
"webpack": "3.3",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-dashboard": "^0.1.8",
"webpack-dev-middleware": "^1.12.0",
"webpack-dev-server": "^2.6.1",
... ...
... ... @@ -4,7 +4,6 @@ import ResourceTwoImage from './resource-two-image';
import ResourceFocusImage from './resource-focus-image';
import ResourceSingleImage from './resource-single-image';
import ResourceProductList from './resource-product-list';
import ResourceShopFloor from './resource-shop-floor';
import ResourceBlkNewProductList from './resource-new-product-list';
export {
... ... @@ -13,7 +12,7 @@ export {
ResourceTwoImage,
ResourceSingleImage,
ResourceProductList,
ResourceShopFloor,
ResourceFocusImage,
ResourceFocusImage,
ResourceBlkNewProductList
};
... ...
<template>
<resource>
<!-- <resource-single-image></resource-single-image>
<resource-product-list></resource-product-list> -->
</resource>
</template>
<script>
import Resource from './resource';
import ResourceSingleImage from './resource-single-image';
import ResourcePoductList from './resource-product-list';
export default {
name: 'ResourceShopFloor',
props: {
value: Object
},
components: {Resource, ResourceSingleImage, ResourcePoductList}
};
</script>
<style lang="scss">
.resource-products {
width: 100%;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
white-space: nowrap;
li.product-item {
display: inline-block;
padding-right: 20px;
text-align: center;
line-height: 40px;
img {
width: 188px;
height: 250px;
}
}
}
</style>
... ... @@ -12,9 +12,9 @@ export default context => {
const route = router.resolve(url).route;
if (url !== route.fullPath && url !== route.redirectedFrom) {
return reject({url: route.fullPath});
}
// if (url !== route.fullPath) {
// return reject({code: 500, message: 'url not matched', url: route.fullPath});
// }
store.commit(SET_ENV, context.env);
router.push(url);
router.onReady(() => {
... ...
... ... @@ -18,7 +18,7 @@
<div class="resources">
<component
:is="component.template_name"
v-for="(component, index) in channel.home.filter(c => ['twoPicture', 'newSingleImage', 'shopFloor', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
v-for="(component, index) in channel.home.filter(c => ['twoPicture', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
:value="component.data"
:key="index"></component>
</div>
... ... @@ -31,12 +31,9 @@
import {
FETCH_HOME_REQUEST
} from 'store/channel/types';
import {
ResourceTwoImage,
ResourceSingleImage,
ResourceShopFloor,
ResourceProductList
} from 'components/resources';
import ResourceTwoImage from 'components/resources/resource-two-image';
import ResourceSingleImage from 'components/resources/resource-single-image';
import ResourceProductList from 'components/resources/resource-product-list';
import {SearchSlider} from 'components/search';
import {mapState} from 'vuex';
import {HomeSlider} from './components';
... ... @@ -70,7 +67,6 @@ export default {
components: {
twoPicture: ResourceTwoImage,
newSingleImage: ResourceSingleImage,
shopFloor: ResourceShopFloor,
BlkNewProductFloorResource: ResourceProductList,
SearchSlider,
HomeSlider
... ...
... ... @@ -9217,7 +9217,7 @@ wbuf@^1.1.0, wbuf@^1.7.2:
dependencies:
minimalistic-assert "^1.0.0"
webpack-bundle-analyzer@^2.9.0:
webpack-bundle-analyzer@^2.9.1:
version "2.9.1"
resolved "http://npm.yoho.cn/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.9.1.tgz#c2c8e03e8e5768ed288b39ae9e27a8b8d7b9d476"
dependencies:
... ...