zhaojs
2023-07-13 70f5b82bc3fceafac2faf470280876b0eca6fac8
uniapp/components/indexPage.vue
@@ -392,6 +392,7 @@
                  v-if="bottomGoodsList.length>0">
                  <block v-for="(items,index) in bottomGoodsList" :key="index">
                     <view class="goods-items" @click="goDetails(items)">
                         <!-- <colGoodsImg v-if="index==0&&itembannerList&&itembannerList.length>0" :popBannerSList="itembannerList"></colGoodsImg> -->
                        <colGoods :items="items"></colGoods>
                     </view>
                  </block>
@@ -411,6 +412,7 @@
   import slideTop from './slideTop.vue'
   import colGoods from './colGoods.vue'
   import empowerModel from './empowerModel.vue'
      import colGoodsImg from '@/components/colGoodsImg.vue'
   export default {
      props: {
         recomendType: {
@@ -432,10 +434,12 @@
      components: {
         slideTop,
         colGoods,
         empowerModel
         empowerModel,
         colGoodsImg
      },
      data() {
         return {
            popBannerSList:[],
            fallingList: [],
            pageHeight: '',
            headerColor: '',
@@ -491,9 +495,14 @@
            swpidx: 0,
            canrefresh: true,
            fastenter:[],
            popBannerSList:[],
            itembannerList:[],
            enterTop:[],
            enterDown:[]
            enterDown:[],
            tbbanner:[],
            jdbanner:[],
            dybanner:[],
            pddbanner:[],
            wphbanner:[],
         }
      },
      watch: {
@@ -529,6 +538,7 @@
         this.getbottomGoodsList(this.bottomType);
         this.getGOODSfalling();
         this.getRQList();
         //this.getPageImg();
      },
      mounted() {
         this.$emit('scrolltoTop')
@@ -595,7 +605,6 @@
         },
         onRestore() {
            this.swpidx = 0
            console.log('下拉被终止');
         },
         pagescroll(e) {
            this.$emit('scrollNum', e.detail.scrollTop)
@@ -688,7 +697,49 @@
               that.dyList = e.data.dygoods;
            }).catch(function(err) {})
         },
         getPageImg()
         {
             var that=this;
            this.$u.api.getBanner({
               type: '11,16,17,18,19,20'
            }).then(e => {
               if (e.code == 1) return that.$alert(e.msg);
               var res = e.data.info;
               that.tbbanner=res.tmImg;
               that.jdbanner=res.jdImg;
               that.dybanner=res.dyImg;
               that.pddbanner=res.pddImg;
               that.wphbanner=res.wphImg;
               that.changeBanner(that.bottomCurrent);
            }).catch(function(err) {
               console.log(err)
            })
         },
         changeBanner(type)
         {
            switch(type)
            {
               case 2://京东
                 this.itembannerList=this.jdbanner;
                 break;
               case 6://抖音
                 this.itembannerList=this.dybanner;
                 break;
               case 3://拼多多
                  this.itembannerList=this.pddbanner;
                  break;
               case 4://唯品会
                  this.itembannerList=this.wphbanner;
                  break;
               default:
               this.itembannerList=[];
                  break;
            }
            if(this.itembannerList&&this.itembannerList>0)
            {
               that.bottomGoodsList.unshift(this.itembannerList[0]);
            }
         },
         getbottomGoodsList(type) {
            var that = this;
            this.$u.api.getGoodThing({
@@ -744,6 +795,7 @@
            if (this.bottomCurrent != idx) {
               this.currentPage = 1;
               this.bottomType = info.type;
               this.changeBanner(info.type);
               this.getbottomGoodsList(this.bottomType);
               this.$nextTick(() => {
                  this.$emit('scrolltoview')