Browse Source

Merge branch 'master' into dev_jzp

master
jiazhipeng 1 year ago
parent
commit
9abe2fa830
  1. 194
      subPackages/food/foodDetail.vue

194
subPackages/food/foodDetail.vue

@ -1,18 +1,17 @@
<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 class="swiper" :autoplay="true" :interval="3000" :duration="3000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff">
<swiper-item v-if="info && info.videourl">
<video
:src="info.videourl"
:src="showImg(info.videourl)"
id="detailVideo"
:poster="
smallSwipeList.length > 0 ? smallSwipeList[0] : ''
showImg(info.image)
"
@play="play"
@error="videoErrorCallback"
controls
playsinline=""
webkit-playsinline=""
x5-video-player-type="h5-page"
></video>
</swiper-item>
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id">
@ -22,154 +21,7 @@
</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>
@ -209,7 +61,6 @@
},'/api/goods/getGoodDetail').then(res => {
res.data.goods_new_tag = (res.data.goods_new_tag ? res.data.goods_new_tag.split(',') : []).splice(0, 2);
this.info = res.data
this.getComment()
})
},
getSpecificationsByGoodsId() {
@ -223,20 +74,6 @@
}
});
},
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({
@ -256,22 +93,6 @@
}
});
},
//
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
@ -281,11 +102,6 @@
url: '/subPackages/oneplus/oneplusOrder'
});
},
goUser() {
uni.switchTab({
url: '/pages/index/user'
})
}
},
onReachBottom() {

Loading…
Cancel
Save