jiazhipeng 12 months ago
parent
commit
27e83385ac
  1. 181
      compoents/moreGoods.vue
  2. 162
      compoents/userReviews.vue
  3. 9
      subPackages/hotelHomestay/detail.vue
  4. 8
      subPackages/line/detail.vue
  5. 9
      subPackages/techan/detail.vue
  6. 11
      subPackages/ticketBooking/detail.vue

181
compoents/moreGoods.vue

@ -0,0 +1,181 @@
<template>
<!-- 更多好物 -->
<view class="comment-box" id="comment">
<view class="comment-title flex-between">
<view>更多好物</view>
<view class="comment-num" ></view>
</view>
<view class="comment-container" v-if="list.length>0">
<view class="item" v-for="item in list" :key="item.goods.id" @click="gotoDetail(item)">
<image class="item-img" :src="showImg(item.goods.image)" mode=""></image>
<view class="content">
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="bottom">
<view class="price">
{{item.goods.money/100}}
</view>
</view>
</view>
</view>
</view>
<view class="empty-box" v-else>
<view>暂无更多推荐</view>
</view>
</view>
</template>
<script>
export default {
props:['goodsId'],
data() {
return {
list: [],
}
},
mounted () {
console.log(1,this.goodsId)
this.getList()
},
methods: {
getList(){
this.list = []
if (!this.goodsId) return
this.Post({
tag_id: 59,
offset: this.list.length,
limit: 4,
goodsId: this.goodsId,
},'/api/tag/getGoodsByTagId').then(res => {
this.list = res.data
})
},
gotoDetail(item) {
if (item.type!=='goods') {
item.search_data.genre = item.type
}
this.goDetailByType(item.search_data)
},
}
}
</script>
<style scoped lang="scss">
.comment-box{
width: 697rpx;
height: auto;
margin: 24rpx auto 0;
.comment-title{
height: 95rpx;
display: flex;
align-items: center;
font-weight: bold;
font-size: 37rpx;
color: #000000;
.comment-num{
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #515150;
}
}
.comment-container{
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item {
margin-bottom: 22rpx;
width: 335rpx;
height: 497rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(153,153,153,0.38);
border-radius: 13rpx;
}
.item-img {
width: 100%;
height: 342rpx;
background: #87CD93;
border-radius: 13rpx 13rpx 0rpx 0rpx;
}
.content {
height: 145rpx;
padding: 0 13rpx 13.33rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.title {
font-family: PingFang SC;
font-weight: bold;
font-size: 29rpx;
color: #000000;
width: 291rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.price {
font-size: 34.67rpx;
font-family: PingFangSC;
// font-weight: bold;
color: #C3282E;
}
.price::before {
content: '¥';
font-size: 24rpx;
}
.price::after {
content: '起';
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
.empty-box {
text-align: center;
width: 100%;
height: 200rpx;
background: #FFFFFF;
border-radius: 20rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
line-height: 200rpx;
}
.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>

162
compoents/userReviews.vue

@ -0,0 +1,162 @@
<template>
<!-- 游客点评 -->
<view class="comment-box" id="comment">
<view class="comment-title flex-between">
<view>用户评价</view>
<view class="comment-num" @click="viewAll()">
{{commentNum}} >
</view>
</view>
<view class="comment-container" v-if="commentList.length > 0">
<view class="comment-item" v-for="(item,index) in commentList" :key="index">
<view class="flex flex-items-center">
<img :src="item.user.avatar" class="comment-avatar">
<view class="comment-name text-overflow">{{item.user.nickname}}</view>
</view>
<view class="comment-content text-overflowRows">
{{ item.content }}
</view>
</view>
</view>
<view class="empty-box" v-else>
<view>这里空空如也快去点评吧!</view>
</view>
</view>
</template>
<script>
export default {
props:['goodsId'],
data() {
return {
commentList: [],
commentNum: 0
}
},
mounted () {
this.getComment()
},
methods: {
getComment() {
this.commentList = []
this.commentNum = 0
if (!this.goodsId) return
this.Post({
goods_id: this.goodsId,
offset: 0,
limit: 2
}, '/api/scenic/getGoodsCommentByScenicId').then(res => {
this.commentList = res.data
this.commentNum = res.msg
})
},
viewAll () {
uni.navigateTo({
url:'/subPackages/eventCalendar/detail?id='+this.id
})
},
}
}
</script>
<style scoped lang="scss">
.comment-box{
width: 697rpx;
height: auto;
margin: 24rpx auto 0;
.comment-title{
height: 95rpx;
display: flex;
align-items: center;
font-weight: bold;
font-size: 37rpx;
color: #000000;
.comment-num{
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #515150;
}
}
.comment-container{
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
padding: 0 29rpx;
}
.comment-item{
padding: 27rpx 0;
border-bottom: 1rpx solid #D8D8D8;
.comment-avatar{
width: 53rpx;
height: 53rpx;
background: #999999;
border-radius: 50%;
margin-right: 20rpx;
flex-shrink: 0;
}
.comment-name{
font-weight: bold;
font-size: 28rpx;
color: #000000;
}
.comment-time {
font-family: PingFangSC;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.comment-content{
margin-top: 24rpx;
font-size: 28rpx;
font-weight: 500;
color: #000000;
}
}
.comment-item:last-of-type{
border: none;
}
.empty-box {
text-align: center;
width: 100%;
height: 200rpx;
background: #FFFFFF;
border-radius: 20rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
line-height: 200rpx;
}
.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>

9
subPackages/hotelHomestay/detail.vue

@ -132,6 +132,11 @@
</view>
</view>
<template v-if="id">
<userReviewsVue :goodsId="id"></userReviewsVue>
<moreGoodsVue :goodsId="id"></moreGoodsVue>
</template>
</view>
<!-- 酒店详情弹窗 -->
@ -179,9 +184,11 @@
<script>
import SelectCalendar from './selectCalendar';
import userReviewsVue from '../../compoents/userReviews.vue';
import moreGoodsVue from '../../compoents/moreGoods.vue'
export default {
components: {
SelectCalendar
SelectCalendar,userReviewsVue,moreGoodsVue
},
data() {
return {

8
subPackages/line/detail.vue

@ -40,6 +40,11 @@
<view class="info-title">产品详情</view>
<view class="info-content" v-html="formateRichText(info.special_content)"></view>
</view>
<template v-if="id">
<userReviewsVue :goodsId="id"></userReviewsVue>
<moreGoodsVue :goodsId="id"></moreGoodsVue>
</template>
</view>
<view class="fixed-bottom">
@ -59,7 +64,10 @@
<script>
const device = uni.getSystemInfoSync();
const ratio = device.windowWidth / 750;
import userReviewsVue from '../../compoents/userReviews.vue';
import moreGoodsVue from '../../compoents/moreGoods.vue'
export default {
components: {userReviewsVue,moreGoodsVue},
data() {
return {
id: null,

9
subPackages/techan/detail.vue

@ -53,6 +53,11 @@
<view class="notice" >
<view class="rich-text" v-html="formateRichText(info.special_content)"></view>
</view>
<template v-if="id">
<userReviewsVue :goodsId="id"></userReviewsVue>
<moreGoodsVue :goodsId="id"></moreGoodsVue>
</template>
</view>
<view class="btn-list" v-if="!paramData.showCart">
@ -164,9 +169,11 @@
</template>
<script>
import userReviewsVue from '../../compoents/userReviews.vue';
import moreGoodsVue from '../../compoents/moreGoods.vue'
import cartDataVue from '../../compoents/cartData.vue'
export default {
components: {cartDataVue},
components: {cartDataVue,userReviewsVue,moreGoodsVue},
data() {
return {
id: null,

11
subPackages/ticketBooking/detail.vue

@ -120,6 +120,12 @@
<view class="common-container" style="padding: 30rpx;">
<view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view>
</view>
<template v-if="id">
<userReviewsVue :goodsId="id"></userReviewsVue>
<moreGoodsVue :goodsId="id"></moreGoodsVue>
</template>
</view>
<!-- 预订须知的弹窗 -->
@ -198,16 +204,17 @@
</template>
<script>
import userReviewsVue from '../../compoents/userReviews.vue';
import moreGoodsVue from '../../compoents/moreGoods.vue'
let innerAudioContext2 = null
export default {
components: {userReviewsVue,moreGoodsVue},
data() {
return {
headImg: null,
swiperCurrent: 1,
id: null,
info: {list_images:'', times_list_info: {start:'',end:''}},
sku: [],
skuInfo: {}, //

Loading…
Cancel
Save