You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.7 KiB
104 lines
2.7 KiB
Page({
|
|
data: {
|
|
diagnosisList: [
|
|
{
|
|
id: 1,
|
|
status: 'replied',
|
|
createdAt:'2025-02-12',
|
|
userInfo: {
|
|
avatar: '/pages/images/tx.png',
|
|
nickName: '张小明'
|
|
},
|
|
petInfo: {
|
|
type: '狗',
|
|
age: 3,
|
|
gender: '公'
|
|
},
|
|
description: '最近三天食欲不振,精神萎靡,偶尔呕吐黄色泡沫,大便偏软带血丝,体温正常但鼻头干燥。',
|
|
images: ['/images/pet1.jpg', '/images/pet2.jpg'],
|
|
replies: [{}, {}, {}]
|
|
},
|
|
{
|
|
id: 2,
|
|
status: 'pending',
|
|
createdAt: '2025-02-12',
|
|
userInfo: {
|
|
avatar: '/pages/images/tx.png',
|
|
nickName: '李小花'
|
|
},
|
|
petInfo: {
|
|
type: '猫',
|
|
age: 2,
|
|
gender: '母'
|
|
},
|
|
description: '今天发现眼睛有黄色分泌物,频繁抓挠眼睛周围,食欲正常但饮水量减少。',
|
|
images: ['/images/cat1.jpg'],
|
|
replies: []
|
|
},
|
|
{
|
|
id: 3,
|
|
status: 'replied',
|
|
createdAt: '2025-02-12',
|
|
userInfo: {
|
|
avatar: '/pages/images/tx.png',
|
|
nickName: '王先生'
|
|
},
|
|
petInfo: {
|
|
type: '狗',
|
|
age: 5,
|
|
gender: '公'
|
|
},
|
|
description: '狗狗最近走路跛脚,右前腿不敢着地,触摸时会叫。之前从沙发上跳下来可能受伤了。',
|
|
images: [],
|
|
replies: [{}, {}]
|
|
}
|
|
]
|
|
},
|
|
|
|
onLoad: function() {
|
|
// 页面加载
|
|
},
|
|
|
|
// 格式化日期显示
|
|
formatDate: function(dateString) {
|
|
const date = new Date(dateString);
|
|
const now = new Date();
|
|
const diff = now - date;
|
|
const diffDays = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
const diffHours = Math.floor(diff / (1000 * 60 * 60));
|
|
const diffMinutes = Math.floor(diff / (1000 * 60));
|
|
|
|
if (diffMinutes < 60) {
|
|
return `${diffMinutes}分钟前`;
|
|
} else if (diffHours < 24) {
|
|
return `${diffHours}小时前`;
|
|
} else if (diffDays === 1) {
|
|
return '昨天';
|
|
} else if (diffDays === 2) {
|
|
return '前天';
|
|
} else if (diffDays < 7) {
|
|
return `${diffDays}天前`;
|
|
} else {
|
|
const month = date.getMonth() + 1;
|
|
const day = date.getDate();
|
|
return `${month}月${day}日`;
|
|
}
|
|
},
|
|
|
|
// 显示创建问诊单
|
|
showCreateModal: function() {
|
|
wx.navigateTo({
|
|
url: '/pagesA/pages/askingSyAdd/askingSyAdd',
|
|
});
|
|
},
|
|
|
|
// 查看详情
|
|
viewDetail: function(e) {
|
|
const index = e.currentTarget.dataset.index;
|
|
const item = this.data.diagnosisList[index];
|
|
wx.navigateTo({
|
|
url: `/pagesA/pages/askingSyDetails/askingSyDetails`,
|
|
});
|
|
},
|
|
|
|
});
|