App.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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', 'ningmeijituan');
  12. // uni.setStorageSync('mine_code', 'ningdongyunying');
  13. // uni.setStorageSync('mine_code', 'shicaocun');
  14. // uni.setStorageSync('mine_code', 'meihuajing');
  15. // uni.setStorageSync('mine_code', 'zaoquan');
  16. // uni.setStorageSync('mine_code', 'qingshuiying');
  17. // uni.setStorageSync('mine_code', 'wuyegongsi');
  18. // uni.setStorageSync('mine_code', 'jinjiaqu');
  19. // uni.setStorageSync('mine_code', 'jinjiaqu_neiwang');
  20. // uni.setStorageSync('mine_code', 'yangchangwan');
  21. // uni.setStorageSync('mine_code', 'jinfeng');
  22. // uni.setStorageSync('mine_code', 'jinfeng_neiwang');
  23. // console.log(set_base_url(uni.getStorageSync('mine_code')))
  24. // uni.setStorageSync('base_url',set_base_url(uni.getStorageSync('mine_code')))
  25. // 设置自动化系统接口内外网域名
  26. if(uni.getStorageSync('mine_code').indexOf('_neiwang') == -1){
  27. uni.setStorageSync('unified_automation_system_url','http://video.nxjiewei.com:8011/api')
  28. }else{
  29. uni.setStorageSync('unified_automation_system_url','http://n.video.nxjiewei.com:8011/api')
  30. }
  31. },
  32. onShow: function() {
  33. console.log('App Show')
  34. uni.setStorageSync('onShow', new Date().format("yyyy-MM-dd h:m"))
  35. },
  36. onHide: function() {
  37. console.log('App Hide')
  38. this.$api.user_recordDuration({
  39. start_date: uni.getStorageSync('onShow'),
  40. end_date: new Date().format("yyyy-MM-dd h:m")
  41. }).then((res) => {
  42. // console.log(res)
  43. })
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. /*每个页面公共css */
  49. @font-face {
  50. font-family: my-fzdbsjt;
  51. src: url('~@/static/font/FangZhengDaBiaoSongJianTi-1.ttf');
  52. }
  53. page {
  54. // font-family: $tdw-base-font;
  55. }
  56. .status_bar {
  57. height: var(--status-bar-height);
  58. width: 100%;
  59. }
  60. </style>