BambooBookView.vue 10 KB

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