多租户商城-商户小程序端
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.

102 lines
2.2 KiB

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