App.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. }
  45. /* #endif */
  46. .example-info {
  47. font-size: 14px;
  48. color: #333;
  49. padding: 10px;
  50. }
  51. /* 隐藏scroll-view的滚动条 */
  52. ::-webkit-scrollbar {
  53. display: none;
  54. width: 0 !important;
  55. height: 0 !important;
  56. -webkit-appearance: none;
  57. background: transparent;
  58. color: transparent;
  59. }
  60. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  61. display: none;
  62. width: 0 !important;
  63. height: 0 !important;
  64. -webkit-appearance: none;
  65. background: transparent;
  66. color: transparent;
  67. }
  68. </style>