|
|
@@ -8,7 +8,7 @@
|
|
|
</config>
|
|
|
<template>
|
|
|
<div>
|
|
|
- <custom-bar title="产品详情" :pre="0" :dark="!!productInfo.video" :barTop="375"></custom-bar>
|
|
|
+ <custom-bar detail title="产品详情" :pre="0" :dark="!!productInfo.video" :barTop="375"></custom-bar>
|
|
|
<banner :banners="banners" :height="375" :radius="0" :autoplay="false"></banner>
|
|
|
<div class="main" id="main">
|
|
|
<div id="detailTop">
|
|
|
@@ -25,20 +25,25 @@
|
|
|
<div class="sub">{{ productInfo.model }}</div>
|
|
|
|
|
|
<div class="btn">
|
|
|
- <van-icon
|
|
|
- @click="collection"
|
|
|
- :custom-class="animate ? 'my-icon iconAnimate' : 'my-icon'"
|
|
|
- :name="isCollection ? 'icon-aixin' : 'icon-icon_collect'"
|
|
|
- :size="42"
|
|
|
- :color="isCollection ? $colors.warn : '#BCC1CC'"
|
|
|
- class-prefix="iconfont"
|
|
|
- />
|
|
|
- <van-button
|
|
|
- plain
|
|
|
- icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/icon_share.png"
|
|
|
- size="small"
|
|
|
- open-type="share"
|
|
|
- ></van-button>
|
|
|
+ <div :class="animate ? 'my-icon iconAnimate' : 'my-icon'" @click="collection">
|
|
|
+ <van-icon
|
|
|
+ v-if="isCollection"
|
|
|
+ :size="24"
|
|
|
+ name="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/icon_collect_pre.png"
|
|
|
+ />
|
|
|
+ <van-icon
|
|
|
+ v-else
|
|
|
+ name="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/icon_collect.png"
|
|
|
+ :size="24"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button class="share" open-type="share">
|
|
|
+ <van-icon
|
|
|
+ name="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/icon_share.png"
|
|
|
+ :size="24"
|
|
|
+ />
|
|
|
+ </button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<van-divider />
|
|
|
@@ -71,7 +76,11 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="vendor" @click="navigateTo('/pagesVendor/Detail?id=' + vendorInfo.id)">
|
|
|
- <van-image class="logo" :radius="4" :src="vendorInfo.logo" :width="60" :height="60" />
|
|
|
+ <image
|
|
|
+ :src="vendorInfo.logo"
|
|
|
+ style="width:60px;height:60px;border-radius:4px;border:1px solid #f2f4f5"
|
|
|
+ />
|
|
|
+ <!-- <van-image class="logo" :radius="4" :src="vendorInfo.logo" :width="60" :height="60" /> -->
|
|
|
<div class="vendor-info">
|
|
|
<div class="vendor-title">
|
|
|
<h3>
|
|
|
@@ -127,7 +136,16 @@
|
|
|
</van-tab>
|
|
|
<van-tab title="PDF资料" name="pdf" v-if="pdf.length > 0">
|
|
|
<div class="detail-content">
|
|
|
- 正在打开pdf...
|
|
|
+ <van-empty
|
|
|
+ class="pdf"
|
|
|
+ image="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/kong_img_pdf.png"
|
|
|
+ >
|
|
|
+ <div class="empty-button">
|
|
|
+ <van-button @click="showPdf" :radius="4" color="#F5F7FA" block
|
|
|
+ >查看PDF文件</van-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </van-empty>
|
|
|
</div>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
@@ -158,6 +176,7 @@
|
|
|
:radius="0"
|
|
|
:disabled="isIntented"
|
|
|
@click="addIntentionList"
|
|
|
+ class="intentionList"
|
|
|
>{{ isIntented ? '已添加' : '添加意向单' }}</van-button
|
|
|
>
|
|
|
<van-button :color="$colors.warn" @click="goConnect" type="primary" :radius="0"
|
|
|
@@ -344,36 +363,39 @@ export default {
|
|
|
tabChange(e) {
|
|
|
this.hotActive = e.detail.index;
|
|
|
if (e.detail.name === 'pdf') {
|
|
|
- wx.showActionSheet({
|
|
|
- itemList: [...this.pdf].map((item, index) => {
|
|
|
- const name = item.name.indexOf('http') !== -1 ? `文件${index + 1}` : item.name;
|
|
|
- return name;
|
|
|
- }),
|
|
|
- success: res => {
|
|
|
- this.$loading('加载中...');
|
|
|
- wx.downloadFile({
|
|
|
- url: this.pdf[res.tapIndex].url,
|
|
|
- fileType: 'pdf',
|
|
|
- success: res => {
|
|
|
- this.hotActive = 0;
|
|
|
- console.log(res);
|
|
|
- const filePath = res.tempFilePath;
|
|
|
- wx.openDocument({
|
|
|
- filePath: filePath,
|
|
|
- success: res => {}
|
|
|
- });
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- this.$loading.close();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- fail(res) {
|
|
|
- console.log(res.errMsg);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.showPdf();
|
|
|
}
|
|
|
},
|
|
|
+ showPdf() {
|
|
|
+ wx.showActionSheet({
|
|
|
+ itemList: [...this.pdf].map((item, index) => {
|
|
|
+ const name = item.name.indexOf('http') !== -1 ? `文件${index + 1}` : item.name;
|
|
|
+ return name;
|
|
|
+ }),
|
|
|
+ success: res => {
|
|
|
+ this.$loading('加载中...');
|
|
|
+ wx.downloadFile({
|
|
|
+ url: this.pdf[res.tapIndex].url,
|
|
|
+ fileType: 'pdf',
|
|
|
+ success: res => {
|
|
|
+ this.hotActive = 0;
|
|
|
+ console.log(res);
|
|
|
+ const filePath = res.tempFilePath;
|
|
|
+ wx.openDocument({
|
|
|
+ filePath: filePath,
|
|
|
+ success: res => {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ complete: () => {
|
|
|
+ this.$loading.close();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
tabClick(e) {
|
|
|
wx.pageScrollTo({
|
|
|
scrollTop: this.detailTop,
|
|
|
@@ -503,24 +525,24 @@ export default {
|
|
|
.btn {
|
|
|
position: absolute;
|
|
|
right: 0px;
|
|
|
- bottom: 0px;
|
|
|
+ bottom: 10px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
|
|
|
- ._van-icon {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
+ // ._van-icon {
|
|
|
+ // margin-left: 10px;
|
|
|
+ // }
|
|
|
|
|
|
- ._van-button {
|
|
|
- height: 40px;
|
|
|
- margin-left: 5px;
|
|
|
- }
|
|
|
+ // ._van-button {
|
|
|
+ // height: 40px;
|
|
|
+ // margin-left: 5px;
|
|
|
+ // }
|
|
|
|
|
|
.van-button {
|
|
|
--button-small-min-width: 0px;
|
|
|
--button-small-height: 40px;
|
|
|
--button-border-width: 0px;
|
|
|
- --button-small-font-size: 24px;
|
|
|
+ --button-small-font-size: 20px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -606,7 +628,7 @@ export default {
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
.van-image {
|
|
|
- border: 1px solid #dcdfe6;
|
|
|
+ border: 1px solid #f5f7fa;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -672,9 +694,9 @@ export default {
|
|
|
|
|
|
.fixed-bottom-content {
|
|
|
background-color: @bgw;
|
|
|
- padding: 8px 16px;
|
|
|
- padding-bottom: calc(8px + constant(safe-area-inset-bottom));
|
|
|
- padding-bottom: calc(8px + env(safe-area-inset-bottom));
|
|
|
+ padding: 0px 16px;
|
|
|
+ padding-bottom: calc(0px + constant(safe-area-inset-bottom));
|
|
|
+ padding-bottom: calc(0px + env(safe-area-inset-bottom));
|
|
|
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
@@ -698,9 +720,9 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
|
|
|
- &:active {
|
|
|
- background-color: darken(#fff, 5);
|
|
|
- }
|
|
|
+ // &:active {
|
|
|
+ // background-color: darken(#fff, 5);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
.btn-list {
|
|
|
@@ -715,6 +737,14 @@ export default {
|
|
|
|
|
|
--button-border-radius: 0px;
|
|
|
}
|
|
|
+
|
|
|
+ .intentionList {
|
|
|
+ .van-button {
|
|
|
+ &.van-button--disabled {
|
|
|
+ --button-disabled-opacity: 0.2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -733,4 +763,34 @@ export default {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+
|
|
|
+.pdf {
|
|
|
+ .van-empty {
|
|
|
+ .empty-button {
|
|
|
+ max-width: 165px;
|
|
|
+ .van-button {
|
|
|
+ color: @warn!important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.share {
|
|
|
+ background-color: transparent;
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+ line-height: 20px;
|
|
|
+ border-width: 0px;
|
|
|
+ margin-left: 20px;
|
|
|
+ height: 24px;
|
|
|
+
|
|
|
+ .van-icon {
|
|
|
+ display: block;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|