style-five.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="style-five">
  3. <view class="head" v-if="list.length !== 0">
  4. <app-head-navigation @click="active" :list="list" :theme="theme"></app-head-navigation>
  5. </view>
  6. <view class="nav" v-if="list[activeIndex].child.length > 0">
  7. <text class="name" @click="setNav(it, k)"
  8. :class="k === activeIndexTwo ? 'active ' + theme + '-m-text ' + theme : 'default'"
  9. v-for="(it, k) in list[activeIndex].child" :key="k">
  10. {{it.name}}
  11. </text>
  12. </view>
  13. <view :class="list[activeIndex].child.length === 0 ? 'margin-fixed' : ''">
  14. <app-product-list :theme-object="themeObject" :isShowAttr="false" :theme="theme" v-if="goods_list.length > 0" @routeGo="route_go" :goods_list="goods_list"></app-product-list>
  15. <view class="no-empty main-center" v-else-if="goods_list.length === 0 && is_over_goods">
  16. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import appHeadNavigation from '../../components/page-component/app-head-navigation/app-head-navigation.vue';
  23. import appProductList from '../../components/page-component/app-product-list/app-product-list.vue';
  24. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  25. export default {
  26. name: "style-five",
  27. components: {
  28. 'app-head-navigation': appHeadNavigation,
  29. 'app-product-list': appProductList,
  30. 'app-no-goods': appNoGoods
  31. },
  32. props: [`list`, `activeIndex`, `goods_list`, `activeIndexTwo`, `theme`, `is_over_goods`],
  33. methods: {
  34. active(data) {
  35. this.$emit('active',data);
  36. },
  37. setNav(it, key) {
  38. this.$emit('setNav',it, key);
  39. },
  40. route_go(e) {
  41. // #ifndef MP-BAIDU
  42. if (e.video_url && this.getVideo == 1) {
  43. uni.navigateTo({
  44. url: `/pages/goods/video?goods_id=${e.id}&sign=${e.sign}`
  45. });
  46. } else {
  47. uni.navigateTo({
  48. url: e.page_url
  49. });
  50. }
  51. // #endif
  52. // #ifdef MP-BAIDU
  53. uni.navigateTo({
  54. url: e.page_url
  55. });
  56. // #endif
  57. }
  58. },
  59. computed: {
  60. themeObject:function() {
  61. return {
  62. back: this.theme + '-m-back ' + this.theme,
  63. theme: this.theme,
  64. color: this.theme + '-m-text ' + this.theme,
  65. sBack: this.theme + '-s-back ' + this.theme
  66. }
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .margin-fixed {
  73. margin-top: #{188upx};
  74. }
  75. .nav {
  76. width: 100%;
  77. padding-top: #{24rpx};
  78. padding-left: #{24rpx};
  79. background-color: #ffffff;
  80. margin-top: #{188upx};
  81. }
  82. .head {
  83. position: fixed;
  84. top: #{88upx};
  85. left: 0;
  86. z-index: 1000;
  87. }
  88. .name {
  89. border: #{1rpx} solid #cccccc;
  90. font-size: #{28rpx};
  91. padding: 0 #{28rpx};
  92. display: inline-block;
  93. height: #{54rpx};
  94. line-height: #{54rpx};
  95. margin-right: #{24rpx};
  96. border-radius: #{28rpx};
  97. margin-bottom: #{20rpx};
  98. }
  99. .default {
  100. color: #666666;
  101. }
  102. .active {
  103. border: #{1rpx} solid ;
  104. }
  105. </style>