index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="index-content" :style="{'--status-bar-': statusBarHeight}">
  3. <view class="index-content-info">
  4. <!-- 头部主要内容 开始 -->
  5. <view class="index-content-header">
  6. <customNavbar
  7. title="首页"
  8. bgColor="rgba(0,0,0,0)"
  9. :is-left="false"
  10. :customNavbarInfo='{}'></customNavbar>
  11. <u-search :showAction="true" bgColor="#fff" actionText="搜索"></u-search>
  12. </view>
  13. <!-- 头部主要内容 结束 -->
  14. <!-- 列表主要内容 开始 -->
  15. <view class="index-content-list">
  16. </view>
  17. <!-- 列表主要内容 结束 -->
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. title: '这是首页',
  26. statusBarHeight: 0, // 状态栏安全距离
  27. }
  28. },
  29. onLoad() {
  30. },
  31. onShow() {
  32. this.statusBarHeight = getApp().globalData.statusBarHeight
  33. },
  34. methods: {
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .index-content {
  40. display: flex;
  41. flex-direction: column;
  42. align-items: center;
  43. justify-content: center;
  44. box-sizing: border-box;
  45. --header-h: 170rpx;
  46. // background-color:
  47. .index-content-info {
  48. width: 100%;
  49. box-sizing: border-box;
  50. }
  51. }
  52. /** 头部主要内容 开始 */
  53. .index-content-header {
  54. width: 100%;
  55. height: var(--header-h);
  56. box-sizing: border-box;
  57. background-color: var(--gd-bgm-color);
  58. ::v-deep .u-search {
  59. padding: 0 30rpx !important;
  60. }
  61. ::v-deep .u-search__action {
  62. color: #fff !important;
  63. }
  64. }
  65. /** 头部主要内容 结束 **/
  66. /** 列表主要内容 开始 */
  67. .index-content-list {
  68. width: 100%;
  69. height: calc( 100% - var(--header-h) - var(--status-bar-h) );
  70. }
  71. /** 列表主要内容 结束 **/
  72. </style>