Authored by ccbikai

Merge branch 'develop' into release/1.0

... ... @@ -12,7 +12,7 @@ const helpers = global.yoho.helpers;
*/
const component = {
index: (req, res, next) => {
const uid = req.user.uid;
const uid = req.user.uid || '6228593';
if (!uid && req.xhr) {
return res.json({
... ...
'use strict';
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const favApi = global.yoho.FavAPI;
const Promise = require('bluebird');
const helpers = global.yoho.helpers;
... ... @@ -46,6 +47,11 @@ const _getInfoNumData = (uid) => {
method: 'app.address.gethidden' // 用户地址的数据
}, {
code: 200
}), favApi.get('brower', {
method: 'app.favorite.getFavoriteCount', // 获取用户收藏商品总数
uid: uid
}, {
code: 200
})]).then(data => {
const res = {
wait_pay_num: '',
... ... @@ -66,6 +72,13 @@ const _getInfoNumData = (uid) => {
}
}
// 收藏商品数另外调接口
if (data[2] && data[2].data && data[2].data.product_favorite_total > 0) {
res.product_favorite_total = data[2].data.product_favorite_total > 99 ? '99+' :
data[2].data.product_favorite_total;
}
return Object.assign(res, {
address_num: data[1].data && data[1].data.length ? data[1].data.length : ''
});
... ...
... ... @@ -22,7 +22,8 @@ module.exports = {
// service: 'http://service-test1.yohops.com:9999/'
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
service: 'http://dev-service.yohops.com:9999/',
favApi: 'http://192.168.102.31:8092/'
},
subDomains: {
host: '.m.yohoblk.com',
... ... @@ -74,7 +75,8 @@ if (isProduction) {
appName: 'm.yohoblk.com',
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/'
service: 'http://service.yoho.yohoops.org/',
favApi: 'http://192.168.102.31:8092/'
},
memcache: {
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
... ... @@ -94,7 +96,8 @@ if (isProduction) {
// service: 'http://dev-service.yohops.com:9999/'
api: 'http://api-test1.yohops.com:9999/',
service: 'http://service-test1.yohops.com:9999/'
service: 'http://service-test1.yohops.com:9999/',
favApi: 'http://192.168.102.31:8092/'
},
memcache: {
master: ['127.0.0.1:12111'],
... ...
... ... @@ -39,7 +39,7 @@
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.1.4",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "0.0.34"
"yoho-node-lib": "0.0.37"
},
"devDependencies": {
"autoprefixer": "^6.4.0",
... ... @@ -70,6 +70,7 @@
"postcss-crip": "^2.0.0",
"postcss-position": "^0.5.0",
"postcss-pxtorem": "^3.3.1",
"postcss-scss": "^0.1.9",
"postcss-short": "^1.4.0",
"postcss-sprites": "^3.3.0",
"postcss-use": "^2.2.0",
... ...
... ... @@ -39,9 +39,6 @@ const dist = {
font: `${distRoot}/assets/font`
};
// webpack 内嵌的样式中的雪碧图,写文件的时候会有冲突,这边使用单实例
let postcssSprites;
/**
* postcss plugins for both dev and pro
* @parem et Symbol
... ... @@ -96,12 +93,9 @@ const postcssPlugin = (et) => {
});
}
if (!postcssSprites) {
postcssSprites = require('postcss-sprites').default(sprites);
}
plugins = [
require('precss'),
postcssSprites,
require('postcss-sprites').default(sprites),
require('postcss-assets')(assets),
require('postcss-calc'),
require('postcss-pxtorem')({
... ... @@ -149,7 +143,9 @@ gulp.task('dist', ['ge'], () => {
gulp.task('postcss-dev', () => {
return gulp.src('scss/index.css')
.pipe(sourcemaps.init())
.pipe(postcss(postcssPlugin(env.dev)))
.pipe(postcss(postcssPlugin(env.dev), {
parser: require('postcss-scss')
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('css/'));
});
... ... @@ -177,7 +173,9 @@ gulp.task('font', () => {
// postcss compile in pro
gulp.task('postcss', ['assets'], () => {
return gulp.src('scss/index.css')
.pipe(postcss(postcssPlugin(env.pro)))
.pipe(postcss(postcssPlugin(env.pro), {
parser: require('postcss-scss')
}))
.pipe(cssnano({
safe: true
}))
... ... @@ -189,7 +187,12 @@ gulp.task('webpack-dev-server', () => {
const devConfig = Object.assign({}, webpackConfig, {
devtool: '#inline-source-map',
vue: {
postcss: postcssPlugin(env.dev),
postcss: {
plugins: postcssPlugin(env.dev),
options: {
parser: require('postcss-scss')
}
},
autoprefixer: false,
loaders: {
css: ExtractTextPlugin.extract(['css?-url'])
... ... @@ -219,7 +222,12 @@ gulp.task('webpack-dev-server', () => {
gulp.task('webpack', ['assets'], (done) => {
const proConfig = Object.assign({}, webpackConfig, {
vue: {
postcss: postcssPlugin(env.pro),
postcss: {
plugins: postcssPlugin(env.dev),
options: {
parser: require('postcss-scss')
}
},
autoprefixer: false,
loaders: {
css: ExtractTextPlugin.extract(['css?-url'])
... ...
... ... @@ -49,7 +49,7 @@
</div>
</div>
</template>
<style class="scss">
<style>
$bgcolor: #fff;
.editorial-page {
... ...
... ... @@ -82,7 +82,7 @@
return {
contentCode: contentCode.editorial.all,
editorialList: [],
page: 0,
page: 1,
scrollDisabled: false,
channel: qs.channel
};
... ... @@ -134,7 +134,7 @@
title: title,
des: des,
img: img,
url: `http://m.yohoblk.com/editorial/${id}.html`
url: `${location.origin}/editorial/${id}.html`
});
}
},
... ...
... ... @@ -95,7 +95,7 @@
title: this.article.articleTitle,
des: '优质精选,BLK潮流资讯为你呈现',
img: util.getImgUrl(this.article.coverImage, 300, 300, 2),
url: `http://m.yohoblk.com/editorial/${this.article.id}.html`
url: `${location.origin}/editorial/${this.article.id}.html`
});
}
},
... ...
... ... @@ -117,7 +117,7 @@
},
created() {
this.domain = this.shareData.domain;
window.onscroll = this.changeTopStatus.bind(this);
window.onscroll = this.changeTopStatus;
}
};
</script>
... ...