多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.9 KiB

2 years ago
  1. <template>
  2. <view class="header">
  3. <view class="top-box">
  4. <image v-if="componentContent.logoType === 1" class="logo"
  5. :src="componentContent.imageUrl"
  6. mode="heightFix"></image>
  7. <view v-else class="h3" :style="{fontSize:componentContent.fontSizeNum+'px',fontWeight:componentContent.textFontW,color:componentContent.titColor}">{{componentContent.title}}</view>
  8. <view class="search-btn" @click="searchPro">
  9. <image class="search-icon"
  10. src="https://ceres.zkthink.com/static/img/search.png"
  11. mode="widthFix"></image>
  12. </view>
  13. </view>
  14. <view class="tabs-nav-warp">
  15. <scroll-view class="tabs-nav" scroll-x="true">
  16. <view class="ul">
  17. <view class="li" :class="{'on':activeTab===0}" @click="tabChange(0)">首页</view>
  18. <view class="li" :class="{'on':activeTab===index+1}" v-for="(item,index) in classifyData" :key="index" @click="tabChange(index+1,item.id)">
  19. {{item.categoryName}}
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {commonMixin} from '../mixin'
  28. export default {
  29. mixins: [commonMixin],
  30. data () {
  31. return {
  32. activeTab: 0
  33. }
  34. },
  35. computed: {
  36. },
  37. methods:{
  38. tabChange (index, id) {
  39. this.activeTab = index
  40. this.$emit('tabChange', index, id)
  41. },
  42. searchPro(key, type) {
  43. uni.navigateTo({
  44. url: `/pages_category_page1/search/index/index`
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .header {
  52. .top-box {
  53. display: flex;
  54. align-items: center;
  55. justify-content: space-between;
  56. padding-left: 30upx;
  57. width: 100%;
  58. .logo {
  59. // width: 280upx;
  60. height: 70upx;
  61. margin-top: 0upx;
  62. }
  63. .search-btn {
  64. height: 66upx;
  65. background: rgba(255, 255, 255, 1);
  66. border-radius: 33upx;
  67. display: flex;
  68. flex-direction: row;
  69. align-items: center;
  70. margin-right: 30upx;
  71. .search-icon {
  72. width: 60upx;
  73. height: 60upx;
  74. }
  75. }
  76. }
  77. }
  78. .tabs-nav-warp{
  79. margin-top: 20upx;
  80. padding:0 30upx;
  81. overflow: hidden;
  82. .tabs-nav{
  83. .ul{
  84. display: flex;
  85. flex-wrap: nowrap;
  86. justify-content: space-between;
  87. .li{
  88. flex: 1 0 auto;
  89. margin-left: 36upx;
  90. font-size: 30upx;
  91. color: #999999;
  92. position: relative;
  93. padding-bottom: 18upx;
  94. text-align: center;
  95. &:first-child{
  96. margin-left: 0;
  97. }
  98. &.on{
  99. &:after{
  100. content: '';
  101. width: 100%;
  102. height: 4upx;
  103. background: #C5AA7B;
  104. position: absolute;
  105. left: 0;
  106. bottom: 0;
  107. }
  108. font-weight:bold;
  109. }
  110. }
  111. }
  112. }
  113. }
  114. </style>