index.vue 781 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="container cart clearfix">
  3. <cart ref="cart" :pathType='pathType'></cart>
  4. </view>
  5. </template>
  6. <script>
  7. import { mapState,mapMutations } from 'vuex';
  8. import cart from '@/components/cm-module/cart-components/index.vue'
  9. export default{
  10. components:{
  11. cart
  12. },
  13. data(){
  14. return{
  15. pathType:0
  16. }
  17. },
  18. onLoad(){
  19. },
  20. computed: {
  21. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  22. },
  23. methods:{
  24. ...mapMutations(['updateNoticeNum'])
  25. },
  26. onPullDownRefresh() {//下拉刷新
  27. this.$refs.cart.initData()
  28. uni.stopPullDownRefresh()
  29. },
  30. onShow(){
  31. if(this.hasLogin){
  32. this.updateNoticeNum()
  33. this.$refs.cart.initData()
  34. }else{
  35. this.$refs.cart.initLogin()
  36. }
  37. },
  38. }
  39. </script>
  40. <style lang="scss">
  41. </style>