App.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script>
  2. import time from "@/common/time.js"
  3. export default {
  4. onLaunch: function() {
  5. console.log('App Launch')
  6. // 启动初始化
  7. // 煤矿鉴别-名称
  8. uni.setStorageSync('mine_code', 'ningdongyunying');
  9. // uni.setStorageSync('mine_code', 'shicaocun');
  10. // uni.setStorageSync('mine_code', 'meihuajing');
  11. // uni.setStorageSync('mine_code', 'zaoquan');
  12. // uni.setStorageSync('mine_code', 'qingshuiying');
  13. // uni.setStorageSync('mine_code', 'wuyegongsi');
  14. // uni.setStorageSync('mine_code', 'jinjiaqu');
  15. // uni.setStorageSync('mine_code', 'yangchangwan');
  16. },
  17. onShow: function() {
  18. console.log('App Show')
  19. uni.setStorageSync('onShow', new Date().format("yyyy-MM-dd h:m"))
  20. },
  21. onHide: function() {
  22. console.log('App Hide')
  23. this.$api.user_recordDuration({
  24. start_date: uni.getStorageSync('onShow'),
  25. end_date: new Date().format("yyyy-MM-dd h:m")
  26. }).then((res) => {
  27. // console.log(res)
  28. })
  29. }
  30. }
  31. </script>
  32. <style lang="scss">
  33. /*每个页面公共css */
  34. @font-face {
  35. font-family: my-fzdbsjt;
  36. src: url('~@/static/font/FangZhengDaBiaoSongJianTi-1.ttf');
  37. }
  38. page {
  39. // font-family: $tdw-base-font;
  40. }
  41. .status_bar {
  42. height: var(--status-bar-height);
  43. width: 100%;
  44. }
  45. </style>