App.vue 1.4 KB

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