|
|
|
@ -3,13 +3,18 @@ import { ref } from 'vue'
|
|
|
|
|
import { Popover, message } from 'ant-design-vue' |
|
|
|
|
import { InviteForm } from '../InviteForm/index' |
|
|
|
|
import { HisTory } from '../HisTory/index' |
|
|
|
|
import type { SignType } from './index.d' |
|
|
|
|
import { current, logUserSign } from '@/api/task/index' |
|
|
|
|
import type { SignType, TaskType } from './index.d' |
|
|
|
|
import { current, logUserSign, receiveAward, routineTask } from '@/api/task/index' |
|
|
|
|
import { useTaskListStore } from '@/store/moules/taskListStore' |
|
|
|
|
import History from '@/assets/images/task/history.png' |
|
|
|
|
import dot from '@/assets/images/task/dot.png' |
|
|
|
|
import money from '@/assets/images/task/money.png' |
|
|
|
|
import receive from '@/assets/images/task/ylq.png' |
|
|
|
|
import unclaimed from '@/assets/images/task/dlq.png' |
|
|
|
|
import { useUserStore } from '@/store/moules/userStore/index' |
|
|
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
|
const taskListStore = useTaskListStore() |
|
|
|
|
|
|
|
|
|
// 历史弹窗布尔 |
|
|
|
|
const visible = ref<boolean>(false) |
|
|
|
@ -37,27 +42,30 @@ function handleSign(type: string) {
|
|
|
|
|
} |
|
|
|
|
getCurrent() |
|
|
|
|
message.success('签到成功!') |
|
|
|
|
userStore.getChatInfoFun() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 做任务赚积分 |
|
|
|
|
const earn = ref([ |
|
|
|
|
{ |
|
|
|
|
title: '登录微信小程序', |
|
|
|
|
dot: 1, |
|
|
|
|
status: 1, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '邀请注册', |
|
|
|
|
dot: 200, |
|
|
|
|
status: 0, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '每日登录', |
|
|
|
|
dot: 2, |
|
|
|
|
status: 1, |
|
|
|
|
}, |
|
|
|
|
]) |
|
|
|
|
// 列表 |
|
|
|
|
const earn = ref<TaskType[]>([]) |
|
|
|
|
|
|
|
|
|
function getRoutineTask() { |
|
|
|
|
routineTask().then((res) => { |
|
|
|
|
earn.value = res.taskCenterList |
|
|
|
|
taskListStore.changeBasicTask(res.existFinishedTask) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
getRoutineTask() |
|
|
|
|
|
|
|
|
|
// 领取积分 |
|
|
|
|
function handleGetDot(id: string) { |
|
|
|
|
receiveAward(id).then(() => { |
|
|
|
|
message.success('领取成功') |
|
|
|
|
getRoutineTask() |
|
|
|
|
userStore.getChatInfoFun() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// 邀请弹窗 |
|
|
|
|
const inviteShow = ref(false) |
|
|
|
|
function handleInvite() { |
|
|
|
@ -143,13 +151,13 @@ function handleInvite() {
|
|
|
|
|
<div v-for="(item, index) in earn" :key="index" class="earn-list"> |
|
|
|
|
<div class="earn-list-left"> |
|
|
|
|
<div class="name"> |
|
|
|
|
{{ item.title }} |
|
|
|
|
{{ item.name }} |
|
|
|
|
</div> |
|
|
|
|
<div v-show="item.status === 1" class="accomplish"> |
|
|
|
|
已获得{{ item.dot }}点数 |
|
|
|
|
<div v-show="item.status === 2" class="accomplish"> |
|
|
|
|
已获得{{ item.score }}点数 |
|
|
|
|
</div> |
|
|
|
|
<div v-show="item.status === 0" class="unfinished"> |
|
|
|
|
0/{{ item.dot }} |
|
|
|
|
<div v-show="item.status !== 2" class="unfinished"> |
|
|
|
|
0/{{ item.score }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="earn-list-right"> |
|
|
|
@ -157,19 +165,23 @@ function handleInvite() {
|
|
|
|
|
<div class="flex items-center"> |
|
|
|
|
<img class="add-dot-photo" :src="money" alt=""> |
|
|
|
|
<div class="add-dot-num"> |
|
|
|
|
+{{ item.dot }} |
|
|
|
|
+{{ item.score }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-show="item.status === 1" class="add-dot-btn accomplish"> |
|
|
|
|
<div v-show="item.status === 2" class="add-dot-btn accomplish"> |
|
|
|
|
已完成 |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-if="item.status === 0 && index !== 1" class="add-dot-btn unfinished"> |
|
|
|
|
未完成 |
|
|
|
|
<div v-if="item.status === 1 " class="add-dot-btn invite" @click="handleGetDot(item.id)"> |
|
|
|
|
领取 |
|
|
|
|
</div> |
|
|
|
|
<div v-if="item.status === 0 && index === 1" class="add-dot-btn invite" @click="handleInvite"> |
|
|
|
|
去邀请 |
|
|
|
|
<div v-if="item.status === 0"> |
|
|
|
|
<div v-if="item.name === '邀请注册'" class="add-dot-btn invite" @click="handleInvite"> |
|
|
|
|
去邀请 |
|
|
|
|
</div> |
|
|
|
|
<div v-else class="add-dot-btn unfinished"> |
|
|
|
|
未完成 |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|