齐采药WEB端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

659 lines
17 KiB

<template>
<div class="goods_detail wrapper_1200">
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">全部商品</el-breadcrumb-item>
<el-breadcrumb-item>其他</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="goods_detail_nav">
<div class="goods_detail_nav_left">
<div class="goods_detail_video" v-show="detailTabId == 0">
<video
muted
autoplay
loop
controls
:src="imgUrl + detailData.video_url"
></video>
</div>
<div class="goods_detail_img" v-show="detailTabId == 1">
<el-carousel
trigger="click"
:autoplay="false"
@change="imgchange"
ref="remarkCarusel"
indicator-position="none"
>
<el-carousel-item v-for="(carouselItem, i) in imageArr" :key="i">
<img :src="imgUrl + carouselItem" alt />
</el-carousel-item>
</el-carousel>
<div class="carousel_bottom">
<div
class="carousel_bottom_list"
v-for="(item, index) in imageArr"
:key="index"
>
<div
:class="{ carousel_active: index == currentImg }"
@click="currentImgChange(index)"
>
<img :src="imgUrl + item" alt />
</div>
</div>
</div>
</div>
<!-- 切换商品视频和图片 -->
<div
class="goods_detail_nav_left_btn"
v-if="detailData.video_url || carouselList.length"
>
<span
class="goods_detail_nav_left_btn_v"
v-show="detailData.video_url"
@click="detailTabId = 0"
:class="{ active: detailTabId === 0 }"
>视 频</span
>
<span
@click="detailTabId = 1"
:class="{ active: detailTabId === 1 }"
v-show="carouselList.length"
>图 片</span
>
</div>
</div>
<div class="goods_detail_nav_right">
<p class="title">{{ detailData.bl_name }}</p>
<div class="price">
<div class="packagePrice">
<span>套餐价¥{{ detailData.bl_price }}</span>
</div>
<div class="originalPrice">原价¥{{ detailData.goods_money }}</div>
<!-- <div class="Integral">
<img style="width: 16px; height: 16px" src="~assets/images/giveIntegral.png" alt />
<span class="integral_txt">每满一元送1积分</span>
</div>-->
</div>
<p class="address_Box">套餐包含商品数:{{ detailData.bundling_goods_count }}件</p>
<div class="address_Box">
<!-- <div>商品编号:{{ detailData.sku_no }}</div> -->
<div v-if="detailData.is_free_shipping == 0">运费:自费</div>
<div v-if="detailData.is_free_shipping == 1">运费:包邮</div>
</div>
<!-- <div class="freight">运费:{{detailData.support_trade_type}}</div> -->
<div class="order">
订购套餐数量:
<div class="jbq" @click.stop.prevent>
<el-input-number
v-model="detailData.num"
size="mini"
@change="handleChange"
:min="0"
></el-input-number>
</div>
</div>
<div class="goods_detail_nav_right_btn">
<el-button
type="primary"
icon="el-icon-shopping-cart-1"
size="small"
@click="goPlaceAnOrder(detailData)"
>购买</el-button
>
</div>
</div>
</div>
<div class="goods_detail_option">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="商品详情" name="detail">
<el-table :data="detailData.bundling_goods" style="width: 100%" border>
<el-table-column prop="sku_name" label="商品名称" align="center">
</el-table-column>
<el-table-column prop="sku_image" label="商品图片" align="center">
<template slot-scope="scope">
<img
style="width: 100px; height: 100px; margin: 0 auto"
:src="imgUrl + scope.row.sku_image"
alt
/>
</template>
</el-table-column>
<el-table-column prop="price" label="商品原价" align="center">
</el-table-column>
<el-table-column prop="promotion_price" label="套餐价格" align="center">
</el-table-column>
<el-table-column prop="stock" label="库存" align="center"> </el-table-column>
<el-table-column prop="unit" label="商品单位" align="center">
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
<div v-show="optionName != 'evaluate'">
<Guess
v-if="guessList.length"
:guessList="guessList"
:Page="guessPage"
@changePage="changePage"
/>
</div>
</div>
</template>
<script>
import Setting from "~/setting";
import countDown from "@/components/countDown";
import Guess from "@/components/guess.vue";
export default {
auth: false,
components: { Guess, countDown },
data() {
return {
imgUrl: Setting.uplodBaseURL,
imageArr: [],
activeName: "detail",
commodityNum: undefined,
detailTabId: 1,
carouselList: [],
guessList: [],
detailData: {},
seckillData: {},
currentImg: "",
optionName: "",
evaluateTabId: 0,
goods_detail_commentList: [],
evaluateData: {},
commentImgs: "",
// 为你推荐分页
guessPage: {
total: 0,
pageSize: 4,
currentPage: 1,
},
};
},
created() {
this.getData();
this.getGuessData();
},
mounted() {},
methods: {
// 获取套餐商品详情
getData() {
let obj = {
bl_id: this.$route.query.id,
couponURL: true,
};
this.$axios
.post(`bundling/api/bundling/detail`, obj)
.then((res) => {
console.log(res.data);
this.imageArr = res.data.bundling_goods.map((item) => {
return item.sku_image;
});
this.detailData = res.data;
this.detailData.num = 0;
})
.catch((err) => {
this.$message.error(err);
});
},
// 获取为你推荐数据
getGuessData() {
let obj = {
page: this.guessPage.currentPage,
page_size: this.guessPage.pageSize,
};
this.$axios
.post(`/goodssku/page`, obj)
.then((res) => {
res.data.list.forEach((item) => {
item["num"] = 0;
});
this.guessList = res.data.list;
this.guessPage.total = res.data.count;
})
.catch((err) => {
this.$message.error(err);
});
},
changePage(e) {
this.guessPage.currentPage = e;
this.getGuessData();
},
handleClick(tab, event) {
this.optionName = tab.name;
},
handleChange(e) {
this.$forceUpdate();
},
imgchange(val) {
this.currentImg = val;
},
currentImgChange(index) {
this.currentImg = index;
this.$refs.remarkCarusel.setActiveItem(index);
},
goPlaceAnOrder(data) {
console.log(this.detailData.num);
if (this.detailData.num == 0) {
this.$message.error("未添加套餐数量");
} else {
this.$router.push({
path: "/shopping_cart/placeAnOrder",
query: {
id: data.bl_id,
num: data.num,
isSetMeal: true,
isSeckill: false,
isCollage: false,
},
});
}
},
},
};
</script>
<style lang="scss" scoped>
.goods_detail {
.crumbs {
margin-top: 20px;
}
.goods_detail_nav {
width: 1200px;
height: 350px;
background: #ffffff;
border-radius: 4px;
margin: 16px auto;
display: flex;
position: relative;
.goods_detail_nav_left {
width: 510px;
height: 320px;
// border: 1px solid #aaa;
margin: 15px;
position: relative;
color: #999999;
.goods_detail_video,
.goods_detail_img {
width: 100%;
height: 100%;
}
.goods_detail_video {
video {
width: 100%;
height: 320px;
}
}
.goods_detail_img {
position: relative;
/deep/ .el-carousel {
.el-carousel__container {
height: 320px;
.el-carousel__item {
img {
width: 100%;
}
}
}
}
.carousel_bottom {
width: 100%;
height: 100px;
position: absolute;
bottom: 0px;
left: 0px;
z-index: 10;
.carousel_bottom_list {
float: left;
margin: 10px;
img {
width: 80px;
height: 80px;
border-radius: 5px;
cursor: pointer;
}
}
.carousel_active {
border: 1px solid var(--themeColor);
border-radius: 5px;
}
}
}
.goods_detail_nav_left_btn {
position: absolute;
top: 10px;
right: 20px;
padding: 5px 10px;
border-radius: 14px;
border: 1px solid #dedede;
z-index: 10;
cursor: pointer;
.goods_detail_nav_left_btn_v {
padding-right: 5px;
border-right: 1px solid #aaa;
}
}
.active {
font-weight: 600;
color: black;
}
}
.goods_detail_nav_right {
width: 510px;
height: 320px;
margin: 15px 0;
.title {
width: 350px;
height: 28px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #222222;
line-height: 28px;
margin-bottom: 10px;
}
.price {
display: flex;
.packagePrice {
width: 150px;
height: 22px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #ff1d1d;
line-height: 22px;
margin-right: 20px;
}
.originalPrice {
width: 100px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 20px;
text-decoration: line-through;
margin-right: 20px;
}
.Integral {
display: flex;
justify-content: space-around;
margin-right: 20px;
.integral_txt {
width: 110px;
height: 17px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ff7d02;
line-height: 17px;
}
}
}
.package {
width: 300px;
height: 22px;
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #585858;
line-height: 22px;
margin: 25px 0;
}
.address_Box {
display: flex;
justify-content: space-between;
width: 400px;
margin: 25px 0;
}
.freight {
margin: 25px 0;
}
.order {
display: flex;
margin: 25px 0;
.jbq {
/deep/ .el-input-number {
width: 100px;
.el-input-number__decrease {
width: 26px;
height: 26px;
border: none;
border-radius: 16px;
background: #d8f6ff;
.el-icon-minus {
color: var(--themeColor);
font-weight: 900;
}
}
.el-input-number__increase {
width: 26px;
height: 26px;
border: none;
border-radius: 16px;
background: var(--themeColor);
.el-icon-plus {
color: #fff;
font-weight: 900;
}
}
.el-input {
.el-input__inner {
border: none;
}
}
}
}
}
.goods_detail_nav_right_btn {
margin-top: 40px;
.collectAct1 {
background: var(--themeColor);
color: #fff;
}
.collectAct2 {
background: #fff;
color: #000;
}
}
}
.time_Limit {
width: 120px;
height: 63px;
position: absolute;
top: 0px;
right: 30px;
background: #ff1449;
border-radius: 0px 0px 6px 6px;
.title {
display: flex;
margin: 5px;
img {
width: 16px;
height: 16px;
margin: 3px;
}
div {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 22px;
}
}
.time {
color: #ffffff;
height: 22px;
line-height: 22px;
/deep/ .styleAll {
min-width: 30px;
height: 20px;
background: #ff7997;
border-radius: 5px;
text-align: center;
}
}
}
.pintuan {
width: 101px;
height: 63px;
position: absolute;
top: 0px;
right: 30px;
background: #ff7d02;
border-radius: 0px 0px 6px 6px;
.pintuanTitle {
display: flex;
margin: 5px;
img {
width: 16px;
height: 16px;
margin: 3px;
}
div {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 22px;
}
}
.pintuan_btn {
color: #ffffff;
width: 60px;
height: 22px;
line-height: 22px;
border-radius: 5px;
font-size: 12px;
margin: 0 auto;
background: #ffb268;
border-radius: 5px;
padding: 0 5px;
}
}
}
.goods_detail_option {
width: 1200px;
min-height: 410px;
background: #ffffff;
border-radius: 4px;
padding: 20px;
margin-bottom: 20px;
.goods_detail_option_text {
margin-bottom: 15px;
span {
margin-right: 20px;
height: 22px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 22px;
}
}
.goods_detail_option_banner {
width: 1200px;
height: 488px;
// border: 1px solid #aaa;
img {
width: 100%;
height: 100%;
}
}
.goods_detail_evaluate {
display: flex;
div {
width: 60px;
height: 26px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999999;
line-height: 26px;
text-align: center;
cursor: pointer;
margin-right: 20px;
}
.evaluate_active {
color: #222222;
border: 1px solid #999;
background: #ffffff;
border-radius: 13px;
border: 1px solid #e1e1e1;
}
}
.goods_detail_comment_Box {
display: flex;
margin-top: 25px;
padding: 5px;
.goods_detail_comment_head {
margin-right: 20px;
img {
width: 50px;
height: 50px;
border-radius: 50%;
}
}
.goods_detail_comment_content {
.content_name {
height: 14px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 14px;
margin-bottom: 15px;
}
.content_time {
height: 14px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 14px;
margin-bottom: 15px;
}
.content_txt {
width: 1070px;
min-height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 20px;
}
.content_image {
display: flex;
flex-wrap: wrap;
width: 1070px;
img {
width: 100px;
height: 100px;
margin: 15px;
margin-left: 0;
}
}
}
}
}
.nothing {
padding-top: 100px;
padding-bottom: 150px;
font-size: 16px;
text-align: center;
color: #969696;
img {
margin: 0 auto;
}
}
}
</style>