Feat(首页):尖货专题对接完成

This commit is contained in:
lifizer
2024-08-02 23:21:02 +08:00
parent 52b75d0bd3
commit 39ae37b484
3 changed files with 82 additions and 29 deletions
+32 -17
View File
@@ -187,7 +187,7 @@
:key="swiperIndex"
>
<image
:src="swiperItem.image"
:src="swiperItem.indexImage"
mode="scaleToFill"
class="swiper-img"
@click="productSwiperItemClickHandle(swiperItem)"
@@ -373,6 +373,7 @@ export default {
_this.bastRightList = []
for (let i = 0; i < data.bastList.length; i++) {
if (i % 2 === 0) {
// 店铺排名
if (i === 4 && data.hotelList.length > 0) {
_this.bastLeftList.push({
type: 'hotel',
@@ -382,23 +383,11 @@ export default {
_this.bastLeftList.push(data.bastList[i])
}
if (i % 2 === 1) {
if (i === 3) {
// 尖货专题
if (i === 3 && data.contentBest.length > 0) {
_this.bastRightList.push({
type: 'swiper',
list: [
{
image: 'http://resource.xdd618.com/19/20240722/1721615384602_入口图8.jpg',
id: 5781
},
{
image: 'http://resource.xdd618.com/19/20240715/1721006994007_微信图片_20240715092549.jpg',
id: 5781
},
{
image: 'http://resource.xdd618.com/19/20240722/1721615384602_入口图8.jpg',
id: 5781
}
]
list: data.contentBest
})
}
_this.bastRightList.push(data.bastList[i])
@@ -428,6 +417,7 @@ export default {
changeOldPopup(state) {
this.isOldUser = state
},
// 民宿专题
goHomeStay(stay) {
if (stay.uniappUrl) {
this.$global.commonJump(stay.uniappUrl)
@@ -446,6 +436,7 @@ export default {
uni.navigateTo({url: '/pkg_product/views/homestay?id=' + stay.id})
}
},
// 节日专题
goFestival() {
uni.navigateTo({url: '/pkg_product/views/festival'})
},
@@ -487,6 +478,7 @@ export default {
this.$global.levelJump(pageLevel, url, params)
}
},
// 千县名品和地标好物
landAndFamousItemClickHandle(item) {
const url = item.url
if (!url) return
@@ -497,11 +489,34 @@ export default {
uni.navigateTo({ url })
}
},
// 店铺排名
hotelItemClickHandle(item) {
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.id}&from=index` })
},
// 尖货专题
productSwiperItemClickHandle(item) {
uni.navigateTo({url: '/pkg_product/views/homestay?id=' + item.id})
// 类型:1-专题页 2-商品详情 3-时令尝鲜
const type = item.type
if (type === 1) {
uni.navigateTo({ url: `/pkg_product/views/festival?id=${item.id}&from=index&theme=best` })
}
// 链接到特定页面
if (type === 2 && item.uniappUrl) {
this.$global.commonJump(stay.uniappUrl)
return
}
// 商品详情
if (type === 2 && item.productId) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.productId
}
})
}
if (type === 3) {
uni.navigateTo({ url: '/pkg_product/views/seasonList' })
}
},
setTopHandle() {
uni.pageScrollTo({