BambooBookView.vue 12 KB

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