From 75a821eb6c6c4807a286bdf16427d82d782d2f86 Mon Sep 17 00:00:00 2001
From: lifizer <913626195@qq.com>
Date: Tue, 13 Aug 2024 17:19:04 +0800
Subject: [PATCH 1/6] =?UTF-8?q?Feat(=E6=B0=91=E5=AE=BF&=E8=8A=82=E6=97=A5&?=
=?UTF-8?q?=E5=B0=96=E8=B4=A7=E4=B8=93=E9=A2=98=E9=A1=B5):=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=E6=A8=A1=E6=9D=BF=E9=85=8D=E7=BD=AE=E6=B8=B2=E6=9F=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/product.js | 8 +
pages/home/index.vue | 87 ++++----
pkg_product/components/ThemePageTemplate1.vue | 168 +++++++++++++++
pkg_product/components/ThemePageTemplate2.vue | 162 ++++++++++++++
pkg_product/components/ThemePageTemplate3.vue | 108 ++++++++++
pkg_product/components/ThemePageTemplate4.vue | 140 ++++++++++++
pkg_product/mixins/themeTemplateMixins.js | 19 ++
pkg_product/views/festival.vue | 168 +++++++++++----
pkg_product/views/homestay.vue | 200 ++++++++++++++----
9 files changed, 928 insertions(+), 132 deletions(-)
create mode 100644 pkg_product/components/ThemePageTemplate1.vue
create mode 100644 pkg_product/components/ThemePageTemplate2.vue
create mode 100644 pkg_product/components/ThemePageTemplate3.vue
create mode 100644 pkg_product/components/ThemePageTemplate4.vue
create mode 100644 pkg_product/mixins/themeTemplateMixins.js
diff --git a/api/product.js b/api/product.js
index 3214618..dd0886b 100644
--- a/api/product.js
+++ b/api/product.js
@@ -78,6 +78,10 @@ export function getHomestay(id) {
return request.get(`/contentHomestay/${id}`, {}, {login: false})
}
+export function getHomestayV2(id) {
+ return request.get(`/contentHomestay/v2/${id}`, {}, {login: false})
+}
+
/**
* 节日专题
* */
@@ -85,6 +89,10 @@ export function getFestival() {
return request.get('/contentFestival', {}, {login: false})
}
+export function getFestivalV2() {
+ return request.get('/contentFestival/v2', {}, {login: false})
+}
+
/**
* 尖货专题
* */
diff --git a/pages/home/index.vue b/pages/home/index.vue
index b084b0c..437952c 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -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,
diff --git a/pkg_product/components/ThemePageTemplate1.vue b/pkg_product/components/ThemePageTemplate1.vue
new file mode 100644
index 0000000..770eac7
--- /dev/null
+++ b/pkg_product/components/ThemePageTemplate1.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg_product/components/ThemePageTemplate2.vue b/pkg_product/components/ThemePageTemplate2.vue
new file mode 100644
index 0000000..eef970e
--- /dev/null
+++ b/pkg_product/components/ThemePageTemplate2.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg_product/components/ThemePageTemplate3.vue b/pkg_product/components/ThemePageTemplate3.vue
new file mode 100644
index 0000000..9e3182d
--- /dev/null
+++ b/pkg_product/components/ThemePageTemplate3.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg_product/components/ThemePageTemplate4.vue b/pkg_product/components/ThemePageTemplate4.vue
new file mode 100644
index 0000000..a494abe
--- /dev/null
+++ b/pkg_product/components/ThemePageTemplate4.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg_product/mixins/themeTemplateMixins.js b/pkg_product/mixins/themeTemplateMixins.js
new file mode 100644
index 0000000..c1a3d29
--- /dev/null
+++ b/pkg_product/mixins/themeTemplateMixins.js
@@ -0,0 +1,19 @@
+export const themeTemplateMixins = {
+ props: {
+ topImage: {
+ type: String,
+ default: ''
+ },
+ templateProperties: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ }
+ },
+ methods: {
+ itemClick(item) {
+ this.$emit('view', item)
+ }
+ }
+}
\ No newline at end of file
diff --git a/pkg_product/views/festival.vue b/pkg_product/views/festival.vue
index 04b21ff..e7662f0 100644
--- a/pkg_product/views/festival.vue
+++ b/pkg_product/views/festival.vue
@@ -9,36 +9,66 @@
color='#ffffff'
/>
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -48,17 +78,30 @@
* 节日专题&尖货推荐初始模板
* options.theme:best-尖货,''-节日
*/
-import { getFestival, getContentBest } from '@/api/product'
+import { getFestivalV2, getContentBest } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
+import ThemePageTemplate1 from '../components/ThemePageTemplate1.vue'
+import ThemePageTemplate2 from '../components/ThemePageTemplate2.vue'
+import ThemePageTemplate3 from '../components/ThemePageTemplate3.vue'
+import ThemePageTemplate4 from '../components/ThemePageTemplate4.vue'
export default {
name: 'FestivalPage',
+ components: {
+ ThemePageTemplate1,
+ ThemePageTemplate2,
+ ThemePageTemplate3,
+ ThemePageTemplate4
+ },
mixins: [pageListenMixins],
data() {
return {
isLoad: false,
topImage: '',
- contents: {},
- pageKeyId: ''
+ contents: [],
+ pageKeyId: '',
+ templateKey: '',
+ // 模板数据
+ templateProperties: {}
}
},
onLoad(options) {
@@ -67,13 +110,41 @@ export default {
// 尖货
if (theme === 'best') {
this.pageKeyId = `appContentBest_id_${id}`
- getContentBest(id).then(({data}) => {
+ this.getContentBestReq(id)
+ } else {
+ this.pageKeyId = 'appContentFestival'
+ this.getFestivalReq()
+ }
+ },
+ methods: {
+ getFestivalReq() {
+ /*旧接口
+ getFestival().then(({data}) => {
this.isLoad = true
- const contents = []
- if (data.templateProperties) {
- const temp = data.templateProperties
- // 第一页图片
- this.topImage = temp.page1Image
+ this.topImage = data.topImage
+ this.contents = data.contents
+ })
+ */
+ getFestivalV2().then(res => {
+ const { data } = res
+ this.renderTemplateData(data)
+ })
+ },
+ getContentBestReq(id) {
+ getContentBest(id).then(res => {
+ const { data } = res
+ this.renderTemplateData(data)
+ })
+ },
+ renderTemplateData(data) {
+ const contents = []
+ if (data.templateProperties) {
+ const templateKey = data.templateKey
+ const temp = data.templateProperties
+ // 第一页图片
+ this.topImage = temp.page1Image
+ // 默认模板
+ if (templateKey === 'default_template') {
// 第二页数据
contents.push({
backgroundImage: temp.page2BackgroundImage,
@@ -85,22 +156,27 @@ export default {
products: temp.page3Links
})
}
- this.contents = contents
- })
- } else {
- this.pageKeyId = 'appContentFestival'
- getFestival().then(({data}) => {
- this.isLoad = true
- this.topImage = data.topImage
- this.contents = data.contents
- })
- }
- },
- methods: {
- goGoods(id) {
- uni.navigateTo({
- url: `/pages/shop/GoodsCon/index?id=${id}&from=festival`
- })
+ // 模板1
+ if (['template_1', 'template_2', 'template_3', 'template_4'].includes(templateKey)) {
+ this.templateProperties = temp
+ }
+ }
+ this.templateKey = data.templateKey
+ this.contents = contents
+ this.isLoad = true
+ },
+ goGoodsOrShop(item) {
+ const id = item.linkId
+ const type = item.type || 1
+ if (type === 1) {
+ uni.navigateTo({
+ url: `/pages/shop/GoodsCon/index?id=${id}&from=festival`
+ })
+ } else {
+ uni.navigateTo({
+ url: `/pagesInn/inn/innHome?id=${id}&from=festival`
+ })
+ }
}
}
}
diff --git a/pkg_product/views/homestay.vue b/pkg_product/views/homestay.vue
index 4675038..f866cd0 100644
--- a/pkg_product/views/homestay.vue
+++ b/pkg_product/views/homestay.vue
@@ -1,38 +1,3 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 8b5d8d6dc79193ad24582e74be9ca199354c6a48 Mon Sep 17 00:00:00 2001
From: lifizer <913626195@qq.com>
Date: Thu, 15 Aug 2024 17:28:23 +0800
Subject: [PATCH 5/6] =?UTF-8?q?Style(=E5=9C=B0=E6=A0=87=E5=A5=BD=E7=89=A9)?=
=?UTF-8?q?:=E7=95=8C=E9=9D=A2UI=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/home/landMark.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pages/home/landMark.vue b/pages/home/landMark.vue
index ed89385..78715cb 100644
--- a/pages/home/landMark.vue
+++ b/pages/home/landMark.vue
@@ -172,14 +172,14 @@ export default {
diff --git a/pkg_product/views/famousList_bak20240819.vue b/pkg_product/views/famousList_bak20240819.vue
new file mode 100644
index 0000000..be3da4f
--- /dev/null
+++ b/pkg_product/views/famousList_bak20240819.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.value }}
+
+
+
+ 千县名品榜单
+
+
+
+
+
+ {{ item.storeName }}
+ ¥
+ {{ item.price }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pkg_product/views/famousQianxian.vue b/pkg_product/views/famousQianxian.vue
new file mode 100644
index 0000000..f357382
--- /dev/null
+++ b/pkg_product/views/famousQianxian.vue
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+ {{ countyFamous.countyName }}
+
+ {{ countyFamous.content }}
+
+
+
+ {{ countyFamous.intro }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+