App.vue 1.8 KB

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