Files
dvcp_v2_wxcp_app/src/pages/mainEntry.vue

54 lines
1.1 KiB
Vue
Raw Normal View History

2021-11-30 14:39:24 +08:00
<template>
<section class="mainEntry">
2021-12-01 18:09:58 +08:00
<component ref="CurrentEntry" v-if="!!app" :is="app"/>
2021-11-30 14:39:24 +08:00
<div v-else>
2021-12-01 18:09:58 +08:00
<ai-result tips="应用建设中.." status="error" btn="返回主页" :btn-tap="back"/>
2021-11-30 14:39:24 +08:00
</div>
</section>
</template>
<script>
2021-12-01 18:09:58 +08:00
import AiResult from "../components/AiResult";
2021-11-30 14:39:24 +08:00
export default {
name: "mainEntry",
2021-12-01 18:09:58 +08:00
components: {AiResult},
2021-11-30 14:39:24 +08:00
inject: {root: {}},
data() {
return {
app: ""
}
},
methods: {
back() {
// uni.reLaunch({url:""})
this.root.goto({path: "/pages/loading"})
}
},
onLoad(params) {
this.app = params.app || ""
2021-12-01 18:09:58 +08:00
sessionStorage.setItem("currentApp", params.app)
2021-11-30 14:39:24 +08:00
},
onShow() {
this.app = this.$route.query.app || ""
2021-12-01 18:09:58 +08:00
if (!this.app && sessionStorage.getItem("currentApp")) {
this.$router.push({query: {app: sessionStorage.getItem("currentApp")}})
location.reload()
}
2021-11-30 14:39:24 +08:00
this.$nextTick(() => {
this.$refs.CurrentEntry?.emitShow?.()
})
},
onReachBottom() {
this.$refs.CurrentEntry?.emitReachBottom?.()
}
}
</script>
<style lang="scss" scoped>
.mainEntry {
2021-12-08 21:33:13 +08:00
min-height: 100vh;
background: #f5f5f5;
2021-11-30 14:39:24 +08:00
}
</style>