qingyiay
2023-07-02 f5427eeb16cadd3b0534454ab3c92df6f0ec1536
App.vue
@@ -1,38 +1,46 @@
<script>
export default {
   onShow() {},
   methods: {}
   // created() {
   //    uni.loadFontFace({
   //       family: 'siYuanLight', // 字体名称,可以自定义
   //       source: 'url("/utils/fonts/siyuan.OTF")', // 字体文件路径
   //       success() {
   //          console.log('字体加载成功');
   //       },
   //       fail() {
   //          console.log('字体加载失败');
   //       }
   //    });
   // }
};
   import { mapState, mapMutations } from 'vuex';
   export default {
      onLaunch() {},
      onHide() {
         console.log('appvue隐藏后台');
         this.changeisconnect(false);
         console.log(this.globalisconnect, this.globalisUploadimg, this.globalisLogin);
      },
      onShow() {
         console.log('appvue显示');
         if (!this.globalisconnect && !this.globalisUploadimg) {
            this.$store.dispatch('websocketInit')
            this.changeisconnect(false);
            console.log('appvue的ws');
         }
      },
      methods: {
         ...mapMutations(['changeisconnect'])
      },
      computed: {
         ...mapState(['globalisconnect', 'globalisUploadimg', 'globalisLogin'])
      }
   };
</script>
<style lang="scss" scoped>
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@font-face {
   font-family: siYuanLight;
   src: url('https://mx.jzeg.cn:9095/appimg/fonts/siyuan.OTF');
}
@font-face {
   font-family: weighting;
   src: url('https://mx.jzeg.cn:9095/appimg/fonts/weighting.TTF');
}
body {
   font-family: siYuanLight, sans-serif;
}
// @font-face {
//    font-family: 'weighting';
//    src: url('./utils/fonts/weighing.TTF');
// }
</style>
<style lang="scss"
   scoped>
   /*每个页面公共css */
   @import '@/uni_modules/uview-ui/index.scss';
   @font-face {
      font-family: siYuanLight;
      src: url('https://mx.jzeg.cn:9095/appimg/fonts/siyuannormal.OTF');
   }
   @font-face {
      font-family: weighting;
      src: url('https://mx.jzeg.cn:9095/appimg/fonts/weighting.TTF');
   }
   body {
      font-family: siYuanLight, sans-serif;
   }
</style>