HealthDetail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="main_right_height">
  3. <div class="">
  4. <div class="">
  5. <TopDes :flag="true" topDesFont="健康常识"></TopDes>
  6. <!-- <el-row>
  7. <el-col :span="1">&nbsp;</el-col>
  8. <el-col :span="22" class="navigation_card">
  9. <div style="display: flex">
  10. <i
  11. class="el-icon-arrow-left"
  12. style="cursor: pointer; line-height: 1.5"
  13. @click="goBack()"
  14. ></i>
  15. <span class="musicTitle">健康常识</span>
  16. </div>
  17. </el-col>
  18. <el-col :span="1"> &nbsp; </el-col>
  19. </el-row> -->
  20. <el-row>
  21. <el-col :span="1">&nbsp;</el-col>
  22. <el-col :span="22">
  23. <el-col>
  24. <div
  25. class="flood-plan-page"
  26. ref="healthFlow"
  27. style="display: block; height: 80vh; margin-top: 10px"
  28. >
  29. <iframe :src="url" frameborder="0" width='100%' height='100%' scrolling='yes'></iframe>
  30. </div>
  31. <!-- <div v-html='content'></div> -->
  32. </el-col>
  33. </el-col>
  34. <el-col :span="1">&nbsp;</el-col>
  35. </el-row>
  36. <el-row> </el-row>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import { session } from "electron";
  43. const fs = require("fs");
  44. export default {
  45. data() {
  46. return {
  47. url: "",
  48. content:''
  49. };
  50. },
  51. //页面初始化函数
  52. created() {},
  53. mounted() {
  54. this.$route.query.name;
  55. this.$route.query.currentUrl;
  56. this.url = this.$route.query.currentUrl + this.$route.query.name+'\\index.html';
  57. console.log(this.url);
  58. this.readFileContent();
  59. },
  60. methods: {
  61. readFileContent(){
  62. this.content= fs.readFileSync(this.url)
  63. },
  64. goBack() {
  65. this.$router.go(-1);
  66. },
  67. },
  68. };
  69. </script>
  70. <style scoped>
  71. .provinceClass >>> .el-input__inner {
  72. border-radius: 20px;
  73. border: 0px;
  74. background-color: #f4f4f4;
  75. }
  76. .wrap {
  77. width: 1280px;
  78. margin: 0 auto;
  79. }
  80. .cardList ul {
  81. display: flex;
  82. min-height: 562px;
  83. justify-content: flex-start;
  84. flex-wrap: wrap;
  85. }
  86. .cardList ul li {
  87. width: 180px;
  88. height: 221px;
  89. background: rgb(255, 255, 255);
  90. box-shadow: 0px 3px 6px rgb(87, 172, 187);
  91. border-radius: 4px;
  92. margin: 30px 35px;
  93. cursor: pointer;
  94. }
  95. @media screen and (max-width: 1024px) {
  96. .cardList ul li {
  97. margin: 30px 10px;
  98. }
  99. .wrap {
  100. width: 100%;
  101. margin: 0;
  102. }
  103. }
  104. .cardList ul li img {
  105. width: 180px;
  106. height: 112px;
  107. }
  108. .cardList ul li h2 {
  109. width: 142px;
  110. font-size: 18px;
  111. font-family: PingFang SC;
  112. font-weight: 500;
  113. line-height: 25px;
  114. color: #333333;
  115. margin-left: 9px;
  116. overflow: hidden;
  117. text-overflow: ellipsis;
  118. white-space: nowrap;
  119. }
  120. .cardList ul li p {
  121. font-size: 16px;
  122. color: #666666;
  123. }
  124. .cardList ul li .content {
  125. font-size: 12px;
  126. font-family: PingFang SC;
  127. font-weight: 400;
  128. line-height: 20px;
  129. color: #999999;
  130. margin-left: 9px;
  131. }
  132. .goDetail {
  133. margin: 5px 0 10px 9px;
  134. }
  135. .goDetail a {
  136. font-size: 14px;
  137. font-family: PingFang SC;
  138. font-weight: 400;
  139. line-height: 20px;
  140. color: #57acbb;
  141. }
  142. .pageNationBox {
  143. padding: 20px 10px;
  144. text-align: center;
  145. }
  146. .view-text {
  147. /**
  148. 思路:
  149. 1.设置inline-block属相
  150. 2.强制不换行
  151. 3.固定高度
  152. 4.隐藏超出部分
  153. 5.显示“……”
  154. */
  155. display: inline-block;
  156. word-break: keep-all;
  157. white-space: nowrap;
  158. width: 960px;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. }
  162. .imgSiz {
  163. width: 120px;
  164. height: 75px;
  165. margin-right: 15px;
  166. }
  167. .main_right_height {
  168. height: 100vh !important;
  169. display: block !important;
  170. overflow-y: auto !important;
  171. background: #fff;
  172. }
  173. .card {
  174. background: #fff;
  175. box-shadow: 0 3px 6px #57acbb;
  176. border-radius: 4px;
  177. display: block;
  178. margin-left: 20px;
  179. margin-right: 20px;
  180. margin-bottom: 80px;
  181. }
  182. .img_card {
  183. width: 100%;
  184. height: 100%;
  185. }
  186. .h3_card {
  187. font-size: 18px;
  188. font-family: PingFang SC;
  189. font-weight: 500;
  190. line-height: 20px;
  191. color: #333;
  192. margin-left: 9px;
  193. overflow: hidden;
  194. text-overflow: ellipsis;
  195. white-space: nowrap;
  196. }
  197. .time_card {
  198. font-size: 12px;
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. line-height: 15px;
  202. color: rgb(171, 168, 168);
  203. margin-left: 9px;
  204. overflow: hidden;
  205. text-overflow: ellipsis;
  206. white-space: nowrap;
  207. }
  208. .xl_input >>> .el-input__inner {
  209. border: 0;
  210. border-radius: 20px;
  211. background-color: #f4f4f4;
  212. }
  213. .search_card {
  214. margin-left: 20px;
  215. margin-bottom: 20px;
  216. }
  217. .navigation_card {
  218. margin-left: 20px;
  219. }
  220. </style>