cardTabs.vue 2.2 KB
<template>
<div class="tab_cart_box">
<van-tabs @change="change" type="card" v-model="active" animated swipeable>
    <van-tab v-for="(item, index) in tags.list" :key="'t'+index" :title="item.key">
        <!-- 实物商品裂变 -->
        <div :key="'c' + index" class="gift_main_box">
          <!-- 商品样式 7 列表 goodType=1为积分商城实物商品-->
          <div infinite-scroll-immediate-check="true" v-infinite-scroll="loadMore" :infinite-scroll-disabled="phyicalGoods[active].loading" :infinite-scroll-distance="phyicalGoods[active].distance">
            <column-list-box class="column-list-box" @jump="toDetail" 
                :lists="phyicalGoods[active]"
                com="7" goodType="1" company="1">
            </column-list-box>
          </div>
          <!-- 没有更多了 -->
          <div v-show="phyicalGoods[active].list && phyicalGoods[active].list.length == 0 && phyicalGoods[active].isCall" class="no_gift_tip">
            <img src="static/img/no_gift_tip.png" alt=""/>
            <div class="text">暂无商品</div>
          </div>
          <div v-show="phyicalGoods[active].list && phyicalGoods[active].list.length>0 && phyicalGoods[active].isMore" class="is_more">
              没有更多了
          </div>
        </div>
    </van-tab>
</van-tabs>
</div>
</template>

<script>
import columnListBox from "@/components/columnListBox/columnListBox";
export default {
data () {
 return {
   active: 0,
 }
},
//部件
 components: {
   columnListBox
 },
//静态
 props: ["tags","phyicalGoods"],
//对象内部的属性监听,也叫深度监听
 watch: {
 },
//属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用;
 computed: { 
 },
//方法表示一个具体的操作,主要书写业务逻辑;
 methods: {
   change(index,key){
      this.$set(this.tags, "value", this.tags.list[index].value);
     	this.$emit("tabChange",index);
   },
   // 商品详情页
   toDetail(item){
     	this.$emit("toDetail",item);
   },
   // 下拉加载
   loadMore(){
     	this.$emit("loadMore");
   }
 },
//请求数据
 created() {
},
 mounted() {
}
}
</script>

<style rel="stylesheet/less" lang="less">
@import './cardTabs';
</style>