更新小程序仓库
This commit is contained in:
@@ -0,0 +1,273 @@
|
||||
// pages/consultOrder/consultOrder.js
|
||||
const app = getApp()
|
||||
import {cancelOrder,inquiryList} from "../../api/consultOrder"
|
||||
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},
|
||||
|
||||
],
|
||||
page:1,
|
||||
isTriggered:false,
|
||||
pageNumber:10,
|
||||
option2: [],
|
||||
inquiry_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.getinquiryList();
|
||||
},
|
||||
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.getinquiryList()
|
||||
}
|
||||
},
|
||||
goExpertList(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/expertConsult/expertConsult',
|
||||
})
|
||||
},
|
||||
changeStatus({ detail }){
|
||||
this.setData({
|
||||
isLock:false,
|
||||
page:1,
|
||||
selectstatus:true,
|
||||
inquiry_status:detail,
|
||||
orderList:[]
|
||||
})
|
||||
this.getinquiryList()
|
||||
},
|
||||
changeFamily({ detail }){
|
||||
this.setData({
|
||||
family_id:detail,
|
||||
isLock:false,
|
||||
selectfamily:true,
|
||||
page:1,
|
||||
orderList:[]
|
||||
})
|
||||
this.getinquiryList()
|
||||
},
|
||||
getinquiryList(){
|
||||
let {inquiry_status,family_id,page,pageNumber}=this.data;
|
||||
this.setData({
|
||||
isLoading:true
|
||||
})
|
||||
inquiryList({
|
||||
inquiry_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.getinquiryList();
|
||||
})
|
||||
|
||||
},
|
||||
goDetail(event){
|
||||
let id=event.currentTarget.dataset.id;
|
||||
app.method.navigateTo({
|
||||
url: '/pages/orderDetail/orderDetail?order_inquiry_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_inquiry_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_inquiry_id==changeId){
|
||||
let currentitem=`orderList[${i}].inquiry_status`
|
||||
this.setData({
|
||||
[currentitem]:changeStatus
|
||||
})
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// this.setData({
|
||||
// isLock:false,
|
||||
// page:1,
|
||||
// orderList:[]
|
||||
// })
|
||||
// this.getinquiryList();
|
||||
// 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":"肝胆相照互联网医院"
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<!--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="../../assets/images/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="{{ inquiry_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_inquiry_id" data-id="{{item.order_inquiry_id}}">
|
||||
<view class="titlebox">
|
||||
<view class="name" wx:if="{{item.inquiry_type==1}}">专家问诊</view>
|
||||
<view class="name" wx:elif="{{item.inquiry_type==2}}">快速问诊</view>
|
||||
<view class="name" wx:elif="{{item.inquiry_type==3}}">公益问诊</view>
|
||||
<view class="name" wx:elif="{{item.inquiry_type==4}}">问诊购药</view>
|
||||
<view class="name" wx:elif="{{item.inquiry_type==5}}">报告解读</view>
|
||||
<view class="status" wx:if="{{item.inquiry_status==1 && item.inquiry_pay_status==1}}">
|
||||
<view class="waitpay">待支付</view>
|
||||
<view class="countdown">
|
||||
<van-count-down time="{{timeModule.countDown(item.created_at)}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==2}}">等待接诊</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==3}}">等待接诊</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==4}}">问诊中</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==5}}">问诊完成</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==6}}">问诊结束 </view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==7 && item.inquiry_pay_status!=5}}">问诊取消</view>
|
||||
<view class="status" wx:elif="{{item.inquiry_status==7 && item.inquiry_pay_status==5}}">
|
||||
<view class="waitpay">支付超时</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="infobox">
|
||||
<image src="{{img_host+'/jiezhening.png'}}" class="headicon" wx:if="{{item.inquiry_status==2}}"></image>
|
||||
<image src="{{item.user_doctor.avatar}}" class="headicon" wx:elif="{{item.inquiry_status!=2 && 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.inquiry_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">{{item.patient_name}}(<text wx:if="{{item.patient_sex==0}}">未知</text><text wx:if="{{item.patient_sex==1}}">男</text><text wx:else>女</text>,{{item.patient_age}}岁)</view>
|
||||
</view>
|
||||
<view class="row rowdesc" wx:if="{{item.inquiry_status!=1 }}">
|
||||
<view class="name">
|
||||
<text wx:if="{{item.inquiry_type!=5}}"> 病情描述</text>
|
||||
<text wx:else>检测项目</text>
|
||||
</view>
|
||||
<view class="dot">:</view>
|
||||
<view class="desc">
|
||||
<text wx:if="{{item.inquiry_type!=5}}">{{item.disease_desc}}</text>
|
||||
<text wx:else>糖组检测</text>
|
||||
</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.inquiry_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 last" wx:else>
|
||||
<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+'/noorder.png'}}" class="noorder"></image>
|
||||
<view class="tips">暂时没有订单记录</view>
|
||||
<view class="btn" bindtap="goExpertList">专家问诊</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -0,0 +1,197 @@
|
||||
/* pages/consultOrder/consultOrder.wxss */
|
||||
.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: 286rpx;
|
||||
height: 276rpx;
|
||||
}
|
||||
.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;
|
||||
color:#333;
|
||||
}
|
||||
.row .desc.red{
|
||||
color:rgba(239, 79, 32, 1);
|
||||
}
|
||||
.rowdesc{
|
||||
align-items: flex-start;
|
||||
}
|
||||
.rowdesc .desc{
|
||||
word-break: break-all;
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user