merchant-app/pages/work/index.vue

40 lines
1.1 KiB
Vue
Raw Normal View History

2024-09-12 14:10:05 +08:00
<template>
2024-10-24 11:10:31 +08:00
<merchantXc v-if="roleType == 0" :titleTop="titleTop" :statusBarHeight="statusBarHeight" :nowTab1="nowTab" ></merchantXc>
<employeeXc v-else-if="roleType == 1" :titleTop="titleTop" :statusBarHeight="statusBarHeight" :nowTab1="nowTab"></employeeXc>
2024-09-12 14:10:05 +08:00
</template>
<script>
2024-10-24 11:10:31 +08:00
import merchantXc from "../components/merchantXc";
import employeeXc from "../components/employeeXc";
2024-09-12 14:10:05 +08:00
export default {
2024-10-24 11:10:31 +08:00
components: {
merchantXc,
employeeXc
},
2024-09-12 14:10:05 +08:00
data() {
return {
2024-10-24 11:10:31 +08:00
roleType: -1,
2024-09-12 14:10:05 +08:00
nowTab: 1,
2024-10-24 11:10:31 +08:00
titleTop: 1,
statusBarHeight: 1,
};
2024-09-12 14:10:05 +08:00
},
2024-10-24 11:10:31 +08:00
onLoad: function(options) {
this.roleType = this.$store.state.user.roleType;
2024-09-12 14:10:05 +08:00
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
const { top, height } = menuButtonInfo;
2024-10-24 11:10:31 +08:00
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
2024-09-12 14:10:05 +08:00
// 计算标题需要偏移的位置
2024-10-24 11:10:31 +08:00
this.titleTop = top + (height - this.statusBarHeight) / 2;
2024-09-12 14:10:05 +08:00
2024-10-24 11:10:31 +08:00
if (options.self == 'true'){
this.nowTab = 2;
}
2024-09-12 14:10:05 +08:00
},
methods: {
}
}
</script>