App.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch')
  5. uni.setStorageSync('firstOpen', true)
  6. const updateManager = uni.getUpdateManager();
  7. updateManager.onCheckForUpdate(function(res){});
  8. updateManager.onUpdateReady(function(res){
  9. uni.showModal({
  10. title: '更新提示',
  11. content:'发现新版本,是否重启应用',
  12. success(res) {
  13. if(res.confirm) {
  14. updateManager.applyUpdate();
  15. }
  16. }
  17. })
  18. });
  19. updateManager.onUpdateFailed(function(res) {
  20. //新本版下载失败
  21. uni.showModal({
  22. title:'失败提示',
  23. content:'新版本下载失败,请手动删掉小程序后重新搜索进入小程序'
  24. })
  25. })
  26. },
  27. onShow: function() {
  28. console.log('App Show')
  29. },
  30. onHide: function() {
  31. console.log('App Hide')
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. /*每个页面公共css */
  37. @import '@/uni_modules/uni-scss/index.scss';
  38. /* #ifndef APP-NVUE */
  39. @import '@/static/iconfont.wxss';
  40. @import '@/static/style/index.scss';
  41. // 设置整个项目的背景色
  42. page {
  43. background-color: #ffffff;
  44. font-family: MiSans-Normal;
  45. }
  46. /* #endif */
  47. .example-info {
  48. font-size: 14px;
  49. color: #333;
  50. padding: 10px;
  51. }
  52. /* 隐藏scroll-view的滚动条 */
  53. ::-webkit-scrollbar {
  54. display: none;
  55. width: 0 !important;
  56. height: 0 !important;
  57. -webkit-appearance: none;
  58. background: transparent;
  59. color: transparent;
  60. }
  61. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  62. display: none;
  63. width: 0 !important;
  64. height: 0 !important;
  65. -webkit-appearance: none;
  66. background: transparent;
  67. color: transparent;
  68. }
  69. </style>