zhaojs
2023-06-30 ba3d748f9eb65a66fca9bd74fc7796b90a0a70ae
uniapp/pages/active/jdSearch.vue
@@ -65,23 +65,28 @@
         <view class="goodsList-container colCen borderBox">
            <view class="goods-content rowStaBet">
               <view class="goods-items borderBox colCen" v-for="(items,index) in goodsList" :key='index' @click="goDetail(items)">
                  <colGoods :items="items"></colGoods>
                   <colGoodsImg v-if="index==0&&popBannerSList&&popBannerSList.length>0" :popBannerSList="popBannerSList"></colGoodsImg>
                  <colGoods v-else :items="items"></colGoods>
               </view>
               <aLoadMore :status="loadstatus" mode="loading3" :showTitle='true' color="#999999"></aLoadMore>
            </view>
         </view>
      </view>
   </view>
</template>
<script>
   import colGoods from '../../components/colGoods.vue'
   import colGoodsImg from '../../components/colGoodsImg.vue'
   export default {
      components:{
         colGoods
         colGoods,
         colGoodsImg
      },
      data() {
         return {
            popBannerSList:[],
            pageTop: 0,
            nowCurrent: 0,
            scrollTop: 0,
@@ -96,7 +101,8 @@
         }
      },
      onLoad() {
         this.getNav()
         this.getNav();
         this.getPageImg();
      },
      onPageScroll(e) {
         this.scrollTop = e.scrollTop
@@ -117,6 +123,24 @@
         }).exec();
      },
      methods: {
         getPageImg()
         {
             var that=this;
            this.$u.api.getBanner({
               type: '11,17'
            }).then(e => {
               console.log(e);
               if (e.code == 1) return that.$alert(e.msg);
               var res = e.data.info;
               this.popBannerSList=res.jdImg;
               if(res.jdImg&&res.jdImg.length>0)
               {
                  that.goodsList.unshift(res[0]);
               }
            }).catch(function(err) {
               console.log(err)
            })
         },
         getNav() {
            var that = this;
            this.$u.api.getTopCalss({ctype:3}).then(e => {
@@ -163,9 +187,12 @@
         },
         goDetail(info) {
            uni.navigateTo({
               url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info))
            })
            if(info&&info!=undefined)
            {
               uni.navigateTo({
                  url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info))
               })
            }
         },
         goback() {
@@ -364,7 +391,7 @@
               .goods-items {
                  width: 336rpx;
                  height: 526rpx;
                  height: 546rpx;
                  margin-bottom: 20rpx;
                  .items-container {