|
|
@@ -6,13 +6,15 @@ |
|
|
|
<img :src="formatImg(mainImg)" alt="main-img" /> |
|
|
|
</div> |
|
|
|
<div class="main-item"> |
|
|
|
<div |
|
|
|
class="main-title" |
|
|
|
:title="productDetail.productName" |
|
|
|
>{{ productDetail.productName }}</div> |
|
|
|
<div class="main-title" :title="productDetail.productName"> |
|
|
|
{{ productDetail.productName }} |
|
|
|
</div> |
|
|
|
<div class="main-price"> |
|
|
|
<span class="price-label">价格:</span> |
|
|
|
<span class="price-value"><span v-if="productDetail.showPrice !== '面议'">¥</span>{{ productDetail.showPrice }}</span> |
|
|
|
<span class="price-value"> |
|
|
|
<span v-if="productDetail.showPrice !== '面议'">¥</span> |
|
|
|
{{ productDetail.showPrice }} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div class="mian-detail" :title="productDetail.productDescription"> |
|
|
|
<span class="mian-detail-span">简介:</span> |
|
|
@@ -23,14 +25,15 @@ |
|
|
|
src="~@assets/image/product/consult-icon.png" |
|
|
|
class="consult-icon" |
|
|
|
alt="icon" |
|
|
|
/> 立即咨询 |
|
|
|
/> |
|
|
|
立即咨询 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="server-detail"> |
|
|
|
<div class="server-title">服务详情</div> |
|
|
|
<div class="server-content"> |
|
|
|
<div v-html="parseMarkdown(productDetail.productDetail) "></div> |
|
|
|
<div v-html="parseMarkdown(productDetail.productDetail)"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -39,9 +42,10 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import "./ProductDetail.scss"; |
|
|
|
import { getByIdServiceProduct } from "@api/index.js"; |
|
|
|
import { getByIdServiceProduct, addProductPageView } from "@api/index.js"; |
|
|
|
import { parseMarkdown, formatImg } from "@/utils/common"; |
|
|
|
import { linkCustomerService } from "@mixin/customerService"; |
|
|
|
import QS from "qs"; |
|
|
|
export default { |
|
|
|
mixins: [linkCustomerService], |
|
|
|
data() { |
|
|
@@ -54,6 +58,7 @@ export default { |
|
|
|
mounted() { |
|
|
|
this.parkServiceProductId = this.$route.query.parkServiceProductId; |
|
|
|
this.getByIdServiceProduct(); |
|
|
|
this.addPageView(this.parkServiceProductId); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getByIdServiceProduct() { |
|
|
@@ -64,21 +69,19 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
getByIdServiceProduct({ parkServiceProductId }) |
|
|
|
.then((res) => { |
|
|
|
.then(res => { |
|
|
|
const data = res.data; |
|
|
|
if (data.status == 0) { |
|
|
|
this.productDetail = data.data; |
|
|
|
let { productMasterImg } = this.productDetail; |
|
|
|
this.mainImg = productMasterImg |
|
|
|
? productMasterImg[0] |
|
|
|
: ""; |
|
|
|
this.mainImg = productMasterImg ? productMasterImg[0] : ""; |
|
|
|
} else if (data.status == 101) { |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
this.pageLoading = false; |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
this.$message.error("获取详情失败,请尝试刷新页面后重试。"); |
|
|
|
this.pageLoading = false; |
|
|
@@ -93,7 +96,23 @@ export default { |
|
|
|
formatImg(url) { |
|
|
|
return formatImg(url); |
|
|
|
}, |
|
|
|
addPageView(parkServiceProductId) { |
|
|
|
let params ={ |
|
|
|
parkServiceProductId |
|
|
|
} |
|
|
|
addProductPageView(QS.stringify(params)) |
|
|
|
.then(res => { |
|
|
|
const data = res.data; |
|
|
|
if (data.status == 0) { |
|
|
|
console.log(`正在访问产品详情页`); |
|
|
|
} else { |
|
|
|
console.log(`统计访问数失败`); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log(`统计访问数失败,失败原因:${err}`); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|