index.vue 734 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin">
  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. },
  25. onPullDownRefresh() {//下拉刷新
  26. this.$refs.cart.initData()
  27. uni.stopPullDownRefresh()
  28. },
  29. onShow(){
  30. if(this.hasLogin){
  31. this.$refs.cart.initData()
  32. }else{
  33. this.$refs.cart.initLogin()
  34. }
  35. },
  36. }
  37. </script>
  38. <style lang="scss">
  39. </style>