93 lines
2.0 KiB
Vue
93 lines
2.0 KiB
Vue
|
<template>
|
||
|
<view>
|
||
|
<u-toast ref="uToast"></u-toast>
|
||
|
<uni-steps style="margin-top: 40rpx;" :options="task_list" :active="active" />
|
||
|
<step1 v-if="active == 0" />
|
||
|
<step2 v-if="active == 1" />
|
||
|
<step3 v-if="active == 2" />
|
||
|
<button style="margin:250rpx 30rpx 0 30rpx" @click="toNext">下一步</button>
|
||
|
<button style="margin:20rpx 30rpx 0 30rpx;background-color: #409EFF;color: white;" @click="toOther">先看看公告</button>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import step3 from "@/pages/pay/index.vue";
|
||
|
import step1 from "@/pages/filling/filling.vue";
|
||
|
import step2 from "@/pages/gather/gather.vue";
|
||
|
import {listOwnTodo} from "@/api/toApi.js";
|
||
|
import {getOwnTodoInfo} from "@/api/validApi.js";
|
||
|
export default {
|
||
|
components:{
|
||
|
step1,
|
||
|
step2,
|
||
|
step3
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
task_list:[],
|
||
|
active:0,
|
||
|
all_list:[]
|
||
|
};
|
||
|
},
|
||
|
onShow(){
|
||
|
this.listOwnTodo();
|
||
|
},
|
||
|
methods:{
|
||
|
toOther(){
|
||
|
uni.navigateTo({
|
||
|
url:"/pages/newindex/newindex"
|
||
|
})
|
||
|
},
|
||
|
async toNext(){
|
||
|
let index = this.active;
|
||
|
let id = this.all_list[index].id;
|
||
|
let res = await getOwnTodoInfo(id);
|
||
|
if(res.code == 200){
|
||
|
let data = res.data;
|
||
|
let status = data.status;
|
||
|
if(status == "0"){
|
||
|
this.$refs.uToast.show({
|
||
|
type: "error",
|
||
|
message: "您当前的任务未完成哦",
|
||
|
duration: 1500
|
||
|
});
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
let step = this.active +1;
|
||
|
if(step == 3){
|
||
|
uni.switchTab({
|
||
|
url:"/pages/newindex/newindex"
|
||
|
})
|
||
|
}
|
||
|
this.active = step;
|
||
|
|
||
|
},
|
||
|
async listOwnTodo(){
|
||
|
let res = await listOwnTodo();
|
||
|
if(res.code ==200){
|
||
|
let data = res.rows;
|
||
|
this.all_list = data;
|
||
|
let temp = [];
|
||
|
|
||
|
let isFirst = true;
|
||
|
data.map((v,i)=>{
|
||
|
temp.push({
|
||
|
"title":v.taskName
|
||
|
});
|
||
|
if(v.status == "0" && isFirst){
|
||
|
this.active = i;
|
||
|
isFirst = false;
|
||
|
}
|
||
|
});
|
||
|
this.task_list = [...temp];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
|
||
|
</style>
|