|
@@ -1,9 +1,57 @@
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref } from "vue"
|
|
|
|
|
|
+import { ref, computed, onMounted, inject } from "vue"
|
|
import { useRouter } from "vue-router"
|
|
import { useRouter } from "vue-router"
|
|
|
|
+import useRollFu from "../rollFu.js"
|
|
|
|
+
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
const curState = ref("ye")
|
|
const curState = ref("ye")
|
|
|
|
+
|
|
|
|
+const $env = inject('$env')
|
|
|
|
+
|
|
|
|
+const { handleScroll } = useRollFu()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 画法数据处理
|
|
|
|
+const paintingData = computed(() => {
|
|
|
|
+ let resZhu = null
|
|
|
|
+ if (curState.value == 'ye') {
|
|
|
|
+ resZhu = configZhuPu['叶']
|
|
|
|
+ } else if (curState.value == 'zhi') {
|
|
|
|
+ resZhu = configZhuPu['枝']
|
|
|
|
+ } else if (curState.value == 'zhu') {
|
|
|
|
+ resZhu = configZhuPu['杆']
|
|
|
|
+ }
|
|
|
|
+ const resValue = Object.entries(resZhu.reduce((groups, item) => {
|
|
|
|
+ const category = item['画法']
|
|
|
|
+ if (!groups[category]) {
|
|
|
|
+ groups[category] = []
|
|
|
|
+ }
|
|
|
|
+ groups[category].push(item)
|
|
|
|
+ return groups
|
|
|
|
+ }, {})).map(([key, value]) => ({
|
|
|
|
+ category: key,
|
|
|
|
+ items: value
|
|
|
|
+ }))
|
|
|
|
+ return resValue
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const rowScroller = ref(null)
|
|
|
|
+
|
|
|
|
+const handleWheel = (val) => {
|
|
|
|
+ const scrollAmount = 50
|
|
|
|
+ if (val == -1 ) {
|
|
|
|
+ rowScroller.value.scrollLeft -= scrollAmount
|
|
|
|
+ } else {
|
|
|
|
+ rowScroller.value.scrollLeft += scrollAmount
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ console.log('paintingData', paintingData.value)
|
|
|
|
+})
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -53,28 +101,54 @@ const curState = ref("ye")
|
|
<div
|
|
<div
|
|
class="btn"
|
|
class="btn"
|
|
:class="{ btnAc: curState == 'zhu' }"
|
|
:class="{ btnAc: curState == 'zhu' }"
|
|
- @click="curState = 'zhu'"
|
|
|
|
|
|
+ @click="() =>{curState = 'zhu',rowScroller.scrollLeft = 0}"
|
|
>
|
|
>
|
|
杆
|
|
杆
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="btn"
|
|
class="btn"
|
|
:class="{ btnAc: curState == 'zhi' }"
|
|
:class="{ btnAc: curState == 'zhi' }"
|
|
- @click="curState = 'zhi'"
|
|
|
|
|
|
+ @click="() =>{curState = 'zhi',rowScroller.scrollLeft = 0}"
|
|
>
|
|
>
|
|
枝
|
|
枝
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="btn"
|
|
class="btn"
|
|
:class="{ btnAc: curState == 'ye' }"
|
|
:class="{ btnAc: curState == 'ye' }"
|
|
- @click="curState = 'ye'"
|
|
|
|
|
|
+ @click="() =>{curState = 'ye',rowScroller.scrollLeft = 0}"
|
|
>
|
|
>
|
|
叶
|
|
叶
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="painting-detail-box">
|
|
|
|
- 画法
|
|
|
|
|
|
+ <div
|
|
|
|
+ ref="rowScroller"
|
|
|
|
+ class="painting-detail-box"
|
|
|
|
+ @wheel="($event) => handleScroll($event, (val) => handleWheel(val))"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-for="(category,index1) in paintingData"
|
|
|
|
+ :key="index1"
|
|
|
|
+ class="category-box"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ class="category-title"
|
|
|
|
+ :style="{margin:index1 == 0 ? '0 10px 0 10px':''}"
|
|
|
|
+ >
|
|
|
|
+ {{ category.category }}
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-for="(item,index2) in category.items"
|
|
|
|
+ :key="index2"
|
|
|
|
+ class="category-item"
|
|
|
|
+ >
|
|
|
|
+ <img
|
|
|
|
+ :src="`${$env.BASE_URL}configMultiMedia/zhupuImages/${item['图片名称'] ? item['图片名称'] : item['名称']}.png`"
|
|
|
|
+ alt=""
|
|
|
|
+ >
|
|
|
|
+ <div>{{ item['名称'] }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -157,7 +231,7 @@ const curState = ref("ye")
|
|
.totle-painting-box {
|
|
.totle-painting-box {
|
|
width: 50%;
|
|
width: 50%;
|
|
height: 60%;
|
|
height: 60%;
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
+ margin-bottom: 5vh;
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -200,6 +274,60 @@ const curState = ref("ye")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .painting-detail-box{
|
|
|
|
+ width: 95%;
|
|
|
|
+ height: 25%;
|
|
|
|
+ // background: red;
|
|
|
|
+ overflow-x: auto;
|
|
|
|
+ overflow-y: hidden;
|
|
|
|
+ display: flex;
|
|
|
|
+ &::-webkit-scrollbar {
|
|
|
|
+ width: 0px;
|
|
|
|
+ height: 0;
|
|
|
|
+ }
|
|
|
|
+ .category-box{
|
|
|
|
+ // display: inline;
|
|
|
|
+ // white-space: nowrap;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: flex-start;
|
|
|
|
+ img{
|
|
|
|
+ width: 20vh;
|
|
|
|
+ height: 20vh;
|
|
|
|
+ object-fit: contain;
|
|
|
|
+ }
|
|
|
|
+ >div{
|
|
|
|
+ // float: left;
|
|
|
|
+ }
|
|
|
|
+ .category-title{
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ writing-mode: vertical-lr;
|
|
|
|
+ letter-spacing: 12px;
|
|
|
|
+ color: #476446;
|
|
|
|
+ background: url(@/assets/images/name-bg.png);
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ font-family: 'KingHwa_OldSong';
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ // line-height: 48px;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ margin: 0 30px 0 60px;
|
|
|
|
+ // height: 70%;
|
|
|
|
+ }
|
|
|
|
+ .category-item{
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 0 20px 0 20px;
|
|
|
|
+ >div{
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ color: #7B916B;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ line-height: 29px;
|
|
|
|
+ font-family: "KingHwa_OldSong";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|