|
@@ -1,22 +1,37 @@
|
|
|
<template>
|
|
|
<div class="museum-list">
|
|
|
<div class="mcon">
|
|
|
- <p v-if="list.length>0">{{list[0].cityName}} {{currentId === 'museum' ? '博物馆' : '虚拟场景'}}数量:{{list.length}}</p>
|
|
|
+ <p v-if="list.length > 0">
|
|
|
+ {{ list[0].cityName }}
|
|
|
+ {{ currentId === "museum" ? "博物馆" : "虚拟场景" }}数量:{{
|
|
|
+ list.length
|
|
|
+ }}
|
|
|
+ </p>
|
|
|
<ul>
|
|
|
- <li @click="onClickItem(item)" v-for="(item,i) in list" :key="i"
|
|
|
+ <li
|
|
|
+ @click="onClickItem(item)"
|
|
|
+ v-for="(item, i) in list"
|
|
|
+ :key="i"
|
|
|
:title="item.name"
|
|
|
>
|
|
|
- {{item.name}}
|
|
|
+ <span v-show="item.museumName">{{ item.museumName }}-</span>
|
|
|
+ {{ item.name }}
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
<ul class="select">
|
|
|
- <li @click="onClickSelect({id:'museum'})" :class="{ active: currentId == 'museum' }">
|
|
|
+ <li
|
|
|
+ @click="onClickSelect({ id: 'museum' })"
|
|
|
+ :class="{ active: currentId == 'museum' }"
|
|
|
+ >
|
|
|
<span></span>
|
|
|
<span>博物馆</span>
|
|
|
</li>
|
|
|
- <li @click="onClickSelect({id:'scene'})" :class="{ active: currentId == 'scene' }">
|
|
|
+ <li
|
|
|
+ @click="onClickSelect({ id: 'scene' })"
|
|
|
+ :class="{ active: currentId == 'scene' }"
|
|
|
+ >
|
|
|
<span></span>
|
|
|
<span>虚拟场景</span>
|
|
|
</li>
|
|
@@ -27,62 +42,64 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted, watch, nextTick } from "vue";
|
|
|
import { getMuseumList, getExhibitionList } from "@/config/api";
|
|
|
-import { useRoute,useRouter } from "vue-router";
|
|
|
+import { useRoute, useRouter } from "vue-router";
|
|
|
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
|
|
|
-const currentId = ref('')
|
|
|
+const currentId = ref("");
|
|
|
|
|
|
-const list = ref([])
|
|
|
+const list = ref([]);
|
|
|
|
|
|
const onClickSelect = (data) => {
|
|
|
- currentId.value = data.id
|
|
|
-}
|
|
|
+ currentId.value = data.id;
|
|
|
+};
|
|
|
|
|
|
-const onClickItem = data => {
|
|
|
- if (currentId.value === 'museum') {
|
|
|
- if (data.name === '广东省博物馆') {
|
|
|
- router.push({name: 'gdmuseum'})
|
|
|
+const onClickItem = (data) => {
|
|
|
+ if (currentId.value === "museum") {
|
|
|
+ if (data.name === "广东省博物馆") {
|
|
|
+ router.push({ name: "gdmuseum" });
|
|
|
} else {
|
|
|
- router.push({name:'exhibition',query:{id:data.id}})
|
|
|
+ router.push({ name: "exhibition", query: { id: data.id } });
|
|
|
}
|
|
|
} else {
|
|
|
- router.push({name:'zhanlan',params:{id:data.id}})
|
|
|
+ router.push({ name: "zhanlan", params: { id: data.id } });
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const getList = () => {
|
|
|
- let getData = currentId.value == 'museum' ? getMuseumList : getExhibitionList
|
|
|
- getData({
|
|
|
- "cityId": route.params.id,
|
|
|
- "pageNum": 1,
|
|
|
- "pageSize": 1000,
|
|
|
- "searchKey": ""
|
|
|
- }, data => {
|
|
|
- list.value = data.data.records
|
|
|
- })
|
|
|
-}
|
|
|
+ let getData = currentId.value == "museum" ? getMuseumList : getExhibitionList;
|
|
|
+ getData(
|
|
|
+ {
|
|
|
+ cityId: route.params.id,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ searchKey: "",
|
|
|
+ },
|
|
|
+ (data) => {
|
|
|
+ list.value = data.data.records;
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
|
|
|
watch(currentId, () => {
|
|
|
- getList()
|
|
|
-})
|
|
|
+ getList();
|
|
|
+});
|
|
|
|
|
|
onMounted(() => {
|
|
|
if (route.query.type) {
|
|
|
- currentId.value = route.query.type
|
|
|
- router.replace({name: route.name, query: {}})
|
|
|
+ currentId.value = route.query.type;
|
|
|
+ router.replace({ name: route.name, query: {} });
|
|
|
} else {
|
|
|
- currentId.value = 'museum'
|
|
|
+ currentId.value = "museum";
|
|
|
}
|
|
|
- getList()
|
|
|
-})
|
|
|
-
|
|
|
+ getList();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.museum-list {
|
|
|
- background: #E8E3D1;
|
|
|
+ background: #e8e3d1;
|
|
|
color: #333333;
|
|
|
|
|
|
.mcon {
|
|
@@ -90,16 +107,15 @@ onMounted(() => {
|
|
|
margin: 0 auto;
|
|
|
padding-top: 50px;
|
|
|
|
|
|
-
|
|
|
- >p {
|
|
|
+ > p {
|
|
|
font-size: 24px;
|
|
|
}
|
|
|
|
|
|
- >ul {
|
|
|
+ > ul {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
- >li {
|
|
|
+ > li {
|
|
|
width: 270px;
|
|
|
height: 50px;
|
|
|
margin: 40px 104px 0 0;
|
|
@@ -139,13 +155,13 @@ onMounted(() => {
|
|
|
transform: translateX(-50%);
|
|
|
color: #fff;
|
|
|
|
|
|
- >li {
|
|
|
+ > li {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin: 0 40px;
|
|
|
cursor: pointer;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
margin-right: 6px;
|
|
|
display: inline-block;
|
|
|
|
|
@@ -159,7 +175,7 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
&:first-of-type {
|
|
|
&::before {
|
|
|
content: "";
|
|
@@ -180,7 +196,6 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
@media screen and (max-width: 1000px) {
|
|
|
-
|
|
|
.museum-list {
|
|
|
color: #333333;
|
|
|
width: 100%;
|
|
@@ -189,16 +204,16 @@ onMounted(() => {
|
|
|
width: 90%;
|
|
|
padding-top: 20px;
|
|
|
|
|
|
- >p {
|
|
|
+ > p {
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
|
|
|
- >ul {
|
|
|
+ > ul {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: space-between;
|
|
|
|
|
|
- >li {
|
|
|
+ > li {
|
|
|
width: 48%;
|
|
|
height: 40px;
|
|
|
margin: 10px 0;
|
|
@@ -221,6 +236,5 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
</style>
|