App.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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: 'https://minio.menduner.com/dev/menduner/miniProgram/share-poster.jpg'
  14. // }
  15. // })
  16. // onShareTimeline(() => {
  17. // return {
  18. // title: '门墩儿 专注顶尖招聘',
  19. // path: '/pages/index/position',
  20. // imageUrl: 'https://minio.menduner.com/dev/menduner/miniProgram/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. }
  64. /* #endif */
  65. .example-info {
  66. font-size: 14px;
  67. color: #333;
  68. padding: 10px;
  69. }
  70. /* 隐藏scroll-view的滚动条 */
  71. ::-webkit-scrollbar {
  72. display: none;
  73. width: 0 !important;
  74. height: 0 !important;
  75. -webkit-appearance: none;
  76. background: transparent;
  77. color: transparent;
  78. }
  79. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  80. display: none;
  81. width: 0 !important;
  82. height: 0 !important;
  83. -webkit-appearance: none;
  84. background: transparent;
  85. color: transparent;
  86. }
  87. </style>