...
|
...
|
@@ -4,25 +4,25 @@ |
|
|
<image-carousel :goods="entity.goodsList"></image-carousel>
|
|
|
<div class="title-box">
|
|
|
<h1 class="line-clamp-2">{{entity.productName}}</h1>
|
|
|
<i class="price" v-if="entity.productPriceBo.marketPrice > entity.productPriceBo.salesPrice"
|
|
|
:class="{'strike-through': entity.productPriceBo.salesPrice > 0}">{{entity.productPriceBo.formatMarketPrice}}</i>
|
|
|
<i class="price" v-if="entity.marketPrice > entity.salesPrice"
|
|
|
:class="{'strike-through': entity.salesPrice > 0}">{{entity.formatMarketPrice}}</i>
|
|
|
|
|
|
<i v-if="entity.productPriceBo.salesPrice > 0"
|
|
|
:class="{price: true, highlight: entity.productPriceBo.marketPrice > entity.productPriceBo.salesPrice}">
|
|
|
{{entity.productPriceBo.formatSalesPrice}}
|
|
|
<i v-if="entity.salesPrice > 0"
|
|
|
:class="{price: true, highlight: entity.marketPrice > entity.salesPrice}">
|
|
|
{{entity.formatSalesPrice !== '0' ? entity.formatSalesPrice : entity.formatMarketPrice}}
|
|
|
</i>
|
|
|
</div>
|
|
|
</show-box>
|
|
|
|
|
|
<show-box class="brand" v-if="entity.brand">
|
|
|
<img :src="entity.brand.brandIco | resize 110 68"/>
|
|
|
<show-box class="brand" v-if="brand">
|
|
|
<img :src="brand.brandIco | resize 110 68"/>
|
|
|
|
|
|
<h2>{{entity.brand.brandName}}</h2>
|
|
|
<h2>{{brand.brandName}}</h2>
|
|
|
<div class="brand-go">
|
|
|
<span>进入店铺</span>
|
|
|
<span class="icon icon-right"></span>
|
|
|
</div>
|
|
|
<a :href="entity.brand.brandDomain | brandUrl"></a>
|
|
|
<a :href="brand.brandDomain | brandUrl"></a>
|
|
|
</show-box>
|
|
|
|
|
|
<show-box v-if="intro.productDescBo">
|
...
|
...
|
@@ -125,7 +125,7 @@ |
|
|
<ul v-for="item in intro.productMaterialList">
|
|
|
<div>
|
|
|
<div class="image-box">
|
|
|
<img :src="item.imageUrl" width="86" height="35"/>
|
|
|
<img :src="item.imageUrl | resize 86 35" width="86" height="35"/>
|
|
|
</div>
|
|
|
<div class="text-box">
|
|
|
<div>{{item.caption}}</div>
|
...
|
...
|
@@ -153,10 +153,10 @@ |
|
|
<h2>商品详情</h2>
|
|
|
<i>DETAILS</i>
|
|
|
|
|
|
<p v-if="entity.brand && entity.brand.brandIntro" v-lazy-html="entity.brand.brandIntro">
|
|
|
<p v-if="brand && brand.brandIntro" v-lazy-html="brand.brandIntro">
|
|
|
</p>
|
|
|
|
|
|
<p v-if="entity.brand && intro.productIntroBo" v-lazy-html="intro.productIntroBo.productIntro">
|
|
|
<p v-if="brand && intro.productIntroBo" v-lazy-html="intro.productIntroBo.productIntro">
|
|
|
</p>
|
|
|
|
|
|
</show-box>
|
...
|
...
|
@@ -412,11 +412,8 @@ |
|
|
yoho: yoho,
|
|
|
intro: {},
|
|
|
firstImage: '',
|
|
|
brand: null,
|
|
|
entity: {
|
|
|
brand: {
|
|
|
brandName: '',
|
|
|
brandIco: ''
|
|
|
},
|
|
|
productPriceBo: {
|
|
|
formatMarketPrice: ''
|
|
|
}
|
...
|
...
|
@@ -480,7 +477,7 @@ |
|
|
toggleFavorite: function() {
|
|
|
$.post('/product/favorite.json', {
|
|
|
operation: this.entity.isCollect === 'Y' ? 'remove' : 'add',
|
|
|
id: this.entity.productPriceBo.productId
|
|
|
id: this.entity.productId
|
|
|
}).then((result)=> {
|
|
|
if (result.code === 200) {
|
|
|
tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功');
|
...
|
...
|
@@ -516,9 +513,10 @@ |
|
|
|
|
|
// 读取基础数据
|
|
|
$.get(`/product/product_${pid}.json`).then((result) => {
|
|
|
// TODO: 异常处理
|
|
|
this.entity = result;
|
|
|
|
|
|
if (!result.data) {
|
|
|
return;
|
|
|
}
|
|
|
this.entity = result.data;
|
|
|
if (this.entity.storage === 0 || this.entity.status === 0) {
|
|
|
this.isSoldOut = true;
|
|
|
}
|
...
|
...
|
@@ -546,12 +544,23 @@ |
|
|
})
|
|
|
});
|
|
|
|
|
|
return result;
|
|
|
}).then((result)=> {
|
|
|
// 读取商品详情
|
|
|
$.get(`/product/product/intro_${pid}.json`, {skn: result.productPriceBo.productSkn}).then(intro => {
|
|
|
this.intro = intro;
|
|
|
});
|
|
|
return result.data;
|
|
|
}).then((data)=> {
|
|
|
if (data) {
|
|
|
// 读取商品详情
|
|
|
$.get(`/product/product/intro_${pid}.json`, {skn: data.productSkn}).then(intro => {
|
|
|
this.intro = intro;
|
|
|
if (this.intro.sizeImage) {
|
|
|
this.intro.sizeImage = this.intro.sizeImage.replace(/https?:/, '');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (data.brandInfo && data.brandInfo.brandId) {
|
|
|
$.get(`/product/product/brand_${data.brandInfo.brandId}.json`).then(brand => {
|
|
|
this.brand = brand.data && brand.data.length ? brand.data[0] : {};
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.always(() => {
|
|
|
this.isReady = true;
|
...
|
...
|
|