Feat(民宿&节日&尖货专题页):使用模板配置渲染

This commit is contained in:
lifizer
2024-08-13 17:19:04 +08:00
parent 017f34bbf4
commit 75a821eb6c
9 changed files with 928 additions and 132 deletions
+44 -43
View File
@@ -367,8 +367,8 @@ export default {
_this.$set(_this, 'landmarkGoodsImage', data.landmarkGoodsImage)
_this.$set(_this, 'countyFamousImage', data.countyFamousImage)
_this.$set(_this, 'oldUserPopup', data.oldUserPopup)
_this.$set(_this, 'contentHomestay', data.contentHomestay)
_this.$set(_this, 'contentFestival', data.contentFestival)
_this.$set(_this, 'contentHomestay', data.contentHomestayV2)
_this.$set(_this, 'contentFestival', data.contentFestivalV2)
_this.bastLeftList = []
_this.bastRightList = []
for (let i = 0; i < data.bastList.length; i++) {
@@ -418,27 +418,53 @@ export default {
this.isOldUser = state
},
// 民宿专题
goHomeStay(stay) {
if (stay.uniappUrl) {
this.$global.commonJump(stay.uniappUrl)
goHomeStay(item) {
if (item.type === 1) {
uni.navigateTo({ url: '/pkg_product/views/homestay?id=' + item.id })
return
}
if (stay.type === 2 && stay.isLinkToProduct) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: stay.productId
}
})
return
}
if (stay.type === 1) {
uni.navigateTo({url: '/pkg_product/views/homestay?id=' + stay.id})
}
this.linkToThemePage(item)
},
// 节日专题
goFestival() {
uni.navigateTo({url: '/pkg_product/views/festival'})
if (this.contentFestival.type === 1) {
uni.navigateTo({ url: '/pkg_product/views/festival' })
return
}
this.linkToThemePage(this.contentFestival)
},
// 尖货专题
productSwiperItemClickHandle(item) {
if (item.type === 1) {
uni.navigateTo({ url: `/pkg_product/views/festival?id=${item.id}&from=index&theme=best` })
return
}
this.linkToThemePage(item)
},
linkToThemePage(item) {
/**
* type:1-专题页,2-商品,3-时令尝鲜
* 当type=2,且uniappUrl有值,以跳转界面地址为准
*/
const type = item.type
// 链接到特定页面
if (type === 2 && item.uniappUrl) {
this.$global.commonJump(item.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' })
}
},
tapOld() {
this.isOldUser = false
@@ -493,31 +519,6 @@ export default {
hotelItemClickHandle(item) {
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.id}&from=index` })
},
// 尖货专题
productSwiperItemClickHandle(item) {
// 类型: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({
scrollTop: 0,