ConferenceServices.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div>
  3. <div class="autoBox container-box">
  4. <div class="bread-crumb">
  5. <el-breadcrumb separator="/">
  6. <el-breadcrumb-item :to="{ path: 'home' }">{{$i18n.locale=='en'? 'Home': '首页'}}</el-breadcrumb-item>
  7. <el-breadcrumb-item>{{$i18n.locale=='en'? 'Conferences': '会议'}}</el-breadcrumb-item>
  8. </el-breadcrumb>
  9. </div>
  10. <div class="conference-recommend" v-if="bannerData.length">
  11. <div class="conference-recommend-header">
  12. <span>{{$t("common.UpcomingEvents")}}</span>
  13. </div>
  14. <div class="conference-recommend-body" style="background: #fff; padding: 20px">
  15. <el-carousel indicator-position="outside" arrow="never" :autoplay="true" :interval="5000" height="388px" style="cursor: pointer; background: #2c558a; padding-top: 70px;">
  16. <el-carousel-item v-for="(item,index) in bannerData" :key="index" style="background: #fff;">
  17. <div @click="toView('ConferenceDetail', item.id)">
  18. <!-- <img :src="item.flag?item.meetingPicUrl:'./api/fileextend/pub/'+item.meetingPicUrl + '?custom=400_260'" alt style="width: 100%;height: 260px; margin-top: 30px" /> -->
  19. <img v-if="item.flag" src="@/assets/img/conference/conference-noon.png" alt style="width: 100%;height: 260px; margin-top: 30px" />
  20. <img v-if="!item.flag" :src="'./api/fileextend/pub/'+item.meetingPicUrl + '?custom=400_260'" alt style="width: 100%;height: 260px; margin-top: 30px" />
  21. <div style="position: absolute; bottom: -18px; right: 28px; background: #2a548c; color: #fff; padding: 10px 20px; font-size: 18px">{{formatDate(item.meetingStartDate)}} - {{formatDate(item.meetingEndDate)}}</div>
  22. </div>
  23. <div style="display: table; height: 100%; padding: 0 30px; box-sizing: border-box; color: #2a548c" @click="toView('ConferenceDetail', item.id)">
  24. <div style="width: 100%; display: table-cell; vertical-align: middle;">
  25. <div
  26. style="font-size: 38px; line-height: 50px; font-weight: 700;"
  27. >{{$i18n.locale=='en'?item.meetingNameEn: item.meetingName}} </div>
  28. <div style="width: 100%;line-height: 45px;font-size: 14px;">
  29. <p style="font-size: 14px; font-weight: bold; margin: 0;">{{$i18n.locale=='en'?item.meetingPlaceEn: item.meetingPlace}}</p>
  30. <div
  31. class="plate"
  32. style="font-size: 16px; height: 150px; line-height: 30px; -webkit-box-orient: vertical;
  33. position:relative;
  34. line-height:1.4em;
  35. overflow: hidden;
  36. height:7em "
  37. >{{$i18n.locale=='en'?item.meetingIntroductionEn: item.meetingIntroduction}}</div>
  38. </div>
  39. </div>
  40. </div>
  41. </el-carousel-item>
  42. </el-carousel>
  43. </div>
  44. </div>
  45. <div class="conference-past">
  46. <div class="conference-recommend-header">
  47. <span>{{$t("common.PastEvents")}}</span>
  48. <div class="conference-search">
  49. <el-input :placeholder="$i18n.locale=='en'? 'Search events': '搜索会议'" v-model="conferenceKey" class="input-with-select" style="font-size: 18px">
  50. <el-button slot="append" icon="el-icon-search" style="font-size: 24px; color: #2c558a" @click="conferenceFilter"></el-button>
  51. </el-input>
  52. </div>
  53. </div>
  54. <div class="conference-recommend-body" v-if="conferenceData.length">
  55. <ul class="conference-recommend-list">
  56. <li :key="i" v-for="(item, i) in filteredData" @click="toView('ConferenceResult', item.id)">
  57. <!-- <div class="cover" :style="{'backgroundImage': 'url(./api/file/pub/'+item.meetingPicUrl+')'}"></div> -->
  58. <div class="cover" :style="{'backgroundImage': 'url(./api/fileextend/pub/'+item.meetingPicUrl+'?custom=400_260)'}"></div>
  59. <div class="conference-recommend-list-right">
  60. <p class="title">{{$i18n.locale=='en'?item.meetingNameEn: item.meetingName}}</p>
  61. <p>
  62. <span class="time">{{formatDate(item.meetingStartDate)}} - {{formatDate(item.meetingEndDate)}}</span>
  63. <span class="network" v-if="item.meetingMainFormDict == '02'">{{$i18n.locale=="en"? 'Network Meeting': '网络会议'}}</span>
  64. <span class="place" v-else>{{$i18n.locale=='en'?item.meetingPlaceEn: item.meetingPlace}}</span>
  65. </p>
  66. <p class="introduction plate">{{$i18n.locale=='en'?item.meetingIntroductionEn: item.meetingIntroduction}}</p>
  67. </div>
  68. </li>
  69. </ul>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import { getConfrences, getConfrencesEn, getsOutInfo } from "@/api/meeting/meetingOutInfo";
  77. import { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper'
  78. import 'vue-awesome-swiper/node_modules/swiper/dist/css/swiper.css'
  79. // import 'swiper/css/swiper.css';
  80. import { getToken } from "@/utils/auth";
  81. // import moment from 'moment-timezone';
  82. export default {
  83. name: "ConferenceServices",
  84. data() {
  85. return {
  86. i: 0,
  87. conferenceKey: '',
  88. activeVideo: '',
  89. showVideo: false,
  90. overlayIndex: -1,
  91. locale: "",
  92. bannerData: [],
  93. conferenceData: [],
  94. filteredData: [],
  95. resultData: [],
  96. newsData: [],
  97. materialData: [],
  98. };
  99. },
  100. watch: {
  101. "$i18n.locale"() {
  102. this.Myconference()
  103. },
  104. },
  105. mounted() {
  106. this.Myconference();
  107. getsOutInfo().then(res=>{
  108. // console.log('全部', res)
  109. res.data.meetingOutInfos.forEach(element => {
  110. if(element.outType == "NEWS"){
  111. this.newsData.push(element)
  112. }
  113. // if(element.outType == "VIDEO" && element.videoCover && element.videoUrl){
  114. // this.resultData.push(element)
  115. // }
  116. // if(element.outType == "FILE" && element.fileCover){
  117. // this.materialData.push(element)
  118. // }
  119. });
  120. this.newsData.splice(3);
  121. this.materialData.splice(3);
  122. // console.log('媒体', this.resultData)
  123. this.$nextTick(()=>{
  124. // this.activeVideo = this.resultData[0].videoUrl;
  125. this.swiperInit();
  126. })
  127. }).catch((error) => {
  128. // this.$message.error(error.msg);
  129. });
  130. },
  131. methods: {
  132. conferenceFilter(){
  133. if(this.conferenceKey == ''){
  134. this.filteredData = this.conferenceData;
  135. }else{
  136. this.filteredData = this.conferenceData.filter(item=>{
  137. return item.meetingName.includes(this.conferenceKey)>0 || item.meetingNameEn.includes(this.conferenceKey)>0
  138. })
  139. }
  140. if(!this.filteredData.length){
  141. this.$message.warning('未找到匹配的内容');
  142. }
  143. },
  144. videoPlay(i){
  145. this.overlayIndex = i;
  146. let selectVideo = document.getElementById('lastConferenceVideo');
  147. selectVideo.play();
  148. this.showVideo = true;
  149. },
  150. swiperInit(){
  151. let that = this;
  152. var galleryThumbs = new Swiper('.gallery-thumbs', {
  153. spaceBetween: 10,
  154. slidesPerView: 4,
  155. // loop: true,
  156. freeMode: true,
  157. loopedSlides: 5, //looped slides should be the same
  158. watchSlidesVisibility: true,
  159. watchSlidesProgress: true,
  160. });
  161. var galleryTop = new Swiper('.gallery-top', {
  162. spaceBetween: 10,
  163. // loop: true,
  164. autoplay: false,
  165. loopedSlides: 5, //looped slides should be the same
  166. navigation: {
  167. nextEl: '.swiper-button-next',
  168. prevEl: '.swiper-button-prev',
  169. },
  170. thumbs: {
  171. swiper: galleryThumbs,
  172. },
  173. on: {
  174. slideChangeTransitionStart: function(){
  175. that.showVideo = false;
  176. that.activeVideo = that.resultData[this.activeIndex].videoUrl;
  177. },
  178. },
  179. });
  180. },
  181. // 判断会议是否结束
  182. isMeetingOver(t){
  183. var ct = Date.parse(new Date());
  184. if(ct-t > 0){
  185. return true;
  186. }else{
  187. return false;
  188. }
  189. },
  190. // 时间戳转时间格式
  191. formatDate(t) {
  192. if(!t){
  193. return ''
  194. }else{
  195. var original = new Date(t);
  196. var year=original.getFullYear();
  197. var month=original.getMonth()+1;
  198. var date=original.getDate();
  199. var hour=original.getHours();
  200. var minute=original.getMinutes();
  201. var second=original.getSeconds();
  202. // return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
  203. return year+"/"+month+"/"+date;
  204. // return moment(t).format('YYYY/MM/DD');
  205. }
  206. },
  207. toView(router, id) {
  208. localStorage.setItem('conferenceId', id);
  209. this.$router.push({ path: router , query: { key: id }});
  210. },
  211. //获取中文会议或英文会议
  212. Myconference(){
  213. if(this.$i18n.locale=='en'){
  214. getConfrencesEn().then(res=>{
  215. this.bannerData = [];
  216. this.conferenceData = [];
  217. res.data.meetingBasicInfos.forEach(item=>{
  218. if(!item.meetingPicUrl){
  219. this.$set(item,'flag','true');
  220. }
  221. // 报名未开始会议
  222. if(!this.isMeetingOver(item.meetingEndDate) && item.meetingIsShow=="01" && item.meetingIsEnroll=="01"){
  223. this.bannerData.push(item)
  224. }
  225. // 已结束会议
  226. if(this.isMeetingOver(item.meetingEndDate) && item.meetingIsShow=="01"){
  227. this.conferenceData.push(item)
  228. }
  229. })
  230. this.filteredData = this.conferenceData;
  231. })
  232. }else{
  233. getConfrences().then(res=>{
  234. // console.log('6666666666666',res)
  235. // this.conferenceData = res.data.meetingBasicInfos.filter((item)=>{
  236. // return item.meetingIsShow == '01';
  237. // })
  238. this.bannerData = [];
  239. this.conferenceData = [];
  240. res.data.meetingBasicInfos.forEach(item=>{
  241. if(!item.meetingPicUrl){
  242. this.$set(item,'flag','true');
  243. }
  244. // 报名未开始会议
  245. if(!this.isMeetingOver(item.meetingEndDate) && item.meetingIsShow=="01" && item.meetingIsEnroll=="01"){
  246. this.bannerData.push(item)
  247. }
  248. // 已结束会议
  249. if(this.isMeetingOver(item.meetingEndDate) && item.meetingIsShow=="01"){
  250. this.conferenceData.push(item)
  251. }
  252. })
  253. this.filteredData = this.conferenceData;
  254. console.log('奇了怪了',this.bannerData)
  255. // console.log('会议', this.conferenceData)
  256. })
  257. };
  258. }
  259. },
  260. };
  261. </script>
  262. <style scoped>
  263. #lastConferenceVideo{
  264. width: 100%;
  265. height: 100%;
  266. position: absolute;
  267. top: 0;
  268. left: 0;
  269. z-index: 9;
  270. }
  271. *{
  272. box-sizing: border-box;
  273. }
  274. .container-box {
  275. margin: 10px auto;
  276. /* background: #fff; */
  277. /* padding: 0 20px; */
  278. min-height: calc( 100vh - 420px )
  279. }
  280. .bread-crumb {
  281. background: #fff;
  282. padding: 20px;
  283. }
  284. body {
  285. margin: 0;
  286. }
  287. .el-carousel__item > div:nth-child(1) {
  288. font-size: 18px;
  289. margin: 0;
  290. float: left;
  291. width: 35%;
  292. position: relative;
  293. }
  294. .el-carousel__item > div:nth-child(2) {
  295. font-size: 18px;
  296. margin: 0;
  297. float: right;
  298. width: 65%;
  299. }
  300. .conference-recommend{
  301. }
  302. .conference-past .conference-recommend-header{
  303. margin-top: 20px;
  304. }
  305. .conference-recommend-header{
  306. position: relative;
  307. line-height: 40px;
  308. padding: 20px 0;
  309. }
  310. .conference-recommend-header img{
  311. vertical-align: middle;
  312. }
  313. .conference-recommend-header span{
  314. vertical-align: middle;
  315. font-size: 24px;
  316. font-weight: bold;
  317. border-bottom: 4px solid #2c558a;
  318. display: inline-block;
  319. padding-bottom: 4px;
  320. /* margin-left: 16px; */
  321. }
  322. .conference-search{
  323. background: #2c558a;
  324. padding: 20px 300px;
  325. margin-top: 20px;
  326. }
  327. .conference-recommend-header div:hover{
  328. color: #333;
  329. }
  330. .conference-recommend-body{
  331. /* display: flex;
  332. justify-content: space-between; */
  333. font-size: 16px;
  334. color: #555;
  335. /* min-height: 693px; */
  336. }
  337. .conference-recommend-body .cover{
  338. width: 100%;
  339. background-size: 100% 100%;
  340. }
  341. .conference-recommend-body .title{
  342. font-size: 18px;
  343. font-weight: bold;
  344. color: #333;
  345. margin-bottom: 20px;
  346. margin-top: 10px;
  347. }
  348. .conference-recommend-list{
  349. /* width: 55%; */
  350. display: flex;
  351. flex-wrap: wrap;
  352. }
  353. .conference-recommend-list .introduction{
  354. height: 106px;
  355. line-height: 28px;
  356. -webkit-box-orient: vertical;
  357. position:relative;
  358. line-height:1.4em;
  359. overflow: hidden;
  360. height:7em
  361. }
  362. .conference-recommend-list .cover{
  363. height: 220px;
  364. width: 320px;
  365. }
  366. .conference-recommend-list .title{
  367. overflow: hidden;
  368. color: #2c558a;
  369. font-size: 24px;
  370. line-height: 24px;
  371. margin-top: 0;
  372. }
  373. .conference-recommend-list li{
  374. width: 100%;
  375. /* padding: 10px; */
  376. position: relative;
  377. cursor: pointer;
  378. display: flex;
  379. padding: 20px;
  380. background: #fff;
  381. margin-bottom: 20px;
  382. }
  383. .conference-recommend-list-right{
  384. flex: 1;
  385. margin-left: 20px;
  386. }
  387. .conference-recommend-list-right p span{
  388. margin-right: 20px;
  389. }
  390. .conference-recommend-list .status{
  391. width: 80px;
  392. line-height: 26px;
  393. position: absolute;
  394. top: 0px;
  395. right: 0px;
  396. background: #e43f3f;
  397. color: #fff;
  398. font-size: 14px;
  399. text-align: center;
  400. border-radius: 0px 0px 0px 13px;
  401. }
  402. .conference-result-body{
  403. display: flex;
  404. }
  405. .conference-result-left{
  406. width: 45%;
  407. }
  408. .conference-result-right{
  409. width: 54%;
  410. padding: 10px;
  411. margin-left: 1%;
  412. }
  413. .conference-result-item {
  414. padding-bottom: 20px;
  415. }
  416. .conference-result-title {
  417. height: 20px;
  418. line-height: 20px;
  419. font-size: 17px;
  420. font-weight: bold;
  421. border-left: 4px solid #2c558a;
  422. padding-left: 10px;
  423. margin: 30px 0;
  424. }
  425. .conference-news-list{
  426. width: 100%;
  427. font-size: 16px;
  428. color: #333;
  429. }
  430. .conference-news-list li{
  431. display: flex;
  432. cursor: pointer;
  433. line-height: 48px;
  434. border-bottom: 1px dashed #999;
  435. }
  436. .conference-news-list li p{
  437. flex: 1;
  438. width: 100%;
  439. overflow: hidden;
  440. text-overflow: ellipsis;
  441. white-space: nowrap;
  442. margin: 0;
  443. }
  444. .conference-news-list li span{
  445. color: #666;
  446. margin-left: 20px;
  447. }
  448. .conference-material-list{
  449. width: 100%;
  450. display: flex;
  451. justify-content: space-between;
  452. }
  453. .conference-material-list li{
  454. width: 30%;
  455. cursor: pointer;
  456. }
  457. .conference-material-list li img{
  458. width: 100%;
  459. }
  460. .conference-material-list li p{
  461. text-align: center;
  462. margin: 0;
  463. }
  464. .swiper-container {
  465. width: 100%;
  466. height: 300px;
  467. margin-left: auto;
  468. margin-right: auto;
  469. --swiper-navigation-color: #68b2f8;
  470. --swiper-navigation-size: 30px;
  471. }
  472. .swiper-slide {
  473. background-size: cover;
  474. background-position: center;
  475. }
  476. .gallery-top {
  477. height: 80%;
  478. width: 100%;
  479. }
  480. .gallery-thumbs {
  481. height: 20%;
  482. box-sizing: border-box;
  483. padding: 10px 0;
  484. }
  485. .gallery-thumbs .swiper-slide {
  486. height: 100%;
  487. opacity: 0.4;
  488. }
  489. .gallery-thumbs .swiper-slide-thumb-active {
  490. opacity: 1;
  491. }
  492. .overlay-box{
  493. width: 100%;
  494. height: 100%;
  495. position: absolute;
  496. top: 0;
  497. left: 0;
  498. background-size: cover;
  499. text-align: center;
  500. z-index: 9;
  501. }
  502. .overlay-box > img{
  503. position: absolute;
  504. top: 50%;
  505. left: 50%;
  506. margin-top: -50px;
  507. margin-left: -50px;
  508. opacity: 0.7;
  509. cursor: pointer;
  510. }
  511. .overlay-box > img:hover{
  512. opacity: 1;
  513. }
  514. .conference-video-title{
  515. margin: 0;
  516. width: 100%;
  517. height: 40px;
  518. text-align: center;
  519. line-height: 40px;
  520. font-size: 18px;
  521. font-weight: bold;
  522. color: #fff;
  523. background: rgba(0, 0, 0, 0.6);
  524. overflow: hidden;
  525. text-overflow:ellipsis;
  526. white-space: nowrap;
  527. position: absolute;
  528. top: -40px;
  529. left: 0;
  530. z-index: 999;
  531. transition: all 0.5s;
  532. }
  533. .swiper-slide:hover .conference-video-title{
  534. top: 0;
  535. }
  536. .conference-recommend >>> .el-carousel__indicators--outside {
  537. text-align: right;
  538. padding-right: 50px;
  539. }
  540. .conference-recommend >>> .el-carousel__button {
  541. opacity: 1;
  542. width: 16px;
  543. height: 16px;
  544. border-radius: 50%;
  545. background-color: #FFF;
  546. -webkit-transition: .3s;
  547. transition: .3s;
  548. }
  549. .conference-recommend >>> .el-carousel__indicator.is-active button {
  550. background-color: rgb(21, 255, 0);
  551. }
  552. </style>