Merge branch 'login-gtag-RBI' of http://git.kingsome.cn/yuyongdong/UAW into login-gtag-RBI
This commit is contained in:
commit
dd84bf9d67
@ -895,55 +895,74 @@ export default {
|
|||||||
// 开始任务
|
// 开始任务
|
||||||
async toPost(data, onlyaction) {
|
async toPost(data, onlyaction) {
|
||||||
// debugger
|
// debugger
|
||||||
if (data.status == 0 || !onlyaction) {
|
let begintask = data.status == 0 && !onlyaction
|
||||||
let res = await apiBeginActivity(data.id);
|
if (begintask) {
|
||||||
if (res.errcode == 0) {
|
|
||||||
await this.getProgress();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.rumGtag(data.task)
|
this.rumGtag(data.task)
|
||||||
|
}
|
||||||
|
|
||||||
|
let btw = false
|
||||||
|
let bdc = false
|
||||||
if (data.task == "TwitterConnect") {
|
if (data.task == "TwitterConnect") {
|
||||||
|
btw = true
|
||||||
await this.loginTwitter(data.id);
|
await this.loginTwitter(data.id);
|
||||||
} else if(data.task == "TwitterFollow") {
|
} else if(data.task == "TwitterFollow") {
|
||||||
//todo: panduan twitter id
|
btw = true
|
||||||
if (!this.usesTwitterId) {
|
// if (!this.usesTwitterId) {
|
||||||
this.$showErr("Please complete the 'Connect Your X' quest first");
|
// this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
} else {
|
// } else {
|
||||||
followTwitter(data.cfg.account)
|
followTwitter(data.cfg.account)
|
||||||
}
|
// }
|
||||||
} else if(data.task == "TwitterLike") {
|
} else if(data.task == "TwitterLike") {
|
||||||
//todo: panduan twitter id
|
btw = true
|
||||||
if (!this.usesTwitterId) {
|
// if (!this.usesTwitterId) {
|
||||||
this.$showErr("Please complete the 'Connect Your X' quest first");
|
// this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
} else {
|
// } else {
|
||||||
window.open(`https://twitter.com/intent/like?tweet_id=${data.cfg.content}`, '_blank');
|
window.open(`https://twitter.com/intent/like?tweet_id=${data.cfg.content}`, '_blank');
|
||||||
}
|
// }
|
||||||
} else if(data.task == "TwitterTweet") {
|
} else if(data.task == "TwitterTweet") {
|
||||||
//todo: panduan twitter id
|
btw = true
|
||||||
if (!this.usesTwitterId) {
|
// if (!this.usesTwitterId) {
|
||||||
this.$showErr("Please complete the 'Connect Your X' quest first");
|
// this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
} else {
|
// } else {
|
||||||
followTwitter(data.cfg.content)
|
followTwitter(data.cfg.content)
|
||||||
}
|
// }
|
||||||
} else if(data.task == "TwitterRetweet") {
|
} else if(data.task == "TwitterRetweet") {
|
||||||
//todo: panduan twitter id
|
btw = true
|
||||||
if (!this.usesTwitterId) {
|
// if (!this.usesTwitterId) {
|
||||||
this.$showErr("Please complete the 'Connect Your X' quest first");
|
// this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
} else {
|
// } else {
|
||||||
window.open(`https://twitter.com/intent/retweet?tweet_id=${data.cfg.content}`, '_blank');
|
window.open(`https://twitter.com/intent/retweet?tweet_id=${data.cfg.content}`, '_blank');
|
||||||
}
|
// }
|
||||||
} else if(data.task == "DiscordJoin") {
|
} else if(data.task == "DiscordJoin") {
|
||||||
//todo: panduan dc id
|
bdc = true
|
||||||
if (!this.usesDiscordId) {
|
// if (!this.usesDiscordId) {
|
||||||
this.$showErr(
|
// this.$showErr(
|
||||||
"Please complete the 'Connect Your Discord' quest first"
|
// "Please complete the 'Connect Your Discord' quest first"
|
||||||
);
|
// );
|
||||||
} else {
|
// } else {
|
||||||
joinDiscord(data.cfg.account)
|
joinDiscord(data.cfg.account)
|
||||||
}
|
// }
|
||||||
} else if (data.task == "DiscordConnect") {
|
} else if (data.task == "DiscordConnect") {
|
||||||
|
bdc = true
|
||||||
this.loginDiscord()
|
this.loginDiscord()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (begintask) {
|
||||||
|
let res = await apiBeginActivity(data.id);
|
||||||
|
|
||||||
|
if (res.errcode == 0) {
|
||||||
|
await this.getProgress();
|
||||||
|
}else if(res.errcode == 14){ //pretask not complete
|
||||||
|
if(btw){
|
||||||
|
this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
|
}else if(bdc){
|
||||||
|
this.$showErr("Please complete the 'Connect Your Discord' quest first");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.$showErr(`Unknown error[${res.errcode}]`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 手动检查任务
|
// 手动检查任务
|
||||||
async toCheck() {
|
async toCheck() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user