|
@@ -1,10 +1,11 @@
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, computed } from "vue"
|
|
|
|
|
|
+import { ref, computed, onMounted } from "vue"
|
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
|
+
|
|
|
|
+const route = useRoute()
|
|
|
|
|
|
// 1-作品简介 2-作者简介
|
|
// 1-作品简介 2-作者简介
|
|
-const curState = computed(() => {
|
|
|
|
- return props.state
|
|
|
|
-})
|
|
|
|
|
|
+const curState = ref(1)
|
|
|
|
|
|
const isCloseInfo = ref(false)
|
|
const isCloseInfo = ref(false)
|
|
|
|
|
|
@@ -59,6 +60,30 @@ const props = defineProps({
|
|
const newTitle = computed(() => {
|
|
const newTitle = computed(() => {
|
|
return props.title.split('\n')
|
|
return props.title.split('\n')
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+// 格式化作品简介/作者简介
|
|
|
|
+const FormatPaintingDesc = computed(() => {
|
|
|
|
+ return props.paintingDesc.replace(/\n/g, "<br>").split('<br>').map((line) => `<p>${line}</p>`).join('')
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const FormatAuthorDesc = computed(() => {
|
|
|
|
+ return props.authorDesc.replace(/\n/g, "<br>").split('<br>').map((line) => `<p>${line}</p>`).join('')
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ if (route.query.state) {
|
|
|
|
+ curState.value = route.query.state
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const exChangeFu = () => {
|
|
|
|
+ if (curState.value == 1) {
|
|
|
|
+ curState.value = 2
|
|
|
|
+
|
|
|
|
+ } else if (curState.value == 2) {
|
|
|
|
+ curState.value = 1
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -82,7 +107,7 @@ const newTitle = computed(() => {
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="exchange"
|
|
class="exchange"
|
|
- @click="curState == 1 ? (curState = 2) : (curState = 1)"
|
|
|
|
|
|
+ @click="exChangeFu"
|
|
>
|
|
>
|
|
<img
|
|
<img
|
|
src="@/assets/images/icon_change.png"
|
|
src="@/assets/images/icon_change.png"
|
|
@@ -101,13 +126,16 @@ const newTitle = computed(() => {
|
|
<p>{{ props.subtitle }}</p>
|
|
<p>{{ props.subtitle }}</p>
|
|
<p>{{ props.location }}</p>
|
|
<p>{{ props.location }}</p>
|
|
<br>
|
|
<br>
|
|
- <p>{{ props.paintingDesc }}</p>
|
|
|
|
|
|
+ <div style="text-indent: 2em;">
|
|
|
|
+ <p v-html="FormatPaintingDesc" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
v-else-if="curState == 2"
|
|
v-else-if="curState == 2"
|
|
class="bottom"
|
|
class="bottom"
|
|
|
|
+ style="text-indent: 2em;"
|
|
>
|
|
>
|
|
- <p>{{ props.authorDesc.length >0? props.authorDesc:'暂无信息' }}</p>
|
|
|
|
|
|
+ <p v-html="FormatPaintingDesc.length > 0 ? FormatPaintingDesc :'暂无信息'" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -173,7 +201,7 @@ const newTitle = computed(() => {
|
|
overflow: auto;
|
|
overflow: auto;
|
|
font-size: 30px;
|
|
font-size: 30px;
|
|
line-height: 35px;
|
|
line-height: 35px;
|
|
- padding: 10px 40px 0 0 ;
|
|
|
|
|
|
+ padding: 10px 40px 20px 0 ;
|
|
color: #E1EDD9;
|
|
color: #E1EDD9;
|
|
font-family: 'KaiTi';
|
|
font-family: 'KaiTi';
|
|
p{
|
|
p{
|