diff --git a/src/api/development.js b/src/api/development.js new file mode 100644 index 0000000..31364f4 --- /dev/null +++ b/src/api/development.js @@ -0,0 +1,70 @@ +import request from '@/config/request'; + +async function http(config) { + return new Promise(resolve => { + request(config) + .then(res => { + resolve(res.data); + }) + .catch(err => { + console.log(err); + resolve(false); + }); + }); +} + +export const apiDevelopment = { + LevelList, + LevelDetail, + CurrentTask +}; + +export default apiDevelopment; + +// personId 这个用于临时测试用 +const personId = 15; + +/** + * 等级列表 + * @returns + */ +function LevelList() { + return http({ + url: '/api/Level/List', + method: 'get', + params: { + personId: personId + } + }); +} + +/** + * 等级详情 + * @param + * \{ levelId ,personId \} + * + * @returns + */ +function LevelDetail(params) { + return http({ + url: '/api/Level/LevelDetail', + method: 'get', + params: { + personId: personId, + ...params + } + }); +} + +/** + * 任务列表 + */ +function CurrentTask() { + return http({ + url: '/api/Task/CurrentTask', + method: 'get', + params: { + personId: personId + } + }); +} diff --git a/src/views/development/index.vue b/src/views/development/index.vue index 1814fe8..9d6f239 100644 --- a/src/views/development/index.vue +++ b/src/views/development/index.vue @@ -9,35 +9,38 @@
了解详情
-
当前任务
-
-
- -
-
-
-
- 幸运熊计划LV - {{ task.level < 10 ? `0${task.level}` : task.level }} -
-
{{ task.detail }}
+
+
当前任务
+
+
+
-
-
-
-
{{ item.title }}
-
查看进度
-
上传打卡
+
+
+
+ {{ task.planName }} + {{ task.levelLv }}
-
-
-
- +
{{ task.serialNumber }}
+
+
+
+
+
{{ item.name }}
+
+ {{ item.sourceType === 3 ? '完成问卷' : item.sourceType === 2 ? '查看进度' : '上传打卡' }}
-
-
- +
+
+
+ +
+
+
+
+ +
@@ -51,11 +54,11 @@ v-for="(item, index) in levels" :key="index" :class="{ - unlock: item.level === task.level + 1, - now: item.level === task.level, - active: item.level < task.level + unlock: item.status === 3, + now: item.status === 1, + active: item.status === 2 }" - @click="toDetail(item, task)" + @click="toDetail(item)" >
@@ -64,16 +67,18 @@
-
LV{{ item.level < 10 ? `0${item.level}` : item.level }}
+
{{ item.levelName }}
{{ - item.level > task.level + 1 + item.status === 0 ? '未解锁' - : item.level === task.level + 1 + : item.status === 3 ? '可查看' - : item.level === task.level + : item.status === 1 ? '进行中' - : '已完成' + : item.status === 2 + ? '已完成' + : '未知' }}
@@ -84,7 +89,7 @@
- +
@@ -94,6 +99,7 @@