App.vue 2.2 KB

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