|
@ -3,24 +3,22 @@ import CanApi from '@/api/CanApi'; |
|
|
import { defaultInitialZIndex, ElMessage } from 'element-plus'; |
|
|
import { defaultInitialZIndex, ElMessage } from 'element-plus'; |
|
|
import { ref } from 'vue'; |
|
|
import { ref } from 'vue'; |
|
|
|
|
|
|
|
|
//地址 |
|
|
|
|
|
var url = "https://wwww.voted?token=9H0l5gBX0kPIbYe1rBrnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w" |
|
|
|
|
|
|
|
|
//获取当前浏览器地址 |
|
|
|
|
|
// var url = window.location.href; |
|
|
|
|
|
var url = "https://wwww.voted?token=oHgj4lMA10LIb4C2pxznbZi0+fEeMx8pywnIlrmTkYxEOqcqxG7SCLo5+Zl/e3VufNpUPfOjn4srEKj1vsk" |
|
|
|
|
|
//截取token=后的字符串 |
|
|
|
|
|
|
|
|
var token = null; |
|
|
var token = null; |
|
|
function getToken() { |
|
|
function getToken() { |
|
|
var url = "https://wwww.voted?token=9H0l5gBX0kPIbYe1rBrnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w" |
|
|
|
|
|
// 使用 URL 对象解析 URL |
|
|
|
|
|
var parsedUrl = new URL(url); |
|
|
|
|
|
|
|
|
|
|
|
// 使用 URLSearchParams 获取 token 参数 |
|
|
|
|
|
// token = parsedUrl.searchParams.get("token"); |
|
|
|
|
|
token = "9H0l5gBX0kPIbYe1rBrnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w"; |
|
|
|
|
|
|
|
|
var parts = url.split("token="); |
|
|
|
|
|
if (parts.length > 1) { |
|
|
|
|
|
token = parts[1].split("&")[0]; // 进一步截取 & 之前的字符串 |
|
|
|
|
|
} |
|
|
console.log("token字符串:",token); // 输出 token 的值 |
|
|
console.log("token字符串:",token); // 输出 token 的值 |
|
|
// token = JSON.parse(tokenStr); |
|
|
|
|
|
// console.log("token json格式:",token); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
getToken(); |
|
|
getToken(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//候选人 |
|
|
//候选人 |
|
|
const candidates = ref([]) |
|
|
const candidates = ref([]) |
|
|
const first = ref(); |
|
|
const first = ref(); |
|
@ -175,7 +173,7 @@ function vote(code) { |
|
|
<!-- 头像框 --> |
|
|
<!-- 头像框 --> |
|
|
<div class="avatar-box2"></div> |
|
|
<div class="avatar-box2"></div> |
|
|
<!-- 头像图片 --> |
|
|
<!-- 头像图片 --> |
|
|
<img class="cover2" src="../assets/image.png"> |
|
|
|
|
|
|
|
|
<img class="cover2" :src="second.avatar"> |
|
|
<!-- 投票按钮 --> |
|
|
<!-- 投票按钮 --> |
|
|
<div class="one-button2" v-if="second.voted == false" @click="vote(second.jwCode)">投票</div> |
|
|
<div class="one-button2" v-if="second.voted == false" @click="vote(second.jwCode)">投票</div> |
|
|
<div class="buttoned2" v-else @click="vote(second.jwCode)">已投票</div> |
|
|
<div class="buttoned2" v-else @click="vote(second.jwCode)">已投票</div> |
|
@ -189,7 +187,7 @@ function vote(code) { |
|
|
<!-- 头像框 --> |
|
|
<!-- 头像框 --> |
|
|
<div class="avatar-box1"></div> |
|
|
<div class="avatar-box1"></div> |
|
|
<!-- 头像图片 --> |
|
|
<!-- 头像图片 --> |
|
|
<img class="cover1" src="../assets/image.png"> |
|
|
|
|
|
|
|
|
<img class="cover1" :src="first.avatar"> |
|
|
<!-- 投票按钮 --> |
|
|
<!-- 投票按钮 --> |
|
|
<div class="one-button1" v-if="first.voted == false" @click="vote(first.jwCode)">投票</div> |
|
|
<div class="one-button1" v-if="first.voted == false" @click="vote(first.jwCode)">投票</div> |
|
|
<div class="buttoned1" v-else @click="vote(first.jwCode)">已投票</div> |
|
|
<div class="buttoned1" v-else @click="vote(first.jwCode)">已投票</div> |
|
@ -203,7 +201,7 @@ function vote(code) { |
|
|
<!-- 头像框 --> |
|
|
<!-- 头像框 --> |
|
|
<div class="avatar-box3"></div> |
|
|
<div class="avatar-box3"></div> |
|
|
<!-- 头像图片 --> |
|
|
<!-- 头像图片 --> |
|
|
<img class="cover3" src="../assets/image.png"> |
|
|
|
|
|
|
|
|
<img class="cover3" :src="third.avatar"> |
|
|
<!-- 投票按钮 --> |
|
|
<!-- 投票按钮 --> |
|
|
<div class="one-button3" v-if="third.voted == false" @click="vote(third.jwCode)">投票</div> |
|
|
<div class="one-button3" v-if="third.voted == false" @click="vote(third.jwCode)">投票</div> |
|
|
<div class="buttoned3" v-else @click="vote(third.jwCode)">已投票</div> |
|
|
<div class="buttoned3" v-else @click="vote(third.jwCode)">已投票</div> |
|
@ -221,7 +219,7 @@ function vote(code) { |
|
|
<!-- 排名 --> |
|
|
<!-- 排名 --> |
|
|
<div class="num">{{ index + 4 }}</div> |
|
|
<div class="num">{{ index + 4 }}</div> |
|
|
<!-- 头像 --> |
|
|
<!-- 头像 --> |
|
|
<img class="list-avatar" src="../assets/image.png"> |
|
|
|
|
|
|
|
|
<img class="list-avatar" :src="backCandidate.avatar"> |
|
|
<!-- 投票数 --> |
|
|
<!-- 投票数 --> |
|
|
<div class="votes">已有{{ backCandidate.votes }}人投票</div> |
|
|
<div class="votes">已有{{ backCandidate.votes }}人投票</div> |
|
|
<!-- 投票按钮 --> |
|
|
<!-- 投票按钮 --> |
|
@ -455,7 +453,7 @@ function vote(code) { |
|
|
.cover1 { |
|
|
.cover1 { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
|
|
|
|
|
|
left: 40.9%; |
|
|
|
|
|
|
|
|
left: 40.8%; |
|
|
top: -8%; |
|
|
top: -8%; |
|
|
width: 19.1%; |
|
|
width: 19.1%; |
|
|
height: 9%; |
|
|
height: 9%; |
|
|