Authored by ccbikai

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

@@ -3,6 +3,7 @@ const app = require('product/detail/index.vue'); @@ -3,6 +3,7 @@ const app = require('product/detail/index.vue');
3 const loading = require('common/loading'); 3 const loading = require('common/loading');
4 const lazyload = require('yoho-vue-lazyload'); 4 const lazyload = require('yoho-vue-lazyload');
5 5
  6 +require('common/vue-filter');
6 require('../common/overlay'); 7 require('../common/overlay');
7 8
8 Vue.use(lazyload); 9 Vue.use(lazyload);
1 <template> 1 <template>
2 - <top-nav v-if="isApp" :title="entity.productName"></top-nav> 2 + <top-nav v-if="isApp" :title="entity.productName" :img="firstImage | resize 300 300"></top-nav>
3 <show-box :is-first="true"> 3 <show-box :is-first="true">
4 <image-carousel :goods="entity.goodsList"></image-carousel> 4 <image-carousel :goods="entity.goodsList"></image-carousel>
5 <div class="title-box"> 5 <div class="title-box">
@@ -401,6 +401,7 @@ @@ -401,6 +401,7 @@
401 yoho: yoho, 401 yoho: yoho,
402 isApp: yoho.isApp, 402 isApp: yoho.isApp,
403 intro: {}, 403 intro: {},
  404 + firstImage: '',
404 entity: { 405 entity: {
405 brand: { 406 brand: {
406 brandName: '', 407 brandName: '',
@@ -508,6 +509,13 @@ @@ -508,6 +509,13 @@
508 $.get(`/product/product_${pid}.json`).then((result) => { 509 $.get(`/product/product_${pid}.json`).then((result) => {
509 // TODO: 异常处理 510 // TODO: 异常处理
510 this.entity = result; 511 this.entity = result;
  512 +
  513 + this.entity.goodsList.forEach((goods)=> {
  514 + if (!this.firstImage && goods.colorImage) {
  515 + this.firstImage = goods.colorImage;
  516 + }
  517 + });
  518 +
511 return result; 519 return result;
512 }).then((result)=> { 520 }).then((result)=> {
513 loadIntroDeferred = () => { 521 loadIntroDeferred = () => {
@@ -38,13 +38,15 @@ @@ -38,13 +38,15 @@
38 }; 38 };
39 }, 39 },
40 props: { 40 props: {
41 - title: 'String' 41 + title: String,
  42 + img: String
42 }, 43 },
43 methods: { 44 methods: {
44 share: function() { 45 share: function() {
45 yoho.goShare({ 46 yoho.goShare({
46 title: this.title || '', 47 title: this.title || '',
47 des: '我在BLK发现了一个不错的商品,快来看看吧!', 48 des: '我在BLK发现了一个不错的商品,快来看看吧!',
  49 + img: this.img,
48 url: location.href 50 url: location.href
49 }); 51 });
50 } 52 }