You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <script>
  2. import Vue from 'vue'
  3. import util from './utils/util';
  4. export default {
  5. onLaunch: function() {
  6. // #ifndef H5
  7. this.updateManager();
  8. // #endif
  9. },
  10. methods: {
  11. isLogin(){
  12. return !!uni.getStorageSync('token');
  13. },
  14. updateManager(){
  15. const updateManager = uni.getUpdateManager();
  16. updateManager.onCheckForUpdate(res=>console.log('请求完新版本信息的回调-->',res.hasUpdate));
  17. updateManager.onUpdateReady(function () {
  18. util.showModal({
  19. title: '更新提示',
  20. content: '新版本已经准备好,请重启应用!',
  21. showCancel:false,
  22. confirmText:'重启',
  23. success:res=>updateManager.applyUpdate(),
  24. })
  25. });
  26. updateManager.onUpdateFailed(err=>console.log('版本更新失败——>',err));
  27. },
  28. }
  29. }
  30. </script>
  31. <style>
  32. /*每个页面公共css */
  33. page{
  34. background-color: #f2f2f7;
  35. }
  36. view,scroll-view,text,picker{
  37. box-sizing: border-box;
  38. }
  39. .ox-dark-mask{
  40. position: fixed;
  41. left: 0;
  42. top: var(--window-top);
  43. right: 0;
  44. bottom: 0;
  45. background-color: rgba(0, 0, 0, .5);
  46. }
  47. /* btn hover-class */
  48. .hover-active{
  49. position: relative;
  50. overflow: hidden;
  51. }
  52. .hover-active::after{
  53. content: '';
  54. position: absolute;
  55. left: 0;
  56. right: 0;
  57. top: 0;
  58. bottom: 0;
  59. z-index: 2;
  60. background-color: rgba(0,0,0,.1);
  61. }
  62. /* btn hover-class */
  63. </style>