App.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <script>
  2. // import cmSysMixins from '@/mixins/cmSysMixins.js'
  3. import appMixins from '@/mixins/appMixins.js'
  4. export default {
  5. mixins: [appMixins],
  6. onLaunch() {
  7. //小程序热更新代码
  8. const updateManager = uni.getUpdateManager()
  9. updateManager.onCheckForUpdate(function(res) {
  10. console.log(res.hasUpdate)
  11. })
  12. updateManager.onUpdateReady(function(res) {
  13. uni.showModal({
  14. title: '更新提示',
  15. content: '新版本已经准备好,是否重启小程序?',
  16. success(res) {
  17. if (res.confirm) {
  18. updateManager.applyUpdate()
  19. }
  20. }
  21. })
  22. })
  23. this.initSetSystemInfo()
  24. this.appUpdataRefresh()
  25. },
  26. onShow() {
  27. },
  28. onHide() {
  29. console.log('App Hide')
  30. },
  31. }
  32. </script>
  33. <style lang="scss">
  34. /*每个页面公共css */
  35. @import "@/common/css/common.scss";
  36. @import "@/common/css/iconfont.scss";
  37. @import "@/common/css/style/thorui.css";
  38. @import "@/common/css/style/icon.css";
  39. view,
  40. scroll-view,
  41. swiper,
  42. swiper-item,
  43. cover-view,
  44. cover-image,
  45. icon,
  46. text,
  47. rich-text,
  48. progress,
  49. button,
  50. checkbox,
  51. form,
  52. input,
  53. label,
  54. radio,
  55. slider,
  56. switch,
  57. textarea,
  58. navigator,
  59. audio,
  60. camera,
  61. image,
  62. video {
  63. // box-sizing: border-box;
  64. }
  65. // page {
  66. // width: 100%;
  67. // height: 100%;
  68. // background: #fff;
  69. // filter: grayscale(100%);
  70. // filter: gray;
  71. // filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
  72. // --toast-default-width: 114px;
  73. // }
  74. page{
  75. height: 100%;
  76. background-color: #FFFFFF;
  77. }
  78. /* 骨架屏替代方案 */
  79. .Skeleton {
  80. background: #f3f3f3;
  81. padding: 20upx 0;
  82. border-radius: 8upx;
  83. }
  84. .clamp {
  85. overflow: hidden;
  86. text-overflow: ellipsis;
  87. white-space: nowrap;
  88. display: block;
  89. }
  90. .common-hover {
  91. background: #f5f5f5;
  92. }
  93. /* input 样式 */
  94. .input-placeholder {
  95. color: #999999;
  96. }
  97. .placeholder {
  98. color: #999999;
  99. }
  100. </style>