diff --git a/App.vue b/App.vue index 67a49b9..a526b47 100644 --- a/App.vue +++ b/App.vue @@ -1,14 +1,26 @@ diff --git a/components/TimeLine/component/Title.vue b/components/TimeLine/component/Title.vue index fafec0b..e69de29 100644 --- a/components/TimeLine/component/Title.vue +++ b/components/TimeLine/component/Title.vue @@ -1,7 +0,0 @@ - diff --git a/components/Title/components/CreateTask.vue b/components/Title/components/CreateTask.vue index d12ac71..030d6d4 100644 --- a/components/Title/components/CreateTask.vue +++ b/components/Title/components/CreateTask.vue @@ -55,7 +55,7 @@ :key="roleIndex" @click="change(roleIndex)" > - {{ role.name }} + {{ role.name }} @@ -107,7 +107,7 @@ :key="Index" @click="choose(Index)" > - {{ checkoutOption.name }} + {{ checkoutOption.name }} diff --git a/hooks/theme/useTheme.js b/hooks/theme/useTheme.js new file mode 100644 index 0000000..c9ea155 --- /dev/null +++ b/hooks/theme/useTheme.js @@ -0,0 +1,7 @@ +import { computed } from 'vue'; +import { useStore } from 'vuex'; +export default function useTheme() { + const store = useStore(); + const theme = computed(() => store.state.theme); + return theme; +} diff --git a/hooks/user/useGetToken.js b/hooks/user/useGetToken.js index 03b4ae3..fd20a36 100644 --- a/hooks/user/useGetToken.js +++ b/hooks/user/useGetToken.js @@ -16,6 +16,7 @@ export default async function useGetToken() { const token = computed(() => store.state.user.token); const tokenIsAvailable = computed(() => store.getters['user/tokenIsAvailable']); // token是否可用 const userId = computed(() => store.getters['user/userId']); + debugger; if (token.value && tokenIsAvailable.value) { // 1.1 store里有token 且没过期直接:使用store的token return token.value; diff --git a/package.json b/package.json index 53a7794..2219e54 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "cz": "npm run log && git add . && git cz", + "fix": "eslint --fix", "log": "conventional-changelog --config ./node_modules/vue-cli-plugin-commitlint/lib/log -i CHANGELOG.md -s -r 0" }, "author": "", diff --git a/pages.json b/pages.json index 159cd88..a3be40c 100644 --- a/pages.json +++ b/pages.json @@ -5,20 +5,20 @@ "style": { "navigationBarText": "TALL" } - }, - { - "path": "pages/project/project", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/user/accountLogin", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white" - } + }, + { + "path": "pages/project/project", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/user/accountLogin", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } } ], "globalStyle": { @@ -26,12 +26,13 @@ "navigationBarTitleText": "TALL", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" - }, - "easycom": { - "autoscan": true, - "custom": { - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue", - "^p-(.*)": "@/plugins/p-$1/p-$1.vue" - } + }, + "easycom": { + "autoscan": true, + "custom": { + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue", + "^p-(.*)": "@/plugins/p-$1/p-$1.vue", + "theme": "@/components/Theme/Theme.vue" + } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index b78e509..5b0349e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,135 +1,135 @@ - - - - - diff --git a/pages/project/project.vue b/pages/project/project.vue index f83fb1e..6337f25 100644 --- a/pages/project/project.vue +++ b/pages/project/project.vue @@ -13,6 +13,9 @@ + + + 测试切换主题 diff --git a/plugins/p-deliver/p-deliver.vue b/plugins/p-deliver/p-deliver.vue new file mode 100644 index 0000000..1e501b0 --- /dev/null +++ b/plugins/p-deliver/p-deliver.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/plugins/p-task-title/p-task-title.vue b/plugins/p-task-title/p-task-title.vue new file mode 100644 index 0000000..2cf8195 --- /dev/null +++ b/plugins/p-task-title/p-task-title.vue @@ -0,0 +1,10 @@ + + + diff --git a/store/index.js b/store/index.js index 70cac9f..c20d379 100644 --- a/store/index.js +++ b/store/index.js @@ -1,48 +1,58 @@ import { createStore } from 'vuex'; -import user from './user/index.js'; -import socket from './socket/index.js'; import project from './project/index.js'; import role from './role/index.js'; +import socket from './socket/index.js'; import task from './task/index.js'; +import user from './user/index.js'; // 不属于具体模块的 应用级的 store内容 const state = { - networkConnected: true, // 网络是否连接 - forceUseStorage: true, // 强制启用storage - systemInfo: null, // 系统设备信息 + theme: 'theme-default', + networkConnected: true, // 网络是否连接 + forceUseStorage: true, // 强制启用storage + systemInfo: null, // 系统设备信息 }; const getters = { - // 是否启用本地存储 - // 设置了强制启用本地存储 或者 没有网络连接的时候 - useStorage({ networkConnected, forceUseStorage }) { - return forceUseStorage || !networkConnected; - }, + // 是否启用本地存储 + // 设置了强制启用本地存储 或者 没有网络连接的时候 + useStorage({ networkConnected, forceUseStorage }) { + return forceUseStorage || !networkConnected; + }, }; const mutations = { - /** - * 设置网络是否连接的变量 - * @param {*} state - * @param {boolean} networkConnected - */ - setNetworkConnected(state, networkConnected) { - state.networkConnected = networkConnected; - }, + /** + * 设置网络是否连接的变量 + * @param {*} state + * @param {boolean} networkConnected + */ + setNetworkConnected(state, networkConnected) { + state.networkConnected = networkConnected; + }, + + /** + * 设置系统信息的数据 + * @param {object} state + * @param {object | null} data 获取到的数据 + */ + setSystemInfo(state, data) { + state.systemInfo = data; + }, - /** - * 设置系统信息的数据 - * @param {object} state - * @param {object | null} data 获取到的数据 - */ - setSystemInfo(state, data) { - state.systemInfo = data; - }, + /** + * 设置主题 + * @param {object} state + * @param {string} theme 主题名称 默认theme-default + */ + setTheme(state, theme) { + state.theme = theme || 'theme-default'; + }, }; export default createStore({ - state, - getters, - mutations, - modules: {user, socket, project, role, task} + state, + getters, + mutations, + modules: { user, socket, project, role, task }, });