123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <script setup>
- import { ref } from "vue"
- // 1-作品简介 2-作者简介
- const curState = ref(1)
- const props = defineProps({
- title: {
- type: String,
- required: true,
- },
- author: {
- type: String,
- required: true,
- },
- subtitle: {
- type: String,
- required: true,
- },
- age: {
- type: String,
- required: true,
- },
- location: {
- type: String,
- required: true,
- },
- paintingDesc: {
- type: String,
- default: "",
- },
- authorDesc: {
- type: String,
- default: "",
- },
- canClose: {
- type: Boolean,
- default: true,
- },
- size: {
- type: Object,
- default: () => {
- return {
- width: 1,
- height: 1,
- }
- },
- },
- })
- </script>
- <template>
- <div class="info-box">
- <img
- class="close-btn"
- src="@/assets/images/painting-box-back.png"
- alt=""
- >
- <div class="detail-box">
- <div class="top">
- <div class="title">
- {{ curState == 1 ? props.title : "作者简介" }}
- </div>
- <div
- class="exchange"
- @click="curState == 1 ? (curState = 2) : (curState = 1)"
- >
- <img
- src="@/assets/images/icon_change.png"
- alt=""
- >
- {{ curState == 1 ? "作者" : "作品" }}
- </div>
- </div>
- <div class="line" />
- <div
- v-if="curState == 1"
- class="bottom"
- >
- <p>{{ props.author }}</p>
- <p>{{ props.size.width }} x {{ props.size.height }} 厘米</p>
- <p>{{ props.subtitle }}</p>
- <p>{{ props.location }}</p>
- <br>
- <p>{{ props.paintingDesc }}</p>
- </div>
- <div
- v-else-if="curState == 2"
- class="bottom"
- >
- <p>{{ props.authorDesc.length >0? props.authorDesc:'暂无信息' }}</p>
- </div>
- </div>
- </div>
- </template>
- <style lang="less" scoped>
- .info-box {
- width: 60%;
- height: 100%;
- background: url(@/assets/images/painting-box-bg.png);
- background-size: 100% 100%;
- position: relative;
- .close-btn {
- position: absolute;
- top: 50%;
- left: 1.5%;
- transform: translateY(-50%);
- cursor: pointer;
- }
- .detail-box {
- width: 95%;
- height: 100%;
- position: absolute;
- // background: rgba(153, 205, 50, 0.39);
- right: 0;
- padding: 7% 7% 0;
- .top {
- width: 100%;
- height: 65px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .title {
- color: #ffecb0;
- font-size: 44px;
- font-family: "KingHwa_OldSong";
- white-space: pre-wrap;
- }
- .exchange {
- display: flex;
- align-items: center;
- color: #e1edd9;
- font-size: 20px;
- font-family: "KaiTi";
- cursor: pointer;
- }
- }
- .line {
- width: 100%;
- height: 1px;
- background: #ffffff;
- margin-top: 20px;
- }
- .bottom {
- width: 100%;
- margin-top: 20px;
- height: 89%;
- overflow: auto;
- font-size: 30px;
- line-height: 35px;
- padding: 10px 40px 0 0 ;
- color: #E1EDD9;
- font-family: 'KaiTi';
- p{
- white-space: pre-wrap;
- }
- &::-webkit-scrollbar {
- width: 4px;
- }
- /* 滚动条轨道(track)的样式 */
- &::-webkit-scrollbar-track {
- background: #f1f1f100; /* 轨道的背景颜色 */
- }
- /* 滚动条滑块(thumb)的样式 */
- &::-webkit-scrollbar-thumb {
- background: #e1edd942; /* 滑块的背景颜色 */
- border-radius: 50px;
- }
- }
- }
- }
- </style>
|