|
@@ -1,131 +1,122 @@
|
|
|
<template>
|
|
|
- <view class="d-flex flex-col bg-base">
|
|
|
- <SimplePageContentLoader :loader="loader">
|
|
|
- <template v-if="loader.content.value">
|
|
|
- <view class="banner">
|
|
|
- <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="2000" :duration="1000">
|
|
|
- <swiper-item v-for="(item, key) in loader.content.value.images" :key="key">
|
|
|
- <view
|
|
|
- class="item"
|
|
|
- @click="onPreviewImage(key)"
|
|
|
- >
|
|
|
- <ImageWrapper
|
|
|
- :src="item"
|
|
|
- mode="aspectFill"
|
|
|
- width="750rpx"
|
|
|
- />
|
|
|
- </view>
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
- <view class="d-flex flex-col p-3 bg-light">
|
|
|
- <view class="intro-block artifact-info">
|
|
|
- <HomeTitle :title="loader.content.value.title" />
|
|
|
- <view class="desc no-indent">
|
|
|
- <view v-if="loader.content.value.address" class="navigation">
|
|
|
- <view class="address">
|
|
|
- <text class="iconfont icon-navigation"></text>
|
|
|
- <text>{{ loader.content.value.address }}</text>
|
|
|
- </view>
|
|
|
- <view class="link" @click="handleNavTo">
|
|
|
- 去这里 <text class="iconfont icon-go"></text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-if="loader.content.value.openStatusText" class="entry">
|
|
|
- <view class="label">开放时间:</view>
|
|
|
- <view class="value">{{ loader.content.value.openStatusText }}</view>
|
|
|
- </view>
|
|
|
- <view v-if="loader.content.value.age" class="entry">
|
|
|
- <view class="label">年代:</view>
|
|
|
- <view class="value">{{ loader.content.value.age }}</view>
|
|
|
- </view>
|
|
|
- <view class="entry">
|
|
|
- <view class="label">文物类型:</view>
|
|
|
- <view class="value">{{ loader.content.value.crTypeText }}</view>
|
|
|
- </view>
|
|
|
- <view class="entry">
|
|
|
- <view class="label">所属区域:</view>
|
|
|
- <view class="value">{{ loader.content.value.regionText }}</view>
|
|
|
- </view>
|
|
|
- <view class="entry">
|
|
|
- <view class="label">级别:</view>
|
|
|
- <view class="value">{{ loader.content.value.levelText }}</view>
|
|
|
- </view>
|
|
|
- <view v-if="loader.content.value.protectedArea" class="entry">
|
|
|
- <view class="label">保护范围:</view>
|
|
|
- <view class="value">
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <u-parse :content="loader.content.value.protectedArea" :tagStyle="commonParserStyle"></u-parse>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="intro-block">
|
|
|
- <view class="title">
|
|
|
- <view class="line"></view>
|
|
|
- <text class="sm">简介</text>
|
|
|
- </view>
|
|
|
- <view class="desc">
|
|
|
- <u-parse :content="loader.content.value.intro" :tagStyle="commonParserStyle"></u-parse>
|
|
|
- </view>
|
|
|
- <view class="desc">
|
|
|
- <u-parse :content="loader.content.value.value" :tagStyle="commonParserStyle"></u-parse>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <ContentNote />
|
|
|
- <!-- <HomeTitle title="更多人气好去处" />
|
|
|
- <view class="rec-list">
|
|
|
- <swiper class="swiper" :autoplay="false" :circular="false" :duration="500" :next-margin="'145rpx'">
|
|
|
- <swiper-item v-for="item in loader.content.value.associationMeList" :key="item.id" @click="goDetails(item)">
|
|
|
- <view class="item">
|
|
|
- <image :src="item.image" mode="aspectFill"></image>
|
|
|
- <view class="name">
|
|
|
- <text>{{ item.title }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
- </view> -->
|
|
|
+ <DetailTabPage
|
|
|
+ :load="load"
|
|
|
+ :extraTabs="[
|
|
|
+ {
|
|
|
+ id: 5,
|
|
|
+ name: 'VR参观',
|
|
|
+ visible: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 6,
|
|
|
+ name: '保护范围',
|
|
|
+ visible: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 7,
|
|
|
+ name: '建筑环境',
|
|
|
+ visible: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 8,
|
|
|
+ name: '价值评估',
|
|
|
+ visible: true,
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <template #extraTabs="{ content, tabCurrentId }">
|
|
|
+ <template v-if="tabCurrentId==5">
|
|
|
+ <!-- VR参观 -->
|
|
|
+ <view class="d-flex flex-row justify-center p-5">
|
|
|
+ <u-button @click="handleGoToVr(content.vr as string)">
|
|
|
+ <text class="iconfont icon-go"></text>
|
|
|
+ 点击参观
|
|
|
+ </u-button>
|
|
|
</view>
|
|
|
</template>
|
|
|
- </SimplePageContentLoader>
|
|
|
- </view>
|
|
|
+ <template v-if="tabCurrentId==6">
|
|
|
+ <!-- 保护范围 -->
|
|
|
+ <u-parse :content="content.protectedArea" :tagStyle="commonParserStyle" />
|
|
|
+ </template>
|
|
|
+ <template v-if="tabCurrentId==7">
|
|
|
+ <!-- 建筑环境 -->
|
|
|
+ <u-parse :content="content.environment" :tagStyle="commonParserStyle" />
|
|
|
+ </template>
|
|
|
+ <template v-if="tabCurrentId==8">
|
|
|
+ <!-- 价值评估 -->
|
|
|
+ <u-parse :content="content.value" :tagStyle="commonParserStyle" />
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template #titleEnd="{ content }">
|
|
|
+ <u-tag
|
|
|
+ v-if="content.levelText"
|
|
|
+ :text="content.levelText"
|
|
|
+ size="mini" plain color="#d9492e"
|
|
|
+ class="flex-shrink-0"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #titleExtra="{ content }">
|
|
|
+ <IntroBlock
|
|
|
+ small
|
|
|
+ :address="(content.address as string)"
|
|
|
+ :descItems="[
|
|
|
+ {
|
|
|
+ label: '开放时间',
|
|
|
+ value: content.openStatusText
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '年代',
|
|
|
+ value: content.age
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '级别',
|
|
|
+ value: content.levelText
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属区域',
|
|
|
+ value: content.regionText ,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '文物类型',
|
|
|
+ value: content.crTypeText,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '文物编码',
|
|
|
+ value: content.code,
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ @navTo="handleNavTo(content)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </DetailTabPage>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import type { GetContentDetailItem } from "@/api/CommonContent";
|
|
|
-import { useSimplePageContentLoader } from "@/common/composeabe/SimplePageContentLoader";
|
|
|
-import { onLoad } from "@dcloudio/uni-app";
|
|
|
+import type { TabControlItem } from "@/common/composeabe/TabControl";
|
|
|
+import type { Ref } from "vue";
|
|
|
import { navTo } from "@/common/utils/PageAction";
|
|
|
import UnmoveableContent from "@/api/inheritor/UnmoveableContent";
|
|
|
-import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
|
|
|
-import ImageWrapper from "@/common/components/ImageWrapper.vue";
|
|
|
-import HomeTitle from "@/pages/parts/HomeTitle.vue";
|
|
|
import commonParserStyle from "@/common/style/commonParserStyle";
|
|
|
-import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
|
|
|
-import { useSwiperImagePreview } from "@/common/composeabe/SwiperImagePreview";
|
|
|
-import ContentNote from "@/pages/parts/ContentNote.vue";
|
|
|
+import IntroBlock from "@/pages/article/common/IntroBlock.vue";
|
|
|
+import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
|
|
|
|
|
|
-const loader = useSimplePageContentLoader<
|
|
|
- GetContentDetailItem,
|
|
|
- { id: number }
|
|
|
->(async (params) => {
|
|
|
- if (!params)
|
|
|
- throw new Error("!params");
|
|
|
- return await UnmoveableContent.getContentDetail(params.id);
|
|
|
-});
|
|
|
-
|
|
|
-useLoadQuerys({ id : 0, }, (p) => loader.loadData(p));
|
|
|
-
|
|
|
-const { onPreviewImage } = useSwiperImagePreview(() => loader.content.value?.images || [])
|
|
|
+async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
|
|
|
+ const d = await UnmoveableContent.getContentDetail(id);
|
|
|
+ tabsArray.value[4].visible = Boolean(d.vr);
|
|
|
+ tabsArray.value[5].visible = Boolean(d.protectedArea);
|
|
|
+ tabsArray.value[6].visible = Boolean(d.environment);
|
|
|
+ tabsArray.value[7].visible = Boolean(d.value);
|
|
|
+ return d;
|
|
|
+}
|
|
|
|
|
|
-function handleNavTo() {
|
|
|
+function handleGoToVr(vr: string) {
|
|
|
+ navTo('/pages/article/web/ewebview', { url: vr })
|
|
|
+}
|
|
|
+function handleNavTo(content: any) {
|
|
|
navTo('../../travel/nav/navto', {
|
|
|
- latitude: loader.content.value?.latitude,
|
|
|
- longitude: loader.content.value?.longitude,
|
|
|
+ latitude: content?.latitude,
|
|
|
+ longitude: content?.longitude,
|
|
|
})
|
|
|
}
|
|
|
-function goDetails(item: any) {
|
|
|
- navTo('./details', { id: item.id })
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -157,74 +148,6 @@ function goDetails(item: any) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.intro-block {
|
|
|
- margin-bottom: 38rpx;
|
|
|
- .title{
|
|
|
- .sm{
|
|
|
- font-size: 30rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- &.artifact-info{
|
|
|
- .desc{
|
|
|
- line-height: inherit;
|
|
|
- padding-bottom: 10rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .entry {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- justify-content: space-between;
|
|
|
- margin-bottom: 10rpx;
|
|
|
-
|
|
|
- .label {
|
|
|
- color: #666666;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 28rpx;
|
|
|
- }
|
|
|
- .value {
|
|
|
- font-size: 28rpx;
|
|
|
- color: #312520;
|
|
|
- font-weight: 400;
|
|
|
- }
|
|
|
- }
|
|
|
- .sub-title{
|
|
|
- margin-left: 20rpx;
|
|
|
- margin-top: 10rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
- .desc{
|
|
|
- padding:30rpx;
|
|
|
- }
|
|
|
- .navigation{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 28rpx;
|
|
|
- .address{
|
|
|
- flex:1;
|
|
|
- height: auto;
|
|
|
- background: #F9F6EB;
|
|
|
- border-radius: 28rpx;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #000000;
|
|
|
- line-height: 48rpx;
|
|
|
- padding-left: 30rpx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- text.iconfont{
|
|
|
- display: inline-block;
|
|
|
- font-size: 36rpx;
|
|
|
- margin-right: 8rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .link{
|
|
|
- margin-left: 20rpx;
|
|
|
- color:#FF8719;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
.banner {
|
|
|
margin-top: 0;
|
|
|
.swiper {
|