index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <div class="box">
  3. <banner></banner>
  4. <div class="content-box">
  5. <div class="title">SY-CRS-BsAb</div>
  6. <div class="v-content">
  7. <el-row :gutter="20">
  8. <el-col :span="5" :xs="8" v-for="(nav, i) in syList" :key="i" class="list">
  9. <div class="content" @click="tapProfile(nav)">
  10. <img class="profile-img" :src="nav.img" />
  11. <p class="text">{{nav.title}}</p>
  12. </div>
  13. </el-col>
  14. </el-row>
  15. </div>
  16. <!-- Other materials -->
  17. <div class="title">Other materials</div>
  18. <div class="v-content">
  19. <el-row :gutter="20">
  20. <el-col :span="5" :xl="6" :lg="6" :md="8" :sm="8" :xs="8" v-for="(nav, i) in list" :key="i" class="list">
  21. <div class="content" @click="tapProfile(nav)">
  22. <img class="profile-img" :src="nav.img" />
  23. <p class="text">{{nav.title}}</p>
  24. </div>
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </div>
  29. <!-- 弹框 -->
  30. <div class="pop-up" v-if="popShow">
  31. <div class="pop_content">
  32. <!-- <div class="title">{{ $t("nav.MaterialsDownload") }}</div> -->
  33. <!-- <div class="pop_hea">
  34. <div class="biaoti">{{ profile.title }}</div>
  35. <div class="hea_icon" @click="downloadPdf(profile.link, profile.title)">
  36. <i class="el-icon-download"></i>
  37. </div>
  38. </div> -->
  39. <div class="pop_img">
  40. <div class="hea_icon">
  41. <i @click="downloadPdf(profile.link, profile.title)" class="el-icon-download"></i>
  42. <i @click="popShow = false" class="el-icon-close icon"></i>
  43. </div>
  44. <img class="image" :src="profile.contentImg" alt="">
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import banner from "@/components/banner";
  52. export default {
  53. name: "profile",
  54. components: {
  55. banner
  56. },
  57. data() {
  58. return {
  59. list: this.$t("downloadList.list"),
  60. syList: this.$t("downloadList.syList"),
  61. popShow: false,
  62. profile: null
  63. };
  64. },
  65. methods: {
  66. tapProfile(item) {
  67. this.popShow = true;
  68. this.profile = item;
  69. },
  70. downloadPdf(pdfUrl, title) {
  71. console.log(pdfUrl, title);
  72. const loading = this.$loading({
  73. lock: true,
  74. text: this.$t('Download.loading') + '...',
  75. background: 'rgba(0, 0, 0, 0.7)'
  76. });
  77. const xhr = new XMLHttpRequest();
  78. xhr.open('GET', pdfUrl, true);
  79. xhr.responseType = 'blob';
  80. xhr.onload = () => {
  81. if (xhr.status === 200) {
  82. const blob = new Blob([xhr.response], { type: 'application/pdf' });
  83. const url = URL.createObjectURL(blob);
  84. const link = document.createElement('a');
  85. link.href = url;
  86. link.download = title +'.pdf';
  87. link.click();
  88. URL.revokeObjectURL(url);
  89. setTimeout(() => {
  90. // 关闭Loading
  91. loading.close();
  92. }, 1000);
  93. }
  94. };
  95. xhr.send()
  96. }
  97. },
  98. mounted() {},
  99. created() {
  100. }
  101. };
  102. </script>
  103. <style lang="scss" scoped>
  104. @media screen and (min-width: 751px) and (max-width: 9999px) {
  105. .content-box{
  106. width: 1200px;
  107. margin: 40px auto 0;
  108. .title{
  109. font-size: 18px;
  110. font-weight: bold;
  111. color: #333333;
  112. margin-bottom: 20px;
  113. }
  114. .v-content{
  115. margin: auto;
  116. .el-col-5{
  117. width: 20%;
  118. }
  119. .content{
  120. // height: 310px;
  121. background: #F4F8FF;
  122. // border-radius: 20px;
  123. border-radius: 5px 21px 21px 5px;
  124. padding:0 10px 10px;
  125. margin-bottom: 20px;
  126. cursor: pointer;
  127. &:hover{
  128. box-shadow: 0px 0px 18px 0px rgba(0,72,255,0.58);
  129. }
  130. .profile-img{
  131. width: 100%;
  132. }
  133. .text{
  134. font-size: 14px;
  135. line-height: 20px;
  136. word-wrap: break-word;
  137. margin-top: 4px;
  138. display: -webkit-box;
  139. -webkit-box-orient: vertical;
  140. -webkit-line-clamp: 2;
  141. overflow: hidden;
  142. }
  143. }
  144. }
  145. .v-one{
  146. margin-bottom: 20px;
  147. .content{
  148. padding: 20px 10px;
  149. }
  150. }
  151. }
  152. // 弹框
  153. .pop-up{
  154. position: fixed;
  155. top: 0;
  156. left: 0;
  157. right: 0;
  158. bottom: 0;
  159. background: rgba(0, 0, 0, 0.5);
  160. z-index: 99999;
  161. .pop_content{
  162. max-width: 1200px;
  163. width: 640px;
  164. background: #fff;
  165. position: absolute;
  166. top: 50%;
  167. left: 50%;
  168. transform: translate(-50%, -50%);
  169. padding: 10px;
  170. .pop_img{
  171. box-shadow: 0px 0px 18px 0px rgba(0,0,0,0.3);
  172. // margin-top: 20px;
  173. border-radius: 20px;
  174. position: relative;
  175. .hea_icon{
  176. position: absolute;
  177. top: 10px;
  178. right: 10px;
  179. color: #035AA8;
  180. font-size: 28px;
  181. font-weight: 600;
  182. cursor: pointer;
  183. }
  184. .image{
  185. display: block;
  186. width: 100%
  187. }
  188. }
  189. }
  190. }
  191. }
  192. @media screen and (min-width: 0px) and (max-width: 750px) {
  193. .content-box{
  194. width: 100%;
  195. margin: 40px auto 0;
  196. padding: 0 10px;
  197. .title{
  198. font-size: 18px;
  199. font-weight: bold;
  200. color: #333333;
  201. margin-bottom: 20px;
  202. }
  203. .v-content{
  204. margin: auto;
  205. // .el-col-5{
  206. // width: 33.%;
  207. // }
  208. .content{
  209. // height: 310px;
  210. background: #F4F8FF;
  211. // border-radius: 20px;
  212. border-radius: 5px 21px 21px 5px;
  213. padding:0 10px 10px;
  214. margin-bottom: 20px;
  215. cursor: pointer;
  216. &:hover{
  217. box-shadow: 0px 0px 18px 0px rgba(0,72,255,0.58);
  218. }
  219. .profile-img{
  220. width: 100%;
  221. }
  222. .text{
  223. font-size: 14px;
  224. line-height: 20px;
  225. word-wrap: break-word;
  226. margin-top: 4px;
  227. display: -webkit-box;
  228. -webkit-box-orient: vertical;
  229. -webkit-line-clamp: 2;
  230. overflow: hidden;
  231. }
  232. }
  233. }
  234. .v-one{
  235. margin-bottom: 20px;
  236. .content{
  237. padding: 20px 10px;
  238. }
  239. }
  240. }
  241. // 弹框
  242. .pop-up{
  243. position: fixed;
  244. top: 0;
  245. left: 0;
  246. right: 0;
  247. bottom: 0;
  248. background: rgba(0, 0, 0, 0.5);
  249. z-index: 99999;
  250. .pop_content{
  251. width:90%;
  252. background: #fff;
  253. position: absolute;
  254. top: 50%;
  255. left: 50%;
  256. transform: translate(-50%, -50%);
  257. padding: 10px;
  258. .pop_img{
  259. box-shadow: 0px 0px 18px 0px rgba(0,0,0,0.3);
  260. // margin-top: 20px;
  261. border-radius: 20px;
  262. position: relative;
  263. .hea_icon{
  264. position: absolute;
  265. top: 10px;
  266. right: 10px;
  267. color: #035AA8;
  268. font-size: 20px;
  269. font-weight: 600;
  270. cursor: pointer;
  271. }
  272. .image{
  273. display: block;
  274. width: 100%
  275. }
  276. }
  277. }
  278. }
  279. }
  280. </style>