feat: 初始化居家上门服务系统完整项目代码
- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<view class="workbench">
|
||||
<view class="stats-row">
|
||||
<view class="stat-item"><text class="stat-num">{{ stats.todayTotal }}</text><text>今日工单</text></view>
|
||||
<view class="stat-item"><text class="stat-num">{{ stats.completedToday }}</text><text>已完成</text></view>
|
||||
<view class="stat-item warn"><text class="stat-num">{{ stats.exceptionCount }}</text><text>异常</text></view>
|
||||
</view>
|
||||
<view class="quick-actions">
|
||||
<view class="action-card" @click="navTo('/pages/delivery/orders/orders?status=ORDER_ASSIGNED')">
|
||||
<text class="action-num">{{ stats.pendingAccept }}</text><text>待接单</text>
|
||||
</view>
|
||||
<view class="action-card" @click="navTo('/pages/delivery/orders/orders?status=ORDER_ACCEPTED')">
|
||||
<text class="action-num">{{ stats.pendingCheckin }}</text><text>待签到</text>
|
||||
</view>
|
||||
<view class="action-card" @click="navTo('/pages/delivery/orders/orders?status=ORDER_IN_SERVICE')">
|
||||
<text class="action-num">{{ stats.inService }}</text><text>服务中</text>
|
||||
</view>
|
||||
<view class="action-card" @click="navTo('/pages/delivery/offline-sync/offline-sync')">
|
||||
<text>离线补传</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-list">
|
||||
<text class="section-title">今日任务</text>
|
||||
<view v-for="o in todayOrders" :key="o.id" class="order-item" @click="navTo('/pages/delivery/order-detail/order-detail?id='+o.id)">
|
||||
<text class="patient-name">{{ o.patient_name }}</text>
|
||||
<text class="time">{{ o.time_window_start }} - {{ o.time_window_end }}</text>
|
||||
<text :class="'status status-'+o.status">{{ statusText(o.status) }}</text>
|
||||
</view>
|
||||
<view v-if="todayOrders.length === 0" class="empty">暂无今日任务</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { apiGet } from '@/common/api.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
stats: { todayTotal: 0, completedToday: 0, exceptionCount: 0, pendingAccept: 0, pendingCheckin: 0, inService: 0 },
|
||||
todayOrders: []
|
||||
};
|
||||
},
|
||||
onShow() { this.loadData(); },
|
||||
methods: {
|
||||
async loadData() {
|
||||
try {
|
||||
const [wbRes, ordersRes] = await Promise.all([
|
||||
apiGet('/delivery/workbench'),
|
||||
apiGet('/delivery/work-orders/today')
|
||||
]);
|
||||
if (wbRes.data.code === 200) this.stats = wbRes.data.data;
|
||||
if (ordersRes.data.code === 200) this.todayOrders = ordersRes.data.data;
|
||||
} catch (e) {}
|
||||
},
|
||||
navTo(url) { uni.navigateTo({ url }); },
|
||||
statusText(s) {
|
||||
const m = { ORDER_ASSIGNED: '待接单', ORDER_ACCEPTED: '待签到', ORDER_CHECKED_IN: '待服务', ORDER_IN_SERVICE: '服务中', ORDER_COMPLETED: '已完成', ORDER_EXCEPTION: '异常' };
|
||||
return m[s] || s;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.workbench { padding: 20rpx; }
|
||||
.stats-row { display: flex; justify-content: space-around; padding: 30rpx; background: #fff; border-radius: 16rpx; margin-bottom: 20rpx; }
|
||||
.stat-item { text-align: center; }
|
||||
.stat-num { font-size: 48rpx; font-weight: bold; display: block; }
|
||||
.stat-item.warn .stat-num { color: #ff4d4f; }
|
||||
.quick-actions { display: flex; flex-wrap: wrap; gap: 20rpx; margin-bottom: 20rpx; }
|
||||
.action-card { flex: 1; min-width: 150rpx; background: #fff; padding: 30rpx; border-radius: 16rpx; text-align: center; }
|
||||
.action-num { font-size: 40rpx; font-weight: bold; display: block; color: #1677ff; }
|
||||
.section-title { font-size: 32rpx; font-weight: bold; margin: 20rpx 0; display: block; }
|
||||
.order-item { background: #fff; padding: 24rpx; border-radius: 12rpx; margin-bottom: 12rpx; display: flex; justify-content: space-between; }
|
||||
.empty { text-align: center; color: #999; padding: 60rpx; }
|
||||
</style>
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<view class="login-container">
|
||||
<view class="logo-area">
|
||||
<text class="title">居家上门服务</text>
|
||||
<text class="subtitle">服务人员端</text>
|
||||
</view>
|
||||
<view class="form-area">
|
||||
<input class="input" v-model="username" placeholder="请输入账号" />
|
||||
<input class="input" v-model="password" type="password" placeholder="请输入密码" />
|
||||
<button class="login-btn" @click="handleLogin" :disabled="loading">
|
||||
{{ loading ? '登录中...' : '登录' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { BASE_URL } from '@/common/api.js';
|
||||
export default {
|
||||
data() {
|
||||
return { username: '', password: '', loading: false };
|
||||
},
|
||||
methods: {
|
||||
async handleLogin() {
|
||||
if (!this.username || !this.password) {
|
||||
uni.showToast({ title: '请输入账号密码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await uni.request({
|
||||
url: BASE_URL + '/auth/login',
|
||||
method: 'POST',
|
||||
data: { username: this.username, password: this.password, role: 'STAFF' }
|
||||
});
|
||||
if (res.data.code === 200) {
|
||||
uni.setStorageSync('token', res.data.data.token);
|
||||
uni.setStorageSync('userInfo', res.data.data);
|
||||
uni.switchTab({ url: '/pages/delivery/index/index' });
|
||||
} else {
|
||||
uni.showToast({ title: res.data.message, icon: 'none' });
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '网络错误', icon: 'none' });
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.login-container { padding: 80rpx 60rpx; }
|
||||
.logo-area { text-align: center; margin-bottom: 80rpx; }
|
||||
.title { font-size: 48rpx; font-weight: bold; display: block; }
|
||||
.subtitle { font-size: 28rpx; color: #999; margin-top: 10rpx; }
|
||||
.input { border: 1px solid #ddd; border-radius: 12rpx; padding: 24rpx; margin-bottom: 24rpx; font-size: 30rpx; }
|
||||
.login-btn { background: #1677ff; color: #fff; border-radius: 12rpx; height: 88rpx; line-height: 88rpx; font-size: 32rpx; margin-top: 40rpx; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user