Feat(非遗文化):增加商品+视频展示

This commit is contained in:
lifizer
2024-06-26 14:41:30 +08:00
parent f9b8ca6bf2
commit 2b15e320f4
3 changed files with 22 additions and 6 deletions
+6
View File
@@ -546,6 +546,12 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "views/heritageGoodAndVideo",
"style": {
"navigationBarTitleText": ""
}
},
{ {
"path": "views/homestay", "path": "views/homestay",
"style": { "style": {
+6 -1
View File
@@ -41,14 +41,19 @@ export default {
}, },
goDetails(item) { goDetails(item) {
if (!item.isLink) return if (!item.isLink) return
// 1-视频,2-图文(可配置商品),3-商品+视频
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/heritageVideo?id=' + item.id url: '/pkg_product/views/heritageVideo?id=' + item.id
}) })
} else { } else if (item.type === 2) {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/heritageGoods?id=' + item.id url: '/pkg_product/views/heritageGoods?id=' + item.id
}) })
} else if (item.type === 3) {
uni.navigateTo({
url: '/pkg_product/views/heritageGoodAndVideo?id=' + item.id
})
} }
} }
} }
+10 -5
View File
@@ -8,6 +8,7 @@ export default {
data() { data() {
return { return {
id: null, id: null,
type: 2,
info: null, info: null,
pageKeyId: '' pageKeyId: ''
} }
@@ -16,11 +17,11 @@ export default {
const id = options.id const id = options.id
this.id = id this.id = id
this.pageKeyId = `ichContent_id_${id}` this.pageKeyId = `ichContent_id_${id}`
this.getDetails(); this.getDetails()
}, },
methods: { methods: {
getDetails() { getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data); getICHDetails(this.id).then(({data}) => this.info = data)
}, },
goGoods(id) { goGoods(id) {
uni.navigateTo({ uni.navigateTo({
@@ -33,10 +34,14 @@ export default {
<template> <template>
<view class="heritage-goods" v-if="info"> <view class="heritage-goods" v-if="info">
<image class="page-bg" :src="info.backgroundImage" mode="widthFix"/> <image class="page-bg" :src="info.backgroundImage" mode="widthFix" />
<view class="list-box flex flex-wrap"> <view class="list-box flex flex-wrap">
<view class="item flex flex-col jc-between" v-for="(item,index) in info.products" :key="index" <view
@click="goGoods(item.productId)"> v-for="(item,index) in info.products"
:key="index"
class="item flex flex-col jc-between"
@click="goGoods(item.productId)"
>
<view class="flex flex-col ai-center"> <view class="flex flex-col ai-center">
<image :src="item.image" mode="scaleToFill"/> <image :src="item.image" mode="scaleToFill"/>
<view class="more-t">{{ item.storeName }}</view> <view class="more-t">{{ item.storeName }}</view>