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.
|
|
<script> import Vue from 'vue' let __timerId = 0; export default { onLaunch() { /* uniCloud.callFunction({ name: 'bak', success(e) { console.log(e); }, }) */ uni.getSystemInfo({ success: e=> { this.initSize(e); } }) this.initLogin(); }, methods: { //登录状态
async initLogin(){ const token = uni.getStorageSync('uniIdToken'); if(token){ this.$store.commit('setToken', { token }); } }, /** * 存储设备信息 参考colorUI * @param {Object} */ initSize(e){ const systemInfo = e; let navigationBarHeight; let custom = {}; // #ifndef MP
custom = {height: 36,width: 88}; navigationBarHeight = 44; // #endif
// #ifdef MP-WEIXIN
custom = wx.getMenuButtonBoundingClientRect(); navigationBarHeight = custom.bottom + custom.top - e.statusBarHeight * 2; // #endif
systemInfo.custom = custom; systemInfo.navigationBarHeight = navigationBarHeight; Vue.prototype.systemInfo = systemInfo; }, //打开全局定时器
openTimer(){ this.closeTimer(); __timerId = setInterval(()=>{ this.$store.commit('setStateAttr', { key: 'timerIdent', val: !this.$store.state.timerIdent }) }, 1000) }, //关闭定时器
closeTimer(){ if(__timerId != 0){ clearInterval(__timerId); __timerId = 0; } }, }, onShow() { console.log('app show'); this.openTimer(); }, onHide() { this.closeTimer(); } } </script>
<style lang="scss"> /*每个页面公共css */ @import url("./common/css/common.css"); @import url("./common/css/icon.css"); .lazyload{ position: relative; &.lazypic{ &:after{ content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-image: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QONaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMt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jTUspVjDVYqKmBQGkitkKqC+KJFGIuDRFTRrZ0CGbqiAk4IoY3QQPwQRqUF5IMSgTVADUAyDWk40UotLYoKioTtk2QZO3IFkDpIF1KsTzOCGrS5QBiRYqoBGQq6BNfFBOWYoEwBsgjBggyw80FRAHMIBwboMkgmpogfZYIlEtuOCisaWKo7wiGQMYSfogTQYMiM0Q1aBWp6IJ5RHyRBU9FQl0gn8lV01zQ1ECmeSIGxwQRfBAGUhZSrCxxRUw/giajJlDSzjrggNJH6oqMQcEBpJDIhAoyKkEwwQTUQBz+CCIEhXBBkxIQWkMgtDB0GWyQaiTbFA1DoBBp0GZMgAwDoLVEoAjJAswqgjOLIBwUGSD6IISGKBZBkxDs3mgxPayKAER6IYWayCEq1QdzzsgBKQLu72H8UQtankiGx6ZIKshSw6Kg0gj9gmCAAHjgmCHXyQJIYuqI6PF0BTCvVAg9KICoPRAkOKBQDMaIuokoiEX/AERYiGtdSg1HGqKa+SCALoNE0QZBD1CCdA+ToM18kQ0QNadUVloO2KCMS9KoMnbDvigWyugLlscUFpqgCA background-size: 100% 100%; opacity: 0.3; } } image{ position: relative; z-index: 1; opacity: 0; } &.loaded image{ transition: .7s; opacity: 1 !important; } } </style>
|