Browse Source

fix: 获取任务接口参数

test2
xuesinan 3 years ago
parent
commit
bfc9684325
  1. 1
      CHANGELOG.md
  2. 3
      hooks/project/useGetTasks.js
  3. 22
      pages/project/project.vue

1
CHANGELOG.md

@ -149,6 +149,7 @@
- | 解决warning | [dcb0079](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/dcb0079)
- | 没有新消息双击按照上一个角色的任务id跳转的问题 | [eade2dd](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/eade2dd)
- | 拍照上传交付物 | [1cbb2ac](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/1cbb2ac)
- | 切换时间轴模式更新 | [714ba49](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/714ba49)
- | 切换项目存储的任务id未清空 | [77fe17f](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/77fe17f)
- | 切换项目任务清空 | [1dd3b4b](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/1dd3b4b)
- | 日历列表H5在手机端不显示 | [0b4ae72](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/0b4ae72)

3
hooks/project/useGetTasks.js

@ -37,9 +37,8 @@ export default function useGetTasks() {
// 初始化 定期任务
async function initPlanTasks(params) {
// uni.$ui.showLoading();
if (timeLineType.value === 1) setNextPlaceholderTasks();
await getTasks(params); // 获取初始数据
await getTasks(params || {}); // 获取初始数据
}
/**

22
pages/project/project.vue

@ -28,9 +28,10 @@
<!-- <u-button @click="$store.commit('setTheme', 'theme-test')">测试切换主题</u-button> -->
</view>
<u-button size="mini" style="position: fixed; bottom: 20px; left: 100px;" @click="changeModal">
<!-- 点击切换时间轴样式 -->
<!-- <u-button size="mini" style="position: fixed; bottom: 20px; left: 100px;" @click="changeModal">
{{ timeLineType === 1 ? '切换到任务模式' : '切换到时间轴模式' }}
</u-button>
</u-button> -->
</theme>
</template>
@ -61,13 +62,7 @@ const height = ref(null); // 页面高度
const timeLineType = computed(() => store.state.task.timeLineType); //
const remindData = computed(() => store.state.socket.remindData); //
const currLocationTaskId = computed(() => store.state.socket.currLocationTaskId); // id
const targetTaskId = computed(() => store.state.task.targetTaskId); // id
onMounted(() => {
const system = uni.getSystemInfoSync();
height.value = `${system.screenHeight}px`;
console.log('项目详情onMounted')
});
// const targetTaskId = computed(() => store.state.task.targetTaskId); // id
if (!userInfo.value) {
const res = uni.$storage.getStorageSync('user');
@ -76,6 +71,13 @@ if (!userInfo.value) {
}
}
onMounted(() => {
const system = uni.getSystemInfoSync();
height.value = `${system.screenHeight}px`;
console.log('项目详情onMounted')
// initHook.init();
});
onUnmounted(() => {
console.log('卸载组件实例后调用');
clearTasksData();
@ -326,7 +328,7 @@ function changeModal() {
store.commit('task/setUpNextPage', 1);
store.commit('task/setDownNextPage', 1);
store.commit('task/setTimeLineType', timeLineType.value === 1 ? 2 : 1);
const params = { pageNum: 1, taskId: currLocationTaskId.value };
const params = { taskId: currLocationTaskId.value };
getTasksHook.initPlanTasks(params);
}
</script>

Loading…
Cancel
Save