introduction.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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="menu">
  7. <div class="top" @click="currentType = 'document'">
  8. <div>
  9. <svg-icon class="xiaoshiIcon" iconClass="说明书" iconName="说明书"></svg-icon>
  10. </div>
  11. <div>查看文档</div>
  12. </div>
  13. <div class="bottom" @click="currentType = 'video'">
  14. <div>
  15. <svg-icon class="xiaoshiIcon" iconClass="视频" iconName="视频"></svg-icon>
  16. </div>
  17. <div>查看演示视频</div>
  18. </div>
  19. </div>
  20. <div class="introduction_container">
  21. <!-- <div v-if="files && files.length" class="height_100 introduction_item_warp" >
  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. </div> -->
  32. <div v-show="currentType == 'document'" class="height_100 introduction_item_warp">
  33. <div v-if="documents && videos.length" class="height_100">
  34. <div class="introduction_item title" >
  35. <div v-for="(item,index) in documents" :key="index+'a'" class="title_item" @click="documentIndex = index">{{ (index + 1) + '、' + item.name }}
  36. <div v-if="index<documents.length-1" class="line"></div>
  37. </div>
  38. </div>
  39. <!-- <div v-for="(item,index) in documents" :key="index+'d'" class="introduction_item " >
  40. <iframe id="checkIframe" :src="getUrl(item)" frameborder="0" width="100%" :height="height - 200"></iframe>
  41. </div> -->
  42. <div class="introduction_item" >
  43. <iframe id="checkIframe" :src="getUrl(documents[documentIndex])" frameborder="0" width="100%" :height="height - 200"></iframe>
  44. </div>
  45. </div>
  46. <div class="empty" v-else>暂无介绍</div>
  47. </div>
  48. <div v-show="currentType == 'video'" class="height_100 introduction_item_warp">
  49. <div v-if="videos && videos.length">
  50. <div class="introduction_item title1">窍笔演示视频</div>
  51. <div v-for="(item,index) in videos" :key="index+'v'" class="introduction_item " >
  52. <myVideo :url="`${baseUrl}${item.url}`" :title="(index + 1) + '、'+item.name"></myVideo>
  53. </div>
  54. </div>
  55. <div class="empty" v-else>暂无介绍</div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import { Base64 } from 'js-base64';
  62. export default {
  63. components: {},
  64. props: {},
  65. data() {
  66. return {
  67. files:[],
  68. documents:[],
  69. documentIndex:0,
  70. videos:[],
  71. currentType:'document',
  72. baseUrl:'https://qiaobi-ai.com/static/',
  73. height:document.documentElement.clientHeight,
  74. };
  75. },
  76. watch: {},
  77. computed: {},
  78. created() {
  79. this.init()
  80. },
  81. mounted() {},
  82. methods: {
  83. async init(){
  84. await this.getIntroduction()
  85. },
  86. async getIntroduction(){
  87. let url = `/static/qiaobiConfig.json`
  88. await fetch(url).then(res => res.json() ).then(data => {
  89. if(data && data.length){
  90. data.forEach(item => {
  91. let type = this.getFileType(item)
  92. if(type == 'mp4'){
  93. this.videos.push(
  94. {
  95. type:type,
  96. url:item,
  97. name:item.slice(0, item.length - type.length - 1)
  98. }
  99. )
  100. }else{
  101. this.documents.push(
  102. {
  103. type:type,
  104. url:item,
  105. name:item.slice(0, item.length - type.length - 1)
  106. }
  107. )
  108. }
  109. this.files.push(
  110. {
  111. type:type,
  112. url:item,
  113. name:item.slice(0, item.length - type.length - 1)
  114. }
  115. )
  116. });
  117. }
  118. })
  119. },
  120. getFileType(file){
  121. let arr = file.split('.')
  122. if(arr && arr.length>0){
  123. return arr[arr.length-1]
  124. }
  125. return '';
  126. },
  127. getUrl(file){
  128. return `https://xsip.cn/onlinePreview/onlinePreview?url=` + encodeURIComponent(Base64.encode(this.baseUrl+file.url))
  129. },
  130. },
  131. };
  132. </script>
  133. <style lang="scss">
  134. .introduction{
  135. .el-carousel{
  136. height: calc(100% - 0px);
  137. width: 100%;
  138. }
  139. .el-carousel__container{
  140. height: calc(100% - 20px);
  141. width: 100%;
  142. }
  143. }
  144. </style>
  145. <style lang="scss" scoped>
  146. .introduction{
  147. position: relative;
  148. background: white;
  149. padding-bottom: 30px;
  150. padding-top: 10px;
  151. height:calc(100% - 50px);
  152. width: calc(100% - 0px);
  153. .logo{
  154. position: absolute;
  155. // top: 50px;
  156. // left: 50px;
  157. inset: 0;
  158. height: 100px;
  159. width: fit-content;
  160. z-index: 9999;
  161. .img{
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. .menu{
  167. width: 100px;
  168. height: 180px !important;
  169. position: absolute;
  170. left:calc((100% - 75%) / 2);
  171. top: calc(50% - 90px);
  172. margin: auto;
  173. font-size: 12px;
  174. cursor: pointer;
  175. .top{
  176. color: white;
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. flex-direction: column;
  181. height: 75px;
  182. background: #316192;
  183. border-radius: 8px 8px 0 0;
  184. border-bottom: 1px solid white;
  185. }
  186. .bottom{
  187. color: white;
  188. display: flex;
  189. align-items: center;
  190. justify-content: center;
  191. flex-direction: column;
  192. height: 75px;
  193. background: #b31d28;
  194. border-radius: 0 0 8px 8px ;
  195. border-top: 1px solid white;
  196. }
  197. .xiaoshiIcon{
  198. font-size: 24px;
  199. color: white !important;
  200. }
  201. }
  202. .introduction_container{
  203. margin-top: 30px;
  204. overflow-y: auto;
  205. padding: 0 30px;
  206. height:calc(100% - 30px);
  207. width: calc(100% - 60px);
  208. }
  209. .introduction_item_warp{
  210. border-radius: 8px;
  211. width: calc(75% + 40px);
  212. margin: auto;
  213. .title{
  214. border-bottom: 1px solid gray;
  215. display: flex;
  216. align-items: center;
  217. .title_item{
  218. min-width: 200px;
  219. overflow: hidden;
  220. white-space: nowrap;
  221. text-overflow:ellipsis;
  222. cursor: pointer;
  223. .line{
  224. width: 1px;
  225. height: 100%;
  226. background: gray;
  227. }
  228. }
  229. }
  230. .title1{
  231. position: sticky;
  232. top: 0;
  233. background: white;
  234. text-align: center;
  235. font-weight: bold;
  236. font-size: 18px;
  237. border-bottom: 1px solid gray;
  238. }
  239. }
  240. .introduction_item{
  241. margin-top: 20px;
  242. background: white;
  243. width: 75%;
  244. margin: auto;
  245. padding: 20px;
  246. // &:first-child{
  247. // border-radius: 8px 8px 0 0;
  248. // }
  249. // &:last-child{
  250. // border-radius:0 0 8px 8px ;
  251. // }
  252. .title{
  253. line-height: 35px;
  254. font-weight: bold;
  255. // color: white;
  256. color: black;
  257. }
  258. }
  259. .empty{
  260. font-size: 20px;
  261. color:#c2c5c9;
  262. text-align: center;
  263. line-height: 250px;
  264. }
  265. }
  266. </style>