NationaIntroductionCommitteeActivities.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. <template>
  2. <div class="autoBox box" style="position: relative;">
  3. <!-- 轮播图 -->
  4. <el-carousel interval=5000 indicator-position="outside">
  5. <el-carousel-item v-for="(item,index) in initList" :key="'init'+index" v-if="index < 5" style="cursor:pointer;">
  6. <div @click="addBrowse(item.entityId);toView('nationalregionalCommissionsDetailds',item.entityId)">
  7. <img :src="'api/file/pub/' + item.activityLogo" alt="" style="width: 100%;height: 350px;">
  8. </div>
  9. <div class="activity" @click="addBrowse(item.entityId);toView('nationalregionalCommissionsDetailds',item.entityId)">
  10. <div :style="$i18n.locale=='zh'?'margin-top: 60px;width: 100%;':'margin-top: 70px;width: 100%;'">
  11. <div style="width: 300px;line-height: 25px;margin-left: 50px;
  12. font-weight: 700;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
  13. {{item.activityName}}
  14. </div>
  15. <div style="width: 100%;line-height: 30px;font-size: 14px;line-height:30px;">
  16. <span style="margin-left: 50px;margin-right: 15px;">
  17. {{$t('common.place')}}: {{item.activityPlace}}
  18. </span>
  19. <div style="width: 100%;line-height: 30px;font-size: 14px;line-height:30px;">
  20. <span :style="$i18n.locale=='zh'?'margin-left: 50px;':'margin-left: 50px;line-height:30px;'">
  21. {{$t('common.line')}}: {{formatDate(item.activityStartTime)}}--{{formatDate(item.activityEndTime)}}
  22. </span>
  23. <div class="border_box " style="width: 80%;font-size: 14px;max-height: 105px;
  24. line-height: 25px;margin-left: 50px;
  25. color: #666; ;position:relative;line-height:1.4em;overflow: hidden;
  26. text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;">
  27. {{item.activityIntroduction}}
  28. </div>
  29. <!-- <div style="width: 80%;font-size: 14px;height: 40px;margin-left: 50px;color: #666;">
  30. <el-button type="success" round>报名中</el-button>
  31. </div> -->
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </el-carousel-item>
  37. </el-carousel>
  38. <!-- 搜索框 -->
  39. <div style="width: 100%;height: 35px;margin-top: 20px;">
  40. <div style="float: left;margin-right: 20px;transform: translateY(-10PX);">
  41. <el-select v-model="Area" placeholder="请选择区域" style="margin-right: 20px;">
  42. <el-option
  43. v-for="(item,index) in options"
  44. :key="'options'+index"
  45. :label="item.label"
  46. :value="item.value"
  47. >
  48. </el-option>
  49. </el-select>
  50. <el-select v-model="activityTypeDict" placeholder="请选择分类">
  51. <el-option
  52. v-for="(item,index) in options2"
  53. :key="'options2'+index"
  54. :label="$t(item.label)"
  55. :value="item.value">
  56. </el-option>
  57. </el-select>
  58. </div>
  59. <div style="float: right;margin-right: 20px;transform: translateY(-10PX);">
  60. <el-input v-model="activityName" @keyup.enter.native="getAllData(activityName)" :placeholder="$i18n.locale=='zh'?'请输入搜索':'Please enter search'"
  61. style="width: 250px;margin-right: 28px;">
  62. <i class="el-icon-search"></i>
  63. <el-button slot="append" @click="getAllData(activityName)" icon="el-icon-search" style="background: #fff;border-left: 0;"></el-button>
  64. </el-input>
  65. <!-- 发布新活动按钮 -->
  66. <el-select v-model="value2" :placeholder="$i18n.locale=='zh'?'活动发布':'Event release'" class="fabu">
  67. <el-option
  68. v-for="(item,index) in options3"
  69. :key="'options3'+index"
  70. :label="$t(item.label)"
  71. :value="item.value">
  72. </el-option>
  73. </el-select>
  74. </div>
  75. <div style="clear: both;"></div>
  76. <!-- 展示区 -->
  77. <!-- 活动动态 -->
  78. <div style="float: left;width: 75%;min-height: 600px;background-color: #fff;">
  79. <div class="border" style="cursor:pointer;" v-for="(item,index) in initData"
  80. @click="addBrowse(item.entityId);toView(value2==1?'nationalregionalCommissionsDevelopments':'nationalregionalCommissionsDetailds',item.entityId)">
  81. <div style="float: left;width: 320px;height: 180px;">
  82. <img v-if="item.activityLogo" :src="'api/file/pub/' + item.activityLogo" alt="" style="width: 100%;height: 100%;">
  83. <img v-else :src="'api/file/pub/'+'/def/def1.png'" alt="" style="width: 100%;height: 100%;">
  84. <span :class="$i18n.locale == 'zh' ? 'introduceItemTitle' : 'introduceItemTitleEn'">{{options2Map[item.activityTypeDict]}}</span>
  85. </div>
  86. <div style="float: right;width: 535px;height: 180px;margin-right: 20px;position: relative;">
  87. <div style="color: #333;line-height: 30px;font-weight: 700;margin: 10px 0;overflow : hidden;
  88. text-overflow: ellipsis;
  89. display: -webkit-box;
  90. -webkit-line-clamp: 1;
  91. -webkit-box-orient: vertical;">
  92. {{item.activityName}}
  93. </div>
  94. <div style="color: #666;font-size: 15px;">
  95. <span style="color: #666;">
  96. <i class="el-icon-location-outline"></i>
  97. {{item.activityPlace}}
  98. </span>
  99. <span style="margin-left: 30px;">
  100. <i class="el-icon-date"></i>
  101. {{item.activityTime}}
  102. </span>
  103. </div>
  104. <div style="color: #868686;
  105. margin-top: 10px;
  106. font-size: 14px;
  107. max-height: 74px;
  108. line-height: 1.4em;
  109. margin-left: 0px;
  110. -webkit-box-orient: vertical;
  111. position: relative;
  112. overflow: hidden;
  113. ">
  114. {{item.activityIntroduction}}
  115. </div>
  116. <div style="color: #868686;height: 20px;float: right;position: absolute;right: 10px;bottom: 0px;">
  117. <img data-v-9f5ec442="" src="/img/heat.5f8dc124.png" alt="" style="vertical-align: middle; width: 16px; height: 16px; margin: 0px 3px 0px 6px; vertical-align: middle;">
  118. <span style="vertical-align: middle;">
  119. {{item.num?item.num:0}}
  120. </span>
  121. </div>
  122. <!-- <svg t="1605608495714" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3207" width="16" height="16"><path d="M349.256964 934.774863c85.868693 0 187.258894 0.054235 298.438043 0.054235 462.859813-261.864056 115.140367-653.721769 54.593386-697.856965 20.164249 44.13622 24.026206 118.839619-16.784268 155.144476C616.483144 130.466424 445.893908 76.839039 445.893908 76.839039c20.164249 134.927015-73.147974 282.510282-163.134451 392.768455-3.164063-53.788044-6.54302-90.951455-34.80469-142.43399-6.328126 97.763604-81.031525 177.454598-101.30322 275.378861-27.40414 132.620483 20.539802 229.740428 202.551182 332.330968L349.256964 934.774863z" p-id="3208" fill="#707070"></path></svg> -->
  123. </div>
  124. <div style="clear: both;"></div>
  125. </div>
  126. <div style="width: 100%;position: relative;height: 100px;">
  127. <el-pagination
  128. style="height: 80px;position: absolute;left: 50%;top: 80px;transform: translate(-50%,-50%);"
  129. background
  130. layout="prev, pager, next"
  131. page-size=5
  132. @current-change="handleCurrentChange"
  133. :total=total
  134. ></el-pagination>
  135. </div>
  136. </div>
  137. <!-- 重要活动 -->
  138. <div style="float: left;width: 20%;margin-left: 37px; min-height: 600px;background-color: #fff;">
  139. <div>
  140. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  141. style="height: 20px;vertical-align: middle;">
  142. {{$t('common.ImportantEvent')}}
  143. </div>
  144. <div style="margin-top: 10px;position: relative;" class="cursor" v-for="(item,index) in hotLists" v-if="index<5"
  145. @mouseover="mouseOver(index)" @mouseleave="mouseLeave(index)" @click="addBrowse(item.entityId);toView('nationalregionalCommissionsDetailds',item.entityId)">
  146. <img v-if="item.activityLogo" :src="'api/file/pub/' + item.activityLogo" alt="" style="width: 100%;height: 145px;">
  147. <img v-else src="@/assets/img/nationaIntorduction/lavle.png" alt="" style="width: 100%;height: 145px;">
  148. <div class="background_color" style="display: none;" :ref="`img${index}`">
  149. <div style="width: 80%;margin:40px auto 0 auto;text-align: center;font-size: 14px;font-weight: 700;
  150. -webkit-box-orient: vertical;
  151. line-height:1.4em;
  152. overflow: hidden;
  153. height:2.8em;">
  154. {{item.activityName}}
  155. </div>
  156. <div style="font-size: 12px;margin-top: 10px;
  157. -webkit-box-orient: vertical;
  158. position:relative;
  159. line-height:1.4em;
  160. overflow: hidden;
  161. height:2.8em;">
  162. {{item.activityIntroduction}}
  163. </div>
  164. </div>
  165. </div>
  166. <div style="clear: both;"></div>
  167. </div>
  168. <div style="clear: both;"></div>
  169. </div>
  170. <div style="clear: both;"></div>
  171. <el-dialog
  172. :title="$i18n.locale=='zh'?'提示':'Reminder'"
  173. :visible.sync="toViewLogin"
  174. :width="$i18n.locale=='zh'?'500px':'750px'"
  175. :height="$i18n.locale=='zh'?'300px':'386px'"
  176. :before-close="toViewLoginChange"
  177. >
  178. <div style="width: 100%;height: 100%;">
  179. <img src="@/assets/img/loginTips.png" alt="" style="width: 180px;height: 180px;margin-left: 20px;">
  180. <div style="float: right;margin-right: 20px;" :style="$i18n.locale=='zh'?'width: 49%;margin-top: 10px;':'width: 453px;margin-top: -25px;'">
  181. <div style="font-size: 20px;font-weight: normal;color: #333333;
  182. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  183. line-height: 40px;">
  184. {{$t('common.ReminderFirst')}}
  185. </div>
  186. <div style="font-size: 16px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  187. font-weight: normal;color: #666666;line-height: 30px;">
  188. {{$t('common.ReminderSecond')}} <span style="color: #0091FF;font-size: 18px;">{{num}}</span> {{$t('common.ReminderThird')}}
  189. </div>
  190. <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  191. font-weight: normal;color: #666666;line-height: 30px;">
  192. {{$t('common.ReminderForth')}}
  193. </div>
  194. <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  195. height:33px;line-height:60px;font-weight: normal;color: #0091FF;">
  196. <span style="margin-left: 40px;" class="cursor" @click="toView('login')">
  197. {{$t('common.ReminderFifth')}}
  198. </span>
  199. <span style="margin-left: 10px;" class="cursor" @click="toView('Register')">
  200. {{$t('common.ReminderSixth')}}
  201. </span>
  202. </div>
  203. </div>
  204. </div>
  205. </el-dialog>
  206. </div>
  207. </template>
  208. <script>
  209. import { getDicts } from "@/api/dict";
  210. import {getCommitteeActivityList} from '@/api/committee/committeeActivityInfo'
  211. import {addBrowseNum} from '@/api/committee/committeeActivityEntity'
  212. export default {
  213. name: "NationaIntroductionCommitteeLayout",
  214. data () {
  215. return {
  216. initList:[],
  217. activityTypeDict:null,
  218. Area:null,
  219. value2:null,
  220. activityName:null,
  221. hotLists:[],
  222. initData:[],
  223. num:5,
  224. timer:'',
  225. toViewLogin:false,
  226. screen:[{
  227. value:null,
  228. lable:'common.All'
  229. },{
  230. value:'0',
  231. lable:'common.MemberActivities'
  232. },{
  233. value:'1',
  234. lable:'common.AllianceActivities'
  235. },{
  236. value:'2',
  237. lable:'common.CooperationActivities'
  238. }],
  239. options:[],//委员会区域
  240. options2:[],//委员会活动类型
  241. options3:[],//委员会活动编辑状态
  242. options3Zh:[{
  243. label:'发布新活动',
  244. value:0
  245. }],
  246. options3En:[{
  247. label:'Post new event',
  248. value:0
  249. }],
  250. total:0,
  251. }
  252. },
  253. mounted() {
  254. this.getAllData();
  255. this.getData();
  256. },
  257. watch:{
  258. "value2"(){
  259. if(this.value2==0){
  260. if(!this.$Cookies.get('token')){
  261. this.toViewLogin=true;
  262. this.loginTipsChange();
  263. }else {
  264. this.toView("nationalregionalCommissionsEventRelease")
  265. }
  266. }
  267. },
  268. "Area"(){
  269. this.getAllData(this.Area,this.activityName,this.activityTypeDict)
  270. },
  271. "activityTypeDict"(){
  272. this.getAllData(this.Area,this.activityName,this.activityTypeDict)
  273. },
  274. "$i18n.locale"() {
  275. if(this.$i18n.locale == 'zh'){
  276. this.options3 = this.options3Zh || [];
  277. }else{
  278. this.options3 = this.options3En || [];
  279. }
  280. this.getAllData(this.Area,this.activityName,this.activityTypeDict,1);
  281. this.getData();
  282. },
  283. },
  284. computed: {
  285. options2Map(){
  286. return this.options2.array2Obj("value","label")
  287. },
  288. },
  289. methods:{
  290. // 未登录跳转
  291. loginTipsChange(){
  292. const that=this;
  293. this.num =5;
  294. clearInterval(this.timer);
  295. this.timer = setInterval(function() {
  296. if (that.num > 0) {
  297. that.num--;
  298. } else {
  299. if(that.toViewLogin==true){
  300. clearInterval(that.timer);
  301. that.toView('login');
  302. }else {
  303. clearInterval(that.timer);
  304. }
  305. }
  306. }, 1000)
  307. },
  308. // 判断未登录跳转是否关闭
  309. toViewLoginChange(done){
  310. this.toViewLogin=false;
  311. this.num=5;
  312. clearInterval(this.timer);
  313. },
  314. handleCurrentChange(val){
  315. console.log(val+"传递页数")
  316. this.getAllData(this.Area,this.activityName,this.activityTypeDict,val)
  317. },
  318. getData() {
  319. getDicts("COMMITTEE_REGIONAL_DICT,COMMITTEE_ACTIVITY_TYPE,COMMITTEE_REGIONAL_DICT_EN,COMMITTEE_ACTIVITY_TYPE_EN").then(res => {
  320. var data = res.data;
  321. if(data){
  322. if(this.$i18n.locale=='zh'){
  323. this.options= [];
  324. this.options2= [];
  325. this.options= res.data[0];
  326. this.options2 = res.data[1];
  327. this.options.unshift({
  328. label: "全部区域",
  329. value: null,
  330. });
  331. this.options2.unshift({
  332. label: "全部类型",
  333. value: null,
  334. });
  335. }else if(this.$i18n.locale=='en'){
  336. this.options= [];
  337. this.options2= [];
  338. this.options= res.data[2];
  339. this.options2 = res.data[3];
  340. this.options.unshift({
  341. label: "ALL",
  342. value: null,
  343. });
  344. this.options2.unshift({
  345. label: "ALL",
  346. value: null,
  347. });
  348. }
  349. }
  350. });
  351. },
  352. mouseOver(index){
  353. this.$refs[`img${index}`][0].style.display='block';
  354. },
  355. mouseLeave(index){
  356. this.$refs[`img${index}`][0].style.display='none';
  357. },
  358. addBrowse(entityId){
  359. addBrowseNum(entityId).then(res =>{
  360. console.log(res);
  361. })
  362. },
  363. toView(router, json) {
  364. clearInterval(this.timer);
  365. this.$router.push({ name: router, query: {key:json} });
  366. },
  367. getAllData(Area,activityName,activityTypeDict,pageNo){
  368. if(this.$i18n.locale == 'zh'){
  369. this.options3 = this.options3Zh || [];
  370. }else{
  371. this.options3 = this.options3En || [];
  372. }
  373. let list ={
  374. pageSize:5,
  375. pageNo:pageNo?pageNo:1,
  376. continentDict:this.Area,
  377. activityName:this.activityName,
  378. activityTypeDict:this.activityTypeDict,
  379. language:this.$i18n.locale.toUpperCase(),
  380. }
  381. getCommitteeActivityList(list).then(res => {
  382. this.initList = [];
  383. var data = res.data
  384. if(data){
  385. this.initData = res.data.committeeActivityInfos || [];
  386. this.total = res.data.total-0;
  387. this.hotLists = res.data.importantCommitteeActivityInfos || [];
  388. this.hotLists.forEach(element => {
  389. if(element.showFlag == 'y'){
  390. this.initList.push(element)
  391. }
  392. });
  393. }
  394. });
  395. // activityInfos(list).then(res=>{
  396. // var oldList = []
  397. // oldList = res.data?res.data.activityInfos:[];
  398. // oldList.forEach(element => {
  399. // if('y' == element.logoFlag){
  400. // this.initList.push(element);
  401. // }
  402. // });
  403. // console.log(this.initList)
  404. // this.$forceUpdate();
  405. // });
  406. },
  407. }
  408. }
  409. </script>
  410. <style scoped>
  411. .box {
  412. background: #fff;
  413. /* height: 500px; */
  414. padding: 20px 0;
  415. position: absolute;
  416. }
  417. .crumbs {
  418. margin-left: 20px;
  419. }
  420. body {
  421. margin: 0;
  422. }
  423. .el-carousel__item div:nth-child(1) {
  424. font-size: 18px;
  425. margin: 0;
  426. float: left;
  427. width: 70%;
  428. }
  429. .el-carousel__item div:nth-child(2) {
  430. font-size: 18px;
  431. margin: 0;
  432. float: left;
  433. width: 30%;
  434. }
  435. .el-carousel__item:nth-child(n) {
  436. background-color: #ecedef;
  437. color: #000;
  438. }
  439. .cool >>>.el-carousel__container {
  440. height: 350px;
  441. }
  442. .screen1 {
  443. padding: 10px 18px;
  444. font-size: 14px;
  445. background-color: #e8e8e8;
  446. }
  447. .screen2 {
  448. padding: 10px 18px;
  449. font-size: 14px;
  450. background-color: #12559c;
  451. color: #fff;
  452. }
  453. .initData li {
  454. width: 49%;
  455. float: left;
  456. }
  457. .initData li:nth-child(2n-1){
  458. margin-right: 15px;
  459. }
  460. .recommend {
  461. margin-top:15px;
  462. margin-left: 10px;
  463. }
  464. .recommend li{
  465. display: inline-block;
  466. width: 212px;
  467. /* height: 130px; */
  468. text-align: center;
  469. margin-right: 15px;
  470. }
  471. .activity {
  472. height: 100%;
  473. /* background: url(../../assets/img/introductionCooperation/detailsbg.png) no-repeat; */
  474. }
  475. .fabu >>> .el-input--suffix .el-input__inner {
  476. background-color: #0079ef;
  477. color: #fff;
  478. }
  479. .fabu>>> input::-webkit-input-placeholder{
  480. color:#fff;
  481. }
  482. .fabu>>> input::-moz-placeholder{ /* Mozilla Firefox 19+ */
  483. color:#fff;
  484. }
  485. .fabu>>> input:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
  486. color:#fff;
  487. }
  488. .fabu>>> input:-ms-input-placeholder{ /* Internet Explorer 10-11 */
  489. color:#fff;
  490. }
  491. .fabu >>> .el-input--suffix .el-input__inner {
  492. background-color: #0079ef;
  493. color: #fff;
  494. }
  495. .fabu >>> .el-input--suffix .el-input__suffix-inner {
  496. display: none;
  497. }
  498. .border_box:hover{
  499. -webkit-transform: translateY(-3px);
  500. -ms-transform: translateY(-3px);
  501. transform: translateY(-3px);
  502. -webkit-box-shadow: 0 0 6px #999;
  503. box-shadow: 0 0 6px #999;
  504. -webkit-transition: all .5s ease-out;
  505. transition: all .5s ease-out;
  506. }
  507. .border{
  508. height: 180px;
  509. border-bottom: 1px solid #66ccff;
  510. padding: 10px 0;
  511. }
  512. .background_color{
  513. position:absolute;
  514. left:0;
  515. top:0;
  516. color: #fff;
  517. background-color: rgba(0,0,0,0.8);
  518. width: 100%;
  519. height: 100%;
  520. }
  521. .introduceItemTitle {
  522. height: 27px;
  523. line-height: 28px;
  524. width: 100px;
  525. position: absolute;
  526. left: 0%;
  527. background:#ebb73e;
  528. border-radius: 0 0 10px 0;
  529. font-size: 14px;
  530. text-align: center;
  531. color: white;
  532. }
  533. .introduceItemTitleEn {
  534. height: 27px;
  535. line-height: 28px;
  536. width: 150px;
  537. position: absolute;
  538. left: 0%;
  539. background:#ebb73e;
  540. border-radius: 0 0 10px 0;
  541. font-size: 14px;
  542. text-align: center;
  543. color: white;
  544. }
  545. </style>