12.4更新

This commit is contained in:
zoujiandong
2023-12-04 14:49:14 +08:00
parent 63d7cb402d
commit 1e9ea2a70f
36 changed files with 1873 additions and 58 deletions
+154
View File
@@ -0,0 +1,154 @@
// Pages/yishi/write_sickform/index.js
import { API } from './../../../utils/network/api'
import debounce from "./../../../utils/debounce"
let api = new API()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '问诊表', //导航栏 中间的标题
},
obj:{
height:'身高',
weight:'体重',
nation_name:'民族',
job_name:'职业',
marital_status:'婚姻状态',
allergy_history:'是否有过敏史?',
family_history:'是否有家族病史?',
is_pregnant:'是否处于备孕、妊娠、哺乳期?',
is_operation:'是否做过手术?',
drink_wine_status:'是否有饮酒史?',
smoke_status:'是否有吸烟史?',
chemical_compound_status:'是否有接触过化学物?',
diagnosis_hospital:'确诊医院是?',
is_take_medicine:'服用药品是?'
},
order_inquiry_id:'',
list1: [],
list2: [],
result: [],
},
onChange(event) {
this.setData({
result: event.detail,
});
},
toggle(event) {
const { item } = event.currentTarget.dataset;
const checkbox = this.selectComponent(`.checkboxes-${item}`);
checkbox.toggle();
},
handleList(order_inquiry_id){
api.getUnfilled({
order_inquiry_id
}).then(data=>{
let result=data.data;
let {obj}=this.data;
let arr1=[];
let arr2=[];
result.forEach(item => {
if(item=="weight" || item=="height" || item=="marital_status" || item=="nation_name" || item=="job_name"){
if(obj[item]){
arr1.push(item);
}
}else{
if(obj[item]){
arr2.push(item);
}
}
})
this.setData({
list1:arr1,
list2:arr2,
})
})
},
handleSend(){
let {order_inquiry_id,result}=this.data;
if(result.length==0){
wx.showToast({
title: '请至少选择一项',
icon:'none'
})
return false;
}
console.log(this.data.result);
api.doctorSendUnfilled({
order_inquiry_id,
fields:this.data.result
}).then(data=>{
if(data.code==200){
wx.navigateBack();
}
})
},
noop() {},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
order_inquiry_id:options.order_inquiry_id,
})
this.handleList(options.order_inquiry_id);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
+9
View File
@@ -0,0 +1,9 @@
{
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index"
}
}
+61
View File
@@ -0,0 +1,61 @@
<!--Pages/yishi/write_sickform/index.wxml-->
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="container" wx:if="{{list1.length>0 || list2.length>0}}">
<view class="listbox">
<van-checkbox-group value="{{ result }}" bind:change="onChange" >
<view class="box" wx:if="{{list1.length>0}}">
<view class="title">基本信息</view>
<van-cell-group >
<van-cell
wx:for="{{ list1 }}"
wx:key="index"
title="{{obj[item]}}"
value-class="value-class"
clickable
data-item="{{ item }}"
bind:click="toggle"
>
<van-checkbox
catch:tap="noop"
checked-color="#3CC7C0"
class="checkboxes-{{ item }}"
name="{{ item }}"
/>
</van-cell>
</van-cell-group>
</view>
<view class="box" wx:if="{{list2.length>0}}">
<view class="title">个人情况</view>
<van-cell-group >
<van-cell
wx:for="{{ list2 }}"
wx:key="index"
title="{{obj[item]}}"
value-class="value-class"
clickable
data-item="{{ item }}"
bind:click="toggle"
>
<van-checkbox
catch:tap="noop"
checked-color="#3CC7C0"
class="checkboxes-{{ item }}"
name="{{ item }}"
/>
</van-cell>
</van-cell-group>
</view>
</van-checkbox-group>
</view>
<view class="bottom">
<view class="btn" bindtap="handleSend">
发送给患者
</view>
</view>
</view>
<view class="nocontainer" wx:else>
<image src="../../../static/images/yishi/tabbar_icon/empty.png" class="empty"/>
<view>暂无可询问内容</view>
</view>
+68
View File
@@ -0,0 +1,68 @@
/* Pages/yishi/write_sickform/index.wxss */
page{
overflow: hidden;
background-color: #F6F6F6;
}
.van-hairline--top-bottom:after {
border-top-width: 0px!important;
}
.van-hairline--bottom:after {
border-top-width: 0px!important;
}
.listbox{
flex:1;
overflow-y: scroll;
}
.container{
width: 100vw;
height:100vh;
display:flex;
flex-direction: column;
}
.value-class {
order:-1!important;
flex: none !important;
}
.title-class{
order:2!important;
}
.box .title{
padding: 25rpx 30rpx 10rpx;
margin-top: 20rpx;
font-size: 34rpx;
font-weight: 500;
color: #1C2023;
background:#fff;
}
.bottom{
background-color: #FFFFFF;
height:274rpx;
width:100%;
}
.bottom .btn{
margin:40rpx 30rpx;
height: 80rpx;
font-size: 30rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
background: #3CC7C0;
border-radius: 8rpx;
}
.empty{
margin-top: 400rpx;
width:161rpx;
height:162rpx;
}
.nocontainer{
margin-top: 20rpx;
background-color: #fff;
height:100vh;
display: flex;
font-size: 24rpx;
color: #999999;
align-items: center;
flex-direction: column;
}