feat: 首页添加弹幕提醒

This commit is contained in:
阿怪 2024-04-26 14:57:47 +08:00
parent d35fab34e3
commit c30fba1ec2
4 changed files with 58 additions and 7 deletions

View File

@ -20,6 +20,7 @@ const API = {
getTodoist:(data,userId) => net.GET("/user/todo",data,true,{"userId":userId}),// 获取待办事项
getVisionList:data => net.GET("/vision/list",data),// 获取测试记录
todoFinished:data => net.PUT("/user/todo",data),// 修改待办列表状态
todayTodoList:data => net.GET("/user/todo/today",data),// 今天待办列表
// 百科
getArticleList:data => net.GET("/article/list",data),// 百科列表
getArticleDetail:(data,userId) => net.GET("/article/"+data.id,null,true,{"userId":userId}),// 文章详情

View File

@ -1,5 +1,5 @@
// isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true;
const isdev = false;
const baseUrl = isdev ? 'https://367a21fd.r12.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://707788f2.r1.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境

View File

@ -191,7 +191,8 @@
{{item.content}}
</view>
<view class="td-info small-text">
{{util.timestampToDate(item.CreatedAt)}}
<!-- {{util.timestampToDate(item.CreatedAt)}} -->
{{item.remindDay + " " +item.remindTime}}
</view>
</view>
<emptyCard v-else></emptyCard>

View File

@ -14,18 +14,17 @@
const h_index = ref(0)
onShow((e) => {
getLbtList()
// console.log("store:",store)
// if(!store.userInfo && !store.operation_info) { //
if(!store.userInfo) { //
// console.log("store.userInfo",store.userInfo)
// getHospitalList()
// setTimeout(()=>{
// inputDialog.value.open()
// },0)
} else {
setTimeout(()=>{
inputDialog.value.close()
},0)
// setTimeout(()=>{
// inputDialog.value.close()
// },0)
getTodayTodoList()
}
})
@ -51,7 +50,34 @@
pageSize:1000,
key:''
})
const todayTodoList = ref([])
const todayTodoListShow = ref({})
//
async function getTodayTodoList() {
const userInfo = uni.getStorageSync('userInfo')
if(userInfo) {
let user_info = JSON.parse(userInfo)
if(user_info.userId) {
const res = await api.todayTodoList({userId:user_info.userId})
if(res.code == 0) {
todayTodoList.value = res.data
if(todayTodoList.value.length > 0) {
showTodo()
}
}
}
}
}
function showTodo() {
let start_num = 0
setInterval(() => {
if(!(start_num < todayTodoList.value.length)) {
start_num = 0
}
todayTodoListShow.value = todayTodoList.value[start_num]
start_num++
}, 1000)
}
function subscribeFunc() {
uni.requestSubscribeMessage({
         tmplIds: ['PgxoZOOSDgBcmIGd_EVLDnYUmL3eu6NQTAZCsHQeuWY'],
@ -212,6 +238,18 @@
<uni-icons type="forward" color="#9bc027" size="20"></uni-icons>
</view>
</view> -->
<!-- 提示弹幕 -->
<view class="todayTodoListBox" v-if="todayTodoList.length>0">
<uni-icons type="sound-filled" color="#fc9467" size="30"></uni-icons>
<view class="tlb-item-box">
<view class="tlb-item" @tap="todoFunc(1)">
<view class="tlb-time">
{{todayTodoListShow.remindTime}}:
</view>
<view class="tlb-content">{{todayTodoListShow.content}}</view>
</view>
</view>
</view>
<view class="attention-card">
<!-- <view class="part-title">
测试记录
@ -307,6 +345,17 @@
</view>
</template>
<style scoped lang="scss">
.todayTodoListBox{
display: flex;
align-items: center;
.tlb-item-box{
color: gray;
.tlb-item{
display: flex;
align-items: center;
}
}
}
.buy-btn{
display: block;
margin-top:1rem;