style-eight.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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" @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, mapState} 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. ...mapState({
  41. platform: function(state) {
  42. return state.gConfig.systemInfo.platform;
  43. }
  44. })
  45. },
  46. methods: {
  47. route_go(e) {
  48. // #ifndef MP-BAIDU
  49. if (e.video_url && this.getVideo == 1) {
  50. // #ifdef MP
  51. uni.navigateTo({
  52. url: `/pages/goods/video?goods_id=${e.id}&sign=${e.sign}`
  53. });
  54. // #endif
  55. // #ifdef H5
  56. uni.navigateTo({
  57. url: e.page_url
  58. });
  59. // #endif
  60. } else {
  61. uni.navigateTo({
  62. url: e.page_url
  63. });
  64. }
  65. // #endif
  66. // #ifdef MP-BAIDU
  67. uni.navigateTo({
  68. url: e.page_url
  69. });
  70. // #endif
  71. },
  72. active(t) {
  73. this.$emit('active', t);
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .style-eight {
  80. width: #{750upx};
  81. }
  82. .head {
  83. position: fixed;
  84. top: 88upx;
  85. left: 0;
  86. z-index: 1000;
  87. }
  88. .product {
  89. margin-top: #{188upx};
  90. }
  91. .no-empty {
  92. width: 100%;
  93. margin-top: #{250upx};
  94. background-color: #f7f7f7;
  95. }
  96. .u-loading-list {
  97. height: 64upx;
  98. line-height: 64upx;
  99. text-align: center;
  100. color: #b0b0b0;
  101. font-size: 24upx;
  102. }
  103. </style>