introduction copy.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="introduction" :style="`background-image:url(${require('@/assets/image/background_home.jpg')})`">
  3. <div class="logo">
  4. <el-image :src="require('@/assets/image/logo3.png')" class="img" fit="contain"></el-image>
  5. </div>
  6. <div class="introduction_container">
  7. <div v-if="files && files.length" class="height_100 introduction_item_warp" >
  8. <div class="menu">
  9. <div class="top">
  10. <div>
  11. <svg-icon class="xiaoshiIcon" iconClass="说明书" iconName="说明书"></svg-icon>
  12. </div>
  13. <div>查看文档</div>
  14. </div>
  15. <div class="bottom">
  16. <div>
  17. <svg-icon class="xiaoshiIcon" iconClass="视频" iconName="视频"></svg-icon>
  18. </div>
  19. <div>查看演示视频</div>
  20. </div>
  21. </div>
  22. <div v-for="(item,index) in files" :key="index" class="introduction_item " >
  23. <div v-if="item.type != 'mp4'" style="width:100%;height:100%">
  24. <div class="title" >{{ (index + 1) + '、' + item.name }}</div>
  25. <iframe id="checkIframe" :src="getUrl(item)" frameborder="0" width="100%" height="800px"></iframe>
  26. </div>
  27. <div v-else class="video">
  28. <myVideo :url="`${baseUrl}${item.url}`" :title="(index + 1) + '、'+item.name"></myVideo>
  29. </div>
  30. </div>
  31. <!-- <el-carousel :autoplay="false" arrow="hover">
  32. <el-carousel-item v-for="(item,index) in files" :key="index" class="introduction_item height_100" >
  33. <div v-if="item.type != 'mp4'" style="width:100%;height:100%">
  34. <div class="title" >{{ item.url }}</div>
  35. <iframe id="checkIframe" :src="getUrl(item)" frameborder="0" width="100%" height="90%"></iframe>
  36. </div>
  37. <div v-else class="height_100">
  38. <myVideo :url="`${baseUrl}${item.url}`" :title="item.url"></myVideo>
  39. </div>
  40. </el-carousel-item>
  41. </el-carousel> -->
  42. </div>
  43. <div class="empty" v-else>暂无介绍</div>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import { Base64 } from 'js-base64';
  49. export default {
  50. components: {},
  51. props: {},
  52. data() {
  53. return {
  54. files:[],
  55. baseUrl:'https://xsip.cn/static/'
  56. };
  57. },
  58. watch: {},
  59. computed: {},
  60. created() {
  61. this.init()
  62. },
  63. mounted() {},
  64. methods: {
  65. async init(){
  66. await this.getIntroduction()
  67. },
  68. async getIntroduction(){
  69. let url = `/static/qiaobiConfig.json`
  70. await fetch(url).then(res => res.json() ).then(data => {
  71. if(data && data.length){
  72. data.forEach(item => {
  73. let type = this.getFileType(item)
  74. this.files.push(
  75. {
  76. type:type,
  77. url:item,
  78. name:item.slice(0, item.length - type.length - 1)
  79. }
  80. )
  81. });
  82. }
  83. })
  84. },
  85. getFileType(file){
  86. let arr = file.split('.')
  87. if(arr && arr.length>0){
  88. return arr[arr.length-1]
  89. }
  90. return '';
  91. },
  92. getUrl(file){
  93. return `https://xsip.cn/onlinePreview/onlinePreview?url=` + encodeURIComponent(Base64.encode(this.baseUrl+file.url))
  94. },
  95. },
  96. };
  97. </script>
  98. <style lang="scss">
  99. .introduction{
  100. .el-carousel{
  101. height: calc(100% - 0px);
  102. width: 100%;
  103. }
  104. .el-carousel__container{
  105. height: calc(100% - 20px);
  106. width: 100%;
  107. }
  108. }
  109. </style>
  110. <style lang="scss" scoped>
  111. .introduction{
  112. position: relative;
  113. background: white;
  114. padding-bottom: 30px;
  115. padding-top: 10px;
  116. height:calc(100% - 50px);
  117. width: calc(100% - 0px);
  118. .logo{
  119. position: absolute;
  120. // top: 50px;
  121. // left: 50px;
  122. inset: 0;
  123. height: 100px;
  124. width: fit-content;
  125. z-index: 9999;
  126. .img{
  127. width: 100%;
  128. height: 100%;
  129. }
  130. }
  131. .introduction_container{
  132. margin-top: 30px;
  133. overflow-y: auto;
  134. padding: 0 30px;
  135. height:calc(100% - 30px);
  136. width: calc(100% - 60px);
  137. }
  138. .introduction_item_warp{
  139. border-radius: 8px;
  140. width: calc(75% + 40px);
  141. margin: auto;
  142. .menu{
  143. width: 100px;
  144. height: 180px !important;
  145. position: absolute;
  146. left:calc((100% - 75%) / 2);
  147. top: calc(50% - 90px);
  148. margin: auto;
  149. font-size: 12px;
  150. cursor: pointer;
  151. .top{
  152. color: white;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. flex-direction: column;
  157. height: 75px;
  158. background: #316192;
  159. border-radius: 8px 8px 0 0;
  160. border-bottom: 1px solid white;
  161. }
  162. .bottom{
  163. color: white;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. flex-direction: column;
  168. height: 75px;
  169. background: #b31d28;
  170. border-radius: 0 0 8px 8px ;
  171. border-top: 1px solid white;
  172. }
  173. .xiaoshiIcon{
  174. font-size: 24px;
  175. color: white !important;
  176. }
  177. }
  178. }
  179. .introduction_item{
  180. margin-top: 20px;
  181. background: white;
  182. width: 75%;
  183. margin: auto;
  184. padding: 20px;
  185. // &:first-child{
  186. // border-radius: 8px 8px 0 0;
  187. // }
  188. // &:last-child{
  189. // border-radius:0 0 8px 8px ;
  190. // }
  191. .title{
  192. line-height: 35px;
  193. font-weight: bold;
  194. // color: white;
  195. color: black;
  196. }
  197. }
  198. .empty{
  199. font-size: 20px;
  200. color:#c2c5c9;
  201. text-align: center;
  202. line-height: 250px;
  203. }
  204. }
  205. </style>