App.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view>
  3. <login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. onLaunch: function() {
  9. console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
  10. console.log('App Launch')
  11. uni.addInterceptor('switchTab', {
  12. invoke(e) {
  13. console.log(e,1111111)
  14. if(e.url == '/pages/my/my'){
  15. if(!uni.getStorageSync("userInfo").phone){
  16. this.$refs.loginpopup.open()
  17. return false;
  18. }else{
  19. return false;
  20. }
  21. }
  22. },
  23. success: (e) => {
  24. console.log('OK',e)
  25. }
  26. })
  27. },
  28. onShow: function() {
  29. console.log('App Show')
  30. },
  31. onHide: function() {
  32. console.log('App Hide')
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. /*每个页面公共css */
  38. @import "@/uni_modules/uview-ui/index.scss";
  39. @import '@/uni_modules/uni-scss/index.scss';
  40. @import "colorui/main.css";
  41. @import '@/static/styles/index.scss';
  42. @import '@/style/icons/iconfont.css';
  43. @import '@/style/icons/iconfont-colors.css';
  44. @import '@/style/mercharts_icon/iconfont.css';
  45. @import '@/style/mercharts_icon/iconfont_colors.css';
  46. // 设置整个项目的背景色
  47. page {
  48. background-color: #F2F6F9;
  49. }
  50. .content{
  51. // padding-bottom:0rpx;
  52. }
  53. .wrap{
  54. background:#fff;
  55. border-radius:20rpx;
  56. margin:20rpx;
  57. padding:20rpx;
  58. }
  59. .caution{
  60. color:red;
  61. }
  62. .footer,.mercharts_footer{
  63. position:fixed;
  64. bottom:0;
  65. left:0;
  66. background:#fff;
  67. width:100%;
  68. z-index:10;
  69. padding:30rpx 0;
  70. .submit{
  71. background:#f8bc31;
  72. color:#fff;
  73. width:90%;
  74. }
  75. }
  76. .mercharts_footer{
  77. .submit{
  78. background:#5F7DE9;
  79. }
  80. }
  81. .flex{
  82. display:flex;
  83. }
  84. .justify-space-between{
  85. justify-content: space-between;
  86. }
  87. .align-item-center{
  88. align-items: center;
  89. }
  90. .detailedAddress{
  91. width:600rpx;
  92. text-align:center;
  93. }
  94. .merchants_button,.merchants_unable_button,.merchants_default_button,.merchants_caution_button{
  95. background:#5F7DE9;
  96. color:#fff;
  97. padding:5rpx 20rpx;
  98. border-radius: 10rpx;
  99. }
  100. .merchants_default_button{
  101. background:#fff;
  102. color:#000;
  103. border:2rpx solid #5F7DE9;
  104. }
  105. .merchants_default_button_text,
  106. .merchants_caution_button_text,
  107. .merchants_unable_button_text{
  108. padding:5rpx 10rpx;
  109. }
  110. .merchants_default_button_text{
  111. color:#5F7DE9;
  112. }
  113. .merchants_caution_button_text{
  114. color:red;
  115. }
  116. .merchants_unable_button_text{
  117. color:#999;
  118. }
  119. .merchants_caution_button{
  120. background:red;
  121. }
  122. .merchants_unable_button{
  123. background:#999;
  124. }
  125. </style>