layerMap.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <!-- -->
  2. <template>
  3. <div class="layer-box">
  4. <div class="layer-close" @click="$emit('close')"></div>
  5. <div class="layer-content">
  6. <div class="map-content" ref="mapEle">
  7. <ul class="cell-list">
  8. <li class="li" :class="{ active: unit == 1 }" @click="changeUnit(1)"><span>第一单元</span></li>
  9. <li class="li" :class="{ active: unit == 2 }" @click="changeUnit(2)"><span>第二单元</span></li>
  10. </ul>
  11. <div class="map-box-main" ref="mapMainEle">
  12. <div class="map-box" :style="` transform: translate(-50%, -50%) scale(${0.58 * mapScale});`">
  13. <div class="map-svg">
  14. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="665px" height="963px">
  15. <!-- <polygon
  16. id="_x32_"
  17. class="st0"
  18. opacity="0.4"
  19. fill="rgb(134, 92, 92)"
  20. points="208.3,150.5 208.3,0 0,0 0,222 253,222 253,610 0,610 0,846 79.4,846 79.4,672.3
  21. 315.5,672.3 315.5,150.5 "
  22. :class="{ active: unit == 1 }"
  23. />
  24. <polygon
  25. :class="{ active: unit == 2 }"
  26. id="_x31_"
  27. class="st0"
  28. opacity="0.4"
  29. fill="rgb(134, 92, 92)"
  30. points="633,846 633,610 380,610 380,222 633,222 633,0 429,0 429,150.5 315.8,150.5 315,672
  31. 554.2,672 554.2,846 "
  32. /> -->
  33. <path :class="{ active: unit == 2 }" fill="rgb(134, 92, 92)" class="st0" d="M333.3-0.2v645.1H113.9v202H0V534.7h255.7v-205H0V-0.2H333.3z" />
  34. <path :class="{ active: unit == 1 }" fill="rgb(134, 92, 92)" class="st0" d="M333.3-0.2v645.1h221.2v202h109.9V534.7L411.3,535V330l253.1-0.3V-0.2H333.3z" />
  35. </svg>
  36. <div class="point-list">
  37. <div
  38. class="tool_map_point"
  39. :pano-id="id"
  40. @click="goPano(id)"
  41. :class="{ current: panoId == id, over: i.over }"
  42. :style="`transform:translate(${i.x}px,${i.y}px);`"
  43. v-for="(i, id, index) in points"
  44. >
  45. <p class="tips">点位{{ id }}</p>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="point-type-list">
  52. <dl>
  53. <dt class="over"></dt>
  54. <dd>已浏览</dd>
  55. </dl>
  56. <dl>
  57. <dt class="no"></dt>
  58. <dd>未浏览</dd>
  59. </dl>
  60. <dl>
  61. <dt class="now"></dt>
  62. <dd>当前位置</dd>
  63. </dl>
  64. </div>
  65. </div>
  66. <div class="desc-box">
  67. <template v-if="unit == 0">
  68. <p class="title">前 言</p>
  69. <div class="des-content">
  70. <p class="">  中国古代人物画中既有表现“庙堂仪范”的含淳咏德,“林下风雅”的高蹈优游,更不乏描绘黎民大众日常艰辛劳作、节庆欢愉的人物风俗画。</p>
  71. <p class="">
  72.   远古岩画已有人物风俗画雏形。至西周始有观风与化俗的政治传统,使得历代统治者尤重民风变化。世情之淳薄,殊方之人文,农工之造作,商贾之交易,皆可凭图画的直观性与艺术性而传载。加之画家出于自觉意识对民众生活的关怀与记录,使人物风俗画逐渐成为重要画科。魏晋时已有画田家景物的名家。及至两宋,人物风俗画达到高峰,技法多样,且题材广泛,农桑渔猎、陶冶纺织、月令社庆、村市游戏之芸芸众生相,皆被画家惟妙惟肖地呈现于笔底毫端,令人回味无穷。
  73. </p>
  74. <p class="">
  75.   本次展览是继“庙堂仪范”“林下风雅”之后,故宫博物院藏历代人物画特展第三期,绘画佳作中人物的举手投足、一颦一笑,皆呈现出生动鲜活、精彩纷呈的众生形象以及古代生活场景。游目于画作,让我们一起领略艺术之美,感悟历史智慧,传扬文化精神。
  76. </p>
  77. </div>
  78. </template>
  79. <template v-if="unit == 1">
  80. <p class="title">第一单元 村市生涯</p>
  81. <div class="des-content">
  82. <p class="">
  83.   “民务稼穑,衣食滋殖”,古代中国以农业立国,人物风俗画的发展中,农人农事一直是主流题材。“一人之身,百工为备”,经济的发展带来了社会分工,工匠为人们提供了丰富多样的物质生活,其身影也常出现在人物画中。“交易而退,各得其所”,随着城市的兴起,商贾成为新兴的形象逐渐进入人物画中,以表现城市经济生活的画作在北宋开始出现,并向着精细化发展,更加注重人物动作神态、衣纹服饰的描绘,题材更为广泛。
  84. </p>
  85. <p class="">  本单元选取描绘农村、城市经济活动的人物风俗画,分为农人、工匠、商贾三个主题,以展示古代劳动者形象及生产交易场景。</p>
  86. </div>
  87. </template>
  88. <template v-if="unit == 2">
  89. <p class="title">第二单元 太平欢乐</p>
  90. <div class="des-content">
  91. <p class="">
  92.   古人对于大自然的体认开始于对四季周回的感悟,“七月流火,九月授衣”,时序的变化催生出丰富的岁时风俗。这些风俗活动既饱含对丰收的憧憬,又内蕴对自然的敬畏,是人物风俗画的重要表现内容。“绵绵瓜瓞,民之初生”,多子多福是人们的美好向往。婴戏图以众多婴孩为主角,表现孩童的纯真烂漫,寓意着对生命的崇敬与渴望,是备受欢迎的人物风俗画题材。而春游晚归、游戏杂技,舟桥街巷之拥堵,勾栏瓦肆之欢笑,语默之处,日用之间,无不是人物风俗画表现的对象,充分反映了古人生活的丰富多姿。
  93. </p>
  94. <p class="">  本单元选取描绘民众日常生活的人物风俗画,分为岁时、婴戏、娱乐三部分,以展示古人生活娱乐场景。</p>
  95. </div>
  96. </template>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import { mapGetters, mapMutations } from "vuex";
  103. export default {
  104. //import引入的组件需要注入到对象中才能使用
  105. components: {},
  106. // props: ["points"],
  107. data() {
  108. //这里存放数据
  109. return { unit: 0, mapScale: 1 };
  110. },
  111. //监听属性 类似于data概念
  112. computed: {
  113. ...mapGetters({
  114. points: "points",
  115. panoId: "panoId",
  116. }),
  117. },
  118. //监控data中的数据变化
  119. watch: {},
  120. //方法集合
  121. methods: {
  122. ...mapMutations(["setData"]),
  123. goPano(id) {
  124. player.flyToPano({ pano: player.model.panos.get(id) });
  125. this.panoId = id;
  126. // if (!this.points[id].over) {
  127. // this.points[id].over = true;
  128. // }
  129. },
  130. // getPoints() {
  131. // // let w = 633,
  132. // // h = 965;
  133. // let w = 665,
  134. // h = 963;
  135. // let points = manage.initMapPanoPos(w, h);
  136. // if (!this.points) {
  137. // this.setData({ points });
  138. // }
  139. // },
  140. initPicSize() {
  141. try {
  142. let refW = this.$refs.mapEle.getBoundingClientRect().width;
  143. let refH = this.$refs.mapMainEle.getBoundingClientRect().height;
  144. let scaleW = refW / 598;
  145. let scaleH = refH / 622;
  146. this.mapScale = scaleW > scaleH ? scaleH : scaleW;
  147. } catch (err) {
  148. // console.error(err);
  149. }
  150. },
  151. changeUnit(unit) {
  152. if (unit == this.unit) {
  153. this.unit = 0;
  154. } else {
  155. this.unit = unit;
  156. }
  157. },
  158. },
  159. //生命周期 - 创建完成(可以访问当前this实例)
  160. created() {},
  161. //生命周期 - 挂载完成(可以访问DOM元素)
  162. mounted() {
  163. window.addEventListener("resize", this.initPicSize);
  164. this.$nextTick(() => {
  165. this.initPicSize();
  166. // this.getPoints();
  167. // let overList = sessionStorage.getItem("overList");
  168. // if (overList) {
  169. // this.overList = JSON.parse(overList);
  170. // }
  171. });
  172. },
  173. beforeCreate() {}, //生命周期 - 创建之前
  174. beforeMount() {}, //生命周期 - 挂载之前
  175. beforeUpdate() {}, //生命周期 - 更新之前
  176. updated() {}, //生命周期 - 更新之后
  177. beforeDestroy() {}, //生命周期 - 销毁之前
  178. destroyed() {
  179. window.removeEventListener("resize", this.initPicSize);
  180. }, //生命周期 - 销毁完成
  181. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  182. };
  183. </script>
  184. <style lang="less" scoped>
  185. //@import url(); 引入公共css类
  186. .layer-box {
  187. position: fixed;
  188. width: 100vw;
  189. height: 100vh;
  190. background: rgba(0, 0, 0, 0.6);
  191. top: 0;
  192. left: 0;
  193. z-index: 100;
  194. .layer-close {
  195. position: absolute;
  196. width: 56px;
  197. height: 56px;
  198. background: url(../../../assets/image/icon/new-icon/icon_close.png) no-repeat;
  199. background-size: 100%;
  200. right: 56px;
  201. top: 56px;
  202. cursor: pointer;
  203. }
  204. .layer-content {
  205. max-width: 85%;
  206. margin: 0 auto;
  207. padding: 60px 0;
  208. height: 100%;
  209. display: flex;
  210. align-items: center;
  211. overflow: hidden;
  212. .map-content {
  213. max-width: 50%;
  214. max-height: 100%;
  215. width: 598px;
  216. height: 788px;
  217. position: relative;
  218. overflow: hidden;
  219. border-radius: 10px;
  220. background-color: hsla(0, 0%, 100%, 0.8);
  221. animation: ani 0.5s;
  222. display: flex;
  223. flex-direction: column;
  224. .cell-list {
  225. padding: 25px 0 15px;
  226. text-align: center;
  227. font-size: 0;
  228. line-height: 1;
  229. }
  230. .li {
  231. min-width: 112px;
  232. height: 40px;
  233. border: 1px solid rgba(113, 88, 49, 0.8);
  234. line-height: 38px;
  235. text-align: center;
  236. padding: 0 20px;
  237. font-weight: 700;
  238. font-size: 18px;
  239. color: #715831;
  240. border-radius: 20px;
  241. display: inline-block;
  242. margin: 0 10px 10px;
  243. cursor: pointer;
  244. &.active {
  245. border-color: hsla(0, 0%, 100%, 0.8);
  246. color: #fff;
  247. background-color: rgba(146, 96, 96, 0.8);
  248. }
  249. }
  250. .map-box-main {
  251. flex: 1;
  252. position: relative;
  253. overflow: hidden;
  254. .map-box {
  255. width: 805px;
  256. height: 1064px;
  257. transform: translate(-50%, -50%) scale(0.58);
  258. background-image: url(../../../assets/image/icon/new-icon/map.jpg);
  259. position: absolute;
  260. left: 50%;
  261. top: 50%;
  262. overflow: hidden;
  263. .map-svg {
  264. left: 70px;
  265. top: 61px;
  266. position: absolute;
  267. polygon {
  268. cursor: pointer;
  269. opacity: 0 !important;
  270. &.active {
  271. opacity: 0.6 !important;
  272. }
  273. }
  274. path {
  275. cursor: pointer;
  276. opacity: 0 !important;
  277. &.active {
  278. opacity: 0.6 !important;
  279. }
  280. }
  281. .point-list {
  282. position: absolute;
  283. z-index: 100;
  284. left: 0;
  285. top: 0;
  286. width: 100%;
  287. height: 100%;
  288. pointer-events: none;
  289. .tool_map_point {
  290. width: 12px;
  291. height: 12px;
  292. background: #dcd1b9;
  293. border-radius: 50%;
  294. border: 2px solid #c0a06a;
  295. position: absolute;
  296. transform: translate(-50%, -50%);
  297. cursor: pointer;
  298. pointer-events: auto;
  299. z-index: 1;
  300. &.over {
  301. border: none !important;
  302. background: url(../../../assets/image/icon/new-icon/red.png) no-repeat 50% / contain;
  303. }
  304. &.current {
  305. &::after {
  306. content: "";
  307. position: absolute;
  308. left: 50%;
  309. top: 50%;
  310. width: 24px;
  311. height: 24px;
  312. background: url(../../../assets/image/icon/new-icon/blue.png) no-repeat 50% / contain;
  313. transform: translate(-50%, -50%);
  314. }
  315. }
  316. &:hover {
  317. background: #814f4f;
  318. border-color: #814f4f;
  319. z-index: 2;
  320. .tips {
  321. display: block;
  322. }
  323. }
  324. .tips {
  325. padding: 5px 10px;
  326. background: rgba(0, 0, 0, 0.5);
  327. border-radius: 6px;
  328. position: absolute;
  329. left: 50%;
  330. bottom: 20px;
  331. transform: translateX(-50%);
  332. white-space: nowrap;
  333. display: none;
  334. font-size: 20px;
  335. // border: 1px solid #ffffff;
  336. z-index: 100;
  337. &::after {
  338. content: "";
  339. position: absolute;
  340. border: 6px solid transparent;
  341. border-top-color: rgba(0, 0, 0, 0.5);
  342. display: inline-block;
  343. top: 100%;
  344. left: 50%;
  345. transform: translateX(-50%);
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. }
  353. .point-type-list {
  354. display: flex;
  355. justify-content: center;
  356. align-items: center;
  357. flex-wrap: wrap;
  358. padding: 28px 0 24px;
  359. dl {
  360. padding: 0 20px 0;
  361. }
  362. dt {
  363. width: 24px;
  364. height: 24px;
  365. background: url(../../../assets/image/icon/new-icon/red.png) no-repeat;
  366. display: inline-block;
  367. vertical-align: middle;
  368. background-size: 100%;
  369. &.no {
  370. background: url(../../../assets/image/icon/new-icon/no.png) no-repeat;
  371. background-size: 100%;
  372. }
  373. &.now {
  374. background: url(../../../assets/image/icon/new-icon/blue.png) no-repeat;
  375. background-size: 100%;
  376. }
  377. }
  378. dd {
  379. font-weight: 700;
  380. font-size: 18px;
  381. color: #653332;
  382. display: inline-block;
  383. vertical-align: middle;
  384. margin-left: 8px;
  385. }
  386. }
  387. }
  388. .desc-box {
  389. color: #fff;
  390. max-height: 100%;
  391. overflow: auto;
  392. margin-left: 40px;
  393. flex: 1;
  394. .title {
  395. font-weight: 700;
  396. font-size: 26px;
  397. line-height: 36px;
  398. text-align: center;
  399. margin-bottom: 35px;
  400. }
  401. .des-content {
  402. font-size: 20px;
  403. line-height: 33px;
  404. white-space: pre-line;
  405. text-align: justify;
  406. p {
  407. margin-bottom: 16px;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. </style>