index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="box" :style="g_imgUrl">
  3. <el-button color="#7a3e2a" @click="act_backToGround" class="return-button">返回展厅</el-button>
  4. <img class="start-button" src="@/assets/img/reading_button.png" @click="act_redirectTo">
  5. </div>
  6. </template>
  7. <script setup>
  8. /************************************************
  9. * 引入文件 *
  10. ************************************************/
  11. import { ref, onMounted } from "vue";
  12. import { useRouter, useRoute } from "vue-router";
  13. import { require_ } from "@/utils/require";
  14. /************************************************
  15. * 全局变量
  16. *
  17. * 格式: g_ + 事件名 例如: g_route
  18. ************************************************/
  19. const g_route = useRoute();
  20. const g_useRouter = useRouter();
  21. // 首页标识
  22. const g_homePage = ref("");
  23. // 背景图地址
  24. const g_imgUrl = ref('');
  25. // 返回展厅地址
  26. const g_exhibitionHallAddress = ref('');
  27. // 首页标识映射
  28. const g_homePageMap = {
  29. // 南洋资料译丛
  30. information: {
  31. bgImgUrl: require_("@/assets/img/nan_yang_information.jpg"),
  32. path: "/information",
  33. //一期:https://www.720yun.com/vr/e71jOOeOzv1
  34. //二期:https://www.720yun.com/vr/d14jtsevsa0
  35. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  36. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  37. },
  38. // 书目中的东南亚与华侨华人
  39. library: {
  40. bgImgUrl: require_("@/assets/img/forth_background.jpg"),
  41. path: "/library",
  42. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  43. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  44. },
  45. // 南洋问题研究
  46. question: {
  47. bgImgUrl: require_("@/assets/img/nan_yang_question_research.jpg"),
  48. path: "/question",
  49. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  50. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  51. },
  52. // 南洋真人馆沙龙
  53. reading: {
  54. bgImgUrl: require_("@/assets/img/reading.jpg"),
  55. path: "/reading",
  56. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  57. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  58. },
  59. // archivesUnbound
  60. archivesUnbound: {
  61. bgImgUrl: require_("@/assets/img/archivesUnbound.png"),
  62. path: "/archivesUnbound",
  63. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065729"
  64. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  65. },
  66. // 博雅集3-1东南亚重要参考文献汇编
  67. literature: {
  68. bgImgUrl: require_("@/assets/img/东南亚重要参考文献汇编.png"),
  69. path: "/literature",
  70. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065729"
  71. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  72. },
  73. // 博雅集3-3.1南洋资讯检索
  74. consultation: {
  75. bgImgUrl: require_("@/assets/img/南洋真人馆沙龙.png"),
  76. path: "/consultation",
  77. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065728"
  78. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  79. },
  80. // 博雅集3-3.2东南亚经济统计
  81. economy: {
  82. bgImgUrl: require_("@/assets/img/东南亚经济统计.png"),
  83. path: "/economy",
  84. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065728"
  85. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  86. },
  87. // 博雅集2-1东南亚大型特藏
  88. specialCollection: {
  89. bgImgUrl: require_("@/assets/img/东南亚大型特藏.png"),
  90. path: "/specialCollection",
  91. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065726"
  92. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  93. },
  94. // 博雅集2-2东南亚连续出版物
  95. publication: {
  96. bgImgUrl: require_("@/assets/img/东南亚连续出版物.png"),
  97. path: "/publication",
  98. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065726"
  99. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  100. },
  101. // 博雅集1 东南亚研究机构
  102. institution: {
  103. bgImgUrl: require_("@/assets/img/东南亚研究机构.png"),
  104. path: "/institution",
  105. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065726"
  106. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  107. },
  108. // 东南亚地区发展报告
  109. regionDevelop: {
  110. bgImgUrl: require_("@/assets/img/东南亚地区发展报告.png"),
  111. path: "/regionDevelop",
  112. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065726"
  113. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  114. },
  115. // 期刊检索功能
  116. periodicals: {
  117. bgImgUrl: require_("@/assets/img/study.png"),
  118. path: "/periodicals",
  119. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  120. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  121. },
  122. // 研究检索功能
  123. study: {
  124. bgImgUrl: require_("@/assets/img/书目中的东南亚与华侨华人.png"),
  125. path: "/study",
  126. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  127. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  128. },
  129. // 论文检索功能
  130. thesis: {
  131. bgImgUrl: require_("@/assets/img/thesis.png"),
  132. path: "/thesis",
  133. //exhibitionHallAddress: "https://www.720yun.com/vr/faej5peuOw2?s=18065722"
  134. exhibitionHallAddress: "https://seaelibrary.xmu.edu.cn/mainplus/index.html"
  135. },
  136. }
  137. /************************************************
  138. * 生命周期函数
  139. ************************************************/
  140. // 挂载完成
  141. onMounted(() => {
  142. act_resolvingIdentity();
  143. act_upBgImg();
  144. act_upExhibitionHallAddress();
  145. });
  146. /************************************************
  147. * 事件处理
  148. *
  149. * 格式: act_ + 事件名 例如: act_resolvingIdentity
  150. ************************************************/
  151. // 解析首页标识
  152. const act_resolvingIdentity = () => {
  153. g_homePage.value = g_route.query.type;
  154. if (!g_homePage.value) {
  155. g_homePage.value = "information";
  156. g_useRouter.push({ path: "/home", query: { type: "information" } })
  157. }
  158. }
  159. // 修改背景图
  160. const act_upBgImg = () => {
  161. const imgUrl = g_homePageMap[g_homePage.value].bgImgUrl;
  162. if (imgUrl) {
  163. g_imgUrl.value = `background-image:url('${imgUrl}')`;
  164. }
  165. }
  166. // 修改展厅地址
  167. const act_upExhibitionHallAddress = () => {
  168. const exhibitionHallAddress = g_homePageMap[g_homePage.value].exhibitionHallAddress;
  169. if (exhibitionHallAddress) {
  170. g_exhibitionHallAddress.value = exhibitionHallAddress;
  171. }
  172. }
  173. // 返回展厅
  174. const act_backToGround = () => {
  175. window.location.href = g_exhibitionHallAddress.value;
  176. }
  177. // 点击进入内容页面
  178. const act_redirectTo = () => {
  179. const path = g_homePageMap[g_homePage.value].path;
  180. if (path) {
  181. g_useRouter.push({ path });
  182. }
  183. }
  184. </script>
  185. <style scoped>
  186. .box {
  187. background-repeat: no-repeat;
  188. background-size: cover;
  189. background-position: center;
  190. width: 100%;
  191. height: 100%;
  192. }
  193. .return-button {
  194. visibility: visible;
  195. position: absolute;
  196. top: 1%;
  197. right: 1%;
  198. z-index: 100;
  199. }
  200. .start-button {
  201. position: absolute;
  202. top: 55%;
  203. left: 50%;
  204. transform: translate(-50%, -50%) scale(1);
  205. min-width: 300px;
  206. width: calc(8vw + 8vh + 20vmin);
  207. background-repeat: no-repeat;
  208. background-size: cover;
  209. background-position: center;
  210. cursor: pointer;
  211. }
  212. .start-button:hover {
  213. transform: translate(-50%, -50%) scale(0.9);
  214. transition: cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s;
  215. }
  216. </style>