Feat:康养接口对接,细节调优

This commit is contained in:
linxi
2024-10-09 18:07:04 +08:00
parent 3d3efa89bf
commit b397ba232f
4 changed files with 248 additions and 84 deletions
+39 -18
View File
@@ -12,8 +12,11 @@
</view>
<view class="v12-justify-between swap">
<view v-for="(item, index) in traveItems" :key="index" class="trave-item-wrap v12-mr-3 v12-mt-3">
<view class="trave-item"></view>
<view class="trave-btn">旅居预约</view>
<view class="trave-item">
<image class="trave-item" :src="item.cover" mode="widthFix" v-if="item.coverType === 1"></image>
<video class="trave-item" :src="item.cover" :show-fullscreen-btn="false" v-if="item.coverType === 2"></video>
</view>
<view class="trave-btn" @click="toStore(item.hotelId)">旅居预约</view>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-px-3 v12-mt-3">
@@ -29,12 +32,18 @@
<view class="v12-justify-between sanctup-items v12-mt-3">
<view v-for="(item, index) in items" :key="index" class="v12-pa-1">
<view class="img">
<image class="img" :src="item.cover"></image>
<image class="img" :src="item.cover" v-if="item.coverType === 1"></image>
<video
class="img"
:src="item.cover"
:play-btn-position="center"
:show-fullscreen-btn="false"
v-if="item.coverType === 2">
</video>
<view class="v12-white-text v12-font-weight-300 address">{{ item.areaName }}</view>
</view>
<view class="v12-font-bold v12-font-28 more-t">{{ item.address }}</view>
<view class="v12-justify-start v12-align-center v12-my-2">
<view class="v12-font-bold v12-font-28 v12-mt-1 more-t" style="min-height: 76rpx; " @click="toStore(item.hotelId)">{{ item.address }}</view>
<view class="v12-justify-start v12-align-center v12-my-1" @click="toStore(item.hotelId)">
<view class="atr">
<image class="atr" :src="item.logo"></image>
</view>
@@ -51,16 +60,7 @@ export default {
return {
tabs: [],
items: [],
traveItems: [
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
{img: '', value: ''},
],
traveItems: [],
actived: 0,
cityId: '',
cityName: '',
@@ -70,12 +70,13 @@ export default {
},
onLoad(opts) {
this.cityId = opts.city
this.cityName = opts.cityName
this.cityName = decodeURIComponent(decodeURIComponent(opts.cityName))
getCategory().then(res => {
this.tabs = res.data
this.categoryId = res.data[0].id
this.getList()
})
this.getTop()
},
methods: {
handleTab(index, tab) {
@@ -103,7 +104,27 @@ export default {
},
search() {
this.getList()
}
},
getTop() {
const params = {
goodCityId: this.cityId,
categoryId: 0,
page: 1,
limit: 9999
}
getWellnessPlace(params).then(res => {
// console.log(res);
this.traveItems = res.data.records
})
},
toStore(id) {
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: id
}
})
},
}
}
</script>