|
@@ -2,10 +2,12 @@ import httpRequestApi from '../../../utils/APIClient';
|
|
import {
|
|
import {
|
|
formatDate
|
|
formatDate
|
|
} from '../../../utils/util';
|
|
} from '../../../utils/util';
|
|
|
|
+const app = getApp();
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
misssionList: [],
|
|
misssionList: [],
|
|
- continuousDay: 0
|
|
|
|
|
|
+ continuousDay: 0,
|
|
|
|
+ isIOS: false
|
|
},
|
|
},
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
@@ -16,14 +18,20 @@ Page({
|
|
res.data.data.forEach(item => {
|
|
res.data.data.forEach(item => {
|
|
const temp = {}
|
|
const temp = {}
|
|
temp.title = item.task.title;
|
|
temp.title = item.task.title;
|
|
- temp.type = item.task.type;
|
|
|
|
- temp.type = item.task.type;
|
|
|
|
|
|
+ temp.type = item.task.targetType;
|
|
temp.bonus = item.task.award;
|
|
temp.bonus = item.task.award;
|
|
temp.finished = item.finished;
|
|
temp.finished = item.finished;
|
|
|
|
+ temp.taskAmount = item.task.joinAmount;
|
|
|
|
+ if(item.userTask){
|
|
|
|
+ temp.finishedAmount = item.userTask.completeAmount
|
|
|
|
+ } else {
|
|
|
|
+ temp.finishedAmount = 0;
|
|
|
|
+ }
|
|
this.data.misssionList.push(temp)
|
|
this.data.misssionList.push(temp)
|
|
});
|
|
});
|
|
this.setData({
|
|
this.setData({
|
|
- misssionList: this.data.misssionList
|
|
|
|
|
|
+ misssionList: this.data.misssionList,
|
|
|
|
+ isIOS: app.globalData.isIOS
|
|
})
|
|
})
|
|
this.getSignInData();
|
|
this.getSignInData();
|
|
});
|
|
});
|
|
@@ -62,132 +70,132 @@ Page({
|
|
case 1:
|
|
case 1:
|
|
if (pointNum >= 0 && pointNum <= 5) {
|
|
if (pointNum >= 0 && pointNum <= 5) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
} else if (pointNum < 0 && pointNum >= -3) {
|
|
} else if (pointNum < 0 && pointNum >= -3) {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
if (pointNum >= 0 && pointNum <= 2) {
|
|
if (pointNum >= 0 && pointNum <= 2) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum < 0 && pointNum >= -2) {
|
|
} else if (pointNum < 0 && pointNum >= -2) {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
if (pointNum >= 0 && pointNum <= 3) {
|
|
if (pointNum >= 0 && pointNum <= 3) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum === -1) {
|
|
} else if (pointNum === -1) {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
if (pointNum >= 0 && pointNum <= 4) {
|
|
if (pointNum >= 0 && pointNum <= 4) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
if (pointNum > 0 && pointNum <= 4) {
|
|
if (pointNum > 0 && pointNum <= 4) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
} else if(pointNum === 0){
|
|
} else if(pointNum === 0){
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 6:
|
|
case 6:
|
|
if (pointNum > 1) {
|
|
if (pointNum > 1) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 1 && pointNum >= 0) {
|
|
} else if (pointNum <= 1 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 7:
|
|
case 7:
|
|
if (pointNum > 2) {
|
|
if (pointNum > 2) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 2 && pointNum >= 0) {
|
|
} else if (pointNum <= 2 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
} else {
|
|
} else {
|
|
item.style = 'white';
|
|
item.style = 'white';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 8:
|
|
case 8:
|
|
if (pointNum > 3) {
|
|
if (pointNum > 3) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 3 && pointNum >= 0) {
|
|
} else if (pointNum <= 3 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 9:
|
|
case 9:
|
|
if (pointNum > 4) {
|
|
if (pointNum > 4) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 4 && pointNum >= 0) {
|
|
} else if (pointNum <= 4 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 10:
|
|
case 10:
|
|
if (pointNum > 5) {
|
|
if (pointNum > 5) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 5 && pointNum >= 0) {
|
|
} else if (pointNum <= 5 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 11:
|
|
case 11:
|
|
if (pointNum > 6) {
|
|
if (pointNum > 6) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '3';
|
|
|
|
|
|
+ item.mark = '5';
|
|
// 超过今天五个圈圈
|
|
// 超过今天五个圈圈
|
|
} else if (pointNum <= 6 && pointNum >= 0) {
|
|
} else if (pointNum <= 6 && pointNum >= 0) {
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
item.style = 'red';
|
|
item.style = 'red';
|
|
- item.mark = '5';
|
|
|
|
|
|
+ item.mark = '10';
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
// 生成日期
|
|
// 生成日期
|
|
@@ -209,5 +217,10 @@ Page({
|
|
},
|
|
},
|
|
countTheDay: function (item) {
|
|
countTheDay: function (item) {
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ goToPrize: function(){
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: '../prize/prize'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|