盐都地图
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.

139 lines
2.8 KiB

1 year ago
<template>
<div class="bg">
1 year ago
<!-- 我的行程时显示添加行程 -->
<div class="top-box flex-between" v-if="type">
<div>我的行程</div>
<div class="top-btn" @click="addLine">+添加</div>
</div>
<div class="item" v-for="(item,index) in list" :key="index" @click="viewDetail(item)">
1 year ago
<img :src="util.showImg(item.image)" alt="" />
1 year ago
<div :class="['content', {'contents': type}]">
1 year ago
<div class="title">{{item.name}}</div>
1 year ago
<div class="subtitle text-overflowRows" v-if="type" style="display: flex;">
<div v-for="(tagItem, tagIndex) in item.points" :key="tagIndex">{{tagItem.name}}<span v-if="tagIndex + 1 != item.points.length">-</span></div>
1 year ago
</div>
1 year ago
<div class="subtitle" v-else>{{item.points.length}}个景点</div>
<div class="subtitle" v-if="type">{{item.date}}</div>
</div>
<div class="delLine flex-center" v-if="type">
<img src="https://static.ticket.sz-trip.com/yandu/images/map/delLine.png" alt="" @click="delLine(index)">
1 year ago
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
1 year ago
list: [],
type: this.$route.query.type, // type为1时是我的行程,否则为推荐线路
1 year ago
}
},
mounted() {
this.getList()
},
methods: {
// 根据code获取推荐线路
getList() {
this.post({
1 year ago
type: this.$route.query.type ? 1 : '',
1 year ago
code: this.$route.query.code
},'/api/emap/getLineByCode').then(res => {
this.list = res.data
})
1 year ago
},
// 详情
viewDetail(item) {
sessionStorage.setItem('lineDetail', JSON.stringify(item))
this.$router.push('/')
},
// 添加线路
addLine() {
this.$router.push('/')
1 year ago
}
}
}
</script>
<style lang="scss" scoped>
.bg {
width: 100%;
min-height: 100vh;
background: #F7F7F7;
padding-top: 31px;
}
1 year ago
.top-box {
width: 697px;
padding: 30px;
margin: 0 auto;
font-weight: bold;
font-size: 40px;
color: #000000;
.top-btn {
width: 137px;
line-height: 60px;
border-radius: 30px;
border: 1px solid #CCCCCC;
text-align: center;
font-weight: 400;
font-size: 27px;
color: #000000;
}
}
1 year ago
.item {
width: 697px;
height: 240px;
background: #FFFFFF;
box-shadow: 0px 1px 16px 0px rgba(153,153,153,0.35);
border-radius: 20px;
margin: 0 auto 33px;
padding: 13px;
display: flex;
1 year ago
justify-content: space-between;
1 year ago
img {
object-fit: cover;
width: 213px;
height: 213px;
border-radius: 13px;
}
.content {
padding: 15px 0;
width: 410px;
.title {
font-weight: bold;
font-size: 33px;
color: #111111;
}
.subtitle {
margin-top: 8px;
font-weight: 500;
font-size: 27px;
color: #666666;
}
1 year ago
}
.contents {
width: 340px;
}
.delLine {
width: 50px;
1 year ago
1 year ago
img {
width: 30px;
height: 34px;
1 year ago
}
}
}
</style>