From 601e687c48333a4e27dfcb2d23d0c904fc722ec6 Mon Sep 17 00:00:00 2001 From: chris <510148846@qq.com> Date: Fri, 29 Mar 2024 09:51:03 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89icon=E7=BB=84=E4=BB=B6=E3=80=81=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=84=E4=BB=B6=EF=BC=9B2=E3=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=8C=81=E4=B9=85=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=96=B9=E4=BE=BFweb=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 7 +++ App.vue | 37 ++++--------- assets/styles/fonts/iconfont.css | 85 ++++++++++++++++++++++++++++++ assets/styles/fonts/iconfont.ttf | Bin 0 -> 9364 bytes assets/styles/main.scss | 3 +- components/ch-empty/ch-empty.scss | 3 ++ components/ch-empty/ch-empty.vue | 12 +++++ components/ch-icon/ch-icon.scss | 0 components/ch-icon/ch-icon.vue | 35 ++++++++++++ components/components.js | 3 ++ pages/exam/exam.vue | 1 + pages/questions/questions.vue | 3 +- pages/task/task.vue | 1 + pages/taskDetails/taskDetails.vue | 2 +- router/index.js | 4 +- store/system.js | 3 +- store/user.js | 7 +-- 17 files changed, 166 insertions(+), 40 deletions(-) create mode 100644 assets/styles/fonts/iconfont.css create mode 100644 assets/styles/fonts/iconfont.ttf create mode 100644 components/ch-empty/ch-empty.scss create mode 100644 components/ch-empty/ch-empty.vue create mode 100644 components/ch-icon/ch-icon.scss create mode 100644 components/ch-icon/ch-icon.vue diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 0a68351..5801e6a 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -10,6 +10,13 @@ "app-plus" : { "launchtype" : "local" }, + "default" : { + "launchtype" : "local" + }, + "h5" : { + "launchtype" : "local" + }, + "provider" : "aliyun", "type" : "uniCloud" }, { diff --git a/App.vue b/App.vue index 71956e0..6331c5e 100644 --- a/App.vue +++ b/App.vue @@ -1,12 +1,15 @@ \ No newline at end of file diff --git a/components/ch-icon/ch-icon.scss b/components/ch-icon/ch-icon.scss new file mode 100644 index 0000000..e69de29 diff --git a/components/ch-icon/ch-icon.vue b/components/ch-icon/ch-icon.vue new file mode 100644 index 0000000..c2f491a --- /dev/null +++ b/components/ch-icon/ch-icon.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/components/components.js b/components/components.js index 1b6d000..cd05761 100644 --- a/components/components.js +++ b/components/components.js @@ -1,7 +1,10 @@ import ChNavBar from '@/components/ch-nav-bar/ch-nav-bar.vue' import ChNavBtn from '@/components/ch-nav-btn/ch-nav-btn.vue' +import ChIcon from '@/components/ch-icon/ch-icon.vue'; +import ChEmpty from '@/components/ch-empty/ch-empty.vue'; export default function registerComponents (app) { app.component(ChNavBar.name, ChNavBar); app.component(ChNavBtn.name, ChNavBtn); + app.component(ChIcon.name, ChIcon) } \ No newline at end of file diff --git a/pages/exam/exam.vue b/pages/exam/exam.vue index cfc0d6c..0f7fce4 100644 --- a/pages/exam/exam.vue +++ b/pages/exam/exam.vue @@ -15,6 +15,7 @@ + diff --git a/pages/questions/questions.vue b/pages/questions/questions.vue index 6e6ed41..26b83da 100644 --- a/pages/questions/questions.vue +++ b/pages/questions/questions.vue @@ -29,7 +29,8 @@ - + + diff --git a/pages/task/task.vue b/pages/task/task.vue index 3d47d87..ba9b3e2 100644 --- a/pages/task/task.vue +++ b/pages/task/task.vue @@ -15,6 +15,7 @@ + diff --git a/pages/taskDetails/taskDetails.vue b/pages/taskDetails/taskDetails.vue index b8fe6e7..3375219 100644 --- a/pages/taskDetails/taskDetails.vue +++ b/pages/taskDetails/taskDetails.vue @@ -52,7 +52,7 @@ const status = computed(() => { }) const uploadUrl = computed(() => { - return `${config.baseUrl}/api/user.ashx?act=studenthomeworkinfo&studentid=${userId}&homeworkid=${taskId.value}` + return `${config.baseUrl}/api/user.ashx?act=subhomeworkinfo&studentid=${userId}&homeworkid=${taskId.value}` }) onLoad((option) => { diff --git a/router/index.js b/router/index.js index 5d5b6b2..1ee8b1f 100644 --- a/router/index.js +++ b/router/index.js @@ -11,9 +11,9 @@ uniCrazyRouter.beforeEach(async (to, from ,next)=>{ console.log('beforEach router') const path = to.url; - const uId = uni.getStorageSync('uId') || null; + const uInfo = uni.getStorageSync('uInfo') || null; - if (whiteList.includes(path) || uId) { + if (whiteList.includes(path) || uInfo) { next() return; } diff --git a/store/system.js b/store/system.js index 3261409..80de8f3 100644 --- a/store/system.js +++ b/store/system.js @@ -15,8 +15,7 @@ export const useSystemStore = defineStore('system', () => { return new Promise((resolve, reject) => { login(params,).then(res => { userStore.setUserInfo(res); - userStore.setUserId(res.studentid); - uni.setStorageSync('uId', res.studentid); + uni.setStorageSync('uInfo', JSON.stringify(res)); resolve(res) }).catch(error => { console.log('登录失败:', error) diff --git a/store/user.js b/store/user.js index 56121d0..6984b01 100644 --- a/store/user.js +++ b/store/user.js @@ -7,11 +7,8 @@ export const useUserStore = defineStore('user', () => { function setUserInfo(info) { userInfo.value = info; + userId.value = info.studentid } - function setUserId(id) { - userId.value = id; - } - - return { userInfo, userId, setUserInfo, setUserId }; + return { userInfo, userId, setUserInfo }; })