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 ca2d3ca..4f0ad15 100644 --- a/src/jtools/api/login.js +++ b/src/jtools/api/login.js @@ -21,13 +21,21 @@ export function getCode(data) { export function logout() { return request({ url: 'driver-api/tdSysUser/loginOut', - method: 'get', + method: 'get' }); } export function getInfo() { return request({ - url: 'driver-api/tdSysUser/info', - method: 'get', + url: 'driver-api/tdSysUser/queryUserMessage', + method: 'get' + }); +} + +export function bindSchool(data) { + return request({ + url: 'driver-api/tdSysUser/bindSchool', + method: 'post', + data }); } 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 @@