Files
dvcp_v2_wxcp_app/src/pages/mainEntry.vue
yanran200730 2544127ee5 bug
2021-12-08 21:33:17 +08:00

54 lines
1.1 KiB
Vue

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