index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!-- 自定义头部背景组件 -->
  2. <template>
  3. <view class="custom-top-header">
  4. <view class="top-header-bg" :style="{backgroundImage: topHeaderBgImg}">
  5. <view class="head-section p-l-30 p-r-30" :style="{marginTop: (CustomBar + 23) + 'px'}">
  6. <u-grid :border="false" col="4">
  7. <u-grid-item v-for="(item,index) in iconlist" :key="index">
  8. <!-- <u-icon :customStyle="{paddingTop:20+'rpx'}" :name="item.name" :size="22"></u-icon> -->
  9. <u--image :showLoading="true" :src="item.icon" :width="80 + 'rpx'" :height="80 + 'rpx'"></u--image>
  10. <text class="grid-text text-white m-t-20">{{item.title}}</text>
  11. </u-grid-item>
  12. </u-grid>
  13. </view>
  14. <view class="top-header-gap">
  15. </view>
  16. </view>
  17. <view style="width: 100%;height: 230upx;"></view>
  18. </view>
  19. </template>
  20. <script>
  21. const app = getApp();
  22. import api from 'utils/api'
  23. import util from '@/utils/util'
  24. import __config from '@/config/env';
  25. export default {
  26. props: {
  27. title: {
  28. type: String,
  29. default: ''
  30. },
  31. subTitle: {
  32. type: String,
  33. default: ''
  34. },
  35. },
  36. data() {
  37. return {
  38. CustomBar: this.CustomBar,
  39. topHeaderBgImg: util.spliceBgImgUrl('/header-common-bg.png'),
  40. iconlist: [{
  41. icon: util.spliceAssetsUrl('/home-icons/icon-scan.png'),
  42. title: '扫一扫',
  43. url: ''
  44. },
  45. {
  46. icon: util.spliceAssetsUrl('/home-icons/icon-report.png'),
  47. title: '信息上报',
  48. url: ''
  49. },
  50. {
  51. icon: util.spliceAssetsUrl('/home-icons/icon-notice.png'),
  52. title: '消息通知',
  53. url: ''
  54. },
  55. {
  56. icon: util.spliceAssetsUrl('/home-icons/icon-help.png'),
  57. title: '使用帮助',
  58. url: ''
  59. },
  60. ],
  61. }
  62. },
  63. methods: {
  64. }
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .custom-top-header {
  69. .top-header-bg {
  70. background-repeat: no-repeat;
  71. background-size: 100%;
  72. width: 100%;
  73. top: 0;
  74. min-height: 400upx;
  75. z-index: -2;
  76. position: fixed;
  77. }
  78. .top-header-gap {
  79. height: 20upx;
  80. background-color: #f1f1f1;
  81. width: 100%;
  82. border-top-left-radius: 30px;
  83. border-top-right-radius: 30px;
  84. position: absolute;
  85. bottom: 0;
  86. }
  87. }
  88. </style>