From 39ae37b4847caf991e4dbe7dad682b3e7e479787 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Fri, 2 Aug 2024 23:21:02 +0800 Subject: [PATCH] =?UTF-8?q?Feat(=E9=A6=96=E9=A1=B5):=E5=B0=96=E8=B4=A7?= =?UTF-8?q?=E4=B8=93=E9=A2=98=E5=AF=B9=E6=8E=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/product.js | 7 +++++ pages/home/index.vue | 49 +++++++++++++++++++----------- pkg_product/views/festival.vue | 55 ++++++++++++++++++++++++++-------- 3 files changed, 82 insertions(+), 29 deletions(-) diff --git a/api/product.js b/api/product.js index 9df683e..3214618 100644 --- a/api/product.js +++ b/api/product.js @@ -85,6 +85,13 @@ export function getFestival() { return request.get('/contentFestival', {}, {login: false}) } +/** + * 尖货专题 + * */ +export function getContentBest(id) { + return request.get(`/contentBest/${id}`, {}, {login: false}) +} + /* * 非遗文化 * */ diff --git a/pages/home/index.vue b/pages/home/index.vue index dac5519..25506bd 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -187,7 +187,7 @@ :key="swiperIndex" > 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({ diff --git a/pkg_product/views/festival.vue b/pkg_product/views/festival.vue index adbf848..04b21ff 100644 --- a/pkg_product/views/festival.vue +++ b/pkg_product/views/festival.vue @@ -16,7 +16,7 @@ mode="widthFix" /> @@ -35,7 +35,7 @@ :class="cIndex === 0 ? 'span12' : 'span8'" :src="item.image" mode="scaleToFill" - @click="goGoods(item.id)" + @click="goGoods(item.id || item.linkId)" /> @@ -44,8 +44,11 @@