BambooBookView.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <script setup>
  2. import { ref, computed, onMounted, inject } from "vue"
  3. import { useRouter } from "vue-router"
  4. import useRollFu from "../rollFu.js"
  5. const router = useRouter()
  6. const curState = ref("ye")
  7. const $env = inject('$env')
  8. const { handleScroll } = useRollFu()
  9. // 画法数据处理
  10. const paintingData = computed(() => {
  11. let resZhu = null
  12. if (curState.value == 'ye') {
  13. resZhu = configZhuPu['叶']
  14. } else if (curState.value == 'zhi') {
  15. resZhu = configZhuPu['枝']
  16. } else if (curState.value == 'zhu') {
  17. resZhu = configZhuPu['杆']
  18. }
  19. const resValue = Object.entries(resZhu.reduce((groups, item) => {
  20. const category = item['画法']
  21. if (!groups[category]) {
  22. groups[category] = []
  23. }
  24. groups[category].push(item)
  25. return groups
  26. }, {})).map(([key, value]) => ({
  27. category: key,
  28. items: value
  29. }))
  30. return resValue
  31. })
  32. const rowScroller = ref(null)
  33. const handleWheel = (val) => {
  34. const scrollAmount = 50
  35. if (val == -1 ) {
  36. rowScroller.value.scrollLeft -= scrollAmount
  37. } else {
  38. rowScroller.value.scrollLeft += scrollAmount
  39. }
  40. }
  41. onMounted(() => {
  42. console.log('paintingData', paintingData.value)
  43. })
  44. </script>
  45. <template>
  46. <div class="home">
  47. <BtnBack
  48. style="z-index: 2"
  49. @click="router.back()"
  50. />
  51. <div class="left-box">
  52. <div class="title-box-all">
  53. <div class="title-box">
  54. 芥子园画谱
  55. </div>
  56. <div class="zhupu-box">
  57. 竹谱
  58. </div>
  59. </div>
  60. <div class="text">
  61. 《芥子园画传》又称《芥子园画谱》是清代绘画技法图谱,它较系统地介绍了中国画的基本技法。清代文学家李渔曾在南京营造“芥子园”,并支持其婿沈心友及王氏三兄弟(王概、王著、王臬)编绘画谱,故成书出版之时便以此园命名。
  62. </div>
  63. <img
  64. class="zhupu-img"
  65. src="@/assets/images/img_zhupu.png"
  66. alt=""
  67. >
  68. </div>
  69. <div class="right-box">
  70. <div class="totle-painting-box">
  71. <div class="top">
  72. <img
  73. :style="{ opacity: curState == 'ye' ? 1 : 0 }"
  74. src="@/assets/images/img_ye.png"
  75. alt=""
  76. >
  77. <img
  78. :style="{ opacity: curState == 'zhi' ? 1 : 0 }"
  79. src="@/assets/images/img_zhi.png"
  80. alt=""
  81. >
  82. <img
  83. :style="{ opacity: curState == 'zhu' ? 1 : 0 }"
  84. src="@/assets/images/img_zhu.png"
  85. alt=""
  86. >
  87. </div>
  88. <div class="bottom-btns">
  89. <div
  90. class="btn"
  91. :class="{ btnAc: curState == 'zhu' }"
  92. @click="() =>{curState = 'zhu',rowScroller.scrollLeft = 0}"
  93. >
  94. </div>
  95. <div
  96. class="btn"
  97. :class="{ btnAc: curState == 'zhi' }"
  98. @click="() =>{curState = 'zhi',rowScroller.scrollLeft = 0}"
  99. >
  100. </div>
  101. <div
  102. class="btn"
  103. :class="{ btnAc: curState == 'ye' }"
  104. @click="() =>{curState = 'ye',rowScroller.scrollLeft = 0}"
  105. >
  106. </div>
  107. </div>
  108. </div>
  109. <div
  110. ref="rowScroller"
  111. class="painting-detail-box"
  112. @wheel="($event) => handleScroll($event, (val) => handleWheel(val))"
  113. >
  114. <div
  115. v-for="(category,index1) in paintingData"
  116. :key="index1"
  117. class="category-box"
  118. >
  119. <div
  120. class="category-title"
  121. :style="{margin:index1 == 0 ? '0 10px 0 10px':''}"
  122. >
  123. {{ category.category }}
  124. </div>
  125. <div
  126. v-for="(item,index2) in category.items"
  127. :key="index2"
  128. class="category-item"
  129. >
  130. <img
  131. :src="`${$env.BASE_URL}configMultiMedia/zhupuImages/${item['图片名称'] ? item['图片名称'] : item['名称']}.png`"
  132. alt=""
  133. >
  134. <div>{{ item['名称'] }}</div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </template>
  141. <style lang="less" scoped>
  142. .home {
  143. width: 100%;
  144. height: 100%;
  145. background: url(@/assets/images/zhupu-bg.png);
  146. background-size: 100% 100%;
  147. // background-position: top left;
  148. position: relative;
  149. .left-box {
  150. width: 27.3%;
  151. height: 100%;
  152. // background: rgba(255, 0, 0, 0.377);
  153. position: absolute;
  154. left: 0;
  155. top: 0;
  156. .title-box-all {
  157. position: absolute;
  158. font-family: "KingHwa_OldSong";
  159. color: #ffffff;
  160. writing-mode: vertical-lr;
  161. display: flex;
  162. // flex-direction: column;
  163. align-items: center;
  164. left: 3vw;
  165. top: 12vh;
  166. .title-box {
  167. font-size: 2.8em;
  168. // line-height: 56px;
  169. letter-spacing: 0.3em;
  170. }
  171. .zhupu-box {
  172. // margin-top: 10%;
  173. margin-top: 20px;
  174. font-size: 1.8em;
  175. line-height: 28.13px;
  176. letter-spacing: 0.2em;
  177. }
  178. }
  179. .text {
  180. width: 50%;
  181. position: absolute;
  182. top: 50%;
  183. transform: translateY(-50%);
  184. right: 12%;
  185. color: #7b916b;
  186. // opacity: 0.3;
  187. font-size: 28px;
  188. line-height: 36px;
  189. font-family: "KaiTi";
  190. text-transform: none;
  191. text-align: justified;
  192. text-indent: 2em;
  193. }
  194. .zhupu-img {
  195. width: 55%;
  196. position: absolute;
  197. left: 0;
  198. bottom: 0;
  199. }
  200. }
  201. .right-box {
  202. width: calc(100% - 27.3%);
  203. height: 100%;
  204. // background: rgba(255, 0, 0, 0.281);
  205. position: absolute;
  206. top: 0;
  207. right: 0;
  208. display: flex;
  209. flex-direction: column;
  210. align-items: center;
  211. justify-content: center;
  212. .totle-painting-box {
  213. width: 50%;
  214. height: 60%;
  215. margin-bottom: 5vh;
  216. display: flex;
  217. flex-direction: column;
  218. align-items: center;
  219. justify-content: center;
  220. .top {
  221. width: 100%;
  222. height: calc(100% - 60px);
  223. position: relative;
  224. img {
  225. width: 100%;
  226. height: 100%;
  227. object-fit: contain;
  228. position: absolute;
  229. left: 0;
  230. top: 0;
  231. transition: opacity 1s ease-in-out;
  232. }
  233. }
  234. .bottom-btns {
  235. width: 90%;
  236. display: flex;
  237. justify-content: space-evenly;
  238. .btn {
  239. width: 60px;
  240. height: 60px;
  241. font-size: 38px;
  242. flood-color: #474747;
  243. line-height: 52px;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. font-family: "KingHwa_OldSong";
  248. cursor: pointer;
  249. }
  250. .btnAc {
  251. background: url(@/assets/images/zhupu_active.png);
  252. background-size: 100% 100%;
  253. color: #ffffff;
  254. }
  255. }
  256. }
  257. .painting-detail-box{
  258. width: 95%;
  259. height: 25%;
  260. // background: red;
  261. overflow-x: auto;
  262. overflow-y: hidden;
  263. display: flex;
  264. &::-webkit-scrollbar {
  265. width: 0px;
  266. height: 0;
  267. }
  268. .category-box{
  269. // display: inline;
  270. // white-space: nowrap;
  271. display: flex;
  272. align-items: flex-start;
  273. img{
  274. width: 20vh;
  275. height: 20vh;
  276. object-fit: contain;
  277. }
  278. >div{
  279. // float: left;
  280. }
  281. .category-title{
  282. display: inline-flex;
  283. writing-mode: vertical-lr;
  284. letter-spacing: 12px;
  285. color: #476446;
  286. background: url(@/assets/images/name-bg.png);
  287. background-size: 100% 100%;
  288. font-family: 'KingHwa_OldSong';
  289. font-size: 20px;
  290. // line-height: 48px;
  291. padding: 10px;
  292. margin: 0 30px 0 60px;
  293. // height: 70%;
  294. }
  295. .category-item{
  296. display: flex;
  297. flex-direction: column;
  298. align-items: center;
  299. margin: 0 20px 0 20px;
  300. >div{
  301. margin-top: 10px;
  302. color: #7B916B;
  303. font-size: 20px;
  304. line-height: 29px;
  305. font-family: "KingHwa_OldSong";
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. </style>