App.vue 2.0 KB

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