患者1.2

This commit is contained in:
zoujiandong
2024-01-10 08:57:23 +08:00
parent 49c01e8922
commit 5d865d1bbb
339 changed files with 23720 additions and 267 deletions
+274
View File
@@ -0,0 +1,274 @@
// pages/consultOrder/consultOrder.js
const app = getApp()
import {detectionList} from "../../../api/checkSugar"
import{family} from "../../../api/familyDoc"
Page({
/**
* 页面的初始数据
*/
data: {
time: 0,
changeStatus:'',
changeId:'',
isLoading:true,
selectstatus:false,
selectfamily:false,
delId:'',
option1: [
{ text: '全部订单', value: 0 },
{ text: '待支付', value: 1 },
{ text: '待绑定', value: 2 },
{ text: '检测中', value: 3},
{ text: '检测完成', value: 4},
{text:'已取消',value:5}
],
page:1,
isTriggered:false,
pageNumber:10,
option2: [],
detection_status: 0,
family_id:0,
orderList:[],
isLock:false,
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static',
fromType:''
},
handleRefresher(){
this.setData({
isLock:false,
page:1,
orderList:[]
})
this.getDetectionList();
},
goBack(flag=true){
let {fromType}=this.data;
if(app.globalData.origion==1){
wx.reLaunch({
url: '/pages/index/index',
})
}else if(app.globalData.origion==2){
wx.reLaunch({
url: '/pages/index/index',
})
}else{
if(fromType){
wx.reLaunch({
url: '/pages/my/my',
})
}else{
if(true){
wx.navigateBack({
delta: 1,
fail:function(){
wx.reLaunch({
url: '/pages/index/index',
})
}
})
}
}
}
},
lower(e) {
if(!this.data.isLock){
this.setData({
page: ++this.data.page
})
this.getDetectionList()
}
},
goExpertList(){
app.method.navigateTo({
url: '/sugarCheck/pages/checkOrderDetail/checkOrderDetail' //'/pages/expertConsult/expertConsult',
})
},
changeStatus({ detail }){
this.setData({
isLock:false,
page:1,
selectstatus:true,
detection_status:detail,
orderList:[]
})
this.getDetectionList()
},
changeFamily({ detail }){
this.setData({
family_id:detail,
isLock:false,
selectfamily:true,
page:1,
orderList:[]
})
this.getDetectionList()
},
getDetectionList(){
let {detection_status,family_id,page,pageNumber}=this.data;
this.setData({
isLoading:true
})
detectionList({
detection_status,
family_id,
page,
per_page:pageNumber
}).then(data=>{
let result=data.data;
this.setData({
isLoading:false
})
if(result.length==0){
this.setData({
isLock:true,
isTriggered:false
})
return false
};
this.setData({
orderList:this.data.orderList.concat(result),
isTriggered:false
})
})
},
handelCancelOrder(id){
cancelOrder(id).then(data=>{
wx.showToast({
title: '订单取消成功',
icon:"none"
})
})
},
getfamily(){
family().then(data=>{
let arr=[];
data.forEach((item,index)=>{
arr[index]={};
let sex="";
switch (item.sex){
case '0':sex="未知";
break;
case '1':sex="男";
break;
case '2':sex="女";
break;
}
let age=item.age;
arr[index].text=item.card_name+""+sex+""+age+"";
arr[index].value=item.family_id;
})
arr=[{text:"全部成员",value:0}].concat(arr);
this.setData({
option2:arr
})
this.getDetectionList();
})
},
goDetail(event){
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url: '/sugarCheck/pages/checkOrderDetail/checkOrderDetail?order_detection_id='+id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options.fromType){
this.setData({
fromType:options.fromType
})
};
if(options.prevData){
let json=JSON.parse(options.prevData);
this.setData({
changeStatus:json.changeStatus,
changeId:json.changesId
});
}
this.getfamily();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
img_host:app.hostConfig().imghost
});
//刷新列表
let {delId,orderList,changeStatus,changeId}=this.data;
if(delId){
let list=orderList.filter((item)=>{
return item.order_detection_id!=delId
})
this.setData({
orderList:list
})
}else if(changeStatus && changeId){
for (let i = 0; i < orderList.length; i++) {
const item =orderList[i];
if(item.order_detection_id==changeId){
let currentitem=`orderList[${i}].detection_status`
this.setData({
[currentitem]:changeStatus
})
break;
}
}
}else{
// this.setData({
// isLock:false,
// page:1,
// orderList:[]
// })
// this.getDetectionList();
// this.getfamily();
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
// this.goBack(false)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
})
@@ -0,0 +1,11 @@
{
"usingComponents": {
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index",
"van-count-down": "@vant/weapp/count-down/index"
},
"navigationStyle":"custom",
"navigationBarTitleText":"肝胆相照互联网医院"
}
+107
View File
@@ -0,0 +1,107 @@
<!--pages/consultOrder/consultOrder.wxml-->
<wxs src="../../../filters/filter.wxs" module="timeModule"></wxs>
<view class="page">
<view class="ui-navigatorbar" style="border-bottom: 1rpx solid #E3E4E5;background:#fff">
<image class="ui-navigatorbar-back" bindtap="goBack" src="{{img_host+'/back.png'}}" />
<view class="ui-title">检测订单</view>
</view>
<view class="dropdown">
<view class="bar"></view>
<van-dropdown-menu active-color="#3CC7C0">
<van-dropdown-item value="{{ detection_status }}" options="{{ option1 }}" title-class="droptitle {{selectstatus?'active':''}}" bind:change="changeStatus" />
<van-dropdown-item value="{{ family_id }}" title-class="droptitle {{selectfamily?'active':''}}" options="{{ option2 }}" bind:change="changeFamily" />
</van-dropdown-menu>
</view>
<scroll-view scroll-y="true" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="100" refresher-enabled="true" class="hasdata" bindscrolltolower="lower" wx:if="{{orderList.length>0}}">
<view class="databox">
<view class="datacell" bindtap="goDetail" wx:for="{{orderList}}" wx:key="order_detection_id" data-id="{{item.detection_no}}">
<view class="titlebox">
<view class="name" >糖组检测</view>
<view class="status" wx:if="{{item.detection_status==1 && item.detection_pay_status==1}}">
<view class="waitpay">待支付</view>
<view class="countdown">
<van-count-down time="{{timeModule.countDown(item.created_at)}}" />
</view>
</view>
<view class="status waitpay" wx:elif="{{item.detection_status==2}}">待绑定</view>
<view class="status waitpay" wx:elif="{{item.detection_status==3}}">检测中</view>
<view class="status" wx:elif="{{item.detection_status==4}}" style="color:#3CC7C0">已开具报告</view>
<view class="status" wx:elif="{{item.detection_status==5 && item.detection_pay_status!=5 }}">已取消</view>
<view class="status" wx:elif="{{item.detection_status==5 && item.detection_pay_status==5}}">
<view class="waitpay">支付超时</view>
</view>
</view>
<view class="infobox">
<image src="{{item.user_doctor.avatar}}" class="headicon" wx:if="{{item.user_doctor.avatar}}" mode="aspectFill"></image>
<image src="{{img_host+'/doctor_avatar.png'}}" class="headicon" wx:else></image>
<view class="namebox">
<view class="name" wx:if="{{item.user_doctor.user_name}}">{{item.user_doctor.user_name}} <text class="position">{{item.user_doctor.doctor_title}}</text></view>
<view class="name" wx:elif="{{item.detection_status==2}}">平台分配医生中</view>
<view class="name" wx:else>接诊医生</view>
<view class="hospital" wx:if="{{item.user_doctor.hospital_name}}">
{{item.user_doctor.hospital_name}}
</view>
</view>
</view>
<view class="row first">
<view class="name"><text>就</text><text>诊</text><text>人</text></view>
<view class="dot"></view>
<view class="desc">
<view class="namedesc">
{{item.patient_name}}<text wx:if="{{item.patient_sex==0}}">未知</text><text wx:if="{{item.patient_sex==1}}">男</text><text wx:else>女</text><text decode="true" class="agebar"></text><text>{{item.patient_age}}岁)</text></view>
</view>
</view>
<!-- <view class="row rowdesc" wx:if="{{item.detection_status!=1}}">
<view class="name">病情描述</view>
<view class="dot"></view>
<view class="desc">{{item.disease_desc}}</view>
</view>
<view class="row rowdesc" wx:else>
<view class="name">下单时间</view>
<view class="dot"></view>
<view class="desc">{{item.created_at}}</view>
</view> -->
<view class="row last" wx:if="{{item.detection_status!=1}}">
<view class="left">
<view class="name">下单时间</view>
<view class="dot"></view>
<view class="desc">{{item.created_at}}</view>
</view>
<view class="right">
<view class="detail">详情</view>
<image src="{{img_host+'/righticon.png'}}" class="righticon"> </image>
</view>
</view>
<view class="row rowdesc" wx:if="{{item.detection_status==1}}">
<view class="name">下单时间</view>
<view class="dot"></view>
<view class="desc">{{item.created_at}}</view>
</view>
<view class="row last" wx:if="{{item.detection_status==1}}">
<view class="left">
<view class="name">待付金额</view>
<view class="dot"></view>
<view class="desc red">¥{{item.payment_amount_total}}</view>
</view>
<view class="right">
<view class="detail">详情</view>
<image src="{{img_host+'/righticon.png'}}"class="righticon"> </image>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="nodata" wx:elif="{{!isLoading && orderList.length==0}}">
<image src="{{img_host+'/nocheck.png'}}" class="noorder"></image>
<view class="tips">暂无检测订单</view>
<!-- <view class="btn" bindtap="goExpertList">专家问诊</view> -->
</view>
</view>
+332
View File
@@ -0,0 +1,332 @@
/* pages/consultOrder/consultOrder.wxss */
/**app.wxss**/
.container {
padding-top: 135px;
padding-bottom: 10rpx;
/* top:280rpx; */
/* position: absolute; */
width:100%;
/* overflow-y: scroll; */
background: #F2F2F2;
}
input{
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
}
page{
position: relative;
width:100%;
height:100%;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei',
sans-serif;
}
.page{
width:100vw;
height:100vh;
background: #f2f2f2;
}
.contain{padding: 0 30rpx 0rpx;height: 100%;overflow: hidden;position: relative;}
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.van-picker__confirm {
color:#3CC7C0!important;
font-size: 32rpx!important;
}
.van-picker__title{
font-weight: 600!important;
color: rgba(0,0,0,0.9)!important;
font-size: 32rpx!important;
}
.van-picker__cancel{
color: rgba(0,0,0,0.6)!important;
font-size: 32rpx!important;
}
.nonedata{
width:100%;
color:#666;
min-height: 320rpx;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
}
.ui-navigatorbar {
position: fixed;
z-index:99;
top: 0;
width: 750rpx;
height: 172rpx;
background: #F2F2F2;
backdrop-filter: blur(20px);
}
.ui-navigatorbar-back {
position: absolute;
padding-left:40rpx;
padding-right:40rpx;
width:30rpx;
height:60rpx;
left: 0rpx;
bottom: 20rpx;
}
.ui-title {
position: absolute;
width: 350rpx;
height: 88rpx;
line-height: 56rpx;
font-size: 36rpx;
color: #000000;
bottom: 0;
left: 200rpx;
display: flex;
justify-content: center;
align-items: center;
}
.droptitle.active{
color:#3CC7C0;
}
.slotmsg{
-webkit-overflow-scrolling: touch;
font-size: 28rpx;
line-height:40rpx;
max-height:60vh;
overflow-y: auto;
padding:48rpx;
text-align: center;
}
.van-dropdown-item__title{
width:100%!important;
flex:1;
text-align: center;
}
.van-dropdown-item__icon{
z-index:2;
position: absolute!important;
right:25rpx;
}
.van-cell__value{
flex:none!important;
z-index:1;
}
.onlinebox .icon{
top:60rpx;
left:50%;
position: absolute;
margin-left: -48rpx;
width:96rpx;
height:34rpx;
border-radius: 0;
}
.page {
display: flex;
flex-direction: column;
}
.dropdown {
position: relative;
height:102rpx;
margin-top: 172rpx;
}
.dropdown .bar {
position: absolute;
height: 40rpx;
width: 1rpx;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #ccc;
opacity: 0.9;
}
.van-dropdown-menu {
box-shadow: none !important;
border-bottom: 1rpx solid #E7E7E7;
}
.btn {
position: absolute;
bottom: 20rpx;
left: 32rpx;
right: 32rpx;
display: flex;
height: 94rpx;
background: #3CC7C0;
border-radius: 47rpx;
justify-content: center;
align-items: center;
color: #fff;
background: #3CC7C0;
}
.nodata {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.noorder {
margin-top: 150rpx;
width: 518rpx;
height: 325rpx;
}
.tips {
font-size: 28rpx;
font-weight: 400;
color: #666666;
}
.hasdata{
flex: 1;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
margin-top: 20rpx;
}
.datacell{
background:#fff;
padding-bottom: 20rpx;
margin-bottom:10rpx;
}
.datacell:last-child{
margin-bottom: 0;
}
.status{
color: #333333;
font-size: 28rpx;
}
.titlebox .name{
color: #000;
font-size: 32rpx;
}
.titlebox{
padding:0 32rpx;
height: 112rpx;
border-bottom: 1rpx solid #E3E4E5;
display: flex;
justify-content: space-between;
align-items: center;
}
.waitpay{
text-align: right;
color: #EF4F20
}
.headicon{
width:80rpx;
height:80rpx;
flex-shrink: 0;
border-radius: 50%;
}
.van-count-down {
margin-top: 5rpx;
color: #EF4F20!important;
}
.infobox{
padding:20rpx 32rpx 0;
align-items: center;
display: flex;
}
.infobox .name{
margin-left: 30rpx;
font-weight: 600;
}
.hospital{
margin-left: 30rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
}
.infobox .position{
font-weight:normal;
}
.row{
align-items: center;
padding:0 32rpx;
display: flex;
line-height: 52rpx
}
.row.first{
margin-top: 15rpx;
}
.row .name{
white-space: nowrap;
font-size: 28rpx;
color:#333;
font-weight: 600;
width:112rpx;
align-items: baseline;
}
.row.first .name{
display: flex;
justify-content: space-between;
}
.row .dot{
align-items: baseline;
height: 52rpx;
font-weight: 600;
display: flex;
}
.row .desc{
align-items: baseline;
font-size: 28rpx;
line-height: 52rpx;
color:#333;
}
.row .desc.red{
color:rgba(239, 79, 32, 1);
}
.rowdesc{
align-items: flex-start;
}
.namedesc{
display: flex;
align-items: center;
}
.rowdesc .desc{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical
}
.row .price{
color:#EF4F20;
font-weight: bold;
font-size:34rpx
}
.row.last{
justify-content: space-between;
}
.row .left{
display: flex;
}
.row .right{
display: flex;
}
.righticon{
width:24rpx;
height:48rpx;
}
.right .detail{
margin-right: 10rpx;
color: #666666;
}
.agebar{
display: inline-block;
width:2rpx;
background: #333;
height:26rpx;
margin: 0rpx 10rpx 0;
}