App.vue 1.7 KB

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