1
This commit is contained in:
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<hr-page page-bg="#F3F4F6" status-bg="#FFFFFF" nav-title="" :xloading="true">
|
||||
|
||||
<!-- ============ 个人 hero ============ -->
|
||||
<view class="mine-hero">
|
||||
<view class="mine-c1"></view>
|
||||
<view class="mine-c2"></view>
|
||||
<view class="mine-row">
|
||||
<view class="mine-avt">
|
||||
<text class="mine-avt-t">{{ user.avatar }}</text>
|
||||
</view>
|
||||
<view class="hr-flex1">
|
||||
<text class="mine-name">{{ user.name }}</text>
|
||||
<text class="mine-role">{{ user.title }} · {{ user.dept }} · 工号 {{ user.jobNo }}</text>
|
||||
</view>
|
||||
<view class="mine-edit" @click="onEdit">
|
||||
<text class="mine-edit-t">编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mine-tags">
|
||||
<view v-for="(t, i) in user.tags" :key="i" class="mine-tag">
|
||||
<text class="mine-tag-t">{{ t }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- ============ 数据条(上浮压住 hero) ============ -->
|
||||
<view class="mine-stats">
|
||||
<view class="mine-stat-cell">
|
||||
<text class="mine-stat-b">{{ user.hours }}</text>
|
||||
<text class="mine-stat-s">累计学时</text>
|
||||
</view>
|
||||
<view class="mine-stat-sep"></view>
|
||||
<view class="mine-stat-cell">
|
||||
<text class="mine-stat-b">{{ user.courseCount }}</text>
|
||||
<text class="mine-stat-s">完成课程</text>
|
||||
</view>
|
||||
<view class="mine-stat-sep"></view>
|
||||
<view class="mine-stat-cell">
|
||||
<text class="mine-stat-b">{{ user.certCount }}</text>
|
||||
<text class="mine-stat-s">有效证书</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="hr-body" style="padding-top:16px">
|
||||
|
||||
<!-- 救援人员端:学习档案 -->
|
||||
<hr-card v-if="isRescuer" variant="list">
|
||||
<hr-lrow icon="▦" theme="pri" title="学习中心" sub="错题 12 · 收藏 8 · 笔记 5" value="›"
|
||||
@click="go('/pages/study/center')"></hr-lrow>
|
||||
<hr-lrow icon="▤" theme="grn" title="我的证书" sub="3 张有效 · 1 张即将到期" value="›" :is-last="true"
|
||||
@click="go('/pages/study/certificates')"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<!-- 仓管人员端:仓储概览 -->
|
||||
<hr-card v-if="!isRescuer" variant="list">
|
||||
<hr-lrow icon="!" theme="red" title="库存预警" sub="6 项低于预警线" value="去处理 ›" value-theme="red"
|
||||
:value-bold="true" @click="go('/pages/warehouse/stock')"></hr-lrow>
|
||||
<hr-lrow icon="⚑" theme="amb" title="借用审批" sub="3 条待审批" value="去审批 ›" value-theme="pri"
|
||||
:value-bold="true" @click="go('/pages/message/index')"></hr-lrow>
|
||||
<hr-lrow icon="⚙" theme="pri" title="设备台账" sub="24 台 · 4 台借出中" value="›" :is-last="true"
|
||||
@click="go('/pages/warehouse/devices')"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<!-- 通用条目 -->
|
||||
<hr-card variant="list" style="margin-top:10px">
|
||||
<hr-lrow icon="✉" theme="amb" title="消息中心" :sub="msgSub" value="›"
|
||||
@click="go(isRescuer ? '/pages/message/list' : '/pages/message/index')">
|
||||
<template v-slot:right>
|
||||
<view v-if="hrUnread.msgCenter > 0" class="hr-badge">
|
||||
<text class="hr-badge-t">{{ hrUnread.msgCenter }}</text>
|
||||
</view>
|
||||
</template>
|
||||
</hr-lrow>
|
||||
<hr-lrow v-if="isRescuer" icon="☎" title="通讯录" sub="指挥员 / 医院 / 同事" value="›"
|
||||
@click="go('/pages/message/contacts')"></hr-lrow>
|
||||
<hr-lrow v-if="!isRescuer" icon="▦" theme="pri" title="扫码出入库" sub="连续扫码 · 三态即时反馈"
|
||||
value="›" @click="go('/pages/warehouse/scan')"></hr-lrow>
|
||||
<hr-lrow icon="⚙" title="设置" sub="通知 / 隐私 / 关于" value="›" :is-last="true"
|
||||
@click="go('/pages/mine/settings')"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<hr-card variant="list" style="margin-top:10px">
|
||||
<hr-lrow icon="question-line" title="帮助与反馈" sub="使用手册 · 问题上报" value="›" :is-last="true"
|
||||
@click="onHelp"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<view class="mine-logout" @click="onLogout">
|
||||
<text class="mine-logout-t">退出登录</text>
|
||||
</view>
|
||||
|
||||
<view style="height:14px"></view>
|
||||
</view>
|
||||
|
||||
<template v-slot:tabbar>
|
||||
<hr-tabbar :active="isRescuer ? 2 : 4"></hr-tabbar>
|
||||
</template>
|
||||
</hr-page>
|
||||
</template>
|
||||
|
||||
<script lang="uts" setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { hrSession, logout } from '@/utils/role.uts'
|
||||
import { navTo, relaunchTo } from '@/utils/nav.uts'
|
||||
import { hrUnread } from '@/utils/unread.uts'
|
||||
|
||||
/**
|
||||
* s08 个人中心(双角色共用)
|
||||
* 救援端:学习档案(学习中心 / 证书)+ 消息 + 通讯录
|
||||
* 仓管端:仓储概览(库存预警 / 借用审批 / 设备台账)+ 消息 + 扫码
|
||||
*/
|
||||
const user = hrSession
|
||||
|
||||
const isRescuer = computed(() : boolean => {
|
||||
return user.role != 'keeper'
|
||||
})
|
||||
|
||||
const msgSub = computed(() : string => {
|
||||
return isRescuer.value ? '派单通知 · 系统消息' : '库存预警 · 借用审批 · 系统'
|
||||
})
|
||||
|
||||
function go(url : string) : void {
|
||||
navTo(url)
|
||||
}
|
||||
|
||||
function onEdit() : void {
|
||||
uni.showToast({ title: '编辑个人资料', icon: 'none' })
|
||||
}
|
||||
|
||||
function onHelp() : void {
|
||||
uni.showModal({ title: '帮助与反馈', content: '使用手册 / 问题上报\n值班室电话 8801', showCancel: false })
|
||||
}
|
||||
|
||||
function onLogout() : void {
|
||||
uni.showModal({
|
||||
title: '退出登录',
|
||||
content: '确认退出当前账号?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
logout()
|
||||
relaunchTo('/pages/login/index')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.mine-hero {
|
||||
background-image: linear-gradient(to bottom right, #2563EB, #1E40AF);
|
||||
padding: 32rpx 32rpx 52rpx 32rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mine-c1 {
|
||||
position: absolute;
|
||||
right: -80rpx;
|
||||
top: -96rpx;
|
||||
width: 296rpx;
|
||||
height: 296rpx;
|
||||
border-radius: 148rpx;
|
||||
background-color: rgba(255, 255, 255, 0.10);
|
||||
}
|
||||
|
||||
.mine-c2 {
|
||||
position: absolute;
|
||||
right: 68rpx;
|
||||
bottom: -104rpx;
|
||||
width: 184rpx;
|
||||
height: 184rpx;
|
||||
border-radius: 92rpx;
|
||||
background-color: rgba(255, 255, 255, 0.07);
|
||||
}
|
||||
|
||||
.mine-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mine-avt {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 36rpx;
|
||||
background-color: rgba(255, 255, 255, 0.22);
|
||||
border: 3rpx solid rgba(255, 255, 255, 0.5);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
|
||||
.mine-avt-t {
|
||||
font-size: 49.2rpx;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.mine-name {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.mine-role {
|
||||
font-size: 25.8rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.mine-edit {
|
||||
padding: 14rpx 24rpx 14rpx 24rpx;
|
||||
border-radius: 18rpx;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.mine-edit-t {
|
||||
font-size: 26.8rpx;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.mine-tags {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.mine-tag {
|
||||
padding: 6rpx 18rpx 6rpx 18rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: rgba(255, 255, 255, 0.18);
|
||||
margin-right: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.mine-tag-t {
|
||||
font-size: 23.6rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.mine-stats {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 28rpx;
|
||||
margin-top: -28rpx;
|
||||
margin-left: 32rpx;
|
||||
margin-right: 32rpx;
|
||||
padding: 26rpx 8rpx 26rpx 8rpx;
|
||||
box-shadow: 0 12rpx 36rpx rgba(15, 23, 42, 0.10);
|
||||
}
|
||||
|
||||
.mine-stat-cell {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mine-stat-b {
|
||||
font-size: 42.6rpx;
|
||||
font-weight: bold;
|
||||
color: #1F2937;
|
||||
}
|
||||
|
||||
.mine-stat-s {
|
||||
font-size: 23.6rpx;
|
||||
color: #6B7280;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.mine-stat-sep {
|
||||
width: 2rpx;
|
||||
height: 56rpx;
|
||||
background-color: #F3F4F6;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.mine-logout {
|
||||
margin-top: 32rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 24rpx;
|
||||
background-color: #FFFFFF;
|
||||
border: 2rpx solid #E5E7EB;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mine-logout-t {
|
||||
font-size: 32.4rpx;
|
||||
font-weight: bold;
|
||||
color: #DC2626;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<hr-page page-bg="#F3F4F6" status-bg="#FFFFFF" nav-title="设置" :xloading="true">
|
||||
|
||||
<view class="hr-body">
|
||||
|
||||
<!-- ============ 通知 ============ -->
|
||||
<hr-sec title="通知" first></hr-sec>
|
||||
<hr-card variant="list">
|
||||
<view v-for="(s, i) in switches" :key="i" class="hr-lrow"
|
||||
:class="i == switches.length - 1 ? 'hr-lrow-last' : ''">
|
||||
<view class="hr-lmain">
|
||||
<text class="hr-lmain-b">{{ s.title }}</text>
|
||||
<text class="hr-lmain-s">{{ s.sub }}</text>
|
||||
</view>
|
||||
<x-switch v-model="s.on" color="#10B981" size="small"></x-switch>
|
||||
</view>
|
||||
</hr-card>
|
||||
|
||||
<!-- ============ 离线与存储 ============ -->
|
||||
<hr-sec title="离线与存储"></hr-sec>
|
||||
<hr-card variant="list">
|
||||
<hr-lrow v-for="(r, i) in offlineRows" :key="i" :title="r.title" :sub="r.sub" :value="r.value"
|
||||
:is-last="i == offlineRows.length - 1" @click="onRowClick(i, true)"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<!-- ============ 通用 ============ -->
|
||||
<hr-sec title="通用"></hr-sec>
|
||||
<hr-card variant="list">
|
||||
<hr-lrow v-for="(r, i) in commonRows" :key="i" :title="r.title" :sub="r.sub" :value="r.value"
|
||||
:is-last="i == commonRows.length - 1" @click="onRowClick(i, false)"></hr-lrow>
|
||||
</hr-card>
|
||||
|
||||
<hr-tip style="margin-top:16px" theme="info" icon="ℹ"
|
||||
text="P0 派单强提醒开启后,收到 P0 派单将全屏告警并强制震动,请保持开启。"></hr-tip>
|
||||
|
||||
<view style="height:14px"></view>
|
||||
</view>
|
||||
</hr-page>
|
||||
</template>
|
||||
|
||||
<script lang="uts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { settingSwitches, offlineSettingRows, commonSettingRows } from '@/mock/index.uts'
|
||||
import { HrSettingSwitch, HrSettingRow } from '@/mock/types.uts'
|
||||
import { navTo } from '@/utils/nav.uts'
|
||||
|
||||
/** s39 设置 */
|
||||
const switches = ref<HrSettingSwitch[]>(settingSwitches)
|
||||
const offlineRows = ref<HrSettingRow[]>(offlineSettingRows)
|
||||
const commonRows = ref<HrSettingRow[]>(commonSettingRows)
|
||||
|
||||
function onRowClick(i : number, isOffline : boolean) : void {
|
||||
if (isOffline) {
|
||||
if (i == 0) { navTo('/pages/triage/offline-sync'); return }
|
||||
uni.showModal({
|
||||
title: '清理已下载资料',
|
||||
content: '将删除 8.6 MB 离线学习资料,无网络时需重新下载。',
|
||||
success: (res) => {
|
||||
if (res.confirm) { uni.showToast({ title: '已清理 8.6 MB', icon: 'success' }) }
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (i == 0) {
|
||||
uni.showModal({
|
||||
title: '清理缓存',
|
||||
content: '当前缓存 24.3 MB,清理后不影响账号数据。',
|
||||
success: (res) => {
|
||||
if (res.confirm) { uni.showToast({ title: '已清理 24.3 MB', icon: 'success' }) }
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (i == 1) {
|
||||
uni.showModal({ title: '医院救援管理平台', content: '版本 v2.0.0\n移动端逻辑重构版', showCancel: false })
|
||||
return
|
||||
}
|
||||
uni.showModal({ title: '隐私政策', content: '本平台严格保护伤患与医护人员的个人信息,数据仅用于院前急救调度。', showCancel: false })
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user