App.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script>
  2. import Vue from 'vue';
  3. export default {
  4. onLaunch: function() {
  5. this.$store.dispatch('userInfo/getinfo');
  6. this.$store.dispatch('userInfo/getAddrInfo');
  7. // this.$store.dispatch('userInfo/getopenid');
  8. uni.getSystemInfo({
  9. success: function(e) {
  10. // #ifndef MP
  11. Vue.prototype.StatusBar = e.statusBarHeight;
  12. if (e.platform == 'android') {
  13. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  14. } else {
  15. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  16. };
  17. // #endif
  18. // #ifdef MP-WEIXIN || MP-QQ
  19. Vue.prototype.StatusBar = e.statusBarHeight;
  20. Vue.prototype.pxToRpx = 750 / e.windowWidth; //e.windowHeight会有差别顶部栏
  21. let capsule = wx.getMenuButtonBoundingClientRect();
  22. if (capsule) {
  23. Vue.prototype.Custom = capsule;
  24. // Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
  25. Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
  26. } else {
  27. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  28. }
  29. // #endif
  30. // #ifdef MP-ALIPAY
  31. Vue.prototype.StatusBar = e.statusBarHeight;
  32. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  33. // #endif
  34. }
  35. })
  36. },
  37. onShow: function() {
  38. console.log('App Show')
  39. },
  40. onHide: function() {
  41. console.log('App Hide')
  42. }
  43. }
  44. </script>
  45. <style lang='scss'>
  46. @import "style/common.css";
  47. @import "style/icon.css";
  48. .input-placeholder,
  49. .placeholder {
  50. color: $placeholder-color !important;
  51. }
  52. /*每个页面公共css */
  53. </style>