App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch');
  5. let updateManager = wx.getUpdateManager()
  6. updateManager.onCheckForUpdate(function(res) {
  7. console.log(res.hasUpdate)
  8. })
  9. updateManager.onUpdateReady(function() {
  10. wx.showModal({
  11. title: '更新提示',
  12. content: '新版本已经准备好,是否重启应用?',
  13. success(res) {
  14. if (res.confirm) {
  15. updateManager.applyUpdate()
  16. }
  17. }
  18. })
  19. })
  20. updateManager.onUpdateFailed(function() {
  21. wx.showToast({
  22. title: '更新失败',
  23. icon: 'none'
  24. })
  25. })
  26. uni.onTabBarMidButtonTap(() => {
  27. uni.navigateTo({
  28. url: '/pages/health-encyclopedia/health-encyclopedia',
  29. })
  30. })
  31. },
  32. onShow: function() {
  33. },
  34. onHide: function() {
  35. console.log('App Hide')
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. @import "uview-ui/index.scss";
  41. /*每个页面公共css */
  42. page {
  43. background-color: #F2F2F2;
  44. }
  45. button::after {
  46. border: none;
  47. }
  48. button {
  49. margin: 0;
  50. padding: 0;
  51. background: none;
  52. }
  53. ::-webkit-scrollbar {
  54. display: none;
  55. }
  56. /* 解决H5 的问题 */
  57. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  58. /* 隐藏滚动条,仍然可以滚动 */
  59. display: none
  60. }
  61. </style>