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.
149 lines
2.9 KiB
149 lines
2.9 KiB
2 months ago
|
<template>
|
||
|
<view class="bg">
|
||
|
<view class="topImg relative">
|
||
|
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
|
||
|
</view>
|
||
|
|
||
|
|
||
|
<view class="goodBox">
|
||
|
<view @click="gotoDetailByType(item)" class="goodItem" v-for="(item,index) in list" :key="index">
|
||
|
<image class="left-image" :src="showImg(item.headimg||'')" mode="aspectFill"></image>
|
||
|
<view class="contentBox flex-column flex-1 w-1rpx">
|
||
|
<view class="title text-overflowRows">{{item.title}}</view>
|
||
|
<view class="subtitle text-overflow" v-if="item.display_tags" style="font-size: 24rpx;color: #6A8A27;">
|
||
|
{{item.display_tags.split(',').join(" | ")}}
|
||
|
</view>
|
||
|
<view class="subtitle text-overflowRows">{{item.address}}</view>
|
||
|
|
||
|
<view class="price price-money">
|
||
|
{{item.price/100}}
|
||
|
</view>
|
||
|
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<!-- <view class="finished-text" v-if="finished">没有更多数据了</view> -->
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default{
|
||
|
data(){
|
||
|
return {
|
||
|
headImg:null,
|
||
|
|
||
|
list: [],
|
||
|
finished: false,
|
||
|
|
||
|
type_id: 661,//景点分类id
|
||
|
}
|
||
|
},
|
||
|
onShow() {
|
||
|
this.finished = false
|
||
|
},
|
||
|
onReady() {
|
||
|
this.getHeadImg(2383).then(res => {this.headImg = res})
|
||
|
this.getList()
|
||
|
},
|
||
|
onLoad(options) {
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
|
||
|
// 根据景点标签获取景点列表
|
||
|
getList(){
|
||
|
this.Post({tag_id: this.type_id,offset: this.list.length,limit: 10},
|
||
|
'/api/product/get_product_by_tag').then(res => {
|
||
|
this.list = [...this.list, ...res.data.list];
|
||
|
if (res.data.length < 10) {
|
||
|
this.finished = true
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
|
||
|
viewDetail (item) {
|
||
|
uni.navigateTo({
|
||
|
url:'/subPackages/food/detail?id='+item.id
|
||
|
})
|
||
|
},
|
||
|
},
|
||
|
onReachBottom() {
|
||
|
setTimeout(() => {
|
||
|
if (!this.finished) this.getList()
|
||
|
},1000)
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
*{
|
||
|
box-sizing: border-box;
|
||
|
font-family: PingFangSC;
|
||
|
}
|
||
|
.bg{
|
||
|
min-height: 100vh;
|
||
|
background: #F9FCF3;
|
||
|
}
|
||
|
.topImg{
|
||
|
width: 100%;
|
||
|
}
|
||
|
|
||
|
|
||
|
.goodBox{
|
||
|
width: 100%;
|
||
|
z-index: 2;
|
||
|
padding: 26rpx;
|
||
|
|
||
|
.goodItem{
|
||
|
width: 100%;
|
||
|
height: 240rpx;
|
||
|
margin-bottom: 30rpx;
|
||
|
display: flex;
|
||
|
.left-image{
|
||
|
width: 240rpx;
|
||
|
height: 100%;
|
||
|
border-radius: 20rpx;
|
||
|
flex-shrink: 0;
|
||
|
}
|
||
|
|
||
|
.contentBox{
|
||
|
padding: 10rpx 20rpx 0;
|
||
|
height: 100%;
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.title{
|
||
|
width: 100%;
|
||
|
font-weight: bold;
|
||
|
font-size: 31rpx;
|
||
|
color: #333333;
|
||
|
}
|
||
|
|
||
|
.subtitle{
|
||
|
font-weight: 400;
|
||
|
font-size: 23rpx;
|
||
|
color: #999999;
|
||
|
}
|
||
|
|
||
|
|
||
|
.price{
|
||
|
font-family: PingFang SC;
|
||
|
font-weight: bold;
|
||
|
font-size: 33rpx;
|
||
|
color: #DC2525;
|
||
|
text-align: right;
|
||
|
}
|
||
|
.price-money::before{
|
||
|
content: '¥';
|
||
|
font-size: 24rpx;
|
||
|
}
|
||
|
.price-money::after{
|
||
|
content: '起';
|
||
|
color: #999;
|
||
|
font-size: 24rpx;
|
||
|
font-weight: normal;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</style>
|