提交 3fed70aa 编写于 作者: chengxiang.li's avatar chengxiang.li

添加task接口前的activityId判断处理

上级 d40f1d13
...@@ -359,18 +359,7 @@ ...@@ -359,18 +359,7 @@
// 取服务器时间,切换不同时间段的显示 // 取服务器时间,切换不同时间段的显示
vm.getServerTime(); vm.getServerTime();
// 请求接口获取activityId (经与后端产品确认,默认没传id的话,就取接口;默认有的话就不取接口) // 请求接口获取activityId (经与后端产品确认,默认没传id的话,就取接口;默认有的话就不取接口)
if( !vm.activityId ){ vm.handleGetActivityId();
getActivityId().then(res => {
if(res && res.code == '000000' ){
let data = res.data ;
for(let i in data){
if(data[i] == 'ID'){
vm.activityId = i;
}
}
}
})
}
vm.$rocNative.appInit(); vm.$rocNative.appInit();
vm.getUserInfo(); // 判断是否登录 vm.getUserInfo(); // 判断是否登录
...@@ -401,6 +390,21 @@ ...@@ -401,6 +390,21 @@
hideClockModal() { hideClockModal() {
vm.clockSuccessVisible = false; vm.clockSuccessVisible = false;
}, },
handleGetActivityId(cb){
if( !vm.activityId ){
getActivityId().then(res => {
if(res && res.code == '000000' ){
let data = res.data ;
for(let i in data){
if(data[i] == 'ID'){
vm.activityId = i;
}
}
cb && cb();
}
})
}
},
goQuest(){ goQuest(){
// window.location.href = 'https://wj.qq.com/s2/5112128/18be/'; // window.location.href = 'https://wj.qq.com/s2/5112128/18be/';
let url = 'https://wj.qq.com/s2/5112128/18be/'; let url = 'https://wj.qq.com/s2/5112128/18be/';
...@@ -480,7 +484,11 @@ ...@@ -480,7 +484,11 @@
vm.isLogin = false; vm.isLogin = false;
} }
// 登录状态确定后,再调任务接口,以便获取打卡状态 // 登录状态确定后,再调任务接口,以便获取打卡状态
if(vm.activityId){
vm.getTasks(); vm.getTasks();
}else{
vm.handleGetActivityId(vm.getTasks);
}
}); });
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册