This commit is contained in:
zoujiandong
2025-06-17 17:58:29 +08:00
commit b496603f7c
129 changed files with 14644 additions and 0 deletions
+426
View File
@@ -0,0 +1,426 @@
// index.js
const app = getApp()
import {caseList,getSign,getProjectStatus} from "../../api/api"
import {throttle} from "../../utils/util"
import {createStoreBindings} from "mobx-miniprogram-bindings"
import {store} from '../../store/store.js'
Page({
data: {
showDelDraft:false,
editId:'',
showDraft:true,
reason:'',
status_title:'病例状态',
casetype_title:'病例类型',
draftTime:'',
caseDraft:{},
hasDraft:false,
showEntryTip:false,
showEntryTip_second:false,
statusList: [
{ text: '待提交', value: -1,select:false },
{ text: '待审核', value: 0,select:false },
{ text: '待修改', value: 2,select:false },
{ text: '已通过', value: 1,select:false },
],
typeList:[{
text:'四次及以上疗程化',
value:1,
select:false,
},{
text:'早前期(INR≤1.5)',
value:2,
select:false,
}],
select_status:false,
select_type:false,
lock:false,
showCheck:false,
showAgree:false,
isTriggered:false,
list:[],
showCancel:true,
caseType:'',
status:'',
sortItemList:[{
column:0,
isAsc:true
}],
name:'',
pageNum:1,
pageSize:10,
img_host:app.hostConfig().imghost
},
handleGetProjectStatus(){
getProjectStatus().then(res=>{
this.handleGetSign()
}).catch((error)=>{
if(error.code==30007){
wx.showToast({
title: '您未登录',
icon:'none',
duration:4000
})
app.method.navigateTo({
url: '/case/pages/mobileLogin/mobileLogin',
})
}
})
},
onConfirmDelDraft(){
wx.setStorageSync('caseDraft', '');
this.setData({
showDelDraft:false,
hasDraft:false,
showDraft:false
});
},
onCancelDelDraft(){
this.setData({
showDelDraft:false,
})
},
onCloseSwipe(event){
const { position, instance } = event.detail;
switch (position) {
case 'left':
case 'cell':
instance.close();
break;
case 'right':
this.setData({
showDelDraft:true
})
break;
}
},
goDetail:throttle(function(event){
let {id,status,reason}=event.currentTarget.dataset;
if(status==2){
this.setData({
reason,
editId:id,
showCheck:true
})
}else{
app.method.navigateTo({
url: '/case/pages/createCase/createCase?medicalRecordId='+id+"&status="+status,
})
}
}),
goCreate:throttle(function(){
this.handleGetProjectStatus();
// app.method.navigateTo({
// url: '/case/pages/createCase/createCase',
// })
}),
goAgreement:throttle(function(event){
app.method.navigateTo({
url:"/case/pages/privacy/privacy"
})
}),
handleGetSign(){
getSign().then(res=>{
if(res && res.signImg){
app.method.navigateTo({
url: '/case/pages/createCase/createCase',
})
}else{
this.setData({
showAgree:true
})
}
}).catch(error=>{
if(error.code==30007){
wx.showToast({
title: '您未登录',
icon:'none',
duration:4000
})
app.method.navigateTo({
url: '/case/pages/mobileLogin/mobileLogin',
})
}
})
},
handleCaseList(){
let { caseType,pageNum,pageSize,searchCount,status,name}=this.data;
caseList({
caseType,
pageNum,
name,
pageSize,
searchCount,
status
}).then(res=>{
if(status==='' && caseType===''){
this.toggleDraft();
};
this.setData({
isTriggered:false
})
// if(pageNum==1){
// this.setData({
// isTriggered:false
// })
// }
if(res.list.length==0){
this.setData({
lock:true
});
return;
};
this.setData({
list:this.data.list.concat(res.list)
})
}).catch(error=>{
this.setData({
isTriggered:false
})
})
},
onConfirm(){
let id=this.data.editId;
this.setData({
showCheck:false
})
app.method.navigateTo({
url: '/case/pages/createCase/createCase?medicalRecordId='+id+"&status=2",
})
},
onCancel(){
this.setData({
showCheck:false
})
},
onConfirmAgree(){
this.setData({
showAgree:false
});
app.method.navigateTo({
url:'/case/pages/agreement/agreement'
})
},
onCancelAgree(){
this.setData({
showAgree:false
})
},
goSearch(value){
this.setData({
lock:false,
pageNum:1,
name:value.detail,
list:[]
});
this.handleCaseList()
},
handleRefresher(){
let {status}=this.data;
if(status!=-1){
this.setData({
lock:false,
pageNum:1,
list:[]
});
this.handleCaseList()
}else{
this.setData({
isTriggered:false
})
}
},
lower(e) {
let {lock}=this.data;
let addPage=this.data.pageNum+1;
if(!lock){
this.setData({
pageNum:addPage
});
this.handleCaseList();
}
},
chooseStatus(e){
let {hasDraft,statusList,typeList}=this.data;
let {id,value,name,select,index}=e.currentTarget.dataset;
this.selectComponent('#'+id).toggle(false);
if(id=="item1"){
statusList.forEach((item,key)=>{
let cur_obj='statusList['+key+'].select'
this.setData({
[cur_obj]:false
})
})
let obj='statusList['+index+'].select';
this.setData({
status:!select?value:'',
status_title:!select?name:'病例状态',
[obj]:!select,
})
if(value==-1 && this.data.statusList[0].select){
this.setData({
showDraft:hasDraft?true:false,
list:[]
})
}else if(value==-1 && !this.data.statusList[0].select){
this.handleRefresher();
}else{
this.setData({
showDraft:false
})
this.handleRefresher();
}
let hasSelect=this.data.statusList.some(item=> item.select==true );
if(hasSelect){
this.setData({
select_status:true
})
}else{
this.setData({
select_status:false
})
}
}else{
typeList.forEach((item,i)=>{
let cur_obj='typeList['+i+'].select'
this.setData({
[cur_obj]:false
})
})
let obj='typeList['+index+'].select';
this.setData({
caseType:!select?value:'',
[obj]:!select,
casetype_title:!select?name:'病例类型'
})
if(this.data.status==-1 && this.data.statusList[0].select){
this.setData({
showDraft:hasDraft?true:false,
list:[]
})
}else if(this.data.status==-1 && !this.data.statusList[0].select){
this.handleRefresher();
}else{
this.setData({
showDraft:false
})
this.handleRefresher();
}
let hasSelect=this.data.typeList.some(item=> item.select==true );
if(hasSelect){
this.setData({
select_type:true
})
}else{
this.setData({
select_type:false
})
}
console.log(this.data.typeList);
}
},
onConfirmEntry(){
this.setData({
showEntryTip:false
})
},
onCloseEntry(){
this.setData({
showEntryTip:true,
showEntryTip_second:true
})
},
onConfirmEntry_second(){
this.setData({
showEntryTip_second:false,
});
//wx.setStorageSync('hasEntry', true);
},
onCloseEntry_second(){
wx.exitMiniProgram({success: (res) => {}})
this.setData({
showEntryTip_second:false,
showEntryTip:false,
});
},
toggleDraft(){
let caseDraft=wx.getStorageSync('caseDraft');
let draftTime=wx.getStorageSync('draftTime')
if(caseDraft){
this.setData({
caseDraft:JSON.parse(caseDraft),
hasDraft:true,
showDraft:true,
draftTime:draftTime
})
}else{
this.setData({
showDraft:false,
hasDraft:false
})
}
},
onLoad(){
this.storeBindings = createStoreBindings(this, {
store,
fields: [,"active"],
actions: ["updateActive"],
});
},
onUnload() {
this.storeBindings.destroyStoreBindings();
},
onShow(){
console.log("show")
this.updateActive('list');
let nav=this.selectComponent('#nav');
nav.clearKeyWord();
this.setData({
name:'',
select_status:false,
select_type:false,
status_title:'病例状态',
casetype_title:'病例类型',
status:'',
caseType:''
})
this.toggleDraft();
this.handleRefresher();
wx.getPrivacySetting({
success: res => {
console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
if (res.needAuthorization) {
// 需要弹出隐私协议
this.setData({
showEntryTip:true
});
} else {
this.setData({
showEntryTip:false
})
// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私
}
},
fail: () => {},
complete: () => {}
})
}
});
+13
View File
@@ -0,0 +1,13 @@
{
"usingComponents": {
"dialog":"../../components/dialog/dialog",
"van-image": "@vant/weapp/image/index",
"van-overlay": "@vant/weapp/overlay/index",
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"nav":"../../components/nav/nav",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index"
},
"disableScroll": true,
"navigationStyle":"custom"
}
+102
View File
@@ -0,0 +1,102 @@
<wxs src="../../filters/filter.wxs" module="filters"></wxs>
<nav bind:goSearch="goSearch" id="nav"></nav>
<view class="page">
<view class="banner">
<image src="../../static/banner.png" mode="widthFix" class="bannerImg"/>
</view>
<van-dropdown-menu active-color="#3881F7">
<van-dropdown-item id="item1" title="{{status_title}}" title-class="droptitle {{select_status?'active':''}}">
<view class="row">
<view class="rowcell {{item.select?'active':''}}" wx:for="{{statusList}}" wx:key="value" bindtap="chooseStatus" data-id="item1" data-value="{{item.value}}" data-name="{{item.text}}" data-select="{{item.select}}" data-index="{{index}}">{{item.text}}</view>
</view>
</van-dropdown-item>
<van-dropdown-item id="item2" title="{{casetype_title}}" title-class="droptitle {{select_type?'active':''}}">
<view class="row type">
<view class="rowcell {{item.select?'active':''}}" wx:for="{{typeList}}" wx:key="value" bindtap="chooseStatus" data-id="item2" data-value="{{item.value}}" data-name="{{item.text}}" data-select="{{item.select}}" data-index="{{index}}">{{item.text}}</view>
</view>
</van-dropdown-item>
</van-dropdown-menu>
<view class="scrollwraper">
<scroll-view scroll-y style="width: 100%;height:100%" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}" refresher-threshold="100" refresher-enabled="true" bindscrolltolower="lower" id="scroller" bounces="false">
<view class="viewcon" style="padding-bottom: 0;margin: 0 32rpx 16rpx;" >
<van-swipe-cell right-width="{{65 }}" wx:if="{{hasDraft && showDraft}}" async-close
bind:close="onCloseSwipe">
<van-cell-group>
<view class="viewcell" bind:tap="goCreate" style="margin: 0;" >
<view class="left">
<van-image width="94rpx" height="94rpx" round src="{{caseDraft.sex==1?img_host+'/man.png':img_host+'/woman.png'}}" />
<view class="info">
<view class="name">草稿</view>
<view class="date">{{draftTime}}</view>
</view>
</view>
<view class="btn">待提交</view>
</view>
</van-cell-group>
<view slot="right" class="van-swipe-cell__right">删除</view>
</van-swipe-cell>
</view>
<view wx:if="{{list.length>0 }}" class="viewcon">
<view class="viewcell" wx:for="{{list}}" wx:key="id" bind:tap="goDetail" data-id="{{item.id}}" data-status="{{item.status}}" data-reason="{{item.reason}}">
<view class="left">
<van-image width="94rpx" height="94rpx" round src="{{item.sex==1?img_host+'/man.png':img_host+'/woman.png'}}" />
<view class="info">
<view class="name">{{item.userName}}({{item.uid}})</view>
<view class="date">{{filters.transforDay(item.createTime,'date')}}</view>
</view>
</view>
<view class="btn {{item.status==1?'active':item.status==2?'red':''}}">{{item.status==0?'待审核':item.status==1?'已通过':item.status==2?'待修改':'未知'}}</view>
</view>
</view>
<view class="nonedata" wx:elif="{{!showDraft && list.length==0}}">
<image src="{{img_host+'/noCase.png'}}" class="nocase" />
<view class="nodatatip">暂无病例,<text class="link" bind:tap="goCreate">点击创建病例</text></view>
</view>
</scroll-view>
</view>
</view>
<dialog showDialog="{{showCheck}}" showCancel="{{showCancel}}" bind:confirm="onConfirm" bind:cancel="onCancel" title="审核未通过" confirmText="去修改" showTip="{{true}}" message="{{reason}}"></dialog>
<dialog showDialog="{{showAgree}}" showCancel="{{showCancel}}" bind:confirm="onConfirmAgree" bind:cancel="onCancelAgree" title="项目协议" confirmText="查看" message="创建病例前需签署《人工肝病例登记系统》电子协议书"></dialog>
<dialog showDialog="{{showDelDraft}}" showCancel="{{showCancel}}" bind:confirm="onConfirmDelDraft" bind:cancel="onCancelDelDraft" title="注意" confirmText="确定" message="确定删除草稿?"></dialog>
<van-overlay show="{{ showEntryTip }}" zIndex="9999999">
<view class="wrapper">
<view class="privacyBox">
<view class="title">温馨提示</view>
<view class="entrymsg">
<view> 亲爱的用户,感谢您信任并使用人工肝病例登录系统!我们依据最新法律法规的要求,制定了<text class="navigator" bindtap="goAgreement" data-id="2">《隐私协议》</text>。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。</view>
<view>如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。</view>
</view>
<view class="btnbox">
<view class="cancel" bindtap="onCloseEntry">不同意</view>
<button id="agree-btn"
plain
class="confirm"
open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onConfirmEntry">同意并继续</button>
</view>
</view>
</view>
</van-overlay>
<van-overlay show="{{ showEntryTip_second }}" zIndex="99999999">
<view class="wrapper">
<view class="privacyBox">
<view class="title">温馨提示</view>
<view class="entrymsg" >
<view> 很抱歉,如您不同意《隐私协议》,可能无法继续正常使用我们的服务,请您先同意哦~</view>
</view>
<view class="btnbox">
<view class="cancel" bindtap="onCloseEntry_second">不同意</view>
<button id="agree-btn"
plain
class="confirm"
bindtap="onConfirmEntry_second">好的</button>
</view>
</view>
</view>
</van-overlay>
+208
View File
@@ -0,0 +1,208 @@
page{
background-image: linear-gradient( #cdf0ff,#fff 30%);
}
.page {
margin-top: 290rpx;
overflow: hidden;
flex: 1;
display: flex;
flex-direction: column;
}
.viewcon{
padding-bottom: 140rpx;
}
.banner {
margin: 24rpx 32rpx 0;
height: 264rpx;
background: #D8D8D8;
border-radius: 16rpx;
}
.banner .bannerImg{
width:100%;
}
.row {
margin: 24rpx 0;
display: flex;
padding: 0 32rpx;
justify-content: space-between;
}
.row .rowcell {
width: 160rpx;
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
color: rgba(0, 0, 0, 0.65);
font-size: 32rpx;
background: rgba(0, 0, 0, 0.06);
border-radius: 36rpx;
}
.type .rowcell{
width:auto;
padding:0 24rpx;
}
.row .rowcell.active {
color: #3881F7;
background: #EBF3FF;
}
.scrollwraper {
flex: 1;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
background: #f7f9f9;
padding-top: 30rpx;
}
.viewcell {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 32rpx 16rpx;
padding: 24rpx 21rpx;
background-color: #fff;
box-shadow: 0rpx 12rpx 28rpx 0rpx rgba(0, 0, 0, 0.03);
border-radius: 16rpx;
}
.viewcell .left {
display: flex;
align-items: center;
}
.viewcell .left .name {
font-size: 32rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
}
.viewcell .left .date {
margin-top: 10rpx;
font-size: 28rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.25);
}
.viewcell .left .info {
margin-left: 13rpx;
}
.viewcell .btn {
width: 132rpx;
height: 56rpx;
display: flex;
justify-content: center;
align-items: center;
background: #FFFFFF;
border-radius: 8rpx;
font-size: 28rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
border: 2rpx solid rgba(0, 0, 0, 0.15);
}
.viewcell .btn.active {
color: #52C41A;
border: 2rpx solid #52C41A;
}
.viewcell .btn.red {
color: red;
border: 2rpx solid red;
}
.van-dropdown-menu {
margin:0 32rpx;
box-shadow: none!important;
}
.van-dropdown-menu__item{
flex:none!important;
margin-right: 20rpx;
}
.nocase{
width:300rpx;
height: 218rpx;
}
.nodatatip{
margin-top: 16rpx;
font-size: 28rpx;
font-weight: 400;
color: rgba(0,0,0,0.45);
}
.link{
color:#3881F7;
}
.droptitle{
font-size: 32rpx!important;
}
.droptitle.active{
color:#3881F7!important;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.privacyBox {
width:90%;
background-color: #fff;
border-radius: 30rpx;
}
.privacyBox .title{
margin: 0;
text-align: center;
font-weight: 500;
line-height:24px;
padding-top:24px;
text-align: center;
font-size:16px;
}
.privacyBox .btnbox{
display: flex;
align-items: center;
border-top:1rpx solid #efefef;
width:100%;
font-size: 17px;
}
.privacyBox .btnbox .cancel{
flex:1;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
.privacyBox .btnbox .confirm{
margin: 0;
height: 50px;
padding: 0;
color: #3881F7;
flex:1;
font-size: 17px;
border: none!important;
border-left:1rpx solid #efefef!important;
display: flex;
background-color: none!important;
justify-content: center;
align-items: center;
}
.entrymsg{
-webkit-overflow-scrolling: touch;
font-size: 28rpx;
line-height: 40rpx;
max-height: 60vh;
overflow-y: auto;
padding: 48rpx;
text-align: left;
}
.van-swipe-cell__right{
width:65px;
display: flex;
font-size: 28rpx;
justify-content: center;
align-items: center;
color: #fff;
background-color: red;
}