Authored by 陈峰

merge

@@ -63,8 +63,7 @@ const component = { @@ -63,8 +63,7 @@ const component = {
63 63
64 product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line 64 product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line
65 product.isDiscount = product.market_price > product.sales_price; 65 product.isDiscount = product.market_price > product.sales_price;
66 -  
67 - product.coverImage = product.goods_list[0].color_image; 66 + product.coverImage = _.get(product, 'goods_list[0].images_list[0].image_url');
68 67
69 res.render('pdetail', { 68 res.render('pdetail', {
70 module: 'product', 69 module: 'product',
@@ -11,16 +11,16 @@ const isTest = process.env.NODE_ENV === 'test'; @@ -11,16 +11,16 @@ const isTest = process.env.NODE_ENV === 'test';
11 11
12 module.exports = { 12 module.exports = {
13 app: 'h5', 13 app: 'h5',
14 - appVersion: '5.5.2', // 调用api的版本 14 + appVersion: '5.6.0', // 调用api的版本
15 port: 6004, 15 port: 6004,
16 siteUrl: '//m.yohoblk.com', 16 siteUrl: '//m.yohoblk.com',
17 signExtend: { 17 signExtend: {
18 app_type: 1 18 app_type: 1
19 }, 19 },
20 domains: { 20 domains: {
21 - // api: 'http://api-test3.yohops.com:9999/',  
22 - // service: 'http://service-test3.yohops.com:9999/',  
23 - // singleApi: 'http://api-test3.yohops.com:9999/' 21 + api: 'http://api-test3.yohops.com:9999/',
  22 + service: 'http://service-test3.yohops.com:9999/',
  23 + singleApi: 'http://api-test3.yohops.com:9999/'
24 24
25 // api: 'http://api-test2.yohops.com:9999/', 25 // api: 'http://api-test2.yohops.com:9999/',
26 // service: 'http://service-test2.yohops.com:9999/', 26 // service: 'http://service-test2.yohops.com:9999/',
@@ -29,9 +29,9 @@ module.exports = { @@ -29,9 +29,9 @@ module.exports = {
29 // service: 'http://dev-service.yohops.com:9999/', 29 // service: 'http://dev-service.yohops.com:9999/',
30 // singleApi: 'http://192.168.102.27:8092/' 30 // singleApi: 'http://192.168.102.27:8092/'
31 // // 31 // //
32 - api: 'http://api.yoho.cn/',  
33 - service: 'http://service.yoho.cn/',  
34 - singleApi: 'http://single.yoho.cn/' 32 + // api: 'http://api.yoho.cn/',
  33 + // service: 'http://service.yoho.cn/',
  34 + // singleApi: 'http://single.yoho.cn/'
35 }, 35 },
36 subDomains: { 36 subDomains: {
37 host: '.m.yohoblk.com', 37 host: '.m.yohoblk.com',
@@ -100,9 +100,9 @@ if (isProduction) { @@ -100,9 +100,9 @@ if (isProduction) {
100 singleApi: 'http://single.yoho.cn/' 100 singleApi: 'http://single.yoho.cn/'
101 }, 101 },
102 memcache: { 102 memcache: {
103 - master: ['127.0.0.1:11211'],  
104 - slave: ['127.0.0.1:11211'],  
105 - session: ['127.0.0.1:11211'], 103 + master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
  104 + slave: [],
  105 + session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
106 timeout: 100, 106 timeout: 100,
107 retries: 0 107 retries: 0
108 }, 108 },
1 { 1 {
2 "name": "yohoblk-wap", 2 "name": "yohoblk-wap",
3 - "version": "92.0.20", 3 + "version": "92.0.21",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -25,6 +25,7 @@ const hbsLoader = { @@ -25,6 +25,7 @@ const hbsLoader = {
25 const getEntries = () => { 25 const getEntries = () => {
26 const entries = { 26 const entries = {
27 libs: [ 27 libs: [
  28 + 'babel-polyfill',
28 'jquery', 29 'jquery',
29 'yoho-qs', 30 'yoho-qs',
30 'yoho-cookie', 31 'yoho-cookie',
@@ -137,7 +138,7 @@ module.exports = { @@ -137,7 +138,7 @@ module.exports = {
137 ], 138 ],
138 resolve: { 139 resolve: {
139 alias: { 140 alias: {
140 - vue: 'vue/dist/vue.js' 141 + vue$: 'vue/dist/vue.esm.js',
141 }, 142 },
142 extensions: ['.js', '.json', '.css', '.scss', 'vue'], 143 extensions: ['.js', '.json', '.css', '.scss', 'vue'],
143 modules: [ 144 modules: [
@@ -19,7 +19,7 @@ const origin = location.origin; @@ -19,7 +19,7 @@ const origin = location.origin;
19 */ 19 */
20 const defaultTitleMap = { 20 const defaultTitleMap = {
21 1: { 21 1: {
22 - headerid: '1', 22 + headerid: '-1',
23 left: { 23 left: {
24 action: '' 24 action: ''
25 }, 25 },
@@ -66,6 +66,9 @@ $(() => { @@ -66,6 +66,9 @@ $(() => {
66 66
67 // 拦截页面内所有 a 标签的跳转 67 // 拦截页面内所有 a 标签的跳转
68 $body.on('click', 'a[href]', function() { 68 $body.on('click', 'a[href]', function() {
  69 + if ($(this).hasClass('no-link')) {
  70 + return false;
  71 + }
69 if (!$(this).hasClass('no-intercept')) { 72 if (!$(this).hasClass('no-intercept')) {
70 let href = $(this).attr('href'); 73 let href = $(this).attr('href');
71 74
@@ -58,7 +58,7 @@ export default { @@ -58,7 +58,7 @@ export default {
58 return {}; 58 return {};
59 }, 59 },
60 buttonText() { 60 buttonText() {
61 - if (this.value.storage_sum <= 0) { 61 + if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
62 return '已售罄'; 62 return '已售罄';
63 } 63 }
64 return '加入购物车'; 64 return '加入购物车';
@@ -156,7 +156,7 @@ export default { @@ -156,7 +156,7 @@ export default {
156 return yoho.goLogin(); 156 return yoho.goLogin();
157 } 157 }
158 158
159 - if (this.value.storage_sum <= 0) { 159 + if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
160 return; 160 return;
161 } 161 }
162 if (!this.colorId) { 162 if (!this.colorId) {
@@ -3,16 +3,16 @@ @@ -3,16 +3,16 @@
3 <ul class="cardlist card-large clearfix"> 3 <ul class="cardlist card-large clearfix">
4 <li class="card" v-for="(item, index) in data" :key="item.product_skn" @click="clickProduct(item, index)"> 4 <li class="card" v-for="(item, index) in data" :key="item.product_skn" @click="clickProduct(item, index)">
5 <div class="card-pic"> 5 <div class="card-pic">
6 - <a v-good-href="item"> 6 + <a v-good-href="item" :class="hrefClass">
7 <img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name"> 7 <img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name">
8 </a> 8 </a>
9 </div> 9 </div>
10 <div class="card-bd"> 10 <div class="card-bd">
11 <h2 class="card-label"> 11 <h2 class="card-label">
12 - <a v-good-href="item" class="line-clamp-1">{{item.product_name}}</a> 12 + <a v-good-href="item" class="line-clamp-1" :class="hrefClass">{{item.product_name}}</a>
13 </h2> 13 </h2>
14 <h2 class="card-label-desc" v-if="item.product_name1"> 14 <h2 class="card-label-desc" v-if="item.product_name1">
15 - <a v-good-href="item" class="line-clamp-1">{{item.product_name}}</a> 15 + <a v-good-href="item" class="line-clamp-1" :class="hrefClass">{{item.product_name}}</a>
16 </h2> 16 </h2>
17 <span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span> 17 <span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span>
18 <span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span> 18 <span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span>
@@ -30,16 +30,20 @@ @@ -30,16 +30,20 @@
30 </div> 30 </div>
31 </template> 31 </template>
32 <script> 32 <script>
33 - import Vue from 'vue';  
34 - import lazyload from 'vue-lazyload';  
35 - import infinitScroll from 'vue-infinite-scroll';  
36 - import bus from 'common/vue-bus';  
37 -  
38 - Vue.use(lazyload, { preLoad: 3 });  
39 - Vue.use(infinitScroll);  
40 -  
41 -  
42 - export default { 33 +import Vue from 'vue';
  34 +import lazyload from 'vue-lazyload';
  35 +import infinitScroll from 'vue-infinite-scroll';
  36 +import bus from 'common/vue-bus';
  37 +
  38 +Vue.use(lazyload, { preLoad: 3 });
  39 +Vue.use(infinitScroll);
  40 +
  41 +export default {
  42 + data() {
  43 + return {
  44 + hrefClass: {}
  45 + };
  46 + },
43 props: { 47 props: {
44 /* 开启滚动加载 */ 48 /* 开启滚动加载 */
45 disableFetch: Boolean, 49 disableFetch: Boolean,
@@ -54,33 +58,72 @@ @@ -54,33 +58,72 @@
54 return !this.data.length; 58 return !this.data.length;
55 } 59 }
56 }, 60 },
  61 + mounted() {
  62 + const $scrollEl = this.getScrollEventTarget(this.$el);
  63 +
  64 + $scrollEl.addEventListener('scroll', this.throttle(this.scrollEnd, 200));
  65 + },
57 methods: { 66 methods: {
58 fetch: function() { 67 fetch: function() {
59 bus.$emit('list.paging'); 68 bus.$emit('list.paging');
60 }, 69 },
61 clickProduct(item, index) { 70 clickProduct(item, index) {
62 this.$emit('click-product', item, index); 71 this.$emit('click-product', item, index);
  72 + },
  73 + scrollEnd() {
  74 + this.hrefClass = {};
  75 + },
  76 + getScrollEventTarget(element) {
  77 + let getComputedStyle = document.defaultView.getComputedStyle;
  78 + let currentNode = element;
  79 +
  80 + while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) {
  81 + let overflowY = getComputedStyle(currentNode).overflowY;
  82 +
  83 + if (overflowY === 'scroll' || overflowY === 'auto') {
  84 + return currentNode;
  85 + }
  86 + currentNode = currentNode.parentNode;
63 } 87 }
  88 + return window;
  89 + },
  90 + throttle(fn, delay) {
  91 + let timer;
  92 +
  93 + return () => {
  94 + if (timer) {
  95 + clearTimeout(timer);
  96 + timer = null;
64 } 97 }
  98 + this.hrefClass = {
  99 + 'no-link': true
65 }; 100 };
66 101
  102 + timer = setTimeout(() => {
  103 + fn();
  104 + }, delay);
  105 + };
  106 + }
  107 + }
  108 +};
  109 +
67 </script> 110 </script>
68 <style> 111 <style>
69 - @import "../../../scss/common/_color.css"; 112 +@import "../../../scss/common/_color.css";
70 113
71 - .cardlist { 114 +.cardlist {
72 list-style: none; 115 list-style: none;
73 margin: 0; 116 margin: 0;
74 padding: 0; 117 padding: 0;
75 - } 118 +}
76 119
77 - .cardlist--loading { 120 +.cardlist--loading {
78 font-size: 32px; 121 font-size: 32px;
79 text-align: center; 122 text-align: center;
80 padding: 16px 0; 123 padding: 16px 0;
81 - } 124 +}
82 125
83 - .card-large { 126 +.card-large {
84 background-color: #fff; 127 background-color: #fff;
85 128
86 .card { 129 .card {
@@ -130,9 +173,9 @@ @@ -130,9 +173,9 @@
130 color: #888; 173 color: #888;
131 } 174 }
132 } 175 }
133 - } 176 +}
134 177
135 - .good-price { 178 +.good-price {
136 color: #b0b0b0; 179 color: #b0b0b0;
137 margin-right: 14px; 180 margin-right: 14px;
138 font-size: 24px; 181 font-size: 24px;
@@ -150,9 +193,9 @@ @@ -150,9 +193,9 @@
150 &.sale-price { 193 &.sale-price {
151 color: #000; 194 color: #000;
152 } 195 }
153 - } 196 +}
154 197
155 - .empty-tip { 198 +.empty-tip {
156 margin-top: 200px; 199 margin-top: 200px;
157 color: #b0b0b0; 200 color: #b0b0b0;
158 text-align: center; 201 text-align: center;
@@ -162,15 +205,14 @@ @@ -162,15 +205,14 @@
162 font-size: 200px; 205 font-size: 200px;
163 margin-bottom: 56px; 206 margin-bottom: 56px;
164 } 207 }
165 - } 208 +}
166 209
167 - .empty-tip-cn { 210 +.empty-tip-cn {
168 font-size: 34px; 211 font-size: 34px;
169 margin-bottom: 30px; 212 margin-bottom: 30px;
170 - } 213 +}
171 214
172 - .empty-tip-en { 215 +.empty-tip-en {
173 font-size: 20px; 216 font-size: 20px;
174 - }  
175 - 217 +}
176 </style> 218 </style>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <swiper :options="swiperOption" ref="swiper"> 4 <swiper :options="swiperOption" ref="swiper">
5 <swiper-slide v-for="item in goodsList" :key="item.title"> 5 <swiper-slide v-for="item in goodsList" :key="item.title">
6 <img :title="item.title" 6 <img :title="item.title"
7 - v-img-src="{src: item.color_image, width: 580, height: 770}" 7 + v-img-src="{src: item.image_url, width: 580, height: 770}"
8 width="100%"> 8 width="100%">
9 </swiper-slide> 9 </swiper-slide>
10 </swiper> 10 </swiper>
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 </template> 19 </template>
20 <script> 20 <script>
21 require('swiper/dist/css/swiper.css'); 21 require('swiper/dist/css/swiper.css');
  22 + import _ from 'lodash';
22 import yoho from 'yoho'; 23 import yoho from 'yoho';
23 import util from 'common/util'; 24 import util from 'common/util';
24 import vas from 'vue-awesome-swiper'; 25 import vas from 'vue-awesome-swiper';
@@ -55,8 +56,16 @@ @@ -55,8 +56,16 @@
55 } 56 }
56 }, 57 },
57 watch: { 58 watch: {
58 - goods(val) {  
59 - let temp = val.slice(); 59 + goods(list) {
  60 + let temp = [];
  61 + _.each(list, item => {
  62 + _.each(item.images_list, img => {
  63 + temp.push({
  64 + image_url: img.image_url
  65 + });
  66 + });
  67 + });
  68 +
60 const len = temp.length; 69 const len = temp.length;
61 70
62 if (len > 1) { 71 if (len > 1) {
@@ -64,7 +73,7 @@ @@ -64,7 +73,7 @@
64 } 73 }
65 74
66 this.goodsList = temp; 75 this.goodsList = temp;
67 - this.slideCount = this.goodsList.length; 76 + this.slideCount = len;
68 } 77 }
69 }, 78 },
70 methods: { 79 methods: {
@@ -282,6 +282,8 @@ @@ -282,6 +282,8 @@
282 import shoppingBag from 'component/product/shopping-bag.vue'; 282 import shoppingBag from 'component/product/shopping-bag.vue';
283 import operationBar from './operation-bar.vue'; 283 import operationBar from './operation-bar.vue';
284 import 'common/back-top'; 284 import 'common/back-top';
  285 + import cookie from 'yoho-cookie';
  286 + import qs from 'yoho-qs';
285 287
286 288
287 const app = $('#app'); 289 const app = $('#app');
@@ -412,9 +414,14 @@ @@ -412,9 +414,14 @@
412 } 414 }
413 }); 415 });
414 416
  417 + const origin = location.origin;
  418 + const pathname = location.pathname;
  419 + const channel = cookie.get('_Channel') || 'men';
  420 + const queryStr = $.param(Object.assign(qs, {channel}));
  421 +
415 share({ 422 share({
416 title: this.entity.product_name, 423 title: this.entity.product_name,
417 - link: location.href, 424 + link: `${origin}${pathname}?${queryStr}`,
418 desc: '我在BLK发现了一个不错的商品,快来看看吧!', 425 desc: '我在BLK发现了一个不错的商品,快来看看吧!',
419 imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) { 426 imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) {
420 const dict = { 427 const dict = {
@@ -654,7 +661,7 @@ @@ -654,7 +661,7 @@
654 661
655 &.highlight { 662 &.highlight {
656 line-height: 1; 663 line-height: 1;
657 - color: #b0021b; 664 + color: #000;
658 } 665 }
659 } 666 }
660 667
@@ -56,8 +56,11 @@ @@ -56,8 +56,11 @@
56 } 56 }
57 </style> 57 </style>
58 <script> 58 <script>
  59 + import $ from 'yoho-jquery';
59 import yoho from 'yoho'; 60 import yoho from 'yoho';
60 import tip from 'common/tip'; 61 import tip from 'common/tip';
  62 + import cookie from 'yoho-cookie';
  63 + import qs from 'yoho-qs';
61 64
62 export default { 65 export default {
63 name: 'operation-bar', 66 name: 'operation-bar',
@@ -82,11 +85,16 @@ @@ -82,11 +85,16 @@
82 }, 85 },
83 methods: { 86 methods: {
84 share() { 87 share() {
  88 + const origin = location.origin;
  89 + const pathname = location.pathname;
  90 + const channel = cookie.get('_Channel') || 'men';
  91 + const queryStr = $.param(Object.assign(qs, {channel}));
  92 +
85 yoho.goShare({ 93 yoho.goShare({
86 title: this.shareTitle || '', 94 title: this.shareTitle || '',
87 des: '我在BLK发现了一个不错的商品,快来看看吧!', 95 des: '我在BLK发现了一个不错的商品,快来看看吧!',
88 img: location.protocol + this.shareImg, 96 img: location.protocol + this.shareImg,
89 - url: location.href 97 + url: `${origin}${pathname}?${queryStr}`
90 }); 98 });
91 }, 99 },
92 toggleFavorite: function() { 100 toggleFavorite: function() {
@@ -52,6 +52,10 @@ module.exports = (list, options) => { @@ -52,6 +52,10 @@ module.exports = (list, options) => {
52 yhChannel: '' 52 yhChannel: ''
53 }, options); 53 }, options);
54 54
  55 + if (Array.isArray(options.gender)) {
  56 + options.gender = options.gender[0];
  57 + }
  58 +
55 let genderVal = options.gender.split(','); 59 let genderVal = options.gender.split(',');
56 60
57 if (genderVal.indexOf(genderMap.men) && genderVal.indexOf(genderMap.women)) { // 男女 通吃 61 if (genderVal.indexOf(genderMap.men) && genderVal.indexOf(genderMap.women)) { // 男女 通吃
This diff could not be displayed because it is too large.