更新小程序仓库

This commit is contained in:
zoujiandong
2023-11-17 09:51:35 +08:00
parent 13f54a26df
commit 4506940c2d
936 changed files with 60022 additions and 0 deletions
+179
View File
@@ -0,0 +1,179 @@
// pages/myPrescript/myPrescript.js
const app = getApp()
import { prescription,delPrescription} from "../../api/prescription"
import {throttle} from "../../utils/util"
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
page:1,
index:-1,
show:false,
isTriggered:false,
order_prescription_id:'',
isLock: false,
},
goBack(){
wx.navigateBack({
delta: 1,
})
},
handleRefresher(){
this.setData({
list: [],
isLock: false,
page:1,
});
this.handleprescription()
},
handelDel(event){
let order_prescription_id=event.currentTarget.dataset.id;
let index=event.currentTarget.dataset.index;
this.setData({
order_prescription_id,
index,
show:true
})
},
goconsult(event){
let order_inquiry_id=event.currentTarget.dataset.id;
app.method.navigateTo({
url: '/pages/orderDetail/orderDetail?order_inquiry_id='+order_inquiry_id
})
},
goPayInfo(event){
let id=event.currentTarget.dataset.id;
if(getCurrentPages().length>=8){
wx.reLaunch({
url: '/pages/payInfo/payInfo?order_prescription_id='+id,
})
}else{
app.method.navigateTo({
url: '/pages/payInfo/payInfo?order_prescription_id='+id,
})
}
},
goExpert:throttle(function(event){
let doctor_id=event.currentTarget.dataset.doctor_id;
app.method.navigateTo({
url: '/pages/expertDetail/expertDetail?doctor_id='+doctor_id
})
}),
goprescriptDetail:throttle(function(event) {
let id=event.currentTarget.dataset.id;
app.method.navigateTo({
url: '/pages/prescriptDetail/prescriptDetail?order_prescription_id='+id
})
}),
confirm:throttle(function(event){
if(event.detail){
this.handeldelPrescription();
}
}),
handeldelPrescription(){
let {order_prescription_id,index}=this.data;
delPrescription(order_prescription_id).then(data=>{
this.data.list.splice(index,1);
this.setData({
list:this.data.list
})
wx.showToast({
title: '成功删除该处方订单',
icon:"none"
})
})
},
/**
* 生命周期函数--监听页面加载
*/
lower(){
if(!this.data.isLock){
this.setData({
page: ++this.data.page
})
this.handleprescription();
}
},
handleprescription() {
let {page}=this.data;
prescription({
page,
per_page:10,
}).then(data => {
let result = data.data;
if (result.length == 0){
this.setData({
isLock: true,
isTriggered:false
})
return false;
}
this.setData({
isTriggered:false,
list:this.data.list.concat(result)
})
})
},
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
list: [],
isLock: false,
page:1,
});
this.handleprescription()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
})
+8
View File
@@ -0,0 +1,8 @@
{
"usingComponents": {
"dialog":"../../components/dialog/dialog",
"nav":"../../components/nav/nav"
},
"navigationStyle":"custom",
"navigationBarTitleText": "肝胆相照互联网医院"
}
+63
View File
@@ -0,0 +1,63 @@
<!--pages/myPrescript/myPrescript.wxml-->
<nav navName="我的处方"></nav>
<view class="page">
<scroll-view scroll-y="true" bindscrolltolower="lower" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="100" refresher-enabled="true" class="data" wx:if="{{list.length>0}}" class="conbox">
<view class="cell" wx:for="{{list}}" wx:key="order_prescription_id">
<view class="title">
<view class="date">{{item.created_at}}</view>
<!-- 处方状态(1:待审核 2:待使用 3:已失效 4:已使用) -->
<view class="status" wx:if="{{item.prescription_status==1}}">待审核</view>
<view class="status outdate" wx:elif="{{item.prescription_status==2}}">待使用</view>
<view class="status" wx:elif="{{item.prescription_status==3}}">已失效</view>
<view class="status" wx:else>已使用</view>
</view>
<view class="form">
<view class="row">
<view class="name"><text>医</text><text>生</text></view>
<view class="dot"></view>
<view class="desc">{{item.doctor_name}} {{item.user_doctor.doctor_title}} </view>
</view>
<view class="row">
<view class="name"><text>患</text><text>者</text></view>
<view class="dot"></view>
<view class="desc">{{item.patient_name}} <text wx:if="{{item.patient_sex=='1'}}">男</text><text wx:elif="{{item.patient_sex=='2'}}">女</text><text wx:else>未知</text>{{item.patient_age}}岁)</view>
</view>
<view class="row">
<view class="name"><text>诊</text><text>断</text></view>
<view class="dot"></view>
<view class="desc">
<text class="textdesc" wx:for="{{item.order_prescription_icd}}" wx:key="prescription_icd_id" wx:for-item="itemName">{{itemName.icd_name}}</text>
</view>
</view>
<view class="row">
<view class="name"><text>药</text><text>品</text></view>
<view class="dot"></view>
<view class="desc">
<view class="single" wx:for="order_prescription_pr" wx:for="{{item.order_prescription_product}}" wx:for-item="itemName" wx:key="prescription_product_id">
{{itemName.product_name}}
<font class="unit"> {{itemName.product_spec}}</font>
</view>
</view>
</view>
<view class="row">
<view class="name">问诊记录</view>
<view class="dot"></view>
<view class="desc look" bindtap="goconsult" data-id="{{item.order_inquiry_id}}">点击查看 </view>
</view>
<view class="btnbox">
<!-- <view class="btn del" bindtap="handelDel" data-id="{{item.order_prescription_id}}" data-index="{{index}}">删除记录</view> -->
<view class="btn fuzhen" wx:if="{{item.prescription_status==4}}" bindtap="goExpert" data-doctor_id="{{item.doctor_id}}">复诊开方</view>
<view class="btn lookdetail" bindtap="goprescriptDetail" data-id="{{item.order_prescription_id}}">查看详情</view>
<view class="btn pay" wx:if="{{item.prescription_status==2}}" bindtap="goPayInfo" data-id="{{item.order_prescription_id}}">去结算</view>
</view>
</view>
</view>
</scroll-view>
<view class="nonedata conbox" wx:else>
暂无数据!
</view>
</view>
<dialog bind:confirm="confirm" showDialog="{{show}}" message="您确定是要删除该处方订单记录么?"></dialog>
+170
View File
@@ -0,0 +1,170 @@
/* pages/myPrescript/myPrescript.wxss */
.page{
display: flex;
flex-direction: column;
}
.data{
flex:1;
}
.desc .textdesc:after{
content:';'
}
.desc .textdesc:last-child:after{
content:''
}
.conbox{
margin-top: 172rpx;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
.nonedata{
min-height:620rpx;
}
.cell .title{
display: flex;
height: 112rpx;
align-items: center;
justify-content: space-between;
padding:0 32rpx;
background: #FFFFFF;
border-bottom: 1rpx solid #E3E4E5;
}
.form{
background: #FFFFFF;
padding:30rpx 32rpx;
border-bottom: 1rpx solid #E3E4E5;
}
.cell:last-child .form{
border-bottom:none;
}
.title .status{
color: #333;
font-size: 28rpx;
}
.title .status.outdate{
color: #EF4F20;
font-size: 28rpx;
}
.row .outdate{
color: #333;
font-size: 28rpx;
}
.title .date{
color:#000;
font-size: 34rpx;
}
.form .row{
display: flex;
line-height: 52rpx;
}
.row .unit{
word-break: break-all;
color:#666;
font-weight: normal;
display: inline;
}
.single .name{
display: inline;
white-space: nowrap;
}
.row .bar{
margin:0 8rpx 1rpx;
color:#333;
}
.single{
width:100%;
display: inline;
position: relative;
margin-left: 15rpx;
}
.single:first-child{
margin-left: 0;
}
.unit{
padding-right:15rpx;
}
.unit:first-child{
margin-left: 0;
}
.unit::after{
padding-left:15rpx ;
content:"|";
margin-top: -3rpx;
color:#333;
position: absolute;
}
.single:last-child .unit::after{
display: none;
}
.row .name{
color:#333;
font-size: 28rpx;
display: flex;
font-weight:600;
align-items: baseline;
justify-content: space-between;
width:114rpx;
}
.row .dot{
display: flex;
align-items: baseline;
font-weight:600;
}
.row .desc{
align-items: baseline;
word-break: break-all;
color:#333;
flex:1;
display:inline;
font-size: 28rpx;
}
.row .look{
color:#3CC7C0;
text-decoration: underline;
}
.btnbox{
display: flex;
justify-content: flex-end;
font-size: 26rpx;
margin-top: 34rpx;
}
.btnbox .btn{
margin-left: 20rpx;
padding:0 26rpx;
height: 58rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6rpx;
}
.btnbox .btn:first-child{
margin-left: 0;
}
.btnbox .del{
background: #F8F8F8;
color: #353535;
border: 1rpx solid rgba(5,5,5,0.1);
}
.btnbox .lookdetail{
background: #3CC7C0;
color:#fff;
border: 1rpx solid #3CC7C0;
}
.btnbox .pay{
color:#fff;
background: #ED9C00;
border: 1rpx solid #ED9C00;
}
.btnbox .fuzhen{
color:#fff;
background: #ED9C00;
border: 1rpx solid #ED9C00;
}