53 lines
1.0 KiB
Vue
53 lines
1.0 KiB
Vue
<template>
|
|
<view>
|
|
<index v-if="curPageCode === 'indexPage'"></index>
|
|
<module-bar @tap="$commonFun.login" :moduleBarInfos="moduleBarInfos"></module-bar>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import moduleBar from '@/components/custom-bar/module-bar.vue';
|
|
import index from '@/pages/index/index-home.vue';
|
|
|
|
export default {
|
|
components: {
|
|
moduleBar,
|
|
index
|
|
},
|
|
data() {
|
|
return {
|
|
moduleBarInfos: [],
|
|
curPageCode: 'indexPage'
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.loadData();
|
|
this.bindEvent();
|
|
},
|
|
onUnload() {
|
|
this.offEvent();
|
|
},
|
|
methods: {
|
|
async loadData() {
|
|
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
|
},
|
|
bindEvent() {
|
|
uni.$on('getCurPageInfo', function(data) {
|
|
if (data.curPageCode === 'publishPage') {
|
|
this.isShowPublish = true;
|
|
} else {
|
|
this.isShowPublish = false;
|
|
this.curPageCode = data.curPageCode;
|
|
}
|
|
}.bind(this));
|
|
},
|
|
offEvent() {
|
|
uni.$off('getCurPageInfo')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
</style>
|