This commit is contained in:
魏啾
2024-04-30 18:27:43 +08:00
parent 25acfbeb91
commit 3b85017f91
24 changed files with 2846 additions and 108 deletions

View File

@@ -43,10 +43,8 @@
<!-- 轮播图 -->
<swipers :carousel='hometoplist.carousel'></swipers>
<!-- 广告 -->
<advertisement :bannervo='hometoplist.bannerVO'></advertisement>
<view class="" style="width: 200rpx;">
<!-- <customSwiper :swiper-list="hometoplist.bannerVO.counponsInfo" :timersetnteritem='timersetInterval' /> -->
</view>
<advertisement :bannervo='hometoplist.bannerVO' :itemStyle='itemStyle'
:timersetnteritem='timersetInterval' @changeValue="changeParentValue"></advertisement>
<!-- 金刚区 -->
<diamond :district='hometoplist.district'></diamond>
<!-- 今日上线 -->
@@ -244,6 +242,8 @@
district: [],
},
itemStyle: [ //样式
],
homelist: [], //下面数据
clickhometoplistmenulist: {}, //下拉点击的数据
form: {
@@ -291,16 +291,14 @@
setTimeout(() => {
this.GetTop()
}, 1000)
},
onReachBottom() {
this.onLoadhome()
},
onShow() {
this.hometop()
this.init_fn()
this.timersetInterval = '0'
},
methods: {
closeproductlist() {
@@ -332,11 +330,40 @@
}
})
},
changeParentValue(newValue) {
console.log(newValue)
this.itemStyle = newValue
},
getStyle(e) {
if (e > this.hometoplist.bannerVO.counponsInfo.length / 2) {
var right = this.hometoplist.bannerVO.counponsInfo.length - e
return {
transform: 'scale(' + (1) + ') translate(-' + (right * 20) + '%,0px)',
zIndex: 9999 - right,
opacity: 1
}
} else {
return {
transform: 'scale(' + (1) + ') translate(' + (e * 20) + '%,0px)',
zIndex: 9999 - e,
opacity: 1
}
}
},
// 首页上面数据
async hometop() {
try {
let res = await this.api.homehomePageUp()
this.hometoplist = res.data
if (this.hometoplist.bannerVO.counponsInfo) {
this.itemStyle = []
this.hometoplist.bannerVO.counponsInfo.forEach((item,
index) => {
this.itemStyle.push(this.getStyle(index))
})
}
// 计算swiper样式
} catch (e) {}
},
// 下面初始数据