This commit is contained in:
左哥 2025-06-10 22:51:01 +08:00
parent e49b8b8de2
commit 878525c143
12 changed files with 290 additions and 7531 deletions

View File

@ -1,16 +1,30 @@
/**app.wxss**/
@import 'iconfont.less';
page {
background-color: #f3f3f3;
--td-brand-color: #4091ff; // 任何你想要的主题色
background-color: #F8F8F8;
--td-brand-color: #005BA2; // 任何你想要的主题色
--td-bg-color: #F8F8F8;
--td-text-color: #222222;
font-size: 28rpx;
color: #222222;
.t-cell__title-text {
font-size: 28rpx;
}
.t-input__control {
font-size: 28rpx;
}
.t-input{
}
.t-input__label:not(:empty) {
max-width: 10rem;
font-size: 28rpx;
}
.active{
.t-cell__note{
color: #222222;
}
}
}
.page {

22
iconfont.less Normal file
View File

@ -0,0 +1,22 @@
@font-face {
font-family: "iconfont"; /* Project id 4945922 */
src: url('//at.alicdn.com/t/c/font_4945922_cpk575emof.woff2?t=1749563774878') format('woff2'),
url('//at.alicdn.com/t/c/font_4945922_cpk575emof.woff?t=1749563774878') format('woff'),
url('//at.alicdn.com/t/c/font_4945922_cpk575emof.ttf?t=1749563774878') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-shanchu1:before {
content: "\e67d";
}
.icon-xiangji:before {
content: "\e609";
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,9 @@
import request from '~/api/request';
let mode = '';
let modeType = '';
let mode2 = '';
let modeText = ''
let modeIndex = 0
let id = ''
Page({
@ -9,18 +11,36 @@ Page({
* 页面的初始数据
*/
data: {
detail: [],
detail: [{
"name": "",
"dose": "",
"frequency": "",
"time": ""
}],
end_date: '',
reminder: {
"morning": "08:00",
"noon": "12:00",
"evening": "18:00"
},
// 下拉
selectList: [],
selectValue: '',
selectVisible: false,
start_date: '',
timeData: '',
id: '',
style: 'border: 2rpx solid #efefef;border-radius: 12rpx;',
style: 'border: 0;',
frequencyList:[{
label: '每日1次',
value: '1'
},{
label: '每日2次',
value: '2'
},{
label: '每日3次',
value: '3'
}],
dateVisible: false,
minuteVisible: false,
@ -104,10 +124,25 @@ Page({
},
},
showSelect(e){
const { mode, index } = e.currentTarget.dataset;
console.log(mode, index )
modeText = mode
modeIndex = index
this.setData({
selectVisible: true,
selectValue: this.data.detail[index].frequency ? this.data.detail[index].frequency : '',
})
},
onSelectChange(e){
this.setData({
[`detail[${modeIndex}].frequency`]: e.detail.value
})
},
showPicker(e) {
const { mode } = e.currentTarget.dataset;
mode = mode;
modeType = mode;
this.setData({
birthVisible: true,
});
@ -115,7 +150,7 @@ Page({
},
onPickerChange(e){
this.setData({
[mode]: e.detail.value,
[modeType]: e.detail.value,
});
},
showPickertime(e){

View File

@ -9,7 +9,9 @@
"t-upload": "tdesign-miniprogram/upload/upload",
"t-radio": "tdesign-miniprogram/radio/radio",
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group",
"t-tag": "tdesign-miniprogram/tag/tag"
"t-tag": "tdesign-miniprogram/tag/tag",
"t-picker": "tdesign-miniprogram/picker/picker",
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item"
},
"navigationBarTitleText": "用药方案"
}

View File

@ -1,25 +1,60 @@
/* pages/AddTherapeuticRegimen/index.wxss */
.therapeuticRegimen{
padding: 28rpx;
padding: 24rpx;
.improt-file{
border-radius: 20rpx;
background-color: #fff;
padding: 28rpx;
margin-bottom: 28rpx;
width: 140rpx;
height: 140rpx;
background: rgba(0,91,162,0.05);
border-radius: 16rpx;
border: 2rpx dotted rgba(0,91,162,0.2);
display: flex;
justify-content: center;
align-items: center;
.upload-flow{
text-align: center;
font-size: 26rpx;
.iconfont{
font-size: 36rpx;
color: var(--td-brand-color);
}
}
}
.title{
margin-bottom: 20rpx;
margin-left: 30rpx;
display: flex;
justify-content: space-between;
.iconfont{
color: #A8A8A8;
}
}
.therapeuticRegimen-item{
border-radius: 20rpx;
border-radius: 24rpx;
background-color: #fff;
padding: 28rpx;
padding: 24rpx;
padding-left: 0;
margin-bottom: 28rpx;
margin-top: 24rpx;
}
.yp-info{
margin-top: 24rpx;
border-radius: 24rpx;
background-color: #fff;
padding: 24rpx;
padding-left: 0;
}
.input-example {
// background-color: var(--bg-color-demo);
padding: 10rpx 0;
// padding: 10rpx 0;
position: relative;
.tip{
position: absolute;
right: -36rpx;
top: 28rpx;
z-index: 999;
}
}
.input-example__label {
@ -41,8 +76,6 @@
top: 0!important;
}
.yp-item{
border: 2rpx solid #efefef;
border-radius: 12rpx;
overflow: hidden;
}
.administration-time{
@ -52,7 +85,7 @@
padding-left: 40rpx;
}
.radio-group{
width: 300rpx;
width: 400rpx;
}
.add-btn{
margin-top: 40rpx;

View File

@ -1,42 +1,43 @@
<!--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 class="upload-flow">
<text class="iconfont icon-xiangji"></text>
<view>拍照导入</view>
</view>
</view>
<view class="therapeuticRegimen-item">
<view class="title">用药方案</view>
<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" value="{{start_date}}" size="small" borderless="{{true}}" style="{{style}}" data-mode="start_date" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
<view class="input-example">
<t-input placeholder="开始时间" bindtap="showPicker" value="{{start_date}}" data-mode="start_date" borderless="{{true}}" />
<text class="tip">—</text>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label none"> 体重kg </view>
<t-input placeholder="请输入" bindtap="showPicker" value="{{end_date}}" size="small" borderless="{{true}}" style="{{style}}" data-mode="end_date" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
<view class="input-example">
<t-input placeholder="结束时间" bindtap="showPicker" value="{{end_date}}" data-mode="end_date" borderless="{{true}}" />
</view>
</t-col>
</t-row>
</view>
<view class="input-example">
<view class="input-example__label"> 药品信息 </view>
</view>
<view class="yp-info" wx:for="{{detail}}" wx:key="index">
<view class="title">
<text>药品信息</text>
<text class="iconfont icon-shanchu1"></text>
</view>
<view class="delete-btn">
<t-tag class="margin-16" variant="light" theme="danger">删除</t-tag>
</view>
<view class="yp-item" wx:for="{{detail}}" wx:key="index">
<view class="yp-item">
<t-input bind:change="onInput" data-index="{{index}}" data-mode="name" label="药品名称" placeholder="请输入" align="right" value="{{item.name}}" />
<t-input bind:change="onInput" data-index="{{index}}" data-mode="dose" label="单次用药剂量" placeholder="请输入" align="right" value="{{item.dose}}" />
<t-input bind:change="onInput" data-index="{{index}}" data-mode="frequency" label="单次频次(每日次数)" placeholder="请输入" align="right" value="{{item.frequency}}" />
<!-- <t-input bind:change="onInput" data-index="{{index}}" data-mode="frequency" label="单次频次(每日次数)" placeholder="请输入" align="right" value="{{item.frequency}}" /> -->
<t-cell class="{{item.frequency ? 'active':''}}" title="单次频次(每日次数)" arrow bind:click="showSelect" data-index="{{index}}" data-mode="frequency" data-list="{{frequencyList}}" note="{{item.frequency ? (frequencyList[item.frequency - 1].label) : '请选择'}}">
</t-cell>
<view class="administration-time">
<view>饭前/饭后</view>
<view class="radio-group">
@ -47,54 +48,41 @@
</view>
</view>
</view>
<t-button class="add-btn" theme="primary" content="" block bindtap="addItem">+添加用药</t-button>
<t-button wx:if="{{index == detail.length - 1}}" class="add-btn" theme="primary" content="" block bindtap="addItem">+添加用药</t-button>
</view>
<view class="therapeuticRegimen-item">
<view class="title">用药时间提醒</view>
<view class="reminder-time">
<view class="reminder-time">
<view class="label">早上</view>
<t-input placeholder="请输入" bindtap="showPickertime" value="{{reminder.morning}}" size="small" borderless="{{true}}" style="{{style}}" data-mode="morning" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
<view class="reminder-time">
<view class="reminder-time">
<view class="label">中午</view>
<t-input placeholder="请输入" bindtap="showPickertime" value="{{reminder.noon}}" size="small" borderless="{{true}}" style="{{style}}" data-mode="noon" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
<view class="reminder-time">
<view class="reminder-time">
<view class="label">晚上</view>
<t-input placeholder="请输入" bindtap="showPickertime" value="{{reminder.evening}}" size="small" borderless="{{true}}" style="{{style}}" data-mode="evening" suffixIcon="{{ { name: 'calendar-1', ariaLabel: '通讯录' } }}" />
</view>
</view>
<t-button class="add-btn" theme="primary" content="" block bind:tap="saveData">保存</t-button>
<t-date-time-picker
auto-close
bind:cancel="hidePicker"
bind:change="onPickerChange"
cancelBtn="取消"
confirmBtn="确认"
data-mode="birth"
defaultValue="{{timeData}}"
end="{{birthEnd}}"
filter="{{birthFilter}}"
format="YYYY-MM-DD"
mode="date"
popup-props="{{ { usingCustomNavbar: true } }}"
start="{{birthStart}}"
title="选择日期"
value="{{timeData}}"
visible="{{birthVisible}}" />
<t-date-time-picker auto-close bind:cancel="hidePicker" bind:change="onPickerChange" cancelBtn="取消" confirmBtn="确认" data-mode="birth" defaultValue="{{timeData}}" end="{{birthEnd}}" filter="{{birthFilter}}" format="YYYY-MM-DD" mode="date" popup-props="{{ { usingCustomNavbar: true } }}" start="{{birthStart}}" title="选择日期" value="{{timeData}}" visible="{{birthVisible}}" />
<!-- 时分 -->
<t-date-time-picker
title="选择时间"
visible="{{minuteVisible}}"
mode="{{['null', 'minute']}}"
start="{{start}}"
value="{{minute}}"
defaultValue="{{timeData2}}"
format="HH:mm"
bindchange="onConfirm"
bindpick="onColumnChange"
bindcancel="hidePicker"
/>
<t-date-time-picker title="选择时间" visible="{{minuteVisible}}" mode="{{['null', 'minute']}}" start="{{start}}" value="{{minute}}" defaultValue="{{timeData2}}" format="HH:mm" bindchange="onConfirm" bindpick="onColumnChange" bindcancel="hidePicker" />
<!-- 下拉选择 -->
<t-picker
visible="{{selectVisible}}"
value="{{selectValue}}"
data-key="value"
cancelBtn="取消"
confirmBtn="确认"
usingCustomNavbar
bindchange="onSelectChange"
bindcancel="onPickerCancel"
>
<t-picker-item options="{{frequencyList}}"></t-picker-item>
</t-picker>
</view>

View File

@ -1,7 +1,5 @@
import request from '~/api/request';
const {
md5Encrypt
} = require('../../utils/encrypt');
Page({
data: {
phoneNumber: '',
@ -129,24 +127,7 @@ Page({
},
async login() {
if (this.data.isPasswordLogin) {
const res = await request('patient/password_login', 'post', {
mobile: this.data.passwordInfo.account,
password: md5Encrypt(this.data.passwordInfo.password)
});
console.log(res)
await wx.setStorageSync('access_token', res.token);
if (res.is_personal_information_complete) {
wx.switchTab({
url: `/pages/my/index`,
});
} else {
wx.navigateTo({
url: `/pages/my/info-edit/index`,
});
}
} else {
const res = await request('/patient/code_login', 'post', {
code: this.data.code,
mobile: this.data.phoneNumber
@ -161,12 +142,7 @@ Page({
url: `/pages/my/info-edit/index`,
});
}
// if (res.success) {
// wx.navigateTo({
// url: `/pages/loginCode/loginCode?phoneNumber=${this.data.phoneNumber}`,
// });
// }
}
},
// 获取验证码

View File

@ -1,48 +1,106 @@
/* pages/therapeuticRegimen/index.wxss */
.therapeuticRegimen{
padding: 28rpx;
box-sizing: border-box;
padding: 24rpx;
position: relative;
height: calc(100vh - 130rpx);
.therapeuticRegimen-item{
padding: 28rpx;
background-color: #fff;
border-radius: 20rpx;
.time{
border-radius: 24rpx;
position: relative;
overflow: hidden;
.tab-text{
position: absolute;
top: 0;
right: 0;
width: 126rpx;
height: 60rpx;
border-radius: 0rpx 0rpx 0rpx 24rpx;
font-weight: 500;
font-size: 26rpx;
line-height: 60rpx;
text-align: center;
}
.primary{
background: #EDF3F8;
color: var(--td-brand-color);
}
.default{
color: #909399;
background: rgba(rgba(34, 34, 34, 0.1));
}
.time{
font-size: 36rpx;
position: relative;
text{
position: absolute;
right: 0;
}
.primary{
color: var(--td-brand-color);
}
.default{
color: #666666;
}
color: rgba(34, 34, 34, 1);
}
.item-box{
margin-top: 26rpx;
background-color: #f5f5f5;
background-color: var(--td-bg-color);
padding: 24rpx;
padding-bottom: 30rpx;
border-radius: 20rpx;
.name{
font-weight: bold;
display: flex;
justify-content: space-between;
text{
color: var(--td-brand-color);
font-weight: normal;
}
display: flex;
position: relative;
// justify-content: space-between;
.image-box{
width: 100rpx;
height: 100rpx;
background: #EDF3F8;
border-radius: 16rpx;
border: 2rpx solid rgba(0,91,162,0.1);
margin-right: 20rpx;
}
.details{
margin-top: 20rpx;
font-size: 24rpx;
}
.name{
font-size: 32rpx;
color: var(--td-text-color);
line-height: 32rpx;
margin-top: 12rpx;
margin-bottom: 24rpx;
}
.text{
font-size: 28rpx;
color: #909399;
line-height: 28rpx;
}
.yw-jl{
position: absolute;
right: 0rpx;
font-size: 32rpx;
width: 188rpx;
text-align: center;
top: 50%;
transform: translateY(-50%);
&::after{
position: absolute;
content: '';
width: 2rpx;
height: 62rpx;
background: #EDF3F8;
left: 0;
top: -6rpx;
}
}
}
}
.t-button{
margin-top: 28rpx;
.btn-box{
padding: 28rpx;
position: fixed;
left: 0;
bottom: 0;
right: 0;
}
}

View File

@ -1,38 +1,40 @@
<!--pages/therapeuticRegimen/index.wxml-->
<view class="therapeuticRegimen">
<scroll-view class="therapeuticRegimen">
<view class="therapeuticRegimen-item">
<view class="time">
2024.10.01 至 2024.10.31方案
<text class="default">进行中</text>
2024.10.01 至 2024.10.31
</view>
<text class="tab-text primary">进行中</text>
<view class="item-box">
<view class="name">
优思弗
<text>500mg</text>
<view class="image-box"></view>
<view class="details">
<view class="name">优思弗</view>
<view class="text">每日2次饭后服用</view>
</view>
<view class="details">每日2次饭后服用</view>
</view>
<view class="item-box">
<view class="name">
优思弗
<text>500mg</text>
</view>
<view class="details">每日2次饭后服用</view>
</view>
</view>
<view class="therapeuticRegimen-item" wx:for="{{list}}" wx:key="index">
<view class="time">
{{item.start_time}} 至 {{item.end_time}}方案
<text class="{{item.status == '进行中' ? 'primary' : 'default'}}">{{item.status}}</text>
</view>
<view class="item-box" wx:for="{{item.medicine_schemes}}" wx:key="index">
<view class="name">
{{item.name}}
<text>{{item.dose}}</text>
</view>
<view class="details">每日{{item.frequency}}次,{{item.time}}</view>
<view class="yw-jl">500mg</view>
</view>
</view>
<t-button block theme="primary" bindtap="toPath">新增用药方案</t-button>
</view>
<view class="therapeuticRegimen-item" wx:for="{{list}}" wx:key="index">
<view class="time">
{{item.start_time}} 至 {{item.end_time}}
<text class="tab-text {{item.status == '进行中' ? 'primary' : 'default'}}">{{item.status}}</text>
</view>
<view class="item-box" wx:for="{{item.medicine_schemes}}" wx:key="index">
<view class="image-box"></view>
<view class="details">
<view class="name">{{item.name}}</view>
<view class="text">每日{{item.frequency}}次,{{item.time}}</view>
</view>
<view class="yw-jl">{{item.dose}}</view>
</view>
</view>
<view class="btn-box">
<t-button block theme="primary" bindtap="toPath">新增用药方案</t-button>
</view>
</scroll-view>

View File

@ -1,5 +0,0 @@
import crypto from 'crypto-js'
export const md5Encrypt = (str) => {
return crypto.MD5(str).toString()
}