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

89 lines
1.8 KiB

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