From db46299b8c5cce0816c9bcc37c074ad9b7aea6ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=98=BF=E6=80=AA?= <690927457@qq.com>
Date: Wed, 19 Jun 2024 22:25:50 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E9=A6=96=E9=A1=B5=E8=B0=83=E7=94=A8?=
=?UTF-8?q?=E9=89=B4=E6=9D=83=E6=8E=A5=E5=8F=A3;=E7=94=A8=E8=8D=AF?=
=?UTF-8?q?=E6=8F=90=E9=86=92=E6=A1=86:=E5=AD=97=E4=BD=93=E5=A4=AA?=
=?UTF-8?q?=E5=B0=8F=EF=BC=8C=E9=9C=80=E8=B0=83=E6=95=B4=E5=B1=95=E7=A4=BA?=
=?UTF-8?q?=E4=BD=8D=E7=BD=AE;=E8=A7=86=E5=8A=9B=E6=B5=8B=E8=AF=95:?=
=?UTF-8?q?=E8=A7=86=E5=8A=9B=E7=BB=93=E6=9E=9C=E4=BF=9D=E7=95=99=E4=B8=80?=
=?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0(=E4=BE=8B:4.0=205.0)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/index/index.vue | 24 ++++++++++++++++++------
pages/index/result.vue | 14 +++++++++++---
utils/index.js | 11 +++++++++++
3 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 9a28e68..84735e3 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -61,6 +61,18 @@
const res = await api.todayTodoList({userId:user_info.userId})
if(res.code == 0) {
todayTodoList.value = res.data
+ // 测试开始
+ // let o = [
+ // {
+ // remindTime: '2024.1.1',
+ // content: '测试'
+ // },
+ // {
+ // remindTime: '2024.1.1',
+ // content: '快去测试343232423快去测试快去测试快去测试快去测试快去测试'
+ // }]
+ // todayTodoList.value.push(...o)
+ // 测试结束
if(todayTodoList.value.length > 0) {
showTodo()
}
@@ -76,7 +88,7 @@
}
todayTodoListShow.value = todayTodoList.value[start_num]
start_num++
- }, 1000)
+ }, 2000)
}
function subscribeFunc() {
uni.requestSubscribeMessage({
@@ -243,10 +255,7 @@
-
- {{todayTodoListShow.remindTime}}:
-
- {{todayTodoListShow.content}}
+ {{todayTodoListShow.remindTime}}: {{todayTodoListShow.content}}
@@ -348,8 +357,11 @@
.todayTodoListBox{
display: flex;
align-items: center;
+ margin-top: 1vh;
.tlb-item-box{
- color: gray;
+ color: #f97a44;
+ font-weight: 900;
+ font-size: 4.2vw;
.tlb-item{
display: flex;
align-items: center;
diff --git a/pages/index/result.vue b/pages/index/result.vue
index fa54a66..577f651 100644
--- a/pages/index/result.vue
+++ b/pages/index/result.vue
@@ -53,16 +53,24 @@
src: bg_list.value[bg_list_index.value],
success:function(res) {
avatarUrl.value = uni.getStorageSync('avatarUrl')
- info.value.left = parseFloat(res_.value.leftEyeVision)
- info.value.right = parseFloat(res_.value.rightEyeVision)
+ // info.value.left = parseFloat(res_.value.leftEyeVision)
+ // info.value.right = parseFloat(res_.value.rightEyeVision)
show_.value = true
-
+ // 判断度数长度是否只有一位
+ info.value.left = getRightNum(info.value.left)
+ info.value.right = getRightNum(info.value.right)
},
fail(err) {
console.log(err)
}
})
}
+ function getRightNum(num) {
+ if((num+'').length === 1) {
+ num = num+'.0'
+ }
+ return num
+ }
diff --git a/utils/index.js b/utils/index.js
index 4daedf4..fde763b 100644
--- a/utils/index.js
+++ b/utils/index.js
@@ -111,5 +111,16 @@ export default {
else{
return false
}
+ },
+ // 有缓存信息,就访问登录接口,没有缓存就直接返回未登录
+ checkLoginPro(){
+ // let token = uni.getStorageSync('access_token')
+ let u_info = uni.getStorageSync('userInfo')
+ if(u_info){ // 有缓存信息,访问登录接口
+ return true
+ }
+ else{
+ return false
+ }
}
}
\ No newline at end of file