Pārlūkot izejas kodu

移除首页广告

wenjie 9 mēneši atpakaļ
vecāks
revīzija
7462a8f6df
1 mainītis faili ar 31 papildinājumiem un 68 dzēšanām
  1. 31 68
      pages/index/index.vue

+ 31 - 68
pages/index/index.vue

@@ -36,10 +36,7 @@
 				<!-- 列表 -->
 				<zs-list class="store-box" mt="0" @load="loadMore" :status="status">
 					<view class="left">
-						<view class="swiper-box">
-						<!-- 	<view class="progress">
-								{{current+1+'/'+advList.length}}
-							</view> -->
+						<!-- <view class="swiper-box">
 							<swiper class="swiper" @change="swiperChange" skip-hidden-item-layout indicator-dots indicator-color="#fff" indicator-active-color="#FF4D3A" circular :autoplay="true"
 								:interval="3000" :duration="1000">
 								<swiper-item v-for="(item,index) in advList" :key="item.id"  @click="jump(item.jumpUrl)">
@@ -48,14 +45,10 @@
 								</swiper-item>
 									
 							</swiper>
-						</view>
+						</view> -->
 						
 						<view class="store-item" v-for="(item,index) in list" :key="index">
-							<template v-if="item.isAdv">
-								<!-- <image class="ad" :src="item.advertsImg" mode="widthFix"></image> -->
-								<zs-img :src="item.advertsImg" radius="full" width="344rpx" mode="widthFix" @click.native="jump(item.jumpUrl)"></zs-img>
-							</template>
-							<view v-else @click="goGoodsDetail(item)">
+							<view @click="goGoodsDetail(item)">
 								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode="widthFix"></zs-img>
 								<!-- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img> -->
 								<view class="info">
@@ -107,11 +100,8 @@
 					<view class="right">
 						
 						<view class="store-item" v-for="(item,index) in list1" :key="index">
-							<template v-if="item.isAdv">
-								<zs-img :src="item.advertsImg" radius="full" width="344rpx" mode="widthFix" @click.native="jump(item.jumpUrl)"></zs-img>
-								<!-- <image class="ad" :src="item.advertsImg" mode="widthFix"></image> -->
-							</template>
-							<view v-else  @click="goGoodsDetail(item)">
+				
+							<view  @click="goGoodsDetail(item)">
 								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode="widthFix"></zs-img>
 								<view class="info">
 									<view class="title">
@@ -445,69 +435,42 @@
 						})
 						
 						// 存储原始数据
-						this.copyList = this.copyList.concat(list)
-						this.copyList1 = this.copyList1.concat(list1)
+						this.list = this.list.concat(list)
+						this.list1 = this.list1.concat(list1)
 						
-						this.list = JSON.parse(JSON.stringify(this.copyList))
-						this.list1 = JSON.parse(JSON.stringify(this.copyList1))
+						// this.list = JSON.parse(JSON.stringify(this.copyList))
+						// this.list1 = JSON.parse(JSON.stringify(this.copyList1))
 						if(this.query.page+1 == res.content.totalPages){
 							this.status = 'noMore'
 						}else{
 							this.status = 'more'
 							this.query.page++
 						}
-						if(!this.advList1.length){
-							this.getGoodsAdv().then(()=>{
-								this.advList1.map(item=>{
-									if(item.showSort<= (this.list.length + this.list1.length)){
-										if((item.showSort-1)%2 == 0){
-											this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
-										}else{
-											this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
-										}
-									}
-								})
-							}
-						  )
-						  
-						}else{
-							this.advList1.map(item=>{
-								if(item.showSort<= (this.list.length + this.list1.length)){
-									if((item.showSort-1)%2 == 0){
-										this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
-									}else{
-										this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
-									}
-								}
-							})
-						}
-						// 获取商品里面的广告
-						// getAdv({currentPage:1,pageSize:99,advertsType:2,status:1}).then(res1=>{
-						// 	if(res.state == 'Success'){
-						// 		res1.content.records.map(item=>{
-						// 			data.splice(item.showSort-1,0,{isAdv:true,...item})
+						// if(!this.advList1.length){
+						// 	this.getGoodsAdv().then(()=>{
+						// 		this.advList1.map(item=>{
+						// 			if(item.showSort<= (this.list.length + this.list1.length)){
+						// 				if((item.showSort-1)%2 == 0){
+						// 					this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
+						// 				}else{
+						// 					this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
+						// 				}
+						// 			}
 						// 		})
-						// 		console.log(data);
-						// 		data.map((item,index)=>{
-						// 			if(index%2){
-						// 				list.push(item)
+						// 	}
+						//   )
+						  
+						// }else{
+						// 	this.advList1.map(item=>{
+						// 		if(item.showSort<= (this.list.length + this.list1.length)){
+						// 			if((item.showSort-1)%2 == 0){
+						// 				this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
 						// 			}else{
-						// 				list1.push(item)
+						// 				this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
 						// 			}
-						// 		})
-						// 		this.list = this.list.concat(list)
-						// 		this.list1 = this.list1.concat(list1)
-						// 		// let total = this.list.length+this.list1.length
-						// 		// if(total>=res.content.total){
-						// 		if(this.query.pageCurrent == res.content.pages){
-						// 			this.status = 'noMore'
-						// 		}else{
-						// 			this.status = 'more'
-						// 			this.query.pageCurrent++
 						// 		}
-						// 	}
-						// })
-						
+						// 	})
+						// }
 						
 					}
 				})
@@ -628,7 +591,7 @@
 		created() {
 			this.loading = true
 			this.getDialogAdv()
-			Promise.all([this.getMenu(),this.getAdv(),this.getCity()]).then(res=>{
+			Promise.all([this.getMenu(),this.getCity()]).then(res=>{
 				this.search()
 				this.cityList()
 			})