Merge branch 'master' of http://git.kingsome.cn/yuyongdong/UAW
This commit is contained in:
commit
90c9026c30
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-button class="mybtn" :loading="timeLeft > 0" @click="beginAction">{{ timeLeft > 0 ? timeLeft + 's' : title }}</el-button>
|
<el-button class="mybtn" :loading="timeLeft > 0" @click.stop="beginAction">{{ timeLeft > 0 ? timeLeft + 's' : title }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -166,6 +166,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="quest-list">
|
<div class="quest-list">
|
||||||
<li v-for="(item, index) in activeList" :key="index">
|
<li v-for="(item, index) in activeList" :key="index">
|
||||||
|
<div class="quest-item" @click="toPost(item, true)">
|
||||||
<div class="content-right-left">
|
<div class="content-right-left">
|
||||||
<!-- <div class="img-logo">
|
<!-- <div class="img-logo">
|
||||||
<img src="./../../assets/home/twitter.png" alt />
|
<img src="./../../assets/home/twitter.png" alt />
|
||||||
@ -180,13 +181,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="token != null" class="btn">
|
<div v-if="token != null" class="btn">
|
||||||
<div class="is-btn">
|
<div class="is-btn">
|
||||||
<div v-if="item.status == 0" class="started" @click="toPost(item)">{{ item.actionTitle }}</div>
|
<div v-if="item.status == 0" class="started" @click.stop="toPost(item)">{{ item.actionTitle }}</div>
|
||||||
<CheckBtn v-if="item.status == 1" @stateupdate="toCheck" :dataid="item.id" time="10" title="Check" class="started">Check</CheckBtn>
|
<CheckBtn v-if="item.status == 1" @stateupdate="toCheck" :dataid="item.id" time="10" title="Check" class="started">Check</CheckBtn>
|
||||||
<div v-if="item.status == 2" class="claim" @click="getTaskClaim(item.id)">Claim</div>
|
<div v-if="item.status == 2" class="claim" @click.stop="getTaskClaim(item.id)">Claim</div>
|
||||||
<div v-if="item.status == 3" class="success">+{{ item.score }} <img src="./../../assets/home/Checkmark.png" alt=""></div>
|
<div v-if="item.status == 3" class="success">+{{ item.score }} <img src="./../../assets/home/Checkmark.png" alt=""></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='light-btn' v-else @click="onWalletLogin">Connect Wallet</div>
|
<div class='light-btn' v-else @click.stop="onWalletLogin">Connect Wallet</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -750,14 +752,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 开始任务
|
// 开始任务
|
||||||
async toPost(data) {
|
async toPost(data, onlyaction) {
|
||||||
let res = await apiBeginActivity(data.id);
|
// debugger
|
||||||
if(res.errcode == 0) {
|
if(data.status == 0 || !onlyaction){
|
||||||
this.getProgress()
|
let res = await apiBeginActivity(data.id);
|
||||||
// console.log("开始任务", res, data);
|
if(res.errcode == 0) {
|
||||||
|
await this.getProgress()
|
||||||
|
// console.log("开始任务", res, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.task == "TwitterConnect") {
|
if (data.task == "TwitterConnect") {
|
||||||
this.loginTwitter(data.id);
|
await this.loginTwitter(data.id);
|
||||||
} else if(data.task == "TwitterFollow") {
|
} else if(data.task == "TwitterFollow") {
|
||||||
followTwitter(data.cfg.account)
|
followTwitter(data.cfg.account)
|
||||||
} else if(data.task == "TwitterRetweet") {
|
} else if(data.task == "TwitterRetweet") {
|
||||||
@ -778,7 +784,7 @@ export default {
|
|||||||
await this.getProgress()
|
await this.getProgress()
|
||||||
// console.log(res, "检查任务状态------------------");
|
// console.log(res, "检查任务状态------------------");
|
||||||
},
|
},
|
||||||
loginTwitter() {
|
async loginTwitter() {
|
||||||
// const _address = "0x8c10Ae04BF525734eaC00d5F7c062567461c207F";
|
// const _address = "0x8c10Ae04BF525734eaC00d5F7c062567461c207F";
|
||||||
const clientId = "aG1Jdm1YX0NhSU9rYU5sM0xQeVI6MTpjaQ";
|
const clientId = "aG1Jdm1YX0NhSU9rYU5sM0xQeVI6MTpjaQ";
|
||||||
// const codeChallenge = crypto.randomUUID()
|
// const codeChallenge = crypto.randomUUID()
|
||||||
@ -792,8 +798,16 @@ export default {
|
|||||||
)}&response_type=code&scope=tweet.read+users.read+follows.read+offline.access+like.read&state=${encodeURIComponent(
|
)}&response_type=code&scope=tweet.read+users.read+follows.read+offline.access+like.read&state=${encodeURIComponent(
|
||||||
state
|
state
|
||||||
)}`;
|
)}`;
|
||||||
location.href = url;
|
let newwin = window.open(url, "twitter connect");
|
||||||
this.getActivitrStatue(data.id)
|
console.log(newwin.closed);
|
||||||
|
var timer = setInterval(function() {
|
||||||
|
if (newwin.closed) {
|
||||||
|
clearInterval(timer);
|
||||||
|
alert(newwin.closed, "window closed");
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
// location.href = url;
|
||||||
|
await this.getActivitrStatue(data.id)
|
||||||
},
|
},
|
||||||
async loginDiscord() {
|
async loginDiscord() {
|
||||||
const _address = this.$store.state.user.address;
|
const _address = this.$store.state.user.address;
|
||||||
@ -1514,7 +1528,10 @@ export default {
|
|||||||
height: 380px;
|
height: 380px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
li {
|
li:hover{
|
||||||
|
background-color: #27242e;
|
||||||
|
}
|
||||||
|
li .quest-item{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -1525,6 +1542,7 @@ export default {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
.content-right-left {
|
.content-right-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -1561,6 +1579,7 @@ export default {
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
font-weight: normal;
|
||||||
.is-btn {
|
.is-btn {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
@ -1607,6 +1626,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btn:hover{
|
||||||
|
color: deepskyblue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::v-deep .quest-list::-webkit-scrollbar {
|
::v-deep .quest-list::-webkit-scrollbar {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user