-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
56 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,58 @@ | ||
<template> | ||
<div class="main"> | ||
<van-nav-bar | ||
:title="'影院'" | ||
@click-left="$router.push({ name: 'city' })" | ||
@click-right="$router.push({ name: 'searchCinemas' })"> | ||
<template #left> | ||
{{ $store.state.cityName }} | ||
<van-icon | ||
name="arrow-down" | ||
color="black" /> | ||
</template> | ||
<div class="main"> | ||
<van-nav-bar | ||
:title="'影院'" | ||
@click-left="$router.push({ name: 'city' })" | ||
@click-right="$router.push({ name: 'searchCinemas' })" | ||
> | ||
<template #left> | ||
{{ $store.state.cityName }} | ||
<van-icon name="arrow-down" color="black" /> | ||
</template> | ||
|
||
<template #right> | ||
<van-icon | ||
name="search" | ||
size="22" | ||
color="black" /> | ||
</template> | ||
</van-nav-bar> | ||
<transition | ||
name="h" | ||
appear | ||
mode="out-in"> | ||
<keep-alive> | ||
<router-view :height="getCinemaListHeight()"></router-view> | ||
</keep-alive> | ||
</transition> | ||
</div> | ||
<template #right> | ||
<van-icon name="search" size="22" color="black" /> | ||
</template> | ||
</van-nav-bar> | ||
<transition name="h" appear mode="out-in"> | ||
<router-view :height="getCinemaListHeight()"></router-view> | ||
</transition> | ||
</div> | ||
</template> | ||
<script> | ||
import { NavBar } from "vant" | ||
import { Icon } from "vant" | ||
export default { | ||
name: "cinemas", | ||
components: { | ||
[NavBar.name]: NavBar, | ||
[Icon.name]: Icon, | ||
}, | ||
data() { | ||
return { | ||
height: window.outerHeight, | ||
} | ||
}, | ||
methods: { | ||
getCinemaListHeight() { | ||
let height = | ||
this.height > window.outerHeight ? this.height : window.outerHeight | ||
return height - 46 - 49 + "px" | ||
} | ||
}, | ||
activated() { | ||
if (this.$store.state.cinemasData.length === 0) { | ||
this.$store.dispatch("getCinemasData", this.$store.state.cityId) | ||
} | ||
}, | ||
name: "cinemas", | ||
components: { | ||
[NavBar.name]: NavBar, | ||
[Icon.name]: Icon | ||
}, | ||
data() { | ||
return { | ||
height: window.outerHeight | ||
} | ||
}, | ||
methods: { | ||
getCinemaListHeight() { | ||
let height = this.height > window.outerHeight ? this.height : window.outerHeight | ||
return height - 46 - 49 + "px" | ||
} | ||
}, | ||
activated() { | ||
if (this.$store.state.cinemasData.length === 0) { | ||
this.$store.dispatch("getCinemasData", this.$store.state.cityId) | ||
} | ||
} | ||
} | ||
</script> | ||
<style scoped> | ||
.hhh-enter-active { | ||
transition: all 0.3s; | ||
/* animation: 1s run ease reverse; */ | ||
transition: all 0.3s; | ||
/* animation: 1s run ease reverse; */ | ||
} | ||
.hhh-enter { | ||
opacity: 0; | ||
transform: translateY(30px); | ||
opacity: 0; | ||
transform: translateY(30px); | ||
} | ||
</style> |
File renamed without changes.