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.
 
 
 
 
 

934 lines
20 KiB

<template>
<view class="bg" id="bg" v-if="info">
<view class="swipe-box">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff">
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id">
<view class="swiper-item">
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
</view>
<view class="price-box">
<view class="price-box1">
<view class="price-zan">
<view class="price">
<view class="present-price">{{ info.money / 100 }}</view>
</view>
</view>
<view class="title">{{ info.title }}</view>
<view class="tag" v-if="info.goods_new_tag">
<view class="tag-item" v-for="(item, index) in info.goods_new_tag.split(',')" :key="index">{{ item }}
</view>
</view>
</view>
<view class="select-box" @click="openPop">
<view class="left">
<view class="">
选择
</view>
<view class="specifications">
<!-- <span v-for="sName in sku">{{sName.title}};</span> -->
<span>{{sku[0].title}}</span>
</view>
</view>
<image class="right" :src="showImg('/uploads/20231223/32634518cfcfbaac647d3318b254fb02.png')" mode=""></image>
</view>
</view>
<!-- 团建文本渲染部分 -->
<view class="text-box">
<view class="tab-box">
<view :class="index==navIndex?'seld-nav':'' " v-for="(item, index) in navsList" :title="item.name" :key="item.name" @click="changeNav(item,index)" style="display: flex;flex-direction: column;align-items: center;">
<view class="">
{{ item.name }}
</view>
<view class="line" v-if="navIndex == index"></view>
</view>
</view>
<view class="" id="cpts" v-html="formateRichText(info.special_content)" style="padding: 30rpx;"></view>
<view class="" id="fysm" v-html="formateRichText(info.price_content)" style="padding: 30rpx;"></view>
<view class="" id="ydxz" v-html="formateRichText(info.reserve_content)" style="padding: 30rpx;"></view>
</view>
<!-- 游客点评 -->
<view class="comment-box" id="comment">
<view class="comment-title flex-between">
<view>
<img src="https://static.ticket.sz-trip.com/dongtai/images/user/comment.png" class="comment-icon">
游客点评
<span class="comment-rate">{{info.rate}}分</span>
</view>
<view class="comment-num">
共{{commentNum}}条
</view>
</view>
<view v-if="commentList.length > 0">
<view class="comment-item" v-for="(item,index) in commentList" :key="index">
<view style="display: flex;justify-content: space-between;">
<view style="display: flex;">
<img :src="item.user.avatar" class="comment-avatar">
<view class="flex-column" style="height: 57rpx;justify-content: space-around;">
<view class="comment-name">{{item.user.nickname}}</view>
<uni-rate :size="10" :readonly="true" :value="item.rate" active-color="red"/>
</view>
</view>
<view class="comment-time">
{{item.create_time.slice(0,10)}}
</view>
</view>
<view class="comment-content text-overflowRows">
{{ item.content }}
</view>
<!-- <view class="comment-imgs" v-if="item.img_list">
<img :src="showImg(imgItem)" class="comment-img" v-for="(imgItem,imgIndex) in item.img_list.split(',')" :key="imgIndex">
</view> -->
</view>
</view>
<view class="empty-box" v-else>
<view>这里空空如也快去点评吧!</view>
</view>
<navigator :url="'/subPackages/hotel/commentList?goodsId=' + info.id" class="content-more" v-if="commentList.length > 0">
查看全部点评 >
</navigator>
</view>
<view class="btn-list">
<view class="left-box">
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="img-box">
<image src="https://yjdtadmin.sz-trip.com/uploads/20231222/ae5fd4482c56e2655ecae6059171aab0.png"
mode="aspectFill"></image>
<view class="text">
客服
</view>
</view>
</button>
<!-- <view class="img-box">
<image v-if="isCollect == 0" @click.stop="collect" :src="showImg('/uploads/20231226/b5ad17bc7074e949fce2f39fad3c9c44.png')"
mode="aspectFill"></image>
<image v-else @click.stop="collect" :src="showImg('/uploads/20231226/477bbd7016d0eecb47909b8555df49b6.png')"
mode="aspectFill"></image>
<view class="text">
收藏
</view>
</view> -->
</view>
<view class="btn-buy" @click="openPop">
立即购买
</view>
</view>
<uni-popup ref="popup" type="bottom">
<view class="popup-content" v-if="sku.length>0">
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopup"
style="margin: 31rpx 0 0 639rpx;width: 31rpx;height: 31rpx;">
<view class="bottom-productImg">
<img :src="showImg(sku[productIndex].image)" alt="">
<view class="right-content">
<view class="bottom-productPrice com-price">{{showPrice(sku[productIndex].money)}}</view>
<view class="bottom-content text-overflow">已选择:{{sku[productIndex].title}}</view>
</view>
</view>
<view style="max-height: 500rpx;overflow-y: scroll;">
<view class="sp">
规格
</view>
<view v-for="(botItem,botIndex) in sku" :key="botIndex" class="botProduct text-overflow"
@click="changeProduct(botIndex)" :class="productIndex==botIndex?'botProducts':''">
{{botItem.title}}
</view>
</view>
<view class="buy-num com-flex-tao">
数量
<view class="number-btn">
<view>
<text @click="delNumber">-</text>
</view>
<view style="width: 96rpx;height: 69rpx;margin: 0 14rpx;">{{ buyNum }}</view>
<view>
<text @click="addNumber">+</text>
</view>
</view>
</view>
</view>
<view class="btn-box">
<view class="buy-btn" @click="order">
下一步
</view>
</view>
</uni-popup>
</view>
</template>
<script>
// import Base from '@/components/Base';
export default {
extends: Base,
data() {
return {
id: null,
info: null,
sku: [],
productIndex: 0,
businessInfo: [],
isCollect: 0,
showLength: 0,
buyNum: 1,
reserve_content: null,
// 主要内容列表
navsList: [
{ name: "产品特色",id:'cpts' },
{ name: "费用说明",id:'fysm' },
{ name: "预订须知",id:'ydxz' },
{ name: "游客点评",id:'comment' }
],
navIndex:0, //导航栏选中下标
commentList: [],
commentNum: ''
};
},
// onLoad(option) {
// this.id = option.id;
// this.getInfo();
// this.getSpecificationsByGoodsId();
// this.getBusinessInfo();
// },
methods: {
// getComment() {
// this.Post({
// goods_id: this.info.id,
// offset: 0,
// limit: 2
// }, '/api/scenic/getGoodsCommentByScenicId').then(res => {
// this.commentList = res.data
// this.commentNum = res.msg
// })
// },
// changeNav(item,index) {
// this.navIndex = index
// console.log(item.name);
// // 获取要滚动到的元素id
// let to = item.id
// // 获取目标元素
// uni.createSelectorQuery().select('#' + to).boundingClientRect(function(rect){
// // 使用scrollIntoView方法滚动到目标元素
// console.log(rect);
// uni.pageScrollTo({
// scrollTop: rect.top,
// duration: 200
// })
// }).exec();
// },
// changeProduct(index) {
// this.productIndex = index
// },
getInfo() {
this.Post({
goods_id: this.id
},
'/api/goods/getGoodDetail'
).then(res => {
if (res.data.flag == 0) {
setTimeout(() => {
uni.showToast({
title: '商品不存在或已下架',
icon: 'none'
})
}, 0)
setTimeout(() => {
this.goBack()
}, 2000)
}
this.info = res.data;
this.isCollect = res.data.is_collect;
this.getComment()
});
},
getSpecificationsByGoodsId() {
this.Post({
goods_id: this.id
},
'/api/goods/getSpecificationsByGoodsId'
).then(res => {
if (res) {
this.sku = res.data;
}
});
},
getBusinessInfo() {
this.Post({
goods_id: this.id,
lon: this.$store.state.user.location.lon || 116.437164,
lat: this.$store.state.user.location.lat || 39.911372,
limit: 10
},
'/api/extract/getMerchantExtractListByGoodsId'
).then(res => {
if (res) {
this.businessInfo = res.data;
}
});
},
// 收藏
collect() {
this.Post({
type: 3,
id: this.id
},
'/api/scenic/collect'
).then(res => {
if (res) {
uni.showToast({
title: res.msg,
icon: 'none'
});
this.isCollect = !this.isCollect
console.log(this.isCollect);
this.$forceUpdate()
}
});
},
//数量加减
addNumber() {
this.buyNum += 1;
},
delNumber() {
if (this.buyNum <= 1) {
return;
}
this.buyNum -= 1;
},
closePopup() {
this.$refs.popup.close()
},
openPop(){
this.$refs.popup.open()
},
order(item) {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
uni.setStorageSync('order', JSON.stringify(goods)); //规格
uni.setStorageSync('info', JSON.stringify(this.info)); //商品
uni.navigateTo({
url: '/subPackages/oneplus/oneplusOrder'
});
},
goUser() {
uni.switchTab({
url: '/pages/index/user'
})
}
},
onReachBottom() {
}
};
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
overflow-x: hidden;
background: #f2f4f7;
padding-bottom: 210rpx;
}
view {
box-sizing: border-box;
}
button {
margin: 0;
padding: 0;
outline: none;
border-radius: 0;
background-color: transparent;
line-height: inherit;
}
button::after {
border: none;
}
.swipe-box {
height: 484rpx;
position: relative;
.swiper-item-num {
width: 90rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
text-align: center;
line-height: 40rpx;
position: absolute;
right: 30rpx;
bottom: 50rpx;
}
}
.swiper {
height: 484rpx;
position: relative;
.swiper-item {
width: 100%;
height: 484rpx;
.item-img {
width: 750rpx;
height: 484rpx;
}
}
}
.price-box1 {
padding: 24rpx 30rpx;
}
.price-box {
z-index: 9;
position: relative;
margin-top: -20rpx;
width: 750rpx;
background: #ffffff;
border-radius: 20rpx;
.price-zan {
display: flex;
align-items: center;
justify-content: space-between;
.price {
display: flex;
.present-price {
font-size: 42rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(248, 74, 86, 1);
&:before {
content: '¥';
display: inline-block;
font-size: 26rpx;
}
&:after {
content: '起';
display: inline-block;
font-size: 24rpx;
font-family: PingFangSC;
font-weight: 400;
color: #8D8D8D;
}
}
}
}
.tag {
margin-bottom: 40.67rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
.tag-item {
background: rgba(254, 180, 25, .14);
border-radius: 18rpx;
margin-right: 18rpx;
font-size: 24rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FEB419;
padding: 0 16rpx;
}
}
.title {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #000000;
margin-top: 20rpx;
}
}
.notice {
padding: 40rpx 30rpx;
width: 710rpx;
background: #ffffff;
border-radius: 16rpx;
margin: 0 auto;
margin-top: 20rpx;
.notice-title {
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
margin-bottom: 40rpx;
}
}
.tab {
width: 750rpx;
height: 88rpx;
background: #ffffff;
box-shadow: 0px 1rpx 0px 0px rgba(227, 229, 232, 1);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
position: fixed;
top: 0;
.tab-item {
height: 88rpx;
position: relative;
line-height: 88rpx;
.tab-text {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #393b3e;
}
.act-text {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
}
.tab-line {
width: 60rpx;
height: 6rpx;
background: #08c59b;
border-radius: 3rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-30rpx, 0);
}
}
}
.more {
width: 100%;
height: 93rpx;
line-height: 93rpx;
text-align: center;
border-top: solid 1rpx rgba(227, 229, 232, 1);
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4D526C;
margin-top: 50rpx;
}
.xzPopup {
width: 750rpx;
padding: 33rpx 26rpx 20rpx;
box-sizing: border-box;
background-color: #FFFFFF;
position: relative;
max-height: 70vh;
overflow-y: auto;
view {
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 35rpx;
}
img {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 33rpx;
right: 27rpx;
}
}
.comment {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: bold;
color: #6B0500;
margin-top: 28rpx;
}
.btn-list {
position: fixed;
bottom: 0;
width: 750rpx;
height: 180rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
display: flex;
justify-content: space-between;
padding: 30rpx 50rpx 0 50rpx;
.left-box {
display: flex;
align-items: flex-start;
.img-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-right: 64rpx;
image {
width: 48rpx;
height: 48rpx;
}
.text {
font-size: 24rpx;
font-family: PingFangSC;
font-weight: 400;
color: #666666;
}
}
}
.btn-buy {
width: 254rpx;
height: 78rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
border-radius: 40rpx;
text-align: center;
line-height: 78rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
}
.popup-content {
background-color: white;
padding: 0rpx 39rpx 51rpx 39rpx;
height: auto;
border-radius: 20rpx 20rpx 0 0 ;
}
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
}
.bottom-productImg img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
.right-content {
margin: 10rpx 0 0 41rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
&:before{
content: "¥";
font-size: 26rpx;
}
}
.bottom-content {
width: 331rpx;
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
.botProduct {
width: 320rpx;
// height: 78rpx;
border-radius: 13rpx;
background-color: #F5F5F5;
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
line-height: 78rpx;
text-align: center;
margin-bottom: 25rpx;
display: inline-block;
}
.botProduct:nth-child(even) {
margin-right: 30rpx;
}
.botProducts {
// border: 1rpx solid #00AAFF;
background-color:rgba(254, 180, 25, 1);
color: rgba(0, 0, 0, 1);
}
.buy-num {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
// border-top: 1rpx solid #CCCCCC;
padding: 39rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.buy-num .number-btn {
display: flex;
}
.buy-num .number-btn view {
display: flex;
justify-content: center;
align-items: center;
width: 69rpx;
height: 69rpx;
border: 1rpx solid #CCCCCC;
border-radius: 7rpx;
}
.buy-num .number-btn>view text {
font-size: 46rpx;
}
.buy-btn {
width: 670rpx;
height: 78rpx;
text-align: center;
line-height: 78rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
border-radius: 40rpx;
font-size: 34rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
.btn-box{
width: 750rpx;
height: 151rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6,0,1,0.1);
display: flex;
align-items: center;
justify-content: center;
}
.sp{
width: 100%;
height: 30rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 400;
color: #060001;
line-height: 30rpx;
border-top: solid 2rpx #ccc;
margin: 60rpx 0;
padding-top: 30rpx;
}
.guige {
padding: 42rpx 0;
border-top: 1rpx solid #D8D8D8;
}
.select-box {
// width: 100%;
height: 113rpx;
border-top: 1rpx solid #D8D8D8;
padding-left: 38rpx;
padding-right: 32rpx;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
display: flex;
justify-content: space-between;
align-items: center;
}
.left {
display: flex;
}
.specifications {
margin-left: 27.33rpx;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: 500;
color: #888888;
white-space: nowrap;
width: 500rpx;
overflow: hidden;
}
.right {
width: 15.33rpx;
height: 27.33rpx;
}
.text-box {
width: 710rpx;
margin: 22rpx 20rpx;
background: #FFFFFF;
position: relative;
border-radius: 13rpx;
}
.tab-box {
display: flex;
justify-content: space-around;
align-items: center;
font-size: 29rpx;
font-family: PingFangSC;
font-weight: 400;
color: #333333;
height: 85.33rpx;
line-height: 85.33rpx;
}
.seld-nav {
font-size: 33rpx;
font-family: PingFangSC;
font-weight: bold;
color: #000000;
// border-bottom: 5rpx solid #FEB419;
}
.line {
width: 47rpx;
height: 5rpx;
background: #FEB419;
border-radius: 3rpx;
margin-top: -10rpx;
}
.comment-box{
width: 710rpx;
height: auto;
background: #FFFFFF;
border-radius: 13rpx;
margin: 24rpx auto 0;
padding: 0 20rpx;
.comment-title{
border-bottom: 1rpx solid #D9D9D9;
height: 95rpx;
display: flex;
align-items: center;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
.comment-icon{
width: 32rpx;
height: 32rpx;
margin-right: 14rpx;
}
.comment-rate{
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #D62828;
margin-left: 10rpx;
}
.comment-num{
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
}
}
.comment-item{
padding: 37rpx 0;
border-bottom: 1rpx solid #CCCCCC;
.comment-avatar{
width: 57rpx;
height: 57rpx;
border-radius: 50%;
margin-right: 15rpx;
}
.comment-name{
font-size: 21rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
.comment-time {
font-family: PingFangSC;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.comment-content{
margin-top: 30rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
.comment-imgs{
margin-top: 34rpx;
overflow-x: auto;
white-space: nowrap;
.comment-img{
width: 147rpx;
height: 147rpx;
border-radius: 13rpx;
margin-right: 15rpx;
}
}
.comment-imgs::-webkit-scrollbar {
display: none;
}
}
.empty-box {
text-align: center;
padding: 98rpx 0;
font-size: 28rpx;
color: #999999;
}
.content-more{
height: 98rpx;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
}
</style>