style-eight.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="style-eight">
  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="list.length === 0 && goods_list.length !== 0 ? '' : 'product'" v-if="goods_list.length !== 0">
  7. <app-product-list @routeGo="route_go" :goods_list="goods_list" theme="default"></app-product-list>
  8. </view>
  9. <template v-if="goods_list.length === 0 && list.length !== 0">
  10. <view class="no-empty main-center">
  11. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  12. </view>
  13. </template>
  14. <template v-if="list.length === 0 && goods_list.length === 0">
  15. <view class="no-empty main-center">
  16. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  17. </view>
  18. </template>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapGetters } from 'vuex';
  23. import appHeadNavigation from '../../components/page-component/app-head-navigation/app-head-navigation.vue';
  24. import appProductList from '../../components/page-component/app-product-list/app-product-list.vue';
  25. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  26. export default {
  27. name: "style-eight",
  28. components: {
  29. 'app-head-navigation': appHeadNavigation,
  30. 'app-product-list': appProductList,
  31. 'app-no-goods': appNoGoods
  32. },
  33. props: [`goods_list`, `list`],
  34. computed: {
  35. ...mapGetters('mallConfig', {
  36. getVideo: 'getVideo'
  37. }),
  38. },
  39. methods: {
  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. active(data) {
  59. this.$emit('active', data);
  60. }
  61. }
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .style-eight {
  66. width: #{750upx};
  67. }
  68. .head {
  69. position: fixed;
  70. top: #{88upx};
  71. left: 0;
  72. z-index: 1000;
  73. }
  74. .product {
  75. margin-top: #{188upx};
  76. }
  77. .no-empty {
  78. width: 100%;
  79. margin-top: #{250upx};
  80. background-color: #f7f7f7;
  81. }
  82. </style>