You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.8 KiB
84 lines
2.8 KiB
10 months ago
|
<script>
|
||
|
// app.js
|
||
|
import { getStaffbasicinfo } from './utils/api';
|
||
|
import { getOwnedRolesOfStaffId } from './utils/statisticsApi';
|
||
|
export default {
|
||
|
data() {
|
||
|
return {};
|
||
|
},
|
||
|
onLaunch: function (options) {
|
||
|
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
|
||
|
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
|
||
|
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
|
||
|
//虽然最后解决了,但是花费了不少时间
|
||
|
let code = [1011, 1017, 1025, 1047, 1124, 1001, 1038, 1041, 1089, 1090, 1104, 1131, 1187];
|
||
|
if (code.includes(options.scene)) {
|
||
|
console.log(options.scene);
|
||
|
this.globalData.share = true;
|
||
|
} else {
|
||
|
this.globalData.share = false;
|
||
|
}
|
||
|
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||
|
uni.getSystemInfo({
|
||
|
success: (res) => {
|
||
|
this.globalData.height = res.statusBarHeight;
|
||
|
this.globalData.deviceInfo.statusHeight = res.statusBarHeight;
|
||
|
this.globalData.deviceInfo.navigationHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2;
|
||
|
}
|
||
|
});
|
||
|
uni.hideTabBar();
|
||
|
getStaffbasicinfo()
|
||
|
.then((res) => {
|
||
|
this.globalData.user = res.data;
|
||
|
getOwnedRolesOfStaffId(res.data.id).then((res2) => {
|
||
|
this.globalData.roleList = res2.data;
|
||
|
});
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
console.log(err);
|
||
|
uni.redirectTo({
|
||
|
url: '/pages/login/login'
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
globalData: {
|
||
|
userInfo: null,
|
||
|
selected: 0,
|
||
|
deviceInfo: {
|
||
|
statusHeight: 19,
|
||
|
navigationHeight: 40
|
||
|
},
|
||
|
user: {},
|
||
|
share: false,
|
||
|
questionnaireUrl: '',
|
||
|
roleList: []
|
||
|
}
|
||
|
};
|
||
|
</script>
|
||
|
<style>
|
||
|
/**app.wxss**/
|
||
|
.container {
|
||
|
height: 100%;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
justify-content: space-between;
|
||
|
padding: 200rpx 0;
|
||
|
box-sizing: border-box;
|
||
|
font-family: 'PingFangSC-Regular', sans-serif;
|
||
|
}
|
||
|
|
||
|
page {
|
||
|
--calendar-range-edge-background-color: #3e92ff;
|
||
|
--calendar-range-middle-color: #81b5fb;
|
||
|
--button-danger-background-color: linear-gradient(87deg, #81b5fb 0%, #3e92ff 100%);
|
||
|
--button-danger-border-color: 'none';
|
||
|
--calendar-selected-day-background-color: #3e92ff;
|
||
|
font-family: 'PingFangSC-Regular', sans-serif;
|
||
|
}
|
||
|
@font-face {
|
||
|
font-family: 'PingFangSC-Regular';
|
||
|
src: url(/images/pingfangheiti.ttf) format('truetype');
|
||
|
}
|
||
|
</style>
|