index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="outter">
  3. <view class="head_title" :style="{height:head_height+'px'}">
  4. <view class="title" :style="{height:title_height+'px'}">
  5. <text @click="navigateBack()" class="iconfont .icon-Left"></text>
  6. 福利嘉年华
  7. </view>
  8. </view>
  9. <view class="body" :style="{height:'calc(100% - '+head_height+'px)'}">
  10. </view>
  11. <view class="side-button">
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. head_height:0,
  20. title_height:0
  21. };
  22. },
  23. methods:{
  24. getSafeHeight(){
  25. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  26. this.head_height = menuButtonInfo.bottom + 25
  27. this.title_height = menuButtonInfo.height
  28. },
  29. navigateBack(){
  30. uni.navigateBack(1)
  31. }
  32. },
  33. onLoad() {
  34. this.getSafeHeight()
  35. }
  36. }
  37. </script>
  38. <style lang="scss">
  39. .outter{
  40. height: 100%;
  41. position: relative;
  42. .head_title{
  43. width: 100%;
  44. background: linear-gradient( 270deg, #332968 9%, #435797 44%, #382E73 92%), rgba(0,0,0,0.2);
  45. padding-bottom: 25px;
  46. display: flex;
  47. align-items: flex-end;
  48. padding-left: 28px;
  49. .title{
  50. display: flex;
  51. align-items: center;
  52. color: white;
  53. font-size: 20px;
  54. .iconfont{
  55. font-size: 26px;
  56. margin-right: 8px;
  57. }
  58. }
  59. }
  60. .body{
  61. overflow: hidden;
  62. overflow-y: auto;
  63. }
  64. .side-button{
  65. position: absolute;
  66. right: 32px;
  67. height: 32px;
  68. }
  69. }
  70. </style>