Authored by ccbikai

Merge branch 'develop' into release/1.0

@@ -12,7 +12,7 @@ const helpers = global.yoho.helpers; @@ -12,7 +12,7 @@ const helpers = global.yoho.helpers;
12 */ 12 */
13 const component = { 13 const component = {
14 index: (req, res, next) => { 14 index: (req, res, next) => {
15 - const uid = req.user.uid; 15 + const uid = req.user.uid || '6228593';
16 16
17 if (!uid && req.xhr) { 17 if (!uid && req.xhr) {
18 return res.json({ 18 return res.json({
1 'use strict'; 1 'use strict';
2 const api = global.yoho.API; 2 const api = global.yoho.API;
3 const serviceAPI = global.yoho.ServiceAPI; 3 const serviceAPI = global.yoho.ServiceAPI;
  4 +const favApi = global.yoho.FavAPI;
4 const Promise = require('bluebird'); 5 const Promise = require('bluebird');
5 const helpers = global.yoho.helpers; 6 const helpers = global.yoho.helpers;
6 7
@@ -46,6 +47,11 @@ const _getInfoNumData = (uid) => { @@ -46,6 +47,11 @@ const _getInfoNumData = (uid) => {
46 method: 'app.address.gethidden' // 用户地址的数据 47 method: 'app.address.gethidden' // 用户地址的数据
47 }, { 48 }, {
48 code: 200 49 code: 200
  50 + }), favApi.get('brower', {
  51 + method: 'app.favorite.getFavoriteCount', // 获取用户收藏商品总数
  52 + uid: uid
  53 + }, {
  54 + code: 200
49 })]).then(data => { 55 })]).then(data => {
50 const res = { 56 const res = {
51 wait_pay_num: '', 57 wait_pay_num: '',
@@ -66,6 +72,13 @@ const _getInfoNumData = (uid) => { @@ -66,6 +72,13 @@ const _getInfoNumData = (uid) => {
66 } 72 }
67 } 73 }
68 74
  75 + // 收藏商品数另外调接口
  76 + if (data[2] && data[2].data && data[2].data.product_favorite_total > 0) {
  77 + res.product_favorite_total = data[2].data.product_favorite_total > 99 ? '99+' :
  78 + data[2].data.product_favorite_total;
  79 + }
  80 +
  81 +
69 return Object.assign(res, { 82 return Object.assign(res, {
70 address_num: data[1].data && data[1].data.length ? data[1].data.length : '' 83 address_num: data[1].data && data[1].data.length ? data[1].data.length : ''
71 }); 84 });
@@ -22,7 +22,8 @@ module.exports = { @@ -22,7 +22,8 @@ module.exports = {
22 // service: 'http://service-test1.yohops.com:9999/' 22 // service: 'http://service-test1.yohops.com:9999/'
23 23
24 api: 'http://dev-api.yohops.com:9999/', 24 api: 'http://dev-api.yohops.com:9999/',
25 - service: 'http://dev-service.yohops.com:9999/' 25 + service: 'http://dev-service.yohops.com:9999/',
  26 + favApi: 'http://192.168.102.31:8092/'
26 }, 27 },
27 subDomains: { 28 subDomains: {
28 host: '.m.yohoblk.com', 29 host: '.m.yohoblk.com',
@@ -74,7 +75,8 @@ if (isProduction) { @@ -74,7 +75,8 @@ if (isProduction) {
74 appName: 'm.yohoblk.com', 75 appName: 'm.yohoblk.com',
75 domains: { 76 domains: {
76 api: 'http://api.yoho.yohoops.org/', 77 api: 'http://api.yoho.yohoops.org/',
77 - service: 'http://service.yoho.yohoops.org/' 78 + service: 'http://service.yoho.yohoops.org/',
  79 + favApi: 'http://192.168.102.31:8092/'
78 }, 80 },
79 memcache: { 81 memcache: {
80 master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'], 82 master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
@@ -94,7 +96,8 @@ if (isProduction) { @@ -94,7 +96,8 @@ if (isProduction) {
94 // service: 'http://dev-service.yohops.com:9999/' 96 // service: 'http://dev-service.yohops.com:9999/'
95 97
96 api: 'http://api-test1.yohops.com:9999/', 98 api: 'http://api-test1.yohops.com:9999/',
97 - service: 'http://service-test1.yohops.com:9999/' 99 + service: 'http://service-test1.yohops.com:9999/',
  100 + favApi: 'http://192.168.102.31:8092/'
98 }, 101 },
99 memcache: { 102 memcache: {
100 master: ['127.0.0.1:12111'], 103 master: ['127.0.0.1:12111'],
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 "winston": "^2.2.0", 39 "winston": "^2.2.0",
40 "winston-daily-rotate-file": "^1.1.4", 40 "winston-daily-rotate-file": "^1.1.4",
41 "yoho-md5": "^2.0.0", 41 "yoho-md5": "^2.0.0",
42 - "yoho-node-lib": "0.0.34" 42 + "yoho-node-lib": "0.0.37"
43 }, 43 },
44 "devDependencies": { 44 "devDependencies": {
45 "autoprefixer": "^6.4.0", 45 "autoprefixer": "^6.4.0",
@@ -70,6 +70,7 @@ @@ -70,6 +70,7 @@
70 "postcss-crip": "^2.0.0", 70 "postcss-crip": "^2.0.0",
71 "postcss-position": "^0.5.0", 71 "postcss-position": "^0.5.0",
72 "postcss-pxtorem": "^3.3.1", 72 "postcss-pxtorem": "^3.3.1",
  73 + "postcss-scss": "^0.1.9",
73 "postcss-short": "^1.4.0", 74 "postcss-short": "^1.4.0",
74 "postcss-sprites": "^3.3.0", 75 "postcss-sprites": "^3.3.0",
75 "postcss-use": "^2.2.0", 76 "postcss-use": "^2.2.0",
@@ -39,9 +39,6 @@ const dist = { @@ -39,9 +39,6 @@ const dist = {
39 font: `${distRoot}/assets/font` 39 font: `${distRoot}/assets/font`
40 }; 40 };
41 41
42 -// webpack 内嵌的样式中的雪碧图,写文件的时候会有冲突,这边使用单实例  
43 -let postcssSprites;  
44 -  
45 /** 42 /**
46 * postcss plugins for both dev and pro 43 * postcss plugins for both dev and pro
47 * @parem et Symbol 44 * @parem et Symbol
@@ -96,12 +93,9 @@ const postcssPlugin = (et) => { @@ -96,12 +93,9 @@ const postcssPlugin = (et) => {
96 }); 93 });
97 } 94 }
98 95
99 - if (!postcssSprites) {  
100 - postcssSprites = require('postcss-sprites').default(sprites);  
101 - }  
102 plugins = [ 96 plugins = [
103 require('precss'), 97 require('precss'),
104 - postcssSprites, 98 + require('postcss-sprites').default(sprites),
105 require('postcss-assets')(assets), 99 require('postcss-assets')(assets),
106 require('postcss-calc'), 100 require('postcss-calc'),
107 require('postcss-pxtorem')({ 101 require('postcss-pxtorem')({
@@ -149,7 +143,9 @@ gulp.task('dist', ['ge'], () => { @@ -149,7 +143,9 @@ gulp.task('dist', ['ge'], () => {
149 gulp.task('postcss-dev', () => { 143 gulp.task('postcss-dev', () => {
150 return gulp.src('scss/index.css') 144 return gulp.src('scss/index.css')
151 .pipe(sourcemaps.init()) 145 .pipe(sourcemaps.init())
152 - .pipe(postcss(postcssPlugin(env.dev))) 146 + .pipe(postcss(postcssPlugin(env.dev), {
  147 + parser: require('postcss-scss')
  148 + }))
153 .pipe(sourcemaps.write('.')) 149 .pipe(sourcemaps.write('.'))
154 .pipe(gulp.dest('css/')); 150 .pipe(gulp.dest('css/'));
155 }); 151 });
@@ -177,7 +173,9 @@ gulp.task('font', () => { @@ -177,7 +173,9 @@ gulp.task('font', () => {
177 // postcss compile in pro 173 // postcss compile in pro
178 gulp.task('postcss', ['assets'], () => { 174 gulp.task('postcss', ['assets'], () => {
179 return gulp.src('scss/index.css') 175 return gulp.src('scss/index.css')
180 - .pipe(postcss(postcssPlugin(env.pro))) 176 + .pipe(postcss(postcssPlugin(env.pro), {
  177 + parser: require('postcss-scss')
  178 + }))
181 .pipe(cssnano({ 179 .pipe(cssnano({
182 safe: true 180 safe: true
183 })) 181 }))
@@ -189,7 +187,12 @@ gulp.task('webpack-dev-server', () => { @@ -189,7 +187,12 @@ gulp.task('webpack-dev-server', () => {
189 const devConfig = Object.assign({}, webpackConfig, { 187 const devConfig = Object.assign({}, webpackConfig, {
190 devtool: '#inline-source-map', 188 devtool: '#inline-source-map',
191 vue: { 189 vue: {
192 - postcss: postcssPlugin(env.dev), 190 + postcss: {
  191 + plugins: postcssPlugin(env.dev),
  192 + options: {
  193 + parser: require('postcss-scss')
  194 + }
  195 + },
193 autoprefixer: false, 196 autoprefixer: false,
194 loaders: { 197 loaders: {
195 css: ExtractTextPlugin.extract(['css?-url']) 198 css: ExtractTextPlugin.extract(['css?-url'])
@@ -219,7 +222,12 @@ gulp.task('webpack-dev-server', () => { @@ -219,7 +222,12 @@ gulp.task('webpack-dev-server', () => {
219 gulp.task('webpack', ['assets'], (done) => { 222 gulp.task('webpack', ['assets'], (done) => {
220 const proConfig = Object.assign({}, webpackConfig, { 223 const proConfig = Object.assign({}, webpackConfig, {
221 vue: { 224 vue: {
222 - postcss: postcssPlugin(env.pro), 225 + postcss: {
  226 + plugins: postcssPlugin(env.dev),
  227 + options: {
  228 + parser: require('postcss-scss')
  229 + }
  230 + },
223 autoprefixer: false, 231 autoprefixer: false,
224 loaders: { 232 loaders: {
225 css: ExtractTextPlugin.extract(['css?-url']) 233 css: ExtractTextPlugin.extract(['css?-url'])
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 </div> 49 </div>
50 </div> 50 </div>
51 </template> 51 </template>
52 -<style class="scss"> 52 +<style>
53 $bgcolor: #fff; 53 $bgcolor: #fff;
54 54
55 .editorial-page { 55 .editorial-page {
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 return { 82 return {
83 contentCode: contentCode.editorial.all, 83 contentCode: contentCode.editorial.all,
84 editorialList: [], 84 editorialList: [],
85 - page: 0, 85 + page: 1,
86 scrollDisabled: false, 86 scrollDisabled: false,
87 channel: qs.channel 87 channel: qs.channel
88 }; 88 };
@@ -134,7 +134,7 @@ @@ -134,7 +134,7 @@
134 title: title, 134 title: title,
135 des: des, 135 des: des,
136 img: img, 136 img: img,
137 - url: `http://m.yohoblk.com/editorial/${id}.html` 137 + url: `${location.origin}/editorial/${id}.html`
138 }); 138 });
139 } 139 }
140 }, 140 },
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 title: this.article.articleTitle, 95 title: this.article.articleTitle,
96 des: '优质精选,BLK潮流资讯为你呈现', 96 des: '优质精选,BLK潮流资讯为你呈现',
97 img: util.getImgUrl(this.article.coverImage, 300, 300, 2), 97 img: util.getImgUrl(this.article.coverImage, 300, 300, 2),
98 - url: `http://m.yohoblk.com/editorial/${this.article.id}.html` 98 + url: `${location.origin}/editorial/${this.article.id}.html`
99 }); 99 });
100 } 100 }
101 }, 101 },
@@ -117,7 +117,7 @@ @@ -117,7 +117,7 @@
117 }, 117 },
118 created() { 118 created() {
119 this.domain = this.shareData.domain; 119 this.domain = this.shareData.domain;
120 - window.onscroll = this.changeTopStatus.bind(this); 120 + window.onscroll = this.changeTopStatus;
121 } 121 }
122 }; 122 };
123 </script> 123 </script>