合同小程序前端代码仓库
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.

82 lines
1.7 KiB

  1. <script lang="uts">
  2. let firstBackTime = 0
  3. export default {
  4. onLaunch: function () {
  5. console.log('App Launch')
  6. },
  7. onShow: function () {
  8. console.log('App Show')
  9. },
  10. onHide: function () {
  11. console.log('App Hide')
  12. },
  13. // #ifdef APP-ANDROID
  14. onLastPageBackPress: function () {
  15. console.log('App LastPageBackPress')
  16. if (firstBackTime == 0) {
  17. uni.showToast({
  18. title: '再按一次退出应用',
  19. position: 'bottom',
  20. })
  21. firstBackTime = Date.now()
  22. setTimeout(() => {
  23. firstBackTime = 0
  24. }, 2000)
  25. } else if (Date.now() - firstBackTime < 2000) {
  26. firstBackTime = Date.now()
  27. uni.exit()
  28. }
  29. },
  30. // #endif
  31. onExit: function () {
  32. console.log('App Exit')
  33. },
  34. }
  35. </script>
  36. <style>
  37. @import "@/static/iconfont.css";
  38. @import "css/header.css";
  39. /*每个页面公共css */
  40. body{
  41. background-color: #ffffff;
  42. }
  43. body {
  44. font-family: Arial, sans-serif;
  45. margin: 0;
  46. padding: 0;
  47. }
  48. @media only screen and (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2){
  49. .uni-hairline{
  50. border-width: 0.5px !important;
  51. }
  52. .uni-nbfc {
  53. background-color: transparent !important;
  54. }
  55. }
  56. @media screen and (min-width: 320px) {
  57. html {font-size: 14px;}
  58. }
  59. @media screen and (min-width: 360px) {
  60. html {font-size: 16px;}
  61. }
  62. @media screen and (min-width: 400px) {
  63. html {font-size: 18px;}
  64. }
  65. @media screen and (min-width: 440px) {
  66. html {font-size: 20px;}
  67. }
  68. @media screen and (min-width: 480px) {
  69. html {font-size: 22px;}
  70. }
  71. @media screen and (min-width: 640px) {
  72. html {font-size: 28px;}
  73. }
  74. </style>