diff --git a/src/views/BackView.vue b/src/views/BackView.vue index f6b575b..29c5911 100644 --- a/src/views/BackView.vue +++ b/src/views/BackView.vue @@ -13,38 +13,45 @@ function getToken() { if (parts.length > 1) { token = parts[1].split("&")[0]; // 进一步截取 & 之前的字符串 } - console.log("token字符串:",token); // 输出 token 的值 + console.log("token字符串:", token); // 输出 token 的值 } getToken(); const candidates = ref([]) function loadCandidates() { - CanApi.getCandidates(token).then(result =>{ + CanApi.getCandidates(token).then(result => { candidates.value = result.data; + }) } loadCandidates(); //对话窗 const detailVisible = ref(false); const details = ref([]) -function searchDetail(scope){ +function searchDetail(scope) { console.log(scope); detailVisible.value = true; - CanApi.Detail(scope).then(result =>{ + CanApi.Detail(scope).then(result => { details.value = result.data; + for (let i = 0; i < details.value.length; i++) { + if (details.value[i] && details.value[i].voteTime) { + details.value[i].voteTime = details.value[i].voteTime.replace('T', ' '); + } + + } }) } //序号 -const indexMethod = function(index) { - return index +1; +const indexMethod = function (index) { + return index + 1; }