| | |
| | | <view class="cart-num" v-if="cardObj && cardObj.cartTypeNum > 0">{{cardObj.cartTypeNum}}</view> |
| | | </view> |
| | | </view> |
| | | <Login ref="login" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | import Login from '@/components/login/login.vue' |
| | | export default { |
| | | components: {Login}, |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight']) |
| | | ...mapState(['navHeight', 'statusbarHeight', 'userInfo']) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | onLoad(options) { |
| | | this.qualityId = options.qualityId |
| | | this.getGoodsList() |
| | | this.cardNum() |
| | | if (this.userInfo) { |
| | | this.cardNum() |
| | | } |
| | | }, |
| | | onReachBottom() { |
| | | this.getGoodsList() |
| | |
| | | }) |
| | | }, |
| | | addCard(e) { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return; |
| | | } |
| | | this.$u.api.addCart({ |
| | | goodsId: e.id, |
| | | goodsSkuId: e.skuResponsesList[0].id, |
| | |
| | | }) |
| | | }, |
| | | jumpCard() { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return; |
| | | } |
| | | uni.navigateTo({ |
| | | url: '/pages/shopping-cart/shopping-cart' |
| | | }) |