fix:首页调用鉴权接口;用药提醒框:字体太小,需调整展示位置;视力测试:视力结果保留一位小数(例:4.0 5.0)

This commit is contained in:
阿怪 2024-06-19 22:25:50 +08:00
parent c30fba1ec2
commit db46299b8c
3 changed files with 40 additions and 9 deletions

View File

@ -61,6 +61,18 @@
const res = await api.todayTodoList({userId:user_info.userId}) const res = await api.todayTodoList({userId:user_info.userId})
if(res.code == 0) { if(res.code == 0) {
todayTodoList.value = res.data 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) { if(todayTodoList.value.length > 0) {
showTodo() showTodo()
} }
@ -76,7 +88,7 @@
} }
todayTodoListShow.value = todayTodoList.value[start_num] todayTodoListShow.value = todayTodoList.value[start_num]
start_num++ start_num++
}, 1000) }, 2000)
} }
function subscribeFunc() { function subscribeFunc() {
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
@ -243,10 +255,7 @@
<uni-icons type="sound-filled" color="#fc9467" size="30"></uni-icons> <uni-icons type="sound-filled" color="#fc9467" size="30"></uni-icons>
<view class="tlb-item-box"> <view class="tlb-item-box">
<view class="tlb-item" @tap="todoFunc(1)"> <view class="tlb-item" @tap="todoFunc(1)">
<view class="tlb-time"> <view class="tlb-content text-ellipsis-1">{{todayTodoListShow.remindTime}}: &nbsp;{{todayTodoListShow.content}}</view>
{{todayTodoListShow.remindTime}}:
</view>
<view class="tlb-content">{{todayTodoListShow.content}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -348,8 +357,11 @@
.todayTodoListBox{ .todayTodoListBox{
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 1vh;
.tlb-item-box{ .tlb-item-box{
color: gray; color: #f97a44;
font-weight: 900;
font-size: 4.2vw;
.tlb-item{ .tlb-item{
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -53,16 +53,24 @@
src: bg_list.value[bg_list_index.value], src: bg_list.value[bg_list_index.value],
success:function(res) { success:function(res) {
avatarUrl.value = uni.getStorageSync('avatarUrl') avatarUrl.value = uni.getStorageSync('avatarUrl')
info.value.left = parseFloat(res_.value.leftEyeVision) // info.value.left = parseFloat(res_.value.leftEyeVision)
info.value.right = parseFloat(res_.value.rightEyeVision) // info.value.right = parseFloat(res_.value.rightEyeVision)
show_.value = true show_.value = true
//
info.value.left = getRightNum(info.value.left)
info.value.right = getRightNum(info.value.right)
}, },
fail(err) { fail(err) {
console.log(err) console.log(err)
} }
}) })
} }
function getRightNum(num) {
if((num+'').length === 1) {
num = num+'.0'
}
return num
}
</script> </script>
<template> <template>
<view class="visionTestBox page-box"> <view class="visionTestBox page-box">

View File

@ -111,5 +111,16 @@ export default {
else{ else{
return false return false
} }
},
// 有缓存信息,就访问登录接口,没有缓存就直接返回未登录
checkLoginPro(){
// let token = uni.getStorageSync('access_token')
let u_info = uni.getStorageSync('userInfo')
if(u_info){ // 有缓存信息,访问登录接口
return true
}
else{
return false
}
} }
} }