ElectionBallot.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <div class="electionBallot">
  3. <div v-if="OFF!='true'">
  4. <!-- 理事选票banner-->
  5. <div class="Banner">
  6. <img :src="bannerUrls" alt="" style="width: 100%;">
  7. </div>
  8. <!-- 直播界面-->
  9. <!-- <div class="liveBox" v-if="vote == 1 && isShowLive == true">
  10. <div class="close" @click="closeLive">x</div>
  11. <iframe :src="link" frameborder="0" style="height: 100%;width: 100%"></iframe>
  12. </div> -->
  13. <div class="electionTime">
  14. <div style="width: 1200px;margin: auto">
  15. <!--投票类别选择-->
  16. <div class="voteTab">
  17. <span class="backHome" @click="toView('home')" v-if="GoHome">
  18. {{$t('common.BackToHome')}}
  19. </span>
  20. <!-- <div class="voteTabBtn" :class="vote==0?'isActive':''" @click="changeState(0)">{{$i18n.locale == 'zh'?'财务报告':'financial statement'}}</div>
  21. <span> | </span>
  22. <div class="voteTabBtn" :class="vote==1?'isActive':''" @click="changeState(1)">{{$i18n.locale == 'zh'?'选举办法':'Election method'}}</div>
  23. <span> | </span>
  24. <div class="voteTabBtn" :class="vote==2?'isActive':''" @click="changeState(2)">{{$i18n.locale == 'zh'?'工作办法':'Work method'}}</div>
  25. <span> | </span>
  26. <div class="voteTabBtn" :class="vote==3?'isActive':''" @click="changeState(3)">{{$i18n.locale == 'zh'?'主席候选':'Chairman'}}</div>
  27. <span> | </span>
  28. <div class="voteTabBtn" :class="vote==4?'isActive':''" @click="changeState(4)">{{$i18n.locale == 'zh'?'理事单位':'Director unit'}}</div> -->
  29. <!--直播地址-->
  30. <!-- <span class="linkAddress" @click="showLive" v-if="vote==1 && showLink == true">
  31. {{$t('common.Liveing')}}
  32. </span> -->
  33. <div style="clear: both"></div>
  34. </div>
  35. </div>
  36. <!--投票内容-->
  37. <!-- 旧 -->
  38. <!-- <DirectorVote :vote="vote" v-if="vote==0"></DirectorVote> -->
  39. <!-- <MatterVote :vote="vote" v-if="vote==1" :showLink="showLink"></MatterVote> -->
  40. <!-- 新 -->
  41. <FinancialStatement v-if="vote==0" :vote="vote" @pushFlag="getMsgFormSon" @getVotepage="receiveVotepage"></FinancialStatement>
  42. <ElectionMethod v-if="vote==1" @pushFlag="getMsgFormSon" @getVotepage="receiveVotepage"></ElectionMethod>
  43. <WorkMethod v-if="vote==2" @pushFlag="getMsgFormSon" @getVotepage="receiveVotepage"></WorkMethod>
  44. <Chairman v-if="vote==3" @pushFlag="getMsgFormSon" @getVotepage="receiveVotepage"></Chairman>
  45. <DirectorUnit v-if="vote==4" @pushFlag="getMsgFormSon"></DirectorUnit>
  46. <!-- <div class="pageButton">
  47. <el-button type="primary" @click="lastpage" v-if="vote!=0">{{$i18n.locale=='zh'?'上一页':'Previous'}}</el-button>
  48. <el-button type="primary" @click="nextpage" v-if="vote!=4 && nextpageFlag">{{$i18n.locale=='zh'?'下一页':'Next'}}</el-button>
  49. </div> -->
  50. <footers></footers>
  51. </div>
  52. <!-- 投票结束后的弹出框 -->
  53. <el-dialog
  54. :show-close="false"
  55. :visible.sync="OverFlag"
  56. width="600px">
  57. <div class="category-body submit-success">
  58. <p style="font-size: 24px; color: #666; margin-bottom: 20px;text-align:center">{{$i18n.locale=='en'? 'The vote was successful. Thank you for your participation!': '投票成功,感谢参与'}}</p>
  59. <p style="text-align:center">
  60. <el-button style="background: #2c558a; color: #fff" @click="toView('home')">{{$i18n.locale=='en'? 'Back Home': '返回首页'}}</el-button>
  61. <el-button @click="Iknow">{{$i18n.locale=='en'? 'Confirm': '确定'}}</el-button>
  62. </p>
  63. </div>
  64. </el-dialog>
  65. </div>
  66. <!-- 都投完票,再次进入后看到的页面 -->
  67. <div v-if="OFF=='true'" class="Voteover">
  68. <div class="Banner">
  69. <img :src="bannerUrls" alt="" style="width: 100%;">
  70. </div>
  71. <div class="VoteoverText">{{$i18n.locale=='en'? 'You have to vote.': '您已投票'}}</div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import DirectorVote from "./DirectorVote";
  77. import MatterVote from "./MatterVote";
  78. import FinancialStatement from "./FinancialStatement";
  79. import ElectionMethod from "./ElectionMethod";
  80. import WorkMethod from "./WorkMethod";
  81. import Chairman from "./Chairman";
  82. import DirectorUnit from "./DirectorUnit";
  83. import footers from "@/components/footersNew";
  84. //用户投票状态查询方法引入
  85. import {getCouncilVoteSituation,getBannerUrls,getMeetingGeidcoMatters} from "@/api/vote/council";
  86. export default {
  87. name:'electionBallot',
  88. components:{
  89. DirectorVote,
  90. MatterVote,
  91. footers,
  92. FinancialStatement,
  93. ElectionMethod,
  94. WorkMethod,
  95. Chairman,
  96. DirectorUnit
  97. },
  98. data () {
  99. return {
  100. vote:0,
  101. depVip:'',
  102. showHomeEntrance:'',
  103. votedLeader: '',
  104. votedMatter: '',
  105. link:'',
  106. bannerUrls:[],
  107. isShowLive:false,
  108. showLink:'',
  109. nextpageFlag:'',
  110. OverFlag:false,//投票结束后的显示结束的页面
  111. AllFlag:[],
  112. GoHome:false,
  113. OFF:this.$route.query.votedLeader,
  114. xxx:[]
  115. }
  116. },
  117. mounted() {
  118. this.getVoteState();
  119. this.getBannerUrl();
  120. if(localStorage.getItem("Votepage")){
  121. this.vote = localStorage.getItem("Votepage")
  122. }
  123. },
  124. methods:{
  125. receiveVotepage(data){
  126. this.vote = data;
  127. localStorage.setItem("Votepage", this.vote);
  128. },
  129. //===============================
  130. getMsgFormSon(data){
  131. console.log('ssssssssssss',data);
  132. // this.nextpageFlag = data;
  133. if(this.vote==4&&data==true){
  134. this.OverFlag = data
  135. };
  136. if(this.vote==0&&data==true){
  137. this.AllFlag[0] = data
  138. }else if(this.vote==1&&data==true){
  139. this.AllFlag[1] = data
  140. }else if(this.vote==2&&data==true){
  141. this.AllFlag[2] = data
  142. }else if(this.vote==3&&data==true){
  143. this.AllFlag[3] = data
  144. }else if(this.vote==4&&data==true){
  145. this.AllFlag[4] = data
  146. };
  147. if(this.AllFlag.length==5){
  148. if(this.AllFlag.findIndex((target)=>{target===true})==-1){
  149. this.GoHome = true
  150. }
  151. };
  152. console.log('ppppppppppp',this.AllFlag)
  153. },
  154. //==========================
  155. changeState(e){
  156. this.vote = e;
  157. if (this.vote == 0){
  158. this.isShowLive = false
  159. }
  160. },
  161. //查询投票用户状态
  162. getVoteState(){
  163. getCouncilVoteSituation().then((res)=>{
  164. let sta = res.data.councilVoteSituation;
  165. this.depVip=sta.depVip;
  166. this.showHomeEntrance=sta.showHomeEntrance;
  167. this.votedLeader=sta.votedLeader;
  168. this.votedMatter=sta.votedMatter
  169. this.link = sta.councilLiveingLink;
  170. this.showLink = sta.showCouncilLiveingLink;
  171. })
  172. },
  173. //获取banner图片
  174. getBannerUrl(){
  175. getBannerUrls({paramKey:"COUNCIL_AGENDA_ZH,COUNCIL_AGENDA_EN,COUNCIL_PROPAGANDA_ZH,COUNCIL_PROPAGANDA_EN,COUNCIL_END_ZH,COUNCIL_END_EN"}).then(res => {
  176. if(this.$i18n.locale == 'zh'){
  177. this.bannerUrls = 'api/file/pub/'+ res.data.bannerUrls[2].bannerUrl;
  178. }else{
  179. this.bannerUrls = 'api/file/pub/'+ res.data.bannerUrls[3].bannerUrl;
  180. }
  181. });
  182. },
  183. toView(router, json) {
  184. this.$router.push({
  185. name: router,
  186. query: {
  187. key:json,
  188. }
  189. });
  190. },
  191. //显示直播窗口
  192. showLive(){
  193. this.isShowLive = true;
  194. },
  195. //关闭直播窗口
  196. closeLive(){
  197. this.isShowLive = false
  198. },
  199. //下一页
  200. nextpage(){
  201. if(this.vote<4){
  202. this.vote += 1;
  203. };
  204. },
  205. //上一页
  206. lastpage(){
  207. if(this.vote>0){
  208. this.vote -= 1
  209. };
  210. },
  211. //============================
  212. Iknow(){
  213. this.OverFlag = false
  214. }
  215. }
  216. }
  217. </script>
  218. <style scoped>
  219. .electionBallot{
  220. margin: 0;
  221. padding: 0;
  222. width: 100%;
  223. background: #fff;
  224. }
  225. .Banner{
  226. height: 380px;
  227. width: 100%;
  228. background: #faf3ec;
  229. /* background: url("../../assets/img/electionBallot/DirectorVotes/directorBanner.png") no-repeat; */
  230. background-size: cover;
  231. overflow: hidden;
  232. }
  233. .Banner1{
  234. height: 380px;
  235. width: 100%;
  236. background: #0be0c4;
  237. background: url("../../assets/img/electionBallot/MattersVotes/back.png") no-repeat;
  238. background-size: cover;
  239. overflow: hidden;
  240. }
  241. .worldMap{
  242. width: 962px;
  243. height: 205px;
  244. position: absolute;
  245. left: 50%;
  246. top: 60px;
  247. transform: translate(-50%, 10px);
  248. }
  249. .Logo{
  250. width: 246px;
  251. height: 45px;
  252. margin:auto;
  253. position: relative;
  254. top: 82px;
  255. }
  256. .title{
  257. width: 507px;
  258. margin:auto;
  259. position: relative;
  260. top: 100px;
  261. }
  262. .title2{
  263. width: 887px;
  264. margin:auto;
  265. position: relative;
  266. top: 100px;
  267. }
  268. .lightBox{
  269. width: 507px;
  270. margin:auto;
  271. position: relative;
  272. top: 85px;
  273. }
  274. .electionTime{
  275. /*height: 337px;*/
  276. /*text-align: center;*/
  277. }
  278. .backHome{
  279. cursor: pointer;
  280. font-weight: normal;
  281. font-size: 16px;
  282. float: left;
  283. }
  284. .linkAddress{
  285. cursor: pointer;
  286. font-weight: normal;
  287. font-size: 16px;
  288. float: right;
  289. }
  290. .voteTab{
  291. text-align: center;
  292. margin:20px 0;
  293. font-size: 28px;
  294. font-weight: 600;
  295. color: #666666;
  296. }
  297. .voteTabBtn{
  298. display: inline-block;
  299. cursor: pointer;
  300. position: relative;
  301. }
  302. .isActive:after{
  303. width:100%;
  304. height: 4px;
  305. content: "";
  306. content: "";
  307. position: absolute;
  308. top: 107%;
  309. left: 0px;
  310. background-color:#5682CB;
  311. }
  312. .timeBack{
  313. width: 173px;
  314. height: 56px;
  315. background: url("../../assets/img/electionBallot/DirectorVotes/timmer.png") no-repeat;
  316. background-size: 100%;
  317. line-height: 56px;
  318. text-align: left;
  319. }
  320. .voteText{
  321. padding: 0 30px;
  322. margin: 10px 0;
  323. }
  324. .liveBox{
  325. width:1200px;
  326. height: 380px;
  327. background: #ffffff;
  328. position: absolute;
  329. z-index: 999;
  330. top: 0;
  331. left: 50%;
  332. transform: translate(-50%, 0px);
  333. box-shadow: 1px 1px 6px #999;
  334. /*界面可以拉大缩小*/
  335. resize: both;
  336. overflow: auto;
  337. }
  338. .close{
  339. width: 20px;
  340. height: 20px;
  341. background: #ccc;
  342. text-align: center;
  343. line-height: 20px;
  344. color: #fff;
  345. position: absolute;
  346. right: 0;
  347. top: 0;
  348. cursor: pointer;
  349. }
  350. .close:hover{
  351. background: red;
  352. }
  353. .pageButton{
  354. width: 500px;
  355. margin: auto;
  356. text-align: center;
  357. margin-bottom: 30px;
  358. }
  359. .Voteover{
  360. background: #48baff;
  361. height: 100vh;
  362. }
  363. .Voteover>.Banner{
  364. background: #48baff;
  365. }
  366. .VoteoverText{
  367. font-size: 20vh;
  368. text-align: center;
  369. color: #fff;
  370. }
  371. </style>