|
@@ -103,15 +103,25 @@ export default {
|
|
|
addList() {
|
|
|
if (!getload) return;
|
|
|
getload = false;
|
|
|
- voteList("size=" + data.size + "&total=" + data.total).then(res => {
|
|
|
- this.appNameList.push(...(res || []));
|
|
|
- data.total = this.appNameList.length;
|
|
|
- let checkboxGroup = [];
|
|
|
- this.checkboxGroup = checkboxGroup;
|
|
|
- this.$nextTick(() => {
|
|
|
- res.length && (getload = true);
|
|
|
- });
|
|
|
+ let load = Toast.loading({
|
|
|
+ message: "加载中...",
|
|
|
+ duration: 0,
|
|
|
+ forbidClick: false
|
|
|
});
|
|
|
+ voteList("size=" + data.size + "&total=" + data.total)
|
|
|
+ .then(res => {
|
|
|
+ this.appNameList.push(...(res || []));
|
|
|
+ data.total = this.appNameList.length;
|
|
|
+ let checkboxGroup = [];
|
|
|
+ this.checkboxGroup = checkboxGroup;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ res.length && (getload = true);
|
|
|
+ load.clear();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ load.clear();
|
|
|
+ });
|
|
|
},
|
|
|
showPop(item) {
|
|
|
if (!item.appDesc) return;
|
|
@@ -157,9 +167,16 @@ export default {
|
|
|
view: ""
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ let load = Toast.loading({
|
|
|
+ message: "加载中...",
|
|
|
+ duration: 0,
|
|
|
+ forbidClick: false
|
|
|
+ });
|
|
|
saveVote({ source: "智慧融媒", items: r })
|
|
|
.then(() => {
|
|
|
this.disable = true;
|
|
|
+ load.clear();
|
|
|
Toast({
|
|
|
message: "投票成功",
|
|
|
position: "bottom"
|
|
@@ -167,6 +184,7 @@ export default {
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.log(err);
|
|
|
+ load.clear();
|
|
|
});
|
|
|
return false;
|
|
|
})
|
|
@@ -186,13 +204,16 @@ export default {
|
|
|
if (isAndroid && window.H5Listener)
|
|
|
this.$user = window.H5Listener.getUserInfo() || {};
|
|
|
this.$user = JSON.parse(this.$user);
|
|
|
- console.log("-->", this.$user);
|
|
|
if (this.$user) setToken(this.$user.accessToken);
|
|
|
else setToken("");
|
|
|
- isVote().then(res => {
|
|
|
- this.disable = (res || []).length === 0;
|
|
|
+ this.$user.accessToken &&
|
|
|
+ isVote().then(res => {
|
|
|
+ this.disable = (res || []).length === 0;
|
|
|
+ this.addList();
|
|
|
+ });
|
|
|
+ if (!this.$user.accessToken) {
|
|
|
this.addList();
|
|
|
- });
|
|
|
+ }
|
|
|
};
|
|
|
window.voteNext();
|
|
|
let height = document.body.offsetHeight || 0;
|