Browse Source

feat: 主体颜色

test2
xuesinan 4 years ago
parent
commit
bb5c0e36ed
  1. 12
      App.vue
  2. 1
      CHANGELOG.md
  3. 8
      apis/tall.js
  4. 4
      pages/index/index.vue
  5. 92
      pages/project/project.vue

12
App.vue

@ -18,10 +18,10 @@ export default {
this.checkNetwork(); //
this.getSystemInfo(); //
const token = this.$store.state.user.token || this.$storage.getStorageSync('anyringToken') || '';
if (token) {
this.$store.commit('user/setToken', token);
}
// const token = this.$store.state.user.token || this.$storage.getStorageSync('anyringToken') || '';
// if (token) {
// this.$store.commit('user/setToken', token);
// }
// if (!token) {
// this.$ui.showToast(', ');
@ -29,8 +29,8 @@ export default {
// return;
// }
// await this.syncLocalDataToStore(options.query.u); // localStoragestore
// token = await this.getToken();
await this.syncLocalDataToStore('1217647686598135808'); // localStoragestore
const token = await this.getToken();
// this.noPhone(this.$store.state.user.phone);
this.$store.dispatch('socket/initSocket');

1
CHANGELOG.md

@ -13,6 +13,7 @@
- | 将时间轴改成swiper滑动 | [12384f9](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12384f9)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 设置状态栏 | [9871356](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9871356)
- | 时间轴接口 | [a95d005](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a95d005)
- | 时间轴页面 | [e926b75](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e926b75)
- | 时间轴展示 | [8b1b380](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8b1b380)

8
apis/tall.js

@ -1,9 +1,9 @@
import Config from '@/common/js/config.js'
// const apiUrl = Config.apiUrl;
const apiUrl = Config.apiUrlNew;
// const tall = `${apiUrl}/tall3/v3.0`;
const tall = `${apiUrl}/ptostall`;
const apiUrl = Config.apiUrl;
// const apiUrl = Config.apiUrlNew;
const tall = `${apiUrl}/tall3/v3.0`;
// const tall = `${apiUrl}/ptostall`;
export function setupTall(app) {
uni.$u.api = { ...uni.$u.api } || {};

4
pages/index/index.vue

@ -5,7 +5,7 @@
</view>
<!-- <view class="flex flex-col h-full bg-gray-50" @click="openAuth"> -->
<view class="flex flex-col h-full bg-gray-50">
<theme class="flex flex-col h-full bg-gray-50">
<view class="relative">
<!-- <view class="relative" @touchmove="onMove"> -->
<!-- 日历 -->
@ -26,7 +26,7 @@
<!-- 全局提示框 -->
<u-top-tips ref="uTips"></u-top-tips>
</view>
</theme>
</template>
<script setup>

92
pages/project/project.vue

@ -33,55 +33,25 @@ import dayjs from 'dayjs';
const initHook = useInit();
const getTasksHook = useGetTasks();
const store = useStore();
const roleId = computed(() => store.state.role.roleId);
const timeNode = computed(() => store.state.task.timeNode);
const timeUnit = computed(() => store.state.task.timeUnit);
const projectId = computed(() => store.getters['project/projectId']);
const userId = computed(() => store.getters['user/userId']);
const roleId = computed(() => store.state.role.roleId); // id
const roleIndex = computed(() => store.state.role.roleIndex); //
const visibleRoles = computed(() => store.state.role.visibleRoles); //
const timeNode = computed(() => store.state.task.timeNode); //
const timeUnit = computed(() => store.state.task.timeUnit); //
const newProjectInfo = computed(() => store.state.task.newProjectInfo);
const showScrollTo = computed(() => store.state.task.showScrollTo);
const visibleRoles = computed(() => store.state.role.visibleRoles);
const allTasks = computed(() => store.state.task.allTasks);
const roleIndex = computed(() => store.state.role.roleIndex);
const globals = computed(() => store.getters['task/globals']);
const timeGranularity = computed(() => store.getters['task/timeGranularity']);
const height = ref(null);
const showScrollTo = computed(() => store.state.task.showScrollTo); //
const allTasks = computed(() => store.state.task.allTasks); //
const globals = computed(() => store.getters['task/globals']); // +
const timeGranularity = computed(() => store.getters['task/timeGranularity']); // dayjs add
const height = ref(null); //
onMounted(() => {
const system = uni.getSystemInfoSync();
height.value = `${system.windowHeight}px`;
});
//
function getGlobalData() {
if(!allTasks.value[roleIndex]) {
const param = {
roleId: roleId.value,
timeNode: timeNode.value,
timeUnit: timeUnit.value,
projectId: projectId.value,
};
store.dispatch('task/getGlobal', param);
}
// allTasks
const index = visibleRoles.value.findIndex(role => role.id === roleId.value);
const arr = [...allTasks.value];
arr[index].global = [...globals.value];
store.commit('task/setAllTasks', arr);
}
//
function clearTasksData() {
//
store.commit('task/setPermanents', []);
store.commit('task/setDailyTasks', []);
//
store.commit('task/clearTasks');
//
//
store.commit('task/clearEndFlag');
}
/**
* 当角色发生变化时
* 重新查询永久日常任务和普通日常任务
@ -91,7 +61,8 @@ function clearTasksData() {
watch(roleId, newValue => {
if (newValue) {
// allTasks
if (allTasks.value.length && allTasks.value[roleIndex.value].global && allTasks.value[roleIndex.value].task) return;
if (allTasks.value.length && allTasks.value[roleIndex.value].global && allTasks.value[roleIndex.value].task)
return;
console.log('当角色发生变化时', newValue);
store.commit('task/setTimeNode', Date.now());
@ -149,13 +120,47 @@ watch(newProjectInfo, newValue => {
}
});
//
function getGlobalData() {
if (!allTasks.value[roleIndex]) {
const param = {
roleId: roleId.value,
timeNode: timeNode.value,
timeUnit: timeUnit.value,
projectId: projectId.value,
};
store.dispatch('task/getGlobal', param);
}
// allTasks
const index = visibleRoles.value.findIndex(role => role.id === roleId.value);
const arr = [...allTasks.value];
arr[index].global = [...globals.value];
store.commit('task/setAllTasks', arr);
}
//
function clearTasksData() {
//
store.commit('task/setPermanents', []);
store.commit('task/setDailyTasks', []);
//
store.commit('task/clearTasks');
//
//
store.commit('task/clearEndFlag');
}
function getTasks(params) {
getTasksHook.initPlanTasks(params); //
}
// tabsswiper
function tabsChange(e) {
const { id } = visibleRoles.value[e.detail.current];
const {
id
} = visibleRoles.value[e.detail.current];
store.commit('role/setRoleIndex', e.detail.current);
store.commit('role/setRoleId', id);
@ -175,7 +180,8 @@ function setScrollPosition() {
} else {
// taskId
// 线id 线
const task = allTasks.value[roleIndex.value].task.find(item => dayjs(+item.planStart).isSame(timeNode.value, timeGranularity.value));
const task = allTasks.value[roleIndex.value].task.find(item => dayjs(+item.planStart).isSame(timeNode.value,
timeGranularity.value));
task && store.commit('task/setScrollToTaskId', `a${task.id}`); // task id
}
}

Loading…
Cancel
Save