This commit is contained in:
左哥 2025-06-03 22:53:55 +08:00
parent 96018aa0b4
commit 1eceec1dc6
10 changed files with 307 additions and 3 deletions

View File

@ -60,6 +60,10 @@
"root": "pages/therapeuticRegimen",
"name": "therapeuticRegimen",
"pages": ["index"]
},{
"root": "pages/AddTherapeuticRegimen",
"name": "AddTherapeuticRegimen",
"pages": ["index"]
}
],
"window": {

View File

@ -0,0 +1,189 @@
// pages/followUp/index.js
Page({
/**
* 页面的初始数据
*/
data: {
style: 'border: 2rpx solid #efefef;border-radius: 12rpx;',
personInfo: {
name: '',
gender: 0,
birth: '',
address: [],
introduction: '',
yearType: 0,
// photos: [],
},
mode: '',
dateVisible: false,
date: new Date('2021-12-23').getTime(), // 支持时间戳传入
dateText: '',
filter(type, options) {
if (type === 'year') {
return options.sort((a, b) => b.value - a.value);
}
return options;
},
popupProps: {
usingCustomNavbar: true,
},
formatter(item, index) {
if (index === 1) {
const label = item.label.slice(0, -1);
return {
value: item.value,
label: calendarMonth[Number(label) - 1],
};
}
if (index === 2) {
const [dateValue, weekValue] = item.label.split(' ');
const dateSuffixes = {
1: 'st',
2: 'nd',
3: 'rd',
};
const weekMap = {
周一: 'Mon.',
周二: 'Tues.',
周三: 'Wed.',
周四: 'Thurs.',
周五: 'Fri.',
周六: 'Sat.',
周日: 'Sun.',
};
const label = dateValue.slice(0, -1);
return {
value: item.value,
label: `${label}${dateSuffixes[label] || 'th'} ${weekMap[weekValue]}`,
};
}
return {
value: item.value,
label: item.label.slice(0, -1),
};
},
originFiles: [
{
url: 'https://tdesign.gtimg.com/mobile/demos/example4.png',
name: 'uploaded1.png',
type: 'image',
removeBtn: true,
},
{
url: 'https://tdesign.gtimg.com/mobile/demos/example6.png',
name: 'uploaded2.png',
type: 'image',
removeBtn: true,
},
{
url: 'https://tdesign.gtimg.com/mobile/demos/example5.png',
name: 'uploaded3.png',
type: 'image',
removeBtn: true,
},
],
gridConfig: {
column: 4,
width: 160,
height: 160,
},
config: {
count: 1,
},
},
showPicker(e) {
const { mode } = e.currentTarget.dataset;
this.setData({
[`${mode}Visible`]: true,
});
},
handleSuccess(e) {
console.log(e.detail)
const { files } = e.detail;
this.setData({
originFiles: files,
});
},
handleRemove(e) {
console.log(e.detail.file);
const { index } = e.detail;
const { originFiles } = this.data;
originFiles.splice(index, 1);
this.setData({
originFiles,
});
},
handleClick(e) {
console.log(e.detail.file);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,14 @@
{
"usingComponents": {
"t-cell": "tdesign-miniprogram/cell/cell",
"t-input": "tdesign-miniprogram/input/input",
"t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker",
"t-row": "tdesign-miniprogram/row/row",
"t-col": "tdesign-miniprogram/col/col",
"t-button": "tdesign-miniprogram/button/button",
"t-upload": "tdesign-miniprogram/upload/upload",
"t-radio": "tdesign-miniprogram/radio/radio",
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
},
"navigationBarTitleText": "用药方案"
}

View File

@ -0,0 +1,40 @@
/* pages/AddTherapeuticRegimen/index.wxss */
.therapeuticRegimen{
padding: 28rpx;
.improt-file{
border-radius: 20rpx;
background-color: #fff;
padding: 28rpx;
margin-bottom: 28rpx;
}
.title{
margin-bottom: 20rpx;
}
.therapeuticRegimen-item{
border-radius: 20rpx;
background-color: #fff;
padding: 28rpx;
margin-bottom: 28rpx;
}
.input-example {
// background-color: var(--bg-color-demo);
padding: 10rpx 0;
}
.input-example__label {
color: var(--td-text-color-primary);
font-size: 24rpx;
line-height: 40rpx;
margin: 0 8rpx 16rpx;
}
.box{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding-right: 60rpx;
}
.t-overlay{
top: 0!important;
}
}

View File

@ -0,0 +1,39 @@
<!--pages/AddTherapeuticRegimen/index.wxml-->
<view class="therapeuticRegimen">
<view class="improt-file">
<view class="title">拍照导入</view>
<t-upload media-type="{{['image']}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
<view class="therapeuticRegimen-item">
<view class="title">用药方案</view>
<view>
<t-row gutter="12">
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 用药周期 </view>
<t-input placeholder="请输入" bindtap="showPicker" size="small" borderless="{{true}}" style="{{style}}" data-mode="birth" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 体重kg </view>
<t-input placeholder="请输入" bindtap="showPicker" size="small" borderless="{{true}}" style="{{style}}" data-mode="birth" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
</view>
</t-col>
</t-row>
</view>
<view class="input-example">
<view class="input-example__label"> 药品信息 </view>
</view>
<t-input label="药品名称" placeholder="请输入文字" align="right" />
<t-input label="单次用药剂量" placeholder="请输入文字" align="right" />
</view>
<t-date-time-picker auto-close bind:cancel="hidePicker" bind:change="onPickerChange" cancelBtn="取消" confirmBtn="确认" data-mode="birth" defaultValue="{{personInfo.birth}}" end="{{birthEnd}}" filter="{{birthFilter}}" format="YYYY-MM-DD" mode="date" popup-props="{{ { usingCustomNavbar: true } }}" start="{{birthStart}}" title="选择生日" value="{{personInfo.birth}}" visible="{{birthVisible}}" />
</view>

View File

@ -8,6 +8,11 @@ Page({
},
toPath(){
wx.navigateTo({
url: '/pages/AddTherapeuticRegimen/index',
})
},
/**
* 生命周期函数--监听页面加载
*/

View File

@ -1,5 +1,7 @@
{
"usingComponents": {},
"usingComponents": {
"t-button": "tdesign-miniprogram/button/button"
},
"navigationBarTitleText": "用药方案"
}

View File

@ -36,4 +36,7 @@
}
}
}
.t-button{
margin-top: 28rpx;
}
}

View File

@ -20,4 +20,5 @@
<view class="details">每日2次饭后服用</view>
</view>
</view>
<t-button block theme="primary" bindtap="toPath">新增用药方案</t-button>
</view>

View File

@ -3,12 +3,19 @@
"miniprogram": {
"list": [
{
"name": "pages/therapeuticRegimen/index",
"pathName": "pages/therapeuticRegimen/index",
"name": "pages/AddTherapeuticRegimen/index",
"pathName": "pages/AddTherapeuticRegimen/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/therapeuticRegimen/index",
"pathName": "pages/therapeuticRegimen/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/emergency/index",
"pathName": "pages/emergency/index",