goods_cate.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view :style="colorStyle">
  3. <goodsCate1 v-show="category==1" ref="classOne"></goodsCate1>
  4. </view>
  5. </template>
  6. <script>
  7. import colors from "@/mixins/color";
  8. import goodsCate1 from './goods_cate1';
  9. import {
  10. mapGetters
  11. } from 'vuex';
  12. export default {
  13. computed: mapGetters(['isLogin', 'uid']),
  14. components: {
  15. goodsCate1
  16. },
  17. mixins: [colors],
  18. data() {
  19. return {
  20. category: '',
  21. is_diy: uni.getStorageSync('is_diy'),
  22. status: 0,
  23. }
  24. },
  25. onLoad() {
  26. this.classStyle();
  27. },
  28. onReady() {
  29. },
  30. onShow() {
  31. if (this.status == 2 || this.status == 3) {
  32. uni.hideTabBar();
  33. } else if (this.status == 1) {
  34. if (!this.is_diy) {
  35. uni.hideTabBar();
  36. } else {
  37. this.$refs.classOne.getNav();
  38. }
  39. }
  40. },
  41. methods: {
  42. jumpIndex() {
  43. if (this.is_diy) {
  44. if (!uni.getStorageSync('FOOTER_BAR')) {
  45. uni.showTabBar()
  46. }
  47. }
  48. },
  49. classStyle() {
  50. let res = {
  51. data:{
  52. status: 1
  53. }
  54. }
  55. // colorChange('category').then(res => {
  56. let status = res.data.status;
  57. this.status = res.data.status
  58. this.category = status
  59. if (status == 2) {
  60. if (this.isLogin) {
  61. this.$refs.classTwo.getCartNum();
  62. this.$refs.classTwo.getCartList(1);
  63. }
  64. this.$refs.classTwo.getAllCategory()
  65. }
  66. if (status == 3) {
  67. if (this.isLogin) {
  68. this.$refs.classThree.getCartNum();
  69. this.$refs.classThree.getCartList(1);
  70. }
  71. this.$refs.classThree.getAllCategory()
  72. }
  73. if (status == 2 || status == 3) {
  74. uni.hideTabBar()
  75. } else {
  76. if (!this.is_diy) {
  77. uni.hideTabBar()
  78. } else {
  79. this.$refs.classOne.getNav();
  80. }
  81. }
  82. // })
  83. }
  84. },
  85. onReachBottom: function() {
  86. if (this.category == 2) {
  87. this.$refs.classTwo.productslist();
  88. }
  89. if (this.category == 3) {
  90. this.$refs.classThree.productslist();
  91. }
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. /deep/.mask {
  97. z-index: 99;
  98. }
  99. </style>