speaker.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="point-containor">
  3. <ul class="nav-point-list" style="width: 100px">
  4. <template v-for="(item, i) in navPointList">
  5. <li v-if="item.isShow" :class="{'nav-active': navIndex==i}" :key="i" @click="viewPointChange(i)">{{$i18n.locale=='en'? item.textEn: item.text}}</li>
  6. </template>
  7. </ul>
  8. <div class="point-content">
  9. <div v-if="navIndex==0 && viewpointData.length">
  10. <ul class="text-point-list">
  11. <template v-for="(item, i) in viewpointData">
  12. <li v-if="i < viewNum" :key="i" @click="toView('ConfrenceViewpoint', item.id)">
  13. <div
  14. :style="{width: '100%', height: '220px', backgroundImage: 'url(./api/file/pub/'+item.list[0].attachmentSavePath+')', backgroundSize: '100% 100%'}"
  15. ></div>
  16. <p class="position"><span>{{lang=='en'? item.positionEn: item.position}}</span></p>
  17. <p class="speakguest"><span>{{lang=='en'? item.speakGuestEn: item.speakGuest}}</span></p>
  18. <p class="confrence-viewpoint-text plate">{{lang=='en'? item.ideaContentEn: item.ideaContent}}</p>
  19. </li>
  20. </template>
  21. </ul>
  22. <div class="more" v-if="viewNum <= viewpointData.length">
  23. <i @click="viewNum+=6" class="el-icon-d-arrow-right"></i>
  24. </div>
  25. </div>
  26. <div v-if="navIndex==1 && materialData.length">
  27. <ul class="conference-material">
  28. <template v-for="(item, i) in materialData">
  29. <li :key="i" v-if="item.languageType == $i18n.locale">
  30. <div
  31. :style="{width: '100%', height: '220px', backgroundImage: 'url(./api/file/pub/'+item.fileCover+')', backgroundSize: '100% 100%'}"
  32. ></div>
  33. <!-- <div style="width: 100%; text-align: center;">
  34. <img style="max-width: 100%;" :src="'./api/file/pub/'+item.fileCover" alt="">
  35. </div> -->
  36. <p>{{lang=='en'? item.titleEn: item.title}}</p>
  37. <a href="" @click="downLoad($event, item)"></a>
  38. </li>
  39. </template>
  40. </ul>
  41. <LoginReminder ref="loginReminder"></LoginReminder>
  42. </div>
  43. <div v-if="navIndex==2 && videoData.length">
  44. <ul class="video-point-list">
  45. <li v-for="(item, i) in videoData" :key="i" @click="playVideo(item.videoUrl)">
  46. <div class="img-content" :style="{ backgroundImage: item.videoCover?'url(./api/file/pub/'+item.videoCover+')': '#000'}">
  47. <img class="play-img" width="100" height="100" src="@/assets/img/conference/player.png" alt />
  48. </div>
  49. <p class="title">{{lang=='en'? item.titleEn: item.title}}</p>
  50. </li>
  51. </ul>
  52. <div class="mask" v-show="maskShow" @click="closeMask">
  53. <video
  54. :src="currentUrl" width="500" height="350" controls="controls"
  55. id="ConferenceResultVideo">
  56. Your browser does not support the video tag.
  57. </video>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import { getConfrenceDetail } from "@/api/meeting/meetingOutInfo";
  65. import LoginReminder from '../LoginReminder'
  66. export default {
  67. components: { LoginReminder },
  68. data(){
  69. return {
  70. navIndex: 0,
  71. navPointList: [
  72. {text: '图文观点', textEn: 'Graphic view', isShow: false},
  73. {text: '文件观点', textEn: 'File view', isShow: false},
  74. {text: '视频观点', textEn: 'Video view', isShow: false}],
  75. viewpointData: [],
  76. materialData: [],
  77. materialDefaultData:[],
  78. videoData: [],
  79. currentUrl: '',
  80. maskShow: false,
  81. lang: '',
  82. viewNum: 6,
  83. typeNum: 0
  84. }
  85. },
  86. created(){
  87. this.lang = this.$i18n.locale;
  88. console.log('111')
  89. },
  90. watch: {
  91. '$i18n.locale'(val){
  92. this.lang = val;
  93. console.log("切换语言")
  94. this.navPointList[1].isShow = false;
  95. if(this.materialData.length){
  96. //this.navPointList[1].isShow = true;
  97. //this.typeNum++;
  98. this.materialDefaultData = this.materialData.filter(item => item.languageType == this.lang)
  99. console.log("materialDefaultData" , this.materialDefaultData.length)
  100. if (this.materialDefaultData.length){
  101. this.navPointList[1].isShow = true;
  102. if (this.viewpointData.length == 0){
  103. this.navIndex = 1;
  104. }
  105. }
  106. }
  107. if(this.videoData.length){
  108. this.navPointList[2].isShow = true;
  109. //this.typeNum++;
  110. if(this.viewpointData.length==0 && this.materialDefaultData.length==0){
  111. this.navIndex = 2;
  112. }
  113. }
  114. }
  115. },
  116. mounted(){
  117. getConfrenceDetail(this.$route.query.key).then((res) => {
  118. this.viewpointData = res.data.meetingOutInfo.guandian;
  119. this.materialData = res.data.meetingOutInfo.guandian_file;
  120. this.videoData = res.data.meetingOutInfo.guandian_video;
  121. if(this.viewpointData.length){
  122. this.navPointList[0].isShow = true;
  123. this.navIndex = 0;
  124. //this.typeNum++;
  125. }
  126. if(this.materialData.length){
  127. //this.navPointList[1].isShow = true;
  128. //this.typeNum++;
  129. this.materialDefaultData = this.materialData.filter(item => item.languageType == this.lang)
  130. console.log("materialDefaultData" , this.materialDefaultData.length)
  131. if (this.materialDefaultData.length){
  132. this.navPointList[1].isShow = true;
  133. if (this.viewpointData.length == 0){
  134. this.navIndex = 1;
  135. }
  136. }
  137. }
  138. if(this.videoData.length){
  139. this.navPointList[2].isShow = true;
  140. //this.typeNum++;
  141. if(this.viewpointData.length==0 && this.materialDefaultData.length==0){
  142. this.navIndex = 2;
  143. }
  144. }
  145. // console.log('观点',this.viewpointData)
  146. });
  147. },
  148. methods: {
  149. closeMask(){
  150. this.maskShow = false;
  151. let videoEl = document.getElementById('ConferenceResultVideo');
  152. videoEl.pause();
  153. },
  154. playVideo(url){
  155. this.currentUrl = './api/file/pub/'+ url;
  156. this.maskShow = true;
  157. let videoEl = document.getElementById('ConferenceResultVideo');
  158. videoEl.play();
  159. },
  160. downLoad(e, item){
  161. if(this.$Cookies.get('token')){
  162. let el = e.target;
  163. el.setAttribute("href",'./api/file/pub/'+item.list[0].attachmentSavePath)
  164. el.setAttribute('download', this.lang=='en'? item.titleEn: item.title)
  165. }else{
  166. e.preventDefault();
  167. this.$refs.loginReminder.activeChange();
  168. }
  169. },
  170. viewPointChange(i){
  171. this.navIndex = i;
  172. },
  173. toView(router, json) {
  174. this.$router.push({ path: router, query: { key: json } });
  175. },
  176. }
  177. }
  178. </script>
  179. <style scoped>
  180. *{
  181. box-sizing: border-box;
  182. }
  183. .point-containor{
  184. display: flex;
  185. }
  186. .nav-point-list{
  187. padding-top: 16px;
  188. line-height: 40px;
  189. }
  190. .nav-point-list li{
  191. color: #666;
  192. cursor: pointer;
  193. }
  194. .nav-point-list li.nav-active{
  195. color: #02a7f0;
  196. }
  197. .point-content{
  198. flex: 1;
  199. }
  200. .video-point-list{
  201. display: flex;
  202. flex-wrap: wrap;
  203. padding: 20px 10px;
  204. }
  205. .video-point-list li{
  206. width: 33.3%;
  207. min-height: 247px;
  208. padding: 10px;
  209. }
  210. .img-content{
  211. width: 100%;
  212. height: 240px;
  213. position: relative;
  214. background-size: 100% 100%;
  215. }
  216. .img-content img{
  217. position: absolute;
  218. top: 50%;
  219. left: 50%;
  220. transform: translate(-50%, -50%);
  221. cursor: pointer;
  222. opacity: 0.8;
  223. }
  224. .img-content img:hover{
  225. opacity: 1;
  226. }
  227. .title{
  228. text-align: center;
  229. margin: 10px 0;
  230. }
  231. video{
  232. background: #000;
  233. border: 1px solid #000;
  234. }
  235. .mask{
  236. width: 100vw;
  237. height: 100vh;
  238. position: fixed;
  239. top: 0;
  240. left: 0;
  241. background: rgba(0 ,0 , 0, 0.7);
  242. z-index: 9;
  243. }
  244. .mask video{
  245. max-width: 100%;
  246. position: absolute;
  247. top: 50%;
  248. left: 50%;
  249. transform: translate(-50%, -50%);
  250. outline: none;
  251. }
  252. .conference-material{
  253. display: flex;
  254. flex-wrap: wrap;
  255. padding: 20px 10px;
  256. }
  257. .conference-material li{
  258. width: 33.3%;
  259. box-sizing: border-box;
  260. padding: 0 10px;
  261. position: relative;
  262. }
  263. .conference-material p{
  264. color: #333;
  265. text-align: center;
  266. font-weight: bold;
  267. word-break: break-all;
  268. }
  269. .conference-material a{
  270. display: block;
  271. text-decoration: none;
  272. position: absolute;
  273. width: 100%;
  274. height: 100%;
  275. top: 0;
  276. left: 0;
  277. }
  278. .conference-material li:hover p{
  279. color:#dd541a
  280. }
  281. .text-point-list{
  282. display: flex;
  283. flex-wrap: wrap;
  284. padding: 20px 10px;
  285. min-height: 350px;
  286. }
  287. .text-point-list li{
  288. width: 30%;
  289. margin: 0 1.5%;
  290. padding: 10px;
  291. cursor: pointer;
  292. transition: box-shadow .5s;
  293. }
  294. .text-point-list li:hover{
  295. box-shadow: 0px 0px 5px #999;
  296. }
  297. .position{
  298. font-size: 16px;
  299. color: #7f7f7f;
  300. }
  301. .speakguest{
  302. text-align: right;
  303. font-size: 16px;
  304. }
  305. .confrence-viewpoint-text{
  306. font-size: 15px;
  307. line-height: 26px;
  308. color: #aaa;
  309. -webkit-box-orient: vertical;
  310. position:relative;
  311. line-height:1.4em;
  312. overflow: hidden;
  313. height:5.6em;
  314. }
  315. .more{
  316. text-align: center;
  317. font-weight: bold;
  318. font-size: 36px;
  319. }
  320. .more i{
  321. transform: rotate(90deg);
  322. }
  323. .more i:hover{
  324. cursor: pointer;
  325. color: #d15023
  326. }
  327. </style>