110 lines
2.1 KiB
Vue
110 lines
2.1 KiB
Vue
<template>
|
|
<view>
|
|
<gb-qiandao
|
|
:days="dayInfo.day"
|
|
:taskList="dayInfo.taskStatusParams"
|
|
:completeDay="dayInfo.day"
|
|
:dayList="dayList"
|
|
:taskStatus="dayInfo.isSignInToday"
|
|
@receiveMoney="receiveMoney"
|
|
@listTab="listTab"
|
|
></gb-qiandao>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { findSignInRecord, signIn, shareMiniProgram } from '@/api/api.js';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
// 签到天数
|
|
days: 0,
|
|
// 签到任务第一个
|
|
play_number: 0,
|
|
// 签到任务第二个
|
|
search_number: 0,
|
|
// 签到任务第三个
|
|
full_ad: 0,
|
|
// 已完成天数
|
|
completeDay: 0,
|
|
// 签到状态 0.代表未签到 1.代表已签到
|
|
taskStatus: 0,
|
|
// 签到规则
|
|
rule: '这里是签到规则,你可以任意编辑',
|
|
// 签到任务奖励数组
|
|
dayList: [1, 1, 2, 3, 5, 6, 7],
|
|
// 签到任务
|
|
taskList: [
|
|
{
|
|
title: '试玩游戏',
|
|
img: '../../static/yx.png',
|
|
number: 1,
|
|
dec: '完成游戏赚相关游戏'
|
|
},
|
|
{
|
|
title: '试玩应用',
|
|
img: '../../static/zl.png',
|
|
number: 1,
|
|
dec: '完成应用赚相关任务'
|
|
},
|
|
{
|
|
title: '观看广告',
|
|
img: '../../static/kgg.png',
|
|
number: 10,
|
|
dec: '观看广告赚相关广告'
|
|
}
|
|
],
|
|
dayInfo: {}
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.getData();
|
|
},
|
|
methods: {
|
|
// 获取用户签到得相关信息,自己写接口获取即可
|
|
getData() {
|
|
findSignInRecord().then((res) => {
|
|
this.dayInfo = res;
|
|
});
|
|
},
|
|
// 签到并领取奖励
|
|
receiveMoney() {
|
|
signIn().then((res) => {
|
|
uni.showToast({
|
|
title: '签到成功',
|
|
icon: 'none',
|
|
position: 'bottom'
|
|
});
|
|
this.getData();
|
|
});
|
|
},
|
|
|
|
// 签到任务完成
|
|
listTab(i) {
|
|
if (i == 0) {
|
|
uni.showToast({
|
|
title: '跳转第一个任务',
|
|
icon: 'none',
|
|
position: 'bottom'
|
|
});
|
|
}
|
|
if (i == 1) {
|
|
uni.showToast({
|
|
title: '跳转第二个任务',
|
|
icon: 'none',
|
|
position: 'bottom'
|
|
});
|
|
}
|
|
if (i == 2) {
|
|
shareMiniProgram().then((res) => {
|
|
this.getData();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style></style>
|