聚星移动端

App.vue 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <script>
  2. export default {
  3. onLaunch: function () {
  4. var _this = this;
  5. if (!uni.getStorageSync('isLogin')) {
  6. uni.redirectTo({
  7. url: '/pages/login/login'
  8. })
  9. } else {
  10. this.$isResolve()
  11. }
  12. //获取系统信息
  13. uni.getSystemInfo({
  14. success: function (res) {
  15. var data = res;
  16. let modelmes = res.model; //手机品牌
  17. if (modelmes.indexOf('iPhone X') != -1 || modelmes.indexOf('iPhone XS') != -1 || modelmes.indexOf('iPhone XR') != -1 || modelmes.indexOf('iPhone XS Max') != -1 || modelmes.indexOf('iPhone 11') != -1 || modelmes.indexOf('iPhone 11 Pro') != -1 || modelmes.indexOf('iPhone 11 Pro Max') != -1) {
  18. data.isIpx = true
  19. }
  20. data.safeAreaTop = data.statusBarHeight + 40;//statusBarHeight为状态栏的高度,safeAreaTop为内容区距离顶部位置
  21. _this.$store.commit('setSystemInfo', data)
  22. }
  23. });
  24. },
  25. onShow: function () {
  26. console.log('App Show')
  27. },
  28. onHide: function () {
  29. console.log('App Hide')
  30. },
  31. }
  32. </script>
  33. <style lang="scss">
  34. page {
  35. background: #fff;
  36. height: 100%;
  37. color: #0F161E;
  38. }
  39. /*每个页面公共css */
  40. /* 解决小程序和app滚动条的问题 */
  41. /* #ifdef MP-WEIXIN || APP-PLUS */
  42. ::-webkit-scrollbar {
  43. display: none;
  44. width: 0 !important;
  45. height: 0 !important;
  46. -webkit-appearance: none;
  47. background: transparent;
  48. color: transparent;
  49. }
  50. /* #endif */
  51. /* 解决H5 的问题 */
  52. /* #ifdef H5 */
  53. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  54. /* 隐藏滚动条,但依旧具备可以滚动的功能 */
  55. display: none;
  56. width: 0 !important;
  57. height: 0 !important;
  58. -webkit-appearance: none;
  59. background: transparent;
  60. color: transparent;
  61. }
  62. /* #endif */
  63. </style>