|
|
@@ -12,8 +12,8 @@
|
|
|
<banner :banners="banners" :height="375" :radius="0" :autoplay="false"></banner>
|
|
|
<div class="main" id="main">
|
|
|
<div class="info">
|
|
|
- <div class="ad">
|
|
|
- <span>可在MT展厅线下体验,点击查看地址</span>
|
|
|
+ <div class="ad" @click="goLocation">
|
|
|
+ <span>可在IMT展厅线下体验,点击查看地址</span>
|
|
|
<img src="../static/imgs/iocn_dingwei.png" alt="" />
|
|
|
</div>
|
|
|
|
|
|
@@ -80,9 +80,9 @@
|
|
|
>
|
|
|
<van-tab title="图文详情">
|
|
|
<div class="detail-content">
|
|
|
+ <div class="tips" v-html="introduction"></div>
|
|
|
<!-- <rich-text v-if="detailImg" :nodes="detailImg"></rich-text> -->
|
|
|
<div v-html="detailImg" v-if="detailImg"></div>
|
|
|
- <van-empty v-else description="暂无详情" />
|
|
|
</div>
|
|
|
</van-tab>
|
|
|
<van-tab title="详细参数">
|
|
|
@@ -90,7 +90,7 @@
|
|
|
<parameter :productId="productId"></parameter>
|
|
|
</div>
|
|
|
</van-tab>
|
|
|
- <van-tab title="PDF资料" v-if="productInfo.pdf">
|
|
|
+ <van-tab title="PDF资料" v-if="pdf.length > 0">
|
|
|
正在打开pdf...
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
@@ -200,11 +200,10 @@ export default {
|
|
|
.includes(Number(this.productId));
|
|
|
},
|
|
|
pdf() {
|
|
|
- return this.productInfo.pdf
|
|
|
- ? this.productInfo.pdf.split(',').filter(item => {
|
|
|
- return item;
|
|
|
- })
|
|
|
- : [];
|
|
|
+ return this.productInfo.pdf1 ? this.productInfo.pdf1 : [];
|
|
|
+ },
|
|
|
+ introduction() {
|
|
|
+ return (this.productInfo.introduction || '').replace(/\n/g, '<br/>');
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -224,62 +223,42 @@ export default {
|
|
|
saveBrowse(this.productId);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ },
|
|
|
+ onPageScroll() {},
|
|
|
+ onReady() {
|
|
|
setTimeout(() => {
|
|
|
wx.createSelectorQuery()
|
|
|
- .selectAll('.a-class')
|
|
|
- .boundingClientRect(function(rects) {
|
|
|
- rects.forEach(function(rect) {
|
|
|
- rect.id; // 节点的ID
|
|
|
- rect.dataset; // 节点的dataset
|
|
|
- rect.left; // 节点的左边界坐标
|
|
|
- rect.right; // 节点的右边界坐标
|
|
|
- rect.top; // 节点的上边界坐标
|
|
|
- rect.bottom; // 节点的下边界坐标
|
|
|
- rect.width; // 节点的宽度
|
|
|
- rect.height; // 节点的高度
|
|
|
- });
|
|
|
+ .select('#main')
|
|
|
+ .boundingClientRect(rect => {
|
|
|
+ const mainHeight = rect.height;
|
|
|
+ wx.createSelectorQuery()
|
|
|
+ .select('#detail')
|
|
|
+ .boundingClientRect(rect => {
|
|
|
+ this.detailTop = mainHeight - rect.height + rect.width + -this.barHeight - 30;
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
})
|
|
|
.exec();
|
|
|
- }, 1500);
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
- onPageScroll() {},
|
|
|
methods: {
|
|
|
tabClick(e) {
|
|
|
- console.log(e);
|
|
|
- if (!this.detailTop) {
|
|
|
- wx.createSelectorQuery()
|
|
|
- .select('#main')
|
|
|
- .boundingClientRect(rect => {
|
|
|
- const mainHeight = rect.height;
|
|
|
- wx.createSelectorQuery()
|
|
|
- .select('#detail')
|
|
|
- .boundingClientRect(rect => {
|
|
|
- this.detailTop = mainHeight - rect.height + 375 - 51;
|
|
|
- wx.pageScrollTo({
|
|
|
- scrollTop: this.detailTop,
|
|
|
- duration: 300
|
|
|
- });
|
|
|
- })
|
|
|
- .exec();
|
|
|
- })
|
|
|
- .exec();
|
|
|
- } else {
|
|
|
- wx.pageScrollTo({
|
|
|
- scrollTop: this.detailTop,
|
|
|
- duration: 300
|
|
|
- });
|
|
|
- }
|
|
|
+ wx.pageScrollTo({
|
|
|
+ scrollTop: this.detailTop,
|
|
|
+ duration: 300
|
|
|
+ });
|
|
|
this.hotActive = e.detail.index;
|
|
|
+ console.log(this.pdf);
|
|
|
if (e.detail.index === 2) {
|
|
|
wx.showActionSheet({
|
|
|
itemList: [...this.pdf].map((item, index) => {
|
|
|
- return '查看pdf文件' + (index + 1);
|
|
|
+ console.log(item);
|
|
|
+ return '查看pdf文件' + item.name;
|
|
|
}),
|
|
|
success: res => {
|
|
|
this.hotActive = 0;
|
|
|
wx.downloadFile({
|
|
|
- url: this.pdf[res.tapIndex],
|
|
|
+ url: this.pdf[res.tapIndex].url,
|
|
|
success: res => {
|
|
|
const filePath = res.tempFilePath;
|
|
|
|
|
|
@@ -326,6 +305,14 @@ export default {
|
|
|
this.$store.commit('updateChooseList', [this.productInfo]);
|
|
|
console.log(this.$store.state.chooseList);
|
|
|
this.navigateTo('/pagesVendor/Connect?productId=' + this.productId + '&userId=' + this.vendorInfo.userId);
|
|
|
+ },
|
|
|
+ goLocation() {
|
|
|
+ wx.openLocation({
|
|
|
+ latitude: 31.298919,
|
|
|
+ longitude: 121.629521,
|
|
|
+ name: 'imt机床展示区',
|
|
|
+ address: '中国(上海)自由贸易试验区富特东三路526号'
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -333,6 +320,13 @@ export default {
|
|
|
<style lang="less">
|
|
|
.main {
|
|
|
background-color: @bgw;
|
|
|
+
|
|
|
+ .tips {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #292c33;
|
|
|
+ line-height: 24px;
|
|
|
+ padding: 20px 16px;
|
|
|
+ }
|
|
|
}
|
|
|
.info {
|
|
|
padding: 12px 16px 30px;
|