style-five.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="style-five">
  3. <view class="head" v-if="list.length !== 0">
  4. <app-head-navigation @click="active" :list="list"></app-head-navigation>
  5. </view>
  6. <view class="nav" v-if="list[activeIndex].child.length > 0">
  7. <text class="name" @click="setNav(it, key)"
  8. :class="{'active': key === activeIndexTwo}"
  9. v-for="(it, key) in list[activeIndex].child" :key="key">
  10. {{it.name}}
  11. </text>
  12. </view>
  13. <view :class="list[activeIndex].child.length === 0 ? 'margin-fixed' : ''">
  14. <app-product-list v-if="goods_list.length > 0" @routeGo="route_go" theme="default" :goods_list="goods_list"></app-product-list>
  15. <view class="no-empty main-center" v-else>
  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`],
  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. }
  60. </script>
  61. <style scoped lang="scss">
  62. .margin-fixed {
  63. margin-top: #{188upx};
  64. }
  65. .nav {
  66. width: 100%;
  67. padding-top: #{24rpx};
  68. padding-left: #{24rpx};
  69. background-color: #ffffff;
  70. margin-top: #{188upx};
  71. }
  72. .head {
  73. position: fixed;
  74. top: #{88upx};
  75. left: 0;
  76. z-index: 1000;
  77. }
  78. .name {
  79. border: #{1rpx} solid #cccccc;
  80. font-size: #{28rpx};
  81. color: #666666;
  82. padding: 0 #{28rpx};
  83. display: inline-block;
  84. height: #{54rpx};
  85. line-height: #{54rpx};
  86. margin-right: #{24rpx};
  87. border-radius: #{28rpx};
  88. margin-bottom: #{20rpx};
  89. }
  90. .active {
  91. color: #ff4544;
  92. border: #{1rpx} solid #ff4544;
  93. }
  94. </style>