时味苏州
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.
 
 
 
 

133 lines
2.5 KiB

<template>
<view class="bg">
<image :src="headImg" class="topImg" mode="aspectFill"></image>
<view @click="gotoDetailByType(item)" class="item" v-for="(item,index) in list" :key="index">
<image :src="item.headimg" mode="aspectFill" class="image"></image>
<view class="content flex-column">
<view class="title text-overflowRows">{{item.title}}</view>
<view class="tags" v-if="item.scene_tags">
<view class="tag" v-for="(tagItem,tagIndex) in item.scene_tags.split(',').slice(0,2)" :key="tagIndex">{{tagItem}}</view>
</view>
<view class="address text-overflowRows">{{item.province_name}}{{item.city_name}}{{item.area_name}}{{item.address}}</view>
<view class="price">{{item.price / 100}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
headImg: '',
list: [],
finished: false
}
},
mounted() {
// 头图
this.getHeadImg(2371).then(res => {this.headImg = res})
this.getList()
},
onReachBottom() {
setTimeout(() => {
if(!this.finished) this.getList()
},1000)
},
methods: {
getList() {
this.Post({
offset: this.list.length,
limit: 10,
tag_id: 8,
title: ''
}, '/api/scene/get_scene_by_tag').then(res => {
if (res) {
this.list = [...res.data.list, ...this.list]
if (res.data.list.length < 10) {
this.finished = true
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
padding-bottom: 100rpx;
}
.topImg {
width: 100%;
height: 386.67rpx;
}
.item {
margin: 30rpx 26rpx;
height: 240rpx;
display: flex;
.image {
width: 240rpx;
height: 240rpx;
border-radius: 20rpx;
margin-right: 22rpx;
flex-shrink: 0;
}
.content {
flex: 1;
height: 240rpx;
padding-top: 10rpx;
justify-content: space-between;
.title {
font-weight: bold;
font-size: 31rpx;
color: #333333;
}
.tags {
display: flex;
.tag {
font-size: 24rpx;
color: #6A8A27;
margin-right: 11rpx;
}
.tag:not(:last-child)::after{
content: '|';
display: inline-block;
margin-left: 11rpx;
}
}
.address {
font-weight: 400;
font-size: 23rpx;
color: #999999;
}
.price {
font-weight: bold;
font-size: 34rpx;
color: #DC2525;
margin-left: auto;
}
.price::before {
content: '¥';
font-size: 23rpx;
}
.price::after {
content: '起';
font-size: 23rpx;
color: rgba(153, 153, 153, 1);
}
}
}
</style>