补充数据库数据,修改分类栏内容
This commit is contained in:
@@ -1,313 +1,72 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="我的" fallback-url="/pages/mall/delivery/home/index" :hide-header="true">
|
||||
<view class="delivery-profile-page">
|
||||
<view class="delivery-profile-hero">
|
||||
<view class="delivery-hero-top">
|
||||
<view class="delivery-avatar">
|
||||
<text class="delivery-avatar-text">{{ getAvatarText() }}</text>
|
||||
</view>
|
||||
<view class="delivery-user-main">
|
||||
<text class="delivery-user-name">{{ deliveryInfo != null ? deliveryInfo.name : '服务人员' }}</text>
|
||||
<view class="delivery-user-tags">
|
||||
<text class="delivery-user-tag">{{ deliveryInfo != null ? deliveryInfo.role : '居家服务人员' }}</text>
|
||||
<text class="delivery-user-tag delivery-user-tag-light">{{ getOnlineStatusText() }}</text>
|
||||
</view>
|
||||
<text class="delivery-user-org">{{ displayOrganizationName() }}</text>
|
||||
</view>
|
||||
<view class="delivery-setting-btn" @click="goSettings">
|
||||
<text class="delivery-setting-text">设置</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-hero-info-row">
|
||||
<view class="delivery-hero-info-item">
|
||||
<text class="delivery-hero-info-value">{{ displayStaffNo() }}</text>
|
||||
<text class="delivery-hero-info-label">人员编号</text>
|
||||
</view>
|
||||
<view class="delivery-hero-info-item">
|
||||
<text class="delivery-hero-info-value">{{ getCertificateStatusText() }}</text>
|
||||
<text class="delivery-hero-info-label">资质状态</text>
|
||||
</view>
|
||||
<view class="delivery-hero-info-item">
|
||||
<text class="delivery-hero-info-value">{{ displayServiceArea() }}</text>
|
||||
<text class="delivery-hero-info-label">服务区域</text>
|
||||
<view class="page">
|
||||
<view class="hero">
|
||||
<view class="hero-row">
|
||||
<view class="avatar"><text class="avatar-text">护</text></view>
|
||||
<view class="hero-main">
|
||||
<text class="hero-name">{{ nameText }}</text>
|
||||
<text class="hero-role">服务人员 / 护工 / 上门服务人员</text>
|
||||
<text class="hero-org">{{ organizationText }}</text>
|
||||
</view>
|
||||
<view class="hero-setting" @click="goSettings"><text class="hero-setting-text">设置</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-level-card">
|
||||
<view class="delivery-card-header">
|
||||
<view>
|
||||
<text class="delivery-card-title">服务等级</text>
|
||||
<text class="delivery-card-subtitle">接单、完成服务和用户好评会提升等级</text>
|
||||
</view>
|
||||
<text class="delivery-level-badge">{{ growthStats.levelName }}</text>
|
||||
</view>
|
||||
<view class="card stats-card">
|
||||
<view class="stat-item"><text class="stat-value">{{ acceptedText }}</text><text class="stat-label">今日接单</text></view>
|
||||
<view class="stat-item"><text class="stat-value">{{ servingText }}</text><text class="stat-label">服务中</text></view>
|
||||
<view class="stat-item"><text class="stat-value">{{ completedText }}</text><text class="stat-label">今日完成</text></view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-level-main">
|
||||
<text class="delivery-growth-value">{{ growthStats.growthValue }}</text>
|
||||
<text class="delivery-growth-total"> / {{ growthStats.nextLevelValue }} 成长值</text>
|
||||
</view>
|
||||
<view class="card">
|
||||
<text class="section-title">账号信息</text>
|
||||
<text class="row-text">人员编号:{{ staffNoText }}</text>
|
||||
<text class="row-text">联系电话:{{ phoneText }}</text>
|
||||
<text class="row-text">服务区域:{{ serviceAreaText }}</text>
|
||||
<text class="row-text">资质状态:{{ certificateText }}</text>
|
||||
<text class="row-text">资质到期:{{ certificateExpireText }}</text>
|
||||
</view>
|
||||
|
||||
<view class="delivery-progress-track">
|
||||
<view class="delivery-progress-fill" :style="{ width: getLevelProgressWidth() }"></view>
|
||||
</view>
|
||||
|
||||
<text class="delivery-level-tip">{{ growthStats.nextTips }}</text>
|
||||
|
||||
<view class="delivery-level-tags">
|
||||
<text class="delivery-level-tag">接单稳定</text>
|
||||
<text class="delivery-level-tag">好评优秀</text>
|
||||
<text class="delivery-level-tag">准时服务</text>
|
||||
<view class="card">
|
||||
<text class="section-title">工作状态</text>
|
||||
<view class="status-row">
|
||||
<view class="status-btn" :class="onlineStatusText == 'online' ? 'status-btn-active' : ''" @click="changeStatus('online')"><text class="status-btn-text">在线</text></view>
|
||||
<view class="status-btn" :class="onlineStatusText == 'resting' ? 'status-btn-active' : ''" @click="changeStatus('resting')"><text class="status-btn-text">离线</text></view>
|
||||
<view class="status-btn" :class="onlineStatusText == 'busy' ? 'status-btn-active' : ''" @click="changeStatus('busy')"><text class="status-btn-text">忙碌</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-stats-card">
|
||||
<view class="delivery-stat-item">
|
||||
<text class="delivery-stat-value">{{ deliveryInfo != null ? deliveryInfo.todayAccepted : 0 }}</text>
|
||||
<text class="delivery-stat-label">今日接单</text>
|
||||
</view>
|
||||
<view class="delivery-stat-item">
|
||||
<text class="delivery-stat-value">{{ deliveryInfo != null ? deliveryInfo.todayServing : 0 }}</text>
|
||||
<text class="delivery-stat-label">服务中</text>
|
||||
</view>
|
||||
<view class="delivery-stat-item">
|
||||
<text class="delivery-stat-value">{{ deliveryInfo != null ? deliveryInfo.todayCompleted : 0 }}</text>
|
||||
<text class="delivery-stat-label">今日完成</text>
|
||||
</view>
|
||||
<view class="delivery-stat-item">
|
||||
<text class="delivery-stat-value">{{ growthStats.goodRate }}%</text>
|
||||
<text class="delivery-stat-label">好评率</text>
|
||||
</view>
|
||||
<view class="card action-card">
|
||||
<view class="tool-item" @click="goOrders('today')"><text class="tool-title">今日订单</text><text class="tool-desc">查看待服务订单</text></view>
|
||||
<view class="tool-item" @click="goOrders('history')"><text class="tool-title">历史订单</text><text class="tool-desc">查看已完成和异常</text></view>
|
||||
<view class="tool-item" @click="goSettings"><text class="tool-title">设置</text><text class="tool-desc">退出登录和提醒设置</text></view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-status-card">
|
||||
<view class="delivery-card-header">
|
||||
<view>
|
||||
<text class="delivery-card-title">当前状态</text>
|
||||
<text class="delivery-card-subtitle">切换后会影响平台派单</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="delivery-status-row">
|
||||
<view class="delivery-status-btn" :class="deliveryInfo != null && deliveryInfo.onlineStatus == 'online' ? 'delivery-status-active' : ''" @click="changeStatus('online')">
|
||||
<text class="delivery-status-text">在线</text>
|
||||
</view>
|
||||
<view class="delivery-status-btn" :class="deliveryInfo != null && deliveryInfo.onlineStatus == 'resting' ? 'delivery-status-active' : ''" @click="changeStatus('resting')">
|
||||
<text class="delivery-status-text">休息</text>
|
||||
</view>
|
||||
<view class="delivery-status-btn" :class="deliveryInfo != null && deliveryInfo.onlineStatus == 'busy' ? 'delivery-status-active' : ''" @click="changeStatus('busy')">
|
||||
<text class="delivery-status-text">忙碌</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-tools-card">
|
||||
<view class="delivery-card-header">
|
||||
<text class="delivery-card-title">常用功能</text>
|
||||
</view>
|
||||
<view class="delivery-tools-grid">
|
||||
<view class="delivery-tool-item" @click="goOrders">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">单</text></view>
|
||||
<text class="delivery-tool-name">工单列表</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="goMessages">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">息</text></view>
|
||||
<text class="delivery-tool-name">消息中心</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="goCertificates">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">证</text></view>
|
||||
<text class="delivery-tool-name">资质证书</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="goRecords">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">记</text></view>
|
||||
<text class="delivery-tool-name">服务记录</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="showTodo('异常上报')">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">异</text></view>
|
||||
<text class="delivery-tool-name">异常上报</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="showTodo('服务规范')">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">规</text></view>
|
||||
<text class="delivery-tool-name">服务规范</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="goSettings">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">设</text></view>
|
||||
<text class="delivery-tool-name">设置</text>
|
||||
</view>
|
||||
<view class="delivery-tool-item" @click="showTodo('联系平台')">
|
||||
<view class="delivery-tool-icon"><text class="delivery-tool-icon-text">客</text></view>
|
||||
<text class="delivery-tool-name">联系平台</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-account-card">
|
||||
<view class="delivery-card-header">
|
||||
<view>
|
||||
<text class="delivery-card-title">账号与资质</text>
|
||||
<text class="delivery-card-subtitle">展示机构、区域、证书与账号安全信息</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="delivery-account-row">
|
||||
<text class="delivery-account-label">所属机构</text>
|
||||
<text class="delivery-account-value">{{ displayOrganizationName() }}</text>
|
||||
</view>
|
||||
<view class="delivery-account-row">
|
||||
<text class="delivery-account-label">服务区域</text>
|
||||
<text class="delivery-account-value">{{ displayServiceArea() }}</text>
|
||||
</view>
|
||||
<view class="delivery-account-row">
|
||||
<text class="delivery-account-label">资质状态</text>
|
||||
<text class="delivery-account-value">{{ getCertificateStatusText() }}</text>
|
||||
</view>
|
||||
<view class="delivery-account-row delivery-account-row-last">
|
||||
<text class="delivery-account-label">资质到期</text>
|
||||
<text class="delivery-account-value">{{ displayCertificateExpireAt() != '' ? displayCertificateExpireAt() : '暂无' }}</text>
|
||||
</view>
|
||||
<view class="delivery-logout-btn" @click="logout">
|
||||
<text class="delivery-logout-text">退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="delivery-profile-safe"></view>
|
||||
</view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import type { DeliveryInfoType } from '@/types/delivery.uts'
|
||||
import { getDeliveryProfile, updateDeliveryOnlineStatus } from '@/services/deliveryService.uts'
|
||||
import { logoutDelivery, requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
|
||||
type DeliveryGrowthStatsType = {
|
||||
levelName: string
|
||||
growthValue: number
|
||||
nextLevelValue: number
|
||||
completedTotal: number
|
||||
goodRate: number
|
||||
goodReviewCount: number
|
||||
onTimeRate: number
|
||||
nextTips: string
|
||||
}
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
|
||||
const deliveryInfo = ref<DeliveryInfoType | null>(null)
|
||||
|
||||
// TODO: 后续接入真实 delivery 服务等级统计接口
|
||||
const growthStats = ref({
|
||||
levelName: '银牌服务师',
|
||||
growthValue: 486,
|
||||
nextLevelValue: 800,
|
||||
completedTotal: 126,
|
||||
goodRate: 98,
|
||||
goodReviewCount: 112,
|
||||
onTimeRate: 96,
|
||||
nextTips: '再完成 12 单并获得 5 个好评可升级'
|
||||
} as DeliveryGrowthStatsType)
|
||||
|
||||
function displayOrganizationName(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '暂未绑定服务机构'
|
||||
}
|
||||
const organizationName = deliveryInfo.value.organizationName.trim()
|
||||
if (organizationName != '') {
|
||||
return organizationName
|
||||
}
|
||||
return '暂未绑定服务机构'
|
||||
}
|
||||
|
||||
function displayStaffNo(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '待分配'
|
||||
}
|
||||
const staffNo = deliveryInfo.value.staffNo.trim()
|
||||
if (staffNo != '') {
|
||||
return staffNo
|
||||
}
|
||||
return '待分配'
|
||||
}
|
||||
|
||||
function displayServiceArea(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '待完善'
|
||||
}
|
||||
const serviceArea = deliveryInfo.value.serviceArea.trim()
|
||||
if (serviceArea != '') {
|
||||
return serviceArea
|
||||
}
|
||||
return '待完善'
|
||||
}
|
||||
|
||||
function displayCertificateExpireAt(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return ''
|
||||
}
|
||||
return deliveryInfo.value.certificateExpireAt.trim()
|
||||
}
|
||||
|
||||
function getOnlineStatusText(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '未登录'
|
||||
}
|
||||
const status = deliveryInfo.value.onlineStatus
|
||||
if (status == 'online') {
|
||||
return '在线接单'
|
||||
}
|
||||
if (status == 'resting') {
|
||||
return '休息中'
|
||||
}
|
||||
if (status == 'busy') {
|
||||
return '忙碌中'
|
||||
}
|
||||
return '未知状态'
|
||||
}
|
||||
|
||||
function getCertificateStatusText(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '待认证'
|
||||
}
|
||||
const status = deliveryInfo.value.certificateStatus.trim()
|
||||
if (status == 'valid') {
|
||||
return '已认证'
|
||||
}
|
||||
if (status == 'expired') {
|
||||
return '已过期'
|
||||
}
|
||||
if (status == 'pending') {
|
||||
return '审核中'
|
||||
}
|
||||
if (status != '') {
|
||||
return status
|
||||
}
|
||||
return '待认证'
|
||||
}
|
||||
|
||||
function getAvatarText(): string {
|
||||
if (deliveryInfo.value == null) {
|
||||
return '护'
|
||||
}
|
||||
const name = deliveryInfo.value.name.trim()
|
||||
if (name == '') {
|
||||
return '护'
|
||||
}
|
||||
return name.substring(0, 1)
|
||||
}
|
||||
|
||||
function getLevelProgressWidth(): string {
|
||||
if (growthStats.value.nextLevelValue <= 0) {
|
||||
return '0%'
|
||||
}
|
||||
const percent = growthStats.value.growthValue * 100 / growthStats.value.nextLevelValue
|
||||
if (percent >= 100) {
|
||||
return '100%'
|
||||
}
|
||||
if (percent <= 0) {
|
||||
return '0%'
|
||||
}
|
||||
return percent.toString() + '%'
|
||||
}
|
||||
const nameText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.name : '服务人员')
|
||||
const organizationText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.organizationName : '机构待绑定')
|
||||
const acceptedText = computed((): string => deliveryInfo.value != null ? String(deliveryInfo.value.todayAccepted) : '0')
|
||||
const servingText = computed((): string => deliveryInfo.value != null ? String(deliveryInfo.value.todayServing) : '0')
|
||||
const completedText = computed((): string => deliveryInfo.value != null ? String(deliveryInfo.value.todayCompleted) : '0')
|
||||
const staffNoText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.staffNo : '待分配')
|
||||
const phoneText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.phone : '待完善')
|
||||
const serviceAreaText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.serviceArea : '待完善')
|
||||
const certificateText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.certificateStatus : '待认证')
|
||||
const certificateExpireText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.certificateExpireAt : '暂无')
|
||||
const onlineStatusText = computed((): string => deliveryInfo.value != null ? deliveryInfo.value.onlineStatus : 'resting')
|
||||
|
||||
async function loadData() {
|
||||
const authResult = await requireDeliveryAuth({ redirectOnFail: true, toastOnFail: true })
|
||||
@@ -318,419 +77,193 @@ async function loadData() {
|
||||
}
|
||||
|
||||
async function changeStatus(status: string) {
|
||||
const nextInfo = await updateDeliveryOnlineStatus(status)
|
||||
if (nextInfo != null) {
|
||||
deliveryInfo.value = nextInfo
|
||||
uni.showToast({ title: '状态已更新', icon: 'success' })
|
||||
if (deliveryInfo.value == null) {
|
||||
return
|
||||
}
|
||||
deliveryInfo.value = await updateDeliveryOnlineStatus(status)
|
||||
uni.showToast({ title: '状态已更新', icon: 'success' })
|
||||
}
|
||||
|
||||
function goCertificates() {
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/profile/certificates' })
|
||||
function goOrders(tab: string) {
|
||||
uni.setStorageSync('delivery_order_tab', tab)
|
||||
uni.switchTab({ url: '/pages/mall/delivery/orders/index' })
|
||||
}
|
||||
|
||||
function goSettings() {
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/profile/settings' })
|
||||
}
|
||||
|
||||
function goOrders() {
|
||||
uni.switchTab({ url: '/pages/mall/delivery/orders/index' })
|
||||
}
|
||||
|
||||
function goMessages() {
|
||||
uni.switchTab({ url: '/pages/mall/delivery/messages/index' })
|
||||
}
|
||||
|
||||
function goRecords() {
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/records/index' })
|
||||
}
|
||||
|
||||
function showTodo(title: string) {
|
||||
uni.showToast({
|
||||
title: title + '建设中',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await logoutDelivery()
|
||||
uni.reLaunch({ url: '/pages/user/login?mode=delivery' })
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.delivery-profile-page {
|
||||
.page {
|
||||
min-height: 100%;
|
||||
margin-left: -24rpx;
|
||||
margin-right: -24rpx;
|
||||
margin-top: -24rpx;
|
||||
padding-bottom: 32rpx;
|
||||
background-color: #f4f8fb;
|
||||
padding: 0 24rpx 36rpx;
|
||||
background-color: #f3f8fb;
|
||||
}
|
||||
|
||||
.delivery-profile-hero {
|
||||
padding: 72rpx 28rpx 34rpx;
|
||||
border-bottom-left-radius: 36rpx;
|
||||
border-bottom-right-radius: 36rpx;
|
||||
background-color: #0f766e;
|
||||
}
|
||||
|
||||
.delivery-hero-top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delivery-avatar {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
margin-right: 22rpx;
|
||||
border-radius: 56rpx;
|
||||
background-color: rgba(255, 255, 255, 0.92);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.delivery-avatar-text {
|
||||
font-size: 42rpx;
|
||||
font-weight: 700;
|
||||
color: #0f766e;
|
||||
}
|
||||
|
||||
.delivery-user-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.delivery-user-name {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.delivery-user-tags {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 12rpx;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.delivery-user-tag {
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 8rpx;
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 22rpx;
|
||||
color: #0f766e;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.delivery-user-tag-light {
|
||||
color: #ffffff;
|
||||
background-color: rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
.delivery-user-org {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.delivery-setting-btn {
|
||||
padding: 10rpx 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background-color: rgba(255, 255, 255, 0.18);
|
||||
}
|
||||
|
||||
.delivery-setting-text {
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.delivery-hero-info-row {
|
||||
margin-top: 32rpx;
|
||||
padding: 22rpx 18rpx;
|
||||
border-radius: 26rpx;
|
||||
background-color: rgba(255, 255, 255, 0.18);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.delivery-hero-info-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delivery-hero-info-value {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
max-width: 180rpx;
|
||||
text-align: center;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.delivery-hero-info-label {
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.78);
|
||||
}
|
||||
|
||||
.delivery-level-card,
|
||||
.delivery-stats-card,
|
||||
.delivery-status-card,
|
||||
.delivery-tools-card,
|
||||
.delivery-account-card {
|
||||
margin-left: 24rpx;
|
||||
margin-right: 24rpx;
|
||||
margin-top: 22rpx;
|
||||
padding: 26rpx;
|
||||
.hero,
|
||||
.card {
|
||||
border-radius: 28rpx;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 10rpx 28rpx rgba(15, 35, 55, 0.06);
|
||||
}
|
||||
|
||||
.delivery-level-card {
|
||||
margin-top: -18rpx;
|
||||
position: relative;
|
||||
.hero {
|
||||
padding: 64rpx 28rpx 28rpx;
|
||||
border-bottom-left-radius: 36rpx;
|
||||
border-bottom-right-radius: 36rpx;
|
||||
background: linear-gradient(180deg, #1f7db4 0%, #22a380 100%);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.delivery-card-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.delivery-card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.delivery-card-subtitle {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 32rpx;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-level-badge {
|
||||
padding: 8rpx 16rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 22rpx;
|
||||
color: #92400e;
|
||||
background-color: #fef3c7;
|
||||
}
|
||||
|
||||
.delivery-level-main {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.delivery-growth-value {
|
||||
font-size: 46rpx;
|
||||
font-weight: 700;
|
||||
color: #0f766e;
|
||||
}
|
||||
|
||||
.delivery-growth-total {
|
||||
margin-left: 6rpx;
|
||||
margin-bottom: 6rpx;
|
||||
font-size: 24rpx;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-progress-track {
|
||||
margin-top: 18rpx;
|
||||
height: 16rpx;
|
||||
border-radius: 999rpx;
|
||||
background-color: #e2e8f0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.delivery-progress-fill {
|
||||
height: 16rpx;
|
||||
border-radius: 999rpx;
|
||||
background-color: #0f766e;
|
||||
}
|
||||
|
||||
.delivery-level-tip {
|
||||
display: block;
|
||||
margin-top: 14rpx;
|
||||
font-size: 23rpx;
|
||||
line-height: 34rpx;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-level-tags {
|
||||
margin-top: 18rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.delivery-level-tag {
|
||||
margin-right: 12rpx;
|
||||
margin-bottom: 10rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 22rpx;
|
||||
color: #0f766e;
|
||||
background-color: #ecfdf5;
|
||||
}
|
||||
|
||||
.delivery-stats-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding-top: 28rpx;
|
||||
padding-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.delivery-stat-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delivery-stat-value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.delivery-stat-label {
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-status-row {
|
||||
margin-top: 22rpx;
|
||||
.hero-row,
|
||||
.stats-card,
|
||||
.status-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.delivery-status-btn {
|
||||
width: 31%;
|
||||
height: 68rpx;
|
||||
border-radius: 999rpx;
|
||||
background-color: #f1f5f9;
|
||||
display: flex;
|
||||
.hero-row {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 48rpx;
|
||||
background-color: rgba(255, 255, 255, 0.22);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.delivery-status-active {
|
||||
background-color: #0f766e;
|
||||
box-shadow: 0 8rpx 18rpx rgba(15, 118, 110, 0.18);
|
||||
}
|
||||
|
||||
.delivery-status-text {
|
||||
font-size: 26rpx;
|
||||
.avatar-text {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-status-active .delivery-status-text {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.delivery-tools-grid {
|
||||
margin-top: 22rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
.hero-main {
|
||||
flex: 1;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.delivery-tool-item {
|
||||
width: 25%;
|
||||
margin-bottom: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delivery-tool-icon {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 24rpx;
|
||||
background-color: #ecfdf5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.delivery-tool-icon-text {
|
||||
font-size: 28rpx;
|
||||
.hero-name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #0f766e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.delivery-tool-name {
|
||||
margin-top: 10rpx;
|
||||
font-size: 23rpx;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.delivery-account-row {
|
||||
min-height: 72rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom-width: 1rpx;
|
||||
border-bottom-color: #eef2f7;
|
||||
}
|
||||
|
||||
.delivery-account-row-last {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.delivery-account-label {
|
||||
font-size: 26rpx;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.delivery-account-value {
|
||||
max-width: 420rpx;
|
||||
text-align: right;
|
||||
font-size: 26rpx;
|
||||
.hero-role,
|
||||
.hero-org,
|
||||
.stat-label,
|
||||
.row-text,
|
||||
.tool-desc,
|
||||
.hero-setting-text,
|
||||
.status-btn-text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.hero-role,
|
||||
.hero-org {
|
||||
margin-top: 10rpx;
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
}
|
||||
|
||||
.hero-setting {
|
||||
padding: 14rpx 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.hero-setting-text {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-top: 22rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
width: 31%;
|
||||
padding: 22rpx 14rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #f7fbfd;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-value,
|
||||
.section-title,
|
||||
.tool-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 34rpx;
|
||||
color: #176e97;
|
||||
}
|
||||
|
||||
.stat-label,
|
||||
.tool-desc,
|
||||
.row-text {
|
||||
color: #5e758c;
|
||||
}
|
||||
|
||||
.section-title,
|
||||
.tool-title {
|
||||
font-size: 30rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.delivery-logout-btn {
|
||||
margin-top: 24rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #fff1f2;
|
||||
display: flex;
|
||||
.row-text {
|
||||
display: block;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.status-btn {
|
||||
width: 31%;
|
||||
padding: 18rpx 0;
|
||||
border-radius: 18rpx;
|
||||
background-color: #eef6fa;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.delivery-logout-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #e11d48;
|
||||
.status-btn-active {
|
||||
background-color: #d8eef9;
|
||||
}
|
||||
|
||||
.delivery-profile-safe {
|
||||
height: 40rpx;
|
||||
.status-btn-text {
|
||||
color: #176e97;
|
||||
}
|
||||
|
||||
.tool-item {
|
||||
margin-top: 14rpx;
|
||||
padding: 18rpx;
|
||||
border-radius: 18rpx;
|
||||
background-color: #f7fbfd;
|
||||
}
|
||||
|
||||
.tool-title {
|
||||
font-size: 28rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.tool-desc {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -8,20 +8,22 @@
|
||||
<text v-if="deliveryInfo != null" class="info-text">资质状态:{{ deliveryInfo.certificateStatus }}</text>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="提醒与权限" subtitle="预留定位权限、语音播报和消息提醒控制。">
|
||||
<ServicePanel title="提醒与权限" subtitle="保留消息提醒和定位权限提示占位。">
|
||||
<view class="setting-row">
|
||||
<text class="setting-text">消息提醒</text>
|
||||
<switch :checked="messageEnabled" color="#0f766e" @change="toggleMessage" />
|
||||
</view>
|
||||
<view class="setting-row">
|
||||
<text class="setting-text">语音播报</text>
|
||||
<switch :checked="voiceEnabled" color="#0f766e" @change="toggleVoice" />
|
||||
<switch :checked="messageEnabled" color="#1f7db4" @change="toggleMessage" />
|
||||
</view>
|
||||
<view class="setting-row">
|
||||
<text class="setting-text">定位权限提示</text>
|
||||
<text class="setting-hint">请确保 Android 和小程序侧授权开启</text>
|
||||
<text class="setting-hint">定位轨迹仅做字段预留,当前为 mock</text>
|
||||
</view>
|
||||
<view class="setting-row setting-row-last">
|
||||
<text class="setting-text">图片上传</text>
|
||||
<text class="setting-hint">当前仅占位,不做真实上传</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
|
||||
<view class="logout-btn" @click="confirmLogout"><text class="logout-text">退出登录</text></view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
@@ -32,10 +34,9 @@ import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uv
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import type { DeliveryInfoType } from '@/types/delivery.uts'
|
||||
import { getDeliveryProfile } from '@/services/deliveryService.uts'
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
import { logoutDelivery, requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
|
||||
const messageEnabled = ref(true)
|
||||
const voiceEnabled = ref(false)
|
||||
const deliveryInfo = ref<DeliveryInfoType | null>(null)
|
||||
|
||||
function displayOrganizationName(): string {
|
||||
@@ -62,9 +63,7 @@ function displayStaffNo(): string {
|
||||
|
||||
function restoreSettings() {
|
||||
const msg = uni.getStorageSync('delivery_setting_message') as boolean | null
|
||||
const voice = uni.getStorageSync('delivery_setting_voice') as boolean | null
|
||||
messageEnabled.value = msg == null ? true : msg
|
||||
voiceEnabled.value = voice == null ? false : voice
|
||||
}
|
||||
|
||||
function toggleMessage(event: any) {
|
||||
@@ -72,9 +71,17 @@ function toggleMessage(event: any) {
|
||||
uni.setStorageSync('delivery_setting_message', messageEnabled.value)
|
||||
}
|
||||
|
||||
function toggleVoice(event: any) {
|
||||
voiceEnabled.value = event.detail.value === true
|
||||
uni.setStorageSync('delivery_setting_voice', voiceEnabled.value)
|
||||
function confirmLogout() {
|
||||
uni.showModal({
|
||||
title: '退出登录',
|
||||
content: '退出后将清除服务人员信息并返回登录页。',
|
||||
success: async (result) => {
|
||||
if (result.confirm) {
|
||||
await logoutDelivery()
|
||||
uni.reLaunch({ url: '/pages/user/login?mode=delivery' })
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
@@ -100,6 +107,10 @@ onShow(() => {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.setting-row-last {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
display: block;
|
||||
margin-top: 12rpx;
|
||||
@@ -120,4 +131,19 @@ onShow(() => {
|
||||
text-align: right;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
margin-top: 24rpx;
|
||||
padding: 20rpx 0;
|
||||
border-radius: 18rpx;
|
||||
background-color: #fff1f2;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logout-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #dc2626;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user