From 55394e84870971bd0bc184dc6220ea47216decb7 Mon Sep 17 00:00:00 2001 From: qsh <> Date: Sat, 19 Aug 2023 17:42:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98+=E9=A9=BE=E6=A0=A1=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liu-indexed-list/liu-indexed-list.vue | 2 +- src/jtools/api/login.js | 10 +- src/jtools/request/index.js | 4 +- src/pages/me/index.vue | 18 +-- src/pages/me/school.vue | 56 ++++---- src/pages/me/vip.vue | 132 +++++++++++++++--- 6 files changed, 155 insertions(+), 67 deletions(-) diff --git a/src/components/liu-indexed-list/liu-indexed-list.vue b/src/components/liu-indexed-list/liu-indexed-list.vue index 35ab64a..f2cbd56 100644 --- a/src/components/liu-indexed-list/liu-indexed-list.vue +++ b/src/components/liu-indexed-list/liu-indexed-list.vue @@ -353,6 +353,6 @@ } } .actived { - color: #05C341; + color: #05C341 !important; } \ No newline at end of file diff --git a/src/jtools/api/login.js b/src/jtools/api/login.js index 181e52a..05954e0 100644 --- a/src/jtools/api/login.js +++ b/src/jtools/api/login.js @@ -27,7 +27,15 @@ export function logout() { export function getInfo() { return request({ - url: 'driver-api/tdSysUser/info', + url: 'driver-api/tdSysUser/queryUserMessage', method: 'get', }); +} + +export function bindSchool(data) { + return request({ + url: 'driver-api/tdSysUser/bindSchool', + method: 'post', + data + }); } \ No newline at end of file diff --git a/src/jtools/request/index.js b/src/jtools/request/index.js index 90eeccd..538b1fa 100644 --- a/src/jtools/request/index.js +++ b/src/jtools/request/index.js @@ -26,7 +26,7 @@ function service(options = {}) { if (res.data.code == 'E403') { // 未登录 uni.showToast({ - title: res.data.message, + title: res?.data?.message || '请重新登录', icon: 'none' }); useUserStore().logout() @@ -34,7 +34,7 @@ function service(options = {}) { resolved(res.data); } else if(res.data.code != '0000') { uni.showToast({ - title: res.data.message, + title: res?.data?.message || '访问出错', icon: 'none' }) resolved(res.data) diff --git a/src/pages/me/index.vue b/src/pages/me/index.vue index fb14ed2..3929e32 100644 --- a/src/pages/me/index.vue +++ b/src/pages/me/index.vue @@ -10,7 +10,7 @@ {{ user.userName }}{{user.userId}} - 陪您学车 第{{ user.count }}天 + 陪您学车 第{{ user.days }}天 @@ -98,8 +98,7 @@ export default { return useUserStore().isLogin }, user() { - let userInfo = useUserStore().userInfo - return { ...userInfo, count: this.dateDiff(userInfo.createTime) } + return useUserStore().userInfo }, vipOn() { return useUserStore().vipOnList @@ -192,19 +191,6 @@ export default { handleLogout() { useUserStore().logout() }, - dateDiff(end){ - if(!end) { - return 1 - } - today = new Date(); - end = new Date(end); - if(end > today){ - days = parseInt(Math.abs(end - today) / 1000 / 60 / 60 / 24); - }else{ - days = parseInt(Math.abs(end - today) / 1000 / 60 / 60 / 24); // 如果不限制对比时间和当前时间大小可以不用if - } - return days + 1; - }, } } diff --git a/src/pages/me/school.vue b/src/pages/me/school.vue index 17c51f4..c27c879 100644 --- a/src/pages/me/school.vue +++ b/src/pages/me/school.vue @@ -1,45 +1,53 @@