|
@@ -15,7 +15,6 @@
|
|
|
size="large"
|
|
|
>
|
|
|
<template #title>
|
|
|
- <!-- :disabled="disable" -->
|
|
|
<van-checkbox
|
|
|
:disabled="disable"
|
|
|
checked-color="#e42417"
|
|
@@ -79,7 +78,7 @@ import "vant/lib/button/style";
|
|
|
import "vant/lib/progress/style";
|
|
|
import "vant/lib/checkbox-group/style";
|
|
|
|
|
|
-import { voteList, saveVote } from "@/api/vote/vote.js";
|
|
|
+import { voteList, saveVote, isVote } from "@/api/vote/vote.js";
|
|
|
import { isIphone, isAndroid } from "@/utils/isTerminal.js";
|
|
|
import { setToken } from "@/utils/common.js";
|
|
|
|
|
@@ -108,12 +107,6 @@ export default {
|
|
|
this.appNameList.push(...(res || []));
|
|
|
data.total = this.appNameList.length;
|
|
|
let checkboxGroup = [];
|
|
|
- this.appNameList.map(v => {
|
|
|
- if (v.voted) {
|
|
|
- checkboxGroup.push(v.infoId);
|
|
|
- if (!this.disable) this.disable = true;
|
|
|
- }
|
|
|
- });
|
|
|
this.checkboxGroup = checkboxGroup;
|
|
|
this.$nextTick(() => {
|
|
|
res.length && (getload = true);
|
|
@@ -167,6 +160,10 @@ export default {
|
|
|
saveVote({ source: "智慧融媒", items: r })
|
|
|
.then(() => {
|
|
|
this.disable = true;
|
|
|
+ Toast({
|
|
|
+ message: "投票成功",
|
|
|
+ position: "bottom"
|
|
|
+ });
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.log(err);
|
|
@@ -192,9 +189,12 @@ export default {
|
|
|
console.log("-->", this.$user);
|
|
|
if (this.$user) setToken(this.$user.accessToken);
|
|
|
else setToken("");
|
|
|
+ isVote().then(res => {
|
|
|
+ this.disable = (res || []).length === 0;
|
|
|
+ this.addList();
|
|
|
+ });
|
|
|
};
|
|
|
window.voteNext();
|
|
|
- this.addList();
|
|
|
let height = document.body.offsetHeight || 0;
|
|
|
let width = document.body.offsetWidth || 0;
|
|
|
this.$refs.vote.style.minHeight = height - (856 / 1500) * width + "px";
|