style-eight.vue 3.5 KB

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