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": ""
}
},
{
"path": "views/heritageGoodAndVideo",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "views/homestay",
"style": {
+6 -1
View File
@@ -41,14 +41,19 @@ export default {
},
goDetails(item) {
if (!item.isLink) return
// 1-视频,2-图文(可配置商品),3-商品+视频
if (item.type === 1) {
uni.navigateTo({
url: '/pkg_product/views/heritageVideo?id=' + item.id
})
} else {
} else if (item.type === 2) {
uni.navigateTo({
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() {
return {
id: null,
type: 2,
info: null,
pageKeyId: ''
}
@@ -16,11 +17,11 @@ export default {
const id = options.id
this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails();
this.getDetails()
},
methods: {
getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data);
getICHDetails(this.id).then(({data}) => this.info = data)
},
goGoods(id) {
uni.navigateTo({
@@ -33,10 +34,14 @@ export default {
<template>
<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="item flex flex-col jc-between" v-for="(item,index) in info.products" :key="index"
@click="goGoods(item.productId)">
<view
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">
<image :src="item.image" mode="scaleToFill"/>
<view class="more-t">{{ item.storeName }}</view>