doum
3 天以前 988b4e04541d15c7586efb72f565960b4de4c492
mini-program/pages/special-zone/special-zone.vue
@@ -48,6 +48,7 @@
            <view class="cart-num" v-if="cardObj && cardObj.cartTypeNum > 0">{{cardObj.cartTypeNum}}</view>
         </view>
      </view>
      <Login ref="login" />
   </view>
</template>
@@ -55,9 +56,11 @@
   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 {
@@ -72,7 +75,9 @@
      onLoad(options) {
         this.qualityId = options.qualityId
         this.getGoodsList()
         this.cardNum()
         if (this.userInfo) {
            this.cardNum()
         }
      },
      onReachBottom() {
         this.getGoodsList()
@@ -84,6 +89,10 @@
            })
         },
         addCard(e) {
            if (!this.userInfo) {
               this.$refs.login.open()
               return;
            }
            this.$u.api.addCart({
               goodsId: e.id,
               goodsSkuId: e.skuResponsesList[0].id,
@@ -96,6 +105,10 @@
            })
         },
         jumpCard() {
            if (!this.userInfo) {
               this.$refs.login.open()
               return;
            }
            uni.navigateTo({
               url: '/pages/shopping-cart/shopping-cart'
            })