|
|
@@ -1,45 +1,6 @@
|
|
|
<template>
|
|
|
<div class="detail">
|
|
|
- <div class="detail-top">
|
|
|
- <img src="../../assets/png-bg-shangping.png" class="bg-img" />
|
|
|
-
|
|
|
- <div class="detail-info">
|
|
|
- <swiper pagination class="mySwiper" v-if="banners.length > 0">
|
|
|
- <swiper-slide v-for="(item, index) in banners" :key="index">
|
|
|
- <!-- <img :src="item" /> -->
|
|
|
-
|
|
|
- <video
|
|
|
- class="swiper-video"
|
|
|
- v-if="isVideo(item)"
|
|
|
- :src="item.url"
|
|
|
- :poster="getImg(changeImgs([item]), '', 1200)"
|
|
|
- controls="controls"
|
|
|
- >
|
|
|
- 您的浏览器不支持 video 标签。
|
|
|
- </video>
|
|
|
- <van-image
|
|
|
- v-else
|
|
|
- @click="preview(index, changeImgs(banners))"
|
|
|
- :src="getImg(item.url, '', 1200)"
|
|
|
- width="calc(100vw - 134px)"
|
|
|
- height="calc(100vw - 134px)"
|
|
|
- fit="scale-down"
|
|
|
- />
|
|
|
- </swiper-slide>
|
|
|
- </swiper>
|
|
|
-
|
|
|
- <div class="share-content">
|
|
|
- <like-button :isLike="info.liked" @click="likeProduct">
|
|
|
- {{ info.likes }}
|
|
|
- </like-button>
|
|
|
-
|
|
|
- <div class="share-icon" @click="share">
|
|
|
- <img src="../../assets/svgs/icon-fenxiang.svg" alt="" />
|
|
|
- <span>分享</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <product-banner :info="info" @getProduct="getProduct"></product-banner>
|
|
|
|
|
|
<div class="info">
|
|
|
<div class="info-title">
|
|
|
@@ -274,28 +235,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { Swiper, SwiperSlide } from 'swiper/vue';
|
|
|
-
|
|
|
-import 'swiper/swiper.min.css';
|
|
|
-import 'swiper/swiper-bundle.min.css';
|
|
|
-
|
|
|
-import SwiperCore, { Pagination } from 'swiper';
|
|
|
-import Post from '../../components/Post.vue';
|
|
|
import { ImagePreview } from 'vant';
|
|
|
-
|
|
|
-// install Swiper modules
|
|
|
-SwiperCore.use([Pagination]);
|
|
|
import product from '../../mixins/product';
|
|
|
import HashCode from '../../components/product/HashCode.vue';
|
|
|
import ProductTitle from '../../components/product/ProductTitle.vue';
|
|
|
+import ProductBanner from '../../components/product/ProductBanner.vue';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- Swiper,
|
|
|
- SwiperSlide,
|
|
|
- Post,
|
|
|
HashCode,
|
|
|
- ProductTitle
|
|
|
+ ProductTitle,
|
|
|
+ ProductBanner
|
|
|
},
|
|
|
mixins: [product],
|
|
|
data() {
|
|
|
@@ -422,19 +372,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- likeProduct() {
|
|
|
- if (!this.info.liked) {
|
|
|
- this.$http.get(`/collection/${this.info.id}/like`).then(() => {
|
|
|
- this.getProduct();
|
|
|
- this.$toast.success('收藏成功');
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$http.get(`/collection/${this.info.id}/unlike`).then(() => {
|
|
|
- this.getProduct();
|
|
|
- this.$toast.success('取消收藏');
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
buy() {
|
|
|
this.checkLogin().then(() => {
|
|
|
this.$router.push({
|
|
|
@@ -445,9 +382,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- share() {
|
|
|
- this.$refs.post.init();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -738,34 +672,7 @@ export default {
|
|
|
color: @text3;
|
|
|
}
|
|
|
}
|
|
|
-/deep/ .mySwiper {
|
|
|
- width: calc(100vw - 120px);
|
|
|
- height: calc(100vw - 120px);
|
|
|
- z-index: 1;
|
|
|
|
|
|
- .swiper-pagination {
|
|
|
- bottom: 22px;
|
|
|
- }
|
|
|
-
|
|
|
- .swiper-pagination-bullet {
|
|
|
- width: 6px;
|
|
|
- height: 2px;
|
|
|
- border-radius: 1px;
|
|
|
- background: #d7d7d7;
|
|
|
- }
|
|
|
-
|
|
|
- .swiper-pagination-bullet-active {
|
|
|
- background: @prim;
|
|
|
- }
|
|
|
-
|
|
|
- .swiper-slide img {
|
|
|
- display: block;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- object-fit: cover;
|
|
|
- border-radius: 4px;
|
|
|
- }
|
|
|
-}
|
|
|
.goods {
|
|
|
// padding: 20px 16px 0px;
|
|
|
|
|
|
@@ -915,109 +822,8 @@ export default {
|
|
|
border-width: 0px;
|
|
|
}
|
|
|
}
|
|
|
-.goods-info {
|
|
|
- // padding: 0 0 30px;
|
|
|
-}
|
|
|
-.detail-swiper {
|
|
|
- height: 170px;
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.swiper-slide {
|
|
|
- width: 35.2vw;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/.page-detail {
|
|
|
- img {
|
|
|
- display: block;
|
|
|
- max-width: 100%;
|
|
|
- height: auto;
|
|
|
- }
|
|
|
-}
|
|
|
-.swiper-video {
|
|
|
- width: calc(100vw - 134px);
|
|
|
- height: calc(100vw - 134px);
|
|
|
- border: 2px solid #2f2f2f;
|
|
|
- border-radius: 8px;
|
|
|
- overflow: hidden;
|
|
|
- background-color: @bg;
|
|
|
-}
|
|
|
-
|
|
|
-.detail-top {
|
|
|
- position: relative;
|
|
|
- .detail-info {
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- padding-bottom: 50px;
|
|
|
- }
|
|
|
- .bg-img {
|
|
|
- display: block;
|
|
|
- width: 100vw;
|
|
|
- }
|
|
|
- .mySwiper {
|
|
|
- border-radius: 8px;
|
|
|
- border: 2px solid #ffffff;
|
|
|
- .detail-animate();
|
|
|
- .swiper-slide {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- /deep/ .van-image {
|
|
|
- border: 2px solid #2f2f2f;
|
|
|
- border-radius: 8px;
|
|
|
- overflow: hidden;
|
|
|
- background-color: @bg;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // animation: name duration timing-function delay iteration-count direction fill-mode;
|
|
|
- }
|
|
|
|
|
|
- .name {
|
|
|
- font-size: @font4;
|
|
|
- font-weight: bold;
|
|
|
- color: #ffffff;
|
|
|
- line-height: 30px;
|
|
|
- padding: 10px 25px;
|
|
|
- position: relative;
|
|
|
|
|
|
- img {
|
|
|
- position: absolute;
|
|
|
- &:nth-child(2),
|
|
|
- &:nth-child(5) {
|
|
|
- width: 45px;
|
|
|
- display: block;
|
|
|
- }
|
|
|
-
|
|
|
- &:nth-child(3),
|
|
|
- &:nth-child(4) {
|
|
|
- width: calc(100% - 65px);
|
|
|
- height: 10px;
|
|
|
- }
|
|
|
- &:nth-child(2) {
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- }
|
|
|
- &:nth-child(3) {
|
|
|
- top: -0.8px;
|
|
|
- left: 45px;
|
|
|
- }
|
|
|
- &:nth-child(4) {
|
|
|
- bottom: 0.5px;
|
|
|
- right: 45px;
|
|
|
- }
|
|
|
- &:nth-child(5) {
|
|
|
- bottom: 0;
|
|
|
- right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
.share-content {
|
|
|
display: flex;
|
|
|
@@ -1047,45 +853,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.detail-name {
|
|
|
- font-size: @font4;
|
|
|
- font-weight: bold;
|
|
|
- color: #ffffff;
|
|
|
- line-height: 30px;
|
|
|
- padding: 10px 25px;
|
|
|
- position: relative;
|
|
|
-
|
|
|
- img {
|
|
|
- position: absolute;
|
|
|
- &:nth-child(2),
|
|
|
- &:nth-child(5) {
|
|
|
- width: 45px;
|
|
|
- display: block;
|
|
|
- }
|
|
|
-
|
|
|
- &:nth-child(3),
|
|
|
- &:nth-child(4) {
|
|
|
- width: calc(100% - 65px);
|
|
|
- height: 10px;
|
|
|
- }
|
|
|
- &:nth-child(2) {
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- }
|
|
|
- &:nth-child(3) {
|
|
|
- top: -0.8px;
|
|
|
- left: 45px;
|
|
|
- }
|
|
|
- &:nth-child(4) {
|
|
|
- bottom: 0.5px;
|
|
|
- right: 45px;
|
|
|
- }
|
|
|
- &:nth-child(5) {
|
|
|
- bottom: 0;
|
|
|
- right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
.status-text {
|
|
|
font-size: @font4;
|