App.vue 2.0 KB

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