start
This commit is contained in:
66
pages/ai/index.js
Normal file
66
pages/ai/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/ai/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/ai/index.json
Normal file
3
pages/ai/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/ai/index.wxml
Normal file
2
pages/ai/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/ai/index.wxml-->
|
||||
<text>pages/ai/index.wxml</text>
|
||||
1
pages/ai/index.wxss
Normal file
1
pages/ai/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/ai/index.wxss */
|
||||
66
pages/customer/index.js
Normal file
66
pages/customer/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/customer/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/customer/index.json
Normal file
3
pages/customer/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
pages/customer/index.less
Normal file
1
pages/customer/index.less
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/customer/index.wxss */
|
||||
2
pages/customer/index.wxml
Normal file
2
pages/customer/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/customer/index.wxml-->
|
||||
<text>pages/customer/index.wxml</text>
|
||||
66
pages/home/index.js
Normal file
66
pages/home/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/home/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/home/index.json
Normal file
3
pages/home/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/home/index.wxml
Normal file
2
pages/home/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/home/index.wxml-->
|
||||
<text>pages/home/index.wxml</text>
|
||||
1
pages/home/index.wxss
Normal file
1
pages/home/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/home/index.wxss */
|
||||
664
pages/order/index.js
Normal file
664
pages/order/index.js
Normal file
@@ -0,0 +1,664 @@
|
||||
// pages/order/index.js
|
||||
|
||||
// 状态映射配置
|
||||
const STATUS_MAP = {
|
||||
pending: { label: '待确认', text: '待确认', color: '#f59f00' },
|
||||
confirmed: { label: '已确认', text: '已确认', color: '#4c6ef5' },
|
||||
in_progress: { label: '进行中', text: '进行中', color: '#20c997' },
|
||||
completed: { label: '已完成', text: '已完成', color: '#51cf66' },
|
||||
cancelled: { label: '已取消', text: '已取消', color: '#ff6b6b' }
|
||||
};
|
||||
|
||||
// 状态筛选选项
|
||||
const STATUS_FILTERS = [
|
||||
{ label: '全部', value: '', count: 0 },
|
||||
{ label: '待确认', value: 'pending', count: 0 },
|
||||
{ label: '已确认', value: 'confirmed', count: 0 },
|
||||
{ label: '进行中', value: 'in_progress', count: 0 },
|
||||
{ label: '已完成', value: 'completed', count: 0 },
|
||||
{ label: '已取消', value: 'cancelled', count: 0 }
|
||||
];
|
||||
|
||||
// Mock 数据 - 基于 escort_record.js 的数据结构
|
||||
const MOCK_ORDERS = [
|
||||
{
|
||||
_id: 'ORD20240530001',
|
||||
orderNo: '20240530001',
|
||||
userId: 'user001',
|
||||
patient: {
|
||||
name: '张三',
|
||||
mobile: '138****1234',
|
||||
sex: 'male',
|
||||
age: 65,
|
||||
idnumber: '310***********1234'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 1,
|
||||
serviceName: '全程陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '复旦大学附属中山医院',
|
||||
address: '上海市徐汇区枫林路180号',
|
||||
department: '心内科',
|
||||
doctor: '李医生',
|
||||
medicalRecordNo: 'MR202405001'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-06-01T09:00:00.000Z',
|
||||
dateText: '06月01日',
|
||||
startTime: '09:00',
|
||||
endTime: '12:00',
|
||||
duration: 180
|
||||
},
|
||||
attendant: {
|
||||
id: 'att001',
|
||||
name: '王陪诊',
|
||||
sex: 'female'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 298,
|
||||
paidFee: 298,
|
||||
status: 'paid'
|
||||
},
|
||||
notes: {
|
||||
patientNote: '患者行动不便,需要轮椅',
|
||||
escortNote: '',
|
||||
medicalSummary: ''
|
||||
},
|
||||
status: 'pending',
|
||||
statusText: '待确认',
|
||||
meta: {
|
||||
createtime: '2024-05-30T10:00:00.000Z',
|
||||
updatetime: '2024-05-30T10:00:00.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
_id: 'ORD20240529002',
|
||||
orderNo: '20240529002',
|
||||
userId: 'user002',
|
||||
patient: {
|
||||
name: '李四',
|
||||
mobile: '139****5678',
|
||||
sex: 'female',
|
||||
age: 42,
|
||||
idnumber: '310***********5678'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 2,
|
||||
serviceName: '挂号陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '上海交通大学医学院附属瑞金医院',
|
||||
address: '上海市黄浦区瑞金二路197号',
|
||||
department: '内分泌科',
|
||||
doctor: '张医生',
|
||||
medicalRecordNo: 'MR202405002'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-05-31T14:00:00.000Z',
|
||||
dateText: '05月31日',
|
||||
startTime: '14:00',
|
||||
endTime: '16:00',
|
||||
duration: 120
|
||||
},
|
||||
attendant: {
|
||||
id: 'att002',
|
||||
name: '赵陪诊',
|
||||
sex: 'male'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 198,
|
||||
paidFee: 198,
|
||||
status: 'paid'
|
||||
},
|
||||
notes: {
|
||||
patientNote: '需要帮忙取药',
|
||||
escortNote: '',
|
||||
medicalSummary: ''
|
||||
},
|
||||
status: 'confirmed',
|
||||
statusText: '已确认',
|
||||
meta: {
|
||||
createtime: '2024-05-29T08:30:00.000Z',
|
||||
updatetime: '2024-05-29T15:00:00.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
_id: 'ORD20240528003',
|
||||
orderNo: '20240528003',
|
||||
userId: 'user003',
|
||||
patient: {
|
||||
name: '王五',
|
||||
mobile: '137****9012',
|
||||
sex: 'male',
|
||||
age: 78,
|
||||
idnumber: '310***********9012'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 1,
|
||||
serviceName: '全程陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '上海市第六人民医院',
|
||||
address: '上海市徐汇区宜山路600号',
|
||||
department: '骨科',
|
||||
doctor: '刘医生',
|
||||
medicalRecordNo: 'MR202405003'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-05-30T08:30:00.000Z',
|
||||
dateText: '05月30日',
|
||||
startTime: '08:30',
|
||||
endTime: '11:30',
|
||||
duration: 180
|
||||
},
|
||||
attendant: {
|
||||
id: 'att003',
|
||||
name: '陈陪诊',
|
||||
sex: 'female'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 398,
|
||||
paidFee: 200,
|
||||
status: 'partial'
|
||||
},
|
||||
notes: {
|
||||
patientNote: '听力不好,请大声说话',
|
||||
escortNote: '已接到患者,正在前往医院',
|
||||
medicalSummary: ''
|
||||
},
|
||||
status: 'in_progress',
|
||||
statusText: '进行中',
|
||||
meta: {
|
||||
createtime: '2024-05-28T16:00:00.000Z',
|
||||
updatetime: '2024-05-30T08:35:00.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
_id: 'ORD20240525004',
|
||||
orderNo: '20240525004',
|
||||
userId: 'user004',
|
||||
patient: {
|
||||
name: '赵六',
|
||||
mobile: '136****3456',
|
||||
sex: 'female',
|
||||
age: 55,
|
||||
idnumber: '310***********3456'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 3,
|
||||
serviceName: '检查陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '华东医院',
|
||||
address: '上海市静安区延安西路221号',
|
||||
department: '体检中心',
|
||||
doctor: '',
|
||||
medicalRecordNo: 'MR202405004'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-05-28T07:30:00.000Z',
|
||||
dateText: '05月28日',
|
||||
startTime: '07:30',
|
||||
endTime: '11:00',
|
||||
duration: 210
|
||||
},
|
||||
attendant: {
|
||||
id: 'att004',
|
||||
name: '孙陪诊',
|
||||
sex: 'male'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 258,
|
||||
paidFee: 258,
|
||||
status: 'paid'
|
||||
},
|
||||
notes: {
|
||||
patientNote: '需要空腹检查',
|
||||
escortNote: '服务完成,患者已安全送回家',
|
||||
medicalSummary: '完成全身检查,各项指标正常'
|
||||
},
|
||||
status: 'completed',
|
||||
statusText: '已完成',
|
||||
meta: {
|
||||
createtime: '2024-05-25T09:00:00.000Z',
|
||||
updatetime: '2024-05-28T11:30:00.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
_id: 'ORD20240524005',
|
||||
orderNo: '20240524005',
|
||||
userId: 'user005',
|
||||
patient: {
|
||||
name: '钱七',
|
||||
mobile: '135****7890',
|
||||
sex: 'male',
|
||||
age: 33,
|
||||
idnumber: '310***********7890'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 2,
|
||||
serviceName: '挂号陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '上海市第一人民医院',
|
||||
address: '上海市虹口区武进路85号',
|
||||
department: '眼科',
|
||||
doctor: '周医生',
|
||||
medicalRecordNo: 'MR202405005'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-05-27T10:00:00.000Z',
|
||||
dateText: '05月27日',
|
||||
startTime: '10:00',
|
||||
endTime: '11:00',
|
||||
duration: 60
|
||||
},
|
||||
attendant: {
|
||||
id: '',
|
||||
name: '',
|
||||
sex: 'none'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 128,
|
||||
paidFee: 0,
|
||||
status: 'unpaid'
|
||||
},
|
||||
notes: {
|
||||
patientNote: '临时有事,需要取消',
|
||||
escortNote: '',
|
||||
medicalSummary: ''
|
||||
},
|
||||
status: 'cancelled',
|
||||
statusText: '已取消',
|
||||
meta: {
|
||||
createtime: '2024-05-24T14:00:00.000Z',
|
||||
updatetime: '2024-05-26T09:00:00.000Z'
|
||||
}
|
||||
},
|
||||
{
|
||||
_id: 'ORD20240523006',
|
||||
orderNo: '20240523006',
|
||||
userId: 'user006',
|
||||
patient: {
|
||||
name: '孙八',
|
||||
mobile: '134****2468',
|
||||
sex: 'female',
|
||||
age: 60,
|
||||
idnumber: '310***********2468'
|
||||
},
|
||||
escort: {
|
||||
serviceId: 1,
|
||||
serviceName: '全程陪诊服务'
|
||||
},
|
||||
hospital: {
|
||||
province: '上海',
|
||||
name: '上海中医药大学附属龙华医院',
|
||||
address: '上海市徐汇区宛平南路725号',
|
||||
department: '中医内科',
|
||||
doctor: '吴医生',
|
||||
medicalRecordNo: 'MR202405006'
|
||||
},
|
||||
schedule: {
|
||||
date: '2024-06-02T08:00:00.000Z',
|
||||
dateText: '06月02日',
|
||||
startTime: '08:00',
|
||||
endTime: '11:00',
|
||||
duration: 180
|
||||
},
|
||||
attendant: {
|
||||
id: 'att005',
|
||||
name: '周陪诊',
|
||||
sex: 'female'
|
||||
},
|
||||
payment: {
|
||||
totalFee: 328,
|
||||
paidFee: 328,
|
||||
status: 'paid'
|
||||
},
|
||||
notes: {
|
||||
patientNote: ' prefer 女陪诊员',
|
||||
escortNote: '',
|
||||
medicalSummary: ''
|
||||
},
|
||||
status: 'pending',
|
||||
statusText: '待确认',
|
||||
meta: {
|
||||
createtime: '2024-05-23T11:00:00.000Z',
|
||||
updatetime: '2024-05-23T11:00:00.000Z'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
// 统计
|
||||
stats: {
|
||||
total: 0,
|
||||
pending: 0,
|
||||
confirmed: 0,
|
||||
inProgress: 0,
|
||||
completed: 0,
|
||||
cancelled: 0
|
||||
},
|
||||
// 状态筛选
|
||||
statusFilters: STATUS_FILTERS,
|
||||
currentStatus: '',
|
||||
// 订单列表
|
||||
orderList: [],
|
||||
// 分页
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
hasMore: true,
|
||||
// 加载状态
|
||||
isLoading: false,
|
||||
isLoadingMore: false,
|
||||
isRefreshing: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.loadOrderList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 页面显示时刷新数据
|
||||
if (this.data.orderList.length > 0) {
|
||||
this.refreshData();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 计算统计数据
|
||||
*/
|
||||
calculateStats(orders) {
|
||||
const stats = {
|
||||
total: orders.length,
|
||||
pending: 0,
|
||||
confirmed: 0,
|
||||
inProgress: 0,
|
||||
completed: 0,
|
||||
cancelled: 0
|
||||
};
|
||||
|
||||
orders.forEach(order => {
|
||||
switch (order.status) {
|
||||
case 'pending':
|
||||
stats.pending++;
|
||||
break;
|
||||
case 'confirmed':
|
||||
stats.confirmed++;
|
||||
break;
|
||||
case 'in_progress':
|
||||
stats.inProgress++;
|
||||
break;
|
||||
case 'completed':
|
||||
stats.completed++;
|
||||
break;
|
||||
case 'cancelled':
|
||||
stats.cancelled++;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return stats;
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新筛选标签计数
|
||||
*/
|
||||
updateFilterCounts(stats) {
|
||||
const statusFilters = this.data.statusFilters.map(filter => {
|
||||
let count = 0;
|
||||
switch (filter.value) {
|
||||
case '':
|
||||
count = stats.total;
|
||||
break;
|
||||
case 'pending':
|
||||
count = stats.pending;
|
||||
break;
|
||||
case 'confirmed':
|
||||
count = stats.confirmed;
|
||||
break;
|
||||
case 'in_progress':
|
||||
count = stats.inProgress;
|
||||
break;
|
||||
case 'completed':
|
||||
count = stats.completed;
|
||||
break;
|
||||
case 'cancelled':
|
||||
count = stats.cancelled;
|
||||
break;
|
||||
}
|
||||
return { ...filter, count };
|
||||
});
|
||||
|
||||
this.setData({ statusFilters });
|
||||
},
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
*/
|
||||
formatDate(dateStr) {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
return `${month}月${day}日`;
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理订单数据
|
||||
*/
|
||||
processOrders(orders) {
|
||||
return orders.map(order => ({
|
||||
...order,
|
||||
statusText: STATUS_MAP[order.status]?.text || order.status,
|
||||
'schedule.dateText': this.formatDate(order.schedule.date)
|
||||
}));
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载订单列表
|
||||
*/
|
||||
loadOrderList(isRefresh = false) {
|
||||
if (this.data.isLoading || this.data.isLoadingMore) return;
|
||||
|
||||
const { currentStatus, page, pageSize } = this.data;
|
||||
|
||||
this.setData({ isLoading: !isRefresh, isLoadingMore: isRefresh && page > 1 });
|
||||
|
||||
// 模拟 API 请求延迟
|
||||
setTimeout(() => {
|
||||
// 筛选数据
|
||||
let filteredOrders = MOCK_ORDERS;
|
||||
if (currentStatus) {
|
||||
filteredOrders = MOCK_ORDERS.filter(order => order.status === currentStatus);
|
||||
}
|
||||
|
||||
// 分页
|
||||
const start = (page - 1) * pageSize;
|
||||
const end = start + pageSize;
|
||||
const pageData = filteredOrders.slice(start, end);
|
||||
|
||||
// 处理数据
|
||||
const processedOrders = this.processOrders(pageData);
|
||||
|
||||
// 计算统计
|
||||
const stats = this.calculateStats(MOCK_ORDERS);
|
||||
this.updateFilterCounts(stats);
|
||||
|
||||
// 更新列表
|
||||
const orderList = isRefresh && page > 1
|
||||
? [...this.data.orderList, ...processedOrders]
|
||||
: processedOrders;
|
||||
|
||||
this.setData({
|
||||
orderList,
|
||||
stats,
|
||||
isLoading: false,
|
||||
isLoadingMore: false,
|
||||
isRefreshing: false,
|
||||
hasMore: end < filteredOrders.length
|
||||
});
|
||||
}, 600);
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
refreshData() {
|
||||
this.setData({ page: 1, hasMore: true }, () => {
|
||||
this.loadOrderList();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 状态筛选切换
|
||||
*/
|
||||
onStatusChange(e) {
|
||||
const status = e.currentTarget.dataset.status;
|
||||
if (status === this.data.currentStatus) return;
|
||||
|
||||
this.setData({
|
||||
currentStatus: status,
|
||||
page: 1,
|
||||
hasMore: true,
|
||||
orderList: []
|
||||
}, () => {
|
||||
this.loadOrderList();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
onOrderDetail(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/order/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单操作
|
||||
*/
|
||||
onOrderAction(e) {
|
||||
const { id, action } = e.currentTarget.dataset;
|
||||
const order = this.data.orderList.find(item => item._id === id);
|
||||
if (!order) return;
|
||||
|
||||
// 阻止冒泡,防止触发卡片点击
|
||||
e.stopPropagation();
|
||||
|
||||
const actionMap = {
|
||||
confirm: { title: '确认订单', content: '确认接受此订单?', nextStatus: 'confirmed' },
|
||||
cancel: { title: '取消订单', content: '确定要取消此订单?', nextStatus: 'cancelled' },
|
||||
start: { title: '开始服务', content: '确认开始陪诊服务?', nextStatus: 'in_progress' },
|
||||
complete: { title: '完成服务', content: '确认陪诊服务已完成?', nextStatus: 'completed' },
|
||||
detail: { title: '', content: '', nextStatus: '' }
|
||||
};
|
||||
|
||||
const actionConfig = actionMap[action];
|
||||
if (!actionConfig) return;
|
||||
|
||||
if (action === 'detail') {
|
||||
wx.navigateTo({
|
||||
url: `/pages/order/detail?id=${id}`
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
wx.showModal({
|
||||
title: actionConfig.title,
|
||||
content: actionConfig.content,
|
||||
confirmColor: '#4c6ef5',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 更新订单状态
|
||||
this.updateOrderStatus(id, actionConfig.nextStatus);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新订单状态
|
||||
*/
|
||||
updateOrderStatus(id, newStatus) {
|
||||
wx.showLoading({ title: '处理中...' });
|
||||
|
||||
// 模拟 API 请求
|
||||
setTimeout(() => {
|
||||
const orderList = this.data.orderList.map(order => {
|
||||
if (order._id === id) {
|
||||
return {
|
||||
...order,
|
||||
status: newStatus,
|
||||
statusText: STATUS_MAP[newStatus]?.text || newStatus,
|
||||
'meta.updatetime': new Date().toISOString()
|
||||
};
|
||||
}
|
||||
return order;
|
||||
});
|
||||
|
||||
// 重新计算统计
|
||||
const allOrders = MOCK_ORDERS.map(order => {
|
||||
if (order._id === id) {
|
||||
return { ...order, status: newStatus };
|
||||
}
|
||||
return order;
|
||||
});
|
||||
const stats = this.calculateStats(allOrders);
|
||||
this.updateFilterCounts(stats);
|
||||
|
||||
this.setData({ orderList, stats });
|
||||
wx.hideLoading();
|
||||
wx.showToast({ title: '操作成功', icon: 'success' });
|
||||
}, 500);
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
this.setData({ isRefreshing: true, page: 1, hasMore: true }, () => {
|
||||
this.loadOrderList();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
if (!this.data.hasMore || this.data.isLoadingMore) return;
|
||||
|
||||
this.setData({ page: this.data.page + 1 }, () => {
|
||||
this.loadOrderList(true);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '订单管理',
|
||||
path: '/pages/order/index'
|
||||
};
|
||||
}
|
||||
});
|
||||
15
pages/order/index.json
Normal file
15
pages/order/index.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"navigationBarTitleText": "订单管理",
|
||||
"navigationBarBackgroundColor": "#1a1f3c",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#0f1535",
|
||||
"usingComponents": {
|
||||
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||
"t-tag": "tdesign-miniprogram/tag/tag",
|
||||
"t-empty": "tdesign-miniprogram/empty/empty",
|
||||
"t-loading": "tdesign-miniprogram/loading/loading",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider"
|
||||
}
|
||||
}
|
||||
494
pages/order/index.less
Normal file
494
pages/order/index.less
Normal file
@@ -0,0 +1,494 @@
|
||||
/* pages/order/index.less */
|
||||
|
||||
// 颜色变量
|
||||
@bg-primary: #0f1535;
|
||||
@bg-secondary: #1a1f3c;
|
||||
@bg-card: #1e2548;
|
||||
@bg-card-hover: #252d5a;
|
||||
@accent-primary: #4c6ef5;
|
||||
@accent-secondary: #6b7aff;
|
||||
@accent-gradient-start: #4c6ef5;
|
||||
@accent-gradient-end: #748ffc;
|
||||
@text-primary: #ffffff;
|
||||
@text-secondary: #a0a8d0;
|
||||
@text-muted: #6b7298;
|
||||
@border-color: #2a3366;
|
||||
@status-pending: #f59f00;
|
||||
@status-confirmed: #4c6ef5;
|
||||
@status-in-progress: #20c997;
|
||||
@status-completed: #51cf66;
|
||||
@status-cancelled: #ff6b6b;
|
||||
@divider-color: #2a3366;
|
||||
|
||||
page {
|
||||
background-color: @bg-primary;
|
||||
color: @text-primary;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.order-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background-color: @bg-primary;
|
||||
}
|
||||
|
||||
// ========== 顶部统计区域 ==========
|
||||
.header-section {
|
||||
position: relative;
|
||||
padding: 30rpx 30rpx 40rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.header-bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(135deg, @accent-gradient-start 0%, @accent-gradient-end 100%);
|
||||
border-radius: 0 0 40rpx 40rpx;
|
||||
opacity: 0.15;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -100rpx;
|
||||
right: -100rpx;
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
background: radial-gradient(circle, rgba(76, 110, 245, 0.2) 0%, transparent 70%);
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.stats-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: rgba(30, 37, 72, 0.8);
|
||||
backdrop-filter: blur(20rpx);
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
border: 1rpx solid rgba(107, 122, 255, 0.1);
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: @text-primary;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 24rpx;
|
||||
color: @text-secondary;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
height: 60rpx;
|
||||
background: linear-gradient(to bottom, transparent, @divider-color, transparent);
|
||||
}
|
||||
|
||||
// ========== 筛选区域 ==========
|
||||
.filter-section {
|
||||
padding: 20rpx 0;
|
||||
background-color: @bg-primary;
|
||||
}
|
||||
|
||||
.filter-scroll {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-list {
|
||||
display: inline-flex;
|
||||
padding: 0 20rpx;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 28rpx;
|
||||
background-color: @bg-card;
|
||||
border-radius: 32rpx;
|
||||
border: 1rpx solid transparent;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end);
|
||||
border-color: transparent;
|
||||
box-shadow: 0 4rpx 16rpx rgba(76, 110, 245, 0.3);
|
||||
|
||||
.filter-text {
|
||||
color: @text-primary;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.filter-text {
|
||||
font-size: 26rpx;
|
||||
color: @text-secondary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.filter-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 32rpx;
|
||||
height: 32rpx;
|
||||
padding: 0 8rpx;
|
||||
margin-left: 8rpx;
|
||||
background-color: @status-cancelled;
|
||||
border-radius: 16rpx;
|
||||
font-size: 20rpx;
|
||||
color: @text-primary;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
// ========== 订单列表区域 ==========
|
||||
.order-list {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.order-scroll {
|
||||
height: 100%;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.loading-container,
|
||||
.empty-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 200rpx 40rpx;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
color: @text-secondary !important;
|
||||
font-size: 26rpx !important;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
color: @text-secondary !important;
|
||||
font-size: 28rpx !important;
|
||||
}
|
||||
|
||||
.empty-action {
|
||||
margin-top: 30rpx;
|
||||
padding: 16rpx 48rpx;
|
||||
background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end);
|
||||
color: @text-primary;
|
||||
font-size: 28rpx;
|
||||
border-radius: 32rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// ========== 订单卡片 ==========
|
||||
.order-cards {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
margin-bottom: 24rpx;
|
||||
background-color: @bg-card;
|
||||
border-radius: 24rpx;
|
||||
border: 1rpx solid @border-color;
|
||||
overflow: hidden;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
background-color: @bg-card-hover;
|
||||
}
|
||||
|
||||
// 状态左边框
|
||||
&.pending {
|
||||
border-left: 4rpx solid @status-pending;
|
||||
}
|
||||
|
||||
&.confirmed {
|
||||
border-left: 4rpx solid @status-confirmed;
|
||||
}
|
||||
|
||||
&.in_progress {
|
||||
border-left: 4rpx solid @status-in-progress;
|
||||
}
|
||||
|
||||
&.completed {
|
||||
border-left: 4rpx solid @status-completed;
|
||||
}
|
||||
|
||||
&.cancelled {
|
||||
border-left: 4rpx solid @status-cancelled;
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 28rpx 16rpx;
|
||||
}
|
||||
|
||||
.order-id {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
}
|
||||
|
||||
.order-id-text {
|
||||
font-size: 24rpx;
|
||||
color: @text-muted;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.pending {
|
||||
background-color: rgba(245, 159, 0, 0.15);
|
||||
color: @status-pending;
|
||||
}
|
||||
|
||||
&.confirmed {
|
||||
background-color: rgba(76, 110, 245, 0.15);
|
||||
color: @accent-secondary;
|
||||
}
|
||||
|
||||
&.in_progress {
|
||||
background-color: rgba(32, 201, 151, 0.15);
|
||||
color: @status-in-progress;
|
||||
}
|
||||
|
||||
&.completed {
|
||||
background-color: rgba(81, 207, 102, 0.15);
|
||||
color: @status-completed;
|
||||
}
|
||||
|
||||
&.cancelled {
|
||||
background-color: rgba(255, 107, 107, 0.15);
|
||||
color: @status-cancelled;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 卡片主体 ==========
|
||||
.card-body {
|
||||
padding: 0 28rpx;
|
||||
}
|
||||
|
||||
.patient-row {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.patient-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.patient-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.avatar-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: @text-primary;
|
||||
}
|
||||
|
||||
.patient-detail {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.patient-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.patient-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: @text-primary;
|
||||
}
|
||||
|
||||
.patient-gender {
|
||||
font-size: 22rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 6rpx;
|
||||
background-color: rgba(107, 122, 255, 0.15);
|
||||
color: @accent-secondary;
|
||||
|
||||
&.male {
|
||||
background-color: rgba(76, 110, 245, 0.15);
|
||||
color: @accent-primary;
|
||||
}
|
||||
|
||||
&.female {
|
||||
background-color: rgba(255, 107, 107, 0.15);
|
||||
color: @status-cancelled;
|
||||
}
|
||||
}
|
||||
|
||||
.patient-age {
|
||||
font-size: 22rpx;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.patient-phone {
|
||||
font-size: 24rpx;
|
||||
color: @text-muted;
|
||||
}
|
||||
|
||||
.info-divider {
|
||||
height: 1rpx;
|
||||
background: linear-gradient(to right, transparent, @divider-color, transparent);
|
||||
margin: 16rpx 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.hospital-name {
|
||||
font-size: 26rpx;
|
||||
color: @text-primary;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.department-name {
|
||||
font-size: 24rpx;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.service-name {
|
||||
font-size: 26rpx;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.time-text {
|
||||
font-size: 26rpx;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
.attendant-name {
|
||||
font-size: 26rpx;
|
||||
color: @text-secondary;
|
||||
}
|
||||
|
||||
// ========== 卡片底部 ==========
|
||||
.card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 28rpx 24rpx;
|
||||
margin-top: 8rpx;
|
||||
border-top: 1rpx solid rgba(42, 51, 102, 0.5);
|
||||
}
|
||||
|
||||
.fee-section {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.fee-label {
|
||||
font-size: 24rpx;
|
||||
color: @text-muted;
|
||||
}
|
||||
|
||||
.fee-value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: @status-pending;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 14rpx 32rpx;
|
||||
border-radius: 28rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end);
|
||||
color: @text-primary;
|
||||
box-shadow: 0 4rpx 16rpx rgba(76, 110, 245, 0.3);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background-color: transparent;
|
||||
color: @text-secondary;
|
||||
border: 1rpx solid @border-color;
|
||||
|
||||
&:active {
|
||||
background-color: rgba(107, 122, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 加载更多 ==========
|
||||
.load-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40rpx 20rpx;
|
||||
}
|
||||
|
||||
.no-more {
|
||||
font-size: 24rpx;
|
||||
color: @text-muted;
|
||||
}
|
||||
176
pages/order/index.wxml
Normal file
176
pages/order/index.wxml
Normal file
@@ -0,0 +1,176 @@
|
||||
<!--pages/order/index.wxml-->
|
||||
<view class="order-page">
|
||||
|
||||
<!-- 状态筛选标签 -->
|
||||
<view class="filter-section">
|
||||
<scroll-view class="filter-scroll" scroll-x enhanced show-scrollbar="{{false}}">
|
||||
<view class="filter-list">
|
||||
<view
|
||||
class="filter-item {{currentStatus === item.value ? 'active' : ''}}"
|
||||
wx:for="{{statusFilters}}"
|
||||
wx:key="value"
|
||||
data-status="{{item.value}}"
|
||||
bindtap="onStatusChange"
|
||||
>
|
||||
<text class="filter-text">{{item.label}}</text>
|
||||
<view class="filter-badge" wx:if="{{item.count > 0}}">{{item.count}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<view class="order-list">
|
||||
<scroll-view
|
||||
scroll-y
|
||||
class="order-scroll"
|
||||
refresher-enabled
|
||||
refresher-triggered="{{isRefreshing}}"
|
||||
bindrefresherrefresh="onPullDownRefresh"
|
||||
bindscrolltolower="onReachBottom"
|
||||
>
|
||||
<!-- 加载中 -->
|
||||
<view class="loading-container" wx:if="{{isLoading && orderList.length === 0}}">
|
||||
<t-loading theme="spinner" size="40rpx" text="加载中..." t-class-text="loading-text" />
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view class="empty-container" wx:elif="{{!isLoading && orderList.length === 0}}">
|
||||
<t-empty icon="file" description="暂无订单数据" t-class-description="empty-text">
|
||||
<view slot="action">
|
||||
<view class="empty-action" bindtap="loadOrderList">刷新试试</view>
|
||||
</view>
|
||||
</t-empty>
|
||||
</view>
|
||||
|
||||
<!-- 订单卡片列表 -->
|
||||
<view class="order-cards" wx:else>
|
||||
<view
|
||||
class="order-card {{item.status}}"
|
||||
wx:for="{{orderList}}"
|
||||
wx:key="_id"
|
||||
data-id="{{item._id}}"
|
||||
bindtap="onOrderDetail"
|
||||
>
|
||||
<!-- 卡片头部 -->
|
||||
<view class="card-header">
|
||||
<view class="order-id">
|
||||
<t-icon name="file" size="28rpx" color="#6b7aff" />
|
||||
<text class="order-id-text">订单 {{item.orderNo || item._id}}</text>
|
||||
</view>
|
||||
<view class="status-tag {{item.status}}">
|
||||
<text>{{item.statusText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 患者信息 -->
|
||||
<view class="card-body">
|
||||
<view class="patient-row">
|
||||
<view class="patient-info">
|
||||
<view class="patient-avatar">
|
||||
<text class="avatar-text">{{item.patient.name ? item.patient.name[0] : '患'}}</text>
|
||||
</view>
|
||||
<view class="patient-detail">
|
||||
<view class="patient-name-row">
|
||||
<text class="patient-name">{{item.patient.name || '未知患者'}}</text>
|
||||
<text class="patient-gender {{item.patient.sex}}">{{item.patient.sex === 'male' ? '男' : item.patient.sex === 'female' ? '女' : '未知'}}</text>
|
||||
<text class="patient-age" wx:if="{{item.patient.age}}">{{item.patient.age}}岁</text>
|
||||
</view>
|
||||
<text class="patient-phone">{{item.patient.mobile || '暂无电话'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-divider"></view>
|
||||
|
||||
<!-- 医院信息 -->
|
||||
<view class="hospital-row">
|
||||
<view class="info-item">
|
||||
<t-icon name="location" size="26rpx" color="#8b9bff" />
|
||||
<view class="info-content">
|
||||
<text class="hospital-name">{{item.hospital.name || '未知医院'}}</text>
|
||||
<text class="department-name" wx:if="{{item.hospital.department}}">{{item.hospital.department}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊服务 -->
|
||||
<view class="service-row" wx:if="{{item.escort.serviceName}}">
|
||||
<view class="info-item">
|
||||
<t-icon name="service" size="26rpx" color="#8b9bff" />
|
||||
<text class="service-name">{{item.escort.serviceName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预约时间 -->
|
||||
<view class="time-row">
|
||||
<view class="info-item">
|
||||
<t-icon name="time" size="26rpx" color="#8b9bff" />
|
||||
<text class="time-text">{{item.schedule.dateText}} {{item.schedule.startTime || ''}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊员信息 -->
|
||||
<view class="attendant-row" wx:if="{{item.attendant.name}}">
|
||||
<view class="info-item">
|
||||
<t-icon name="user" size="26rpx" color="#8b9bff" />
|
||||
<text class="attendant-name">陪诊员:{{item.attendant.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片底部 -->
|
||||
<view class="card-footer">
|
||||
<view class="fee-section">
|
||||
<text class="fee-label">服务费用</text>
|
||||
<text class="fee-value">¥{{item.payment.totalFee || 0}}</text>
|
||||
</view>
|
||||
<view class="action-buttons">
|
||||
<view
|
||||
class="btn btn-secondary"
|
||||
wx:if="{{item.status === 'pending'}}"
|
||||
data-id="{{item._id}}"
|
||||
data-action="cancel"
|
||||
catchtap="onOrderAction"
|
||||
>取消</view>
|
||||
<view
|
||||
class="btn btn-primary"
|
||||
wx:if="{{item.status === 'pending'}}"
|
||||
data-id="{{item._id}}"
|
||||
data-action="confirm"
|
||||
catchtap="onOrderAction"
|
||||
>确认</view>
|
||||
<view
|
||||
class="btn btn-primary"
|
||||
wx:if="{{item.status === 'confirmed'}}"
|
||||
data-id="{{item._id}}"
|
||||
data-action="start"
|
||||
catchtap="onOrderAction"
|
||||
>开始服务</view>
|
||||
<view
|
||||
class="btn btn-primary"
|
||||
wx:if="{{item.status === 'in_progress'}}"
|
||||
data-id="{{item._id}}"
|
||||
data-action="complete"
|
||||
catchtap="onOrderAction"
|
||||
>完成</view>
|
||||
<view
|
||||
class="btn btn-secondary"
|
||||
wx:if="{{item.status === 'completed' || item.status === 'cancelled'}}"
|
||||
data-id="{{item._id}}"
|
||||
data-action="detail"
|
||||
catchtap="onOrderAction"
|
||||
>查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加载更多 -->
|
||||
<view class="load-more">
|
||||
<t-loading wx:if="{{isLoadingMore}}" theme="spinner" size="32rpx" text="加载中..." t-class-text="loading-text" />
|
||||
<text class="no-more" wx:elif="{{!hasMore}}">没有更多了</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
66
pages/set/index.js
Normal file
66
pages/set/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/mine/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/set/index.json
Normal file
3
pages/set/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/set/index.wxml
Normal file
2
pages/set/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/mine/index.wxml-->
|
||||
<text>pages/mine/index.wxml</text>
|
||||
1
pages/set/index.wxss
Normal file
1
pages/set/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/mine/index.wxss */
|
||||
Reference in New Issue
Block a user