From a92f1621b19f61593ccf0fb8586f35f590ac276d Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Mon, 27 Nov 2023 16:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=85=E7=AB=AF1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cloudbase/container/debug.json | 1 + .../MessageElements/AudioMessage/index.wxml | 2 +- .../MessageElements/AudioMessage/index.wxss | 44 +++- .../TUIChat/components/MessageInput/index.js | 62 +++-- .../components/MessageInput/index.wxml | 6 +- .../components/MessageInput/index.wxss | 4 + api/sickRecord.js | 22 ++ app.js | 20 +- app.json | 6 +- app.wxss | 10 +- assets/images/online.gif | Bin 0 -> 2796 bytes components/navbar/navbar.js | 5 + components/navbar/navbar.wxml | 2 +- pages/expertConsult/expertConsult.js | 9 +- pages/expertConsult/expertConsult.wxml | 10 +- pages/expertConsult/expertConsult.wxss | 31 ++- pages/expertDetail/expertDetail.js | 1 + pages/expertDetail/expertDetail.wxml | 7 +- pages/expertDetail/expertDetail.wxss | 4 +- pages/index/index.wxml | 2 +- pages/index/index.wxss | 3 + pages/inquiryForm/inquiryForm.js | 69 +++++ pages/inquiryForm/inquiryForm.json | 13 + pages/inquiryForm/inquiryForm.wxml | 244 ++++++++++++++++++ pages/inquiryForm/inquiryForm.wxss | 146 +++++++++++ pages/login/login.js | 22 +- pages/mobileLogin/mobileLogin.js | 25 +- pages/search/search.wxml | 3 + pages/search/search.wxss | 3 + pages/sickDetail/sickDetail.js | 74 ++++++ pages/sickDetail/sickDetail.json | 8 + pages/sickDetail/sickDetail.wxml | 130 ++++++++++ pages/sickDetail/sickDetail.wxss | 102 ++++++++ pages/sickManage/sickManage.js | 98 +++++++ pages/sickManage/sickManage.json | 7 + pages/sickManage/sickManage.wxml | 24 ++ pages/sickManage/sickManage.wxss | 96 +++++++ pages/sickRecord/sickRecord.js | 175 +++++++++++++ pages/sickRecord/sickRecord.json | 11 + pages/sickRecord/sickRecord.wxml | 29 +++ pages/sickRecord/sickRecord.wxss | 130 ++++++++++ pages/writeSick/writeSick.js | 209 +++++++++------ pages/writeSick/writeSick.wxml | 4 + pages/writeSick/writeSick.wxss | 22 +- 44 files changed, 1750 insertions(+), 145 deletions(-) create mode 100644 .cloudbase/container/debug.json create mode 100644 api/sickRecord.js create mode 100644 assets/images/online.gif create mode 100644 pages/inquiryForm/inquiryForm.js create mode 100644 pages/inquiryForm/inquiryForm.json create mode 100644 pages/inquiryForm/inquiryForm.wxml create mode 100644 pages/inquiryForm/inquiryForm.wxss create mode 100644 pages/sickDetail/sickDetail.js create mode 100644 pages/sickDetail/sickDetail.json create mode 100644 pages/sickDetail/sickDetail.wxml create mode 100644 pages/sickDetail/sickDetail.wxss create mode 100644 pages/sickManage/sickManage.js create mode 100644 pages/sickManage/sickManage.json create mode 100644 pages/sickManage/sickManage.wxml create mode 100644 pages/sickManage/sickManage.wxss create mode 100644 pages/sickRecord/sickRecord.js create mode 100644 pages/sickRecord/sickRecord.json create mode 100644 pages/sickRecord/sickRecord.wxml create mode 100644 pages/sickRecord/sickRecord.wxss diff --git a/.cloudbase/container/debug.json b/.cloudbase/container/debug.json new file mode 100644 index 0000000..0d44458 --- /dev/null +++ b/.cloudbase/container/debug.json @@ -0,0 +1 @@ +{"containers":[],"config":{}} \ No newline at end of file diff --git a/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml b/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml index a9764ea..797419b 100644 --- a/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml +++ b/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml @@ -1,5 +1,5 @@ - + {{renderDom[0].second}}s diff --git a/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss b/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss index 4bfe7d2..46d0319 100644 --- a/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss +++ b/TUIService/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss @@ -4,9 +4,22 @@ border: 1px solid #D9D9D9; } .my-audio { - border-radius: 10px 2px 10px 10px; - background: rgba(0,110,255,0.10); - border: 1px solid rgba(0,110,255,0.30); + position: relative; + border-radius: 10px 10px 10px 10px; + background: rgb(212, 239, 241); + border: 1rpx solid #1ACAD3; +} +.my-audio::after{ + content:''; + position: absolute; + top: 35rpx; + right: -19rpx; + transform: translate(-50%,-50%) rotate(-135deg); + width: 16rpx; + height: 16rpx; + background: rgb(212, 239, 241); + border: 1rpx solid #1ACAD3; + border-style: none none solid solid } .audio { /*border-radius: 2px 10px 10px 10px;*/ @@ -29,4 +42,29 @@ width: 16px; height: 16px; transform:rotate(180deg) +} +.my-text { + position: relative; + border-radius: 10px 10px 10px 10px; + background: rgb(212, 239, 241); + border: 1rpx solid #1ACAD3; +} + +.your-audio{ + position: relative; + border-radius: 10px 10px 10px 10px; + background: rgb(255, 255, 255); + border: 1rpx solid #D8D8D8; +} +.your-audio::after{ + content:''; + position: absolute; + top: 35rpx; + left: 0; + transform: translate(-50%,-50%) rotate(45deg); + width: 16rpx; + height: 16rpx; + background: rgb(255, 255, 255); + border: 1rpx solid #D8D8D8; + border-style: none none solid solid } \ No newline at end of file diff --git a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.js b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.js index d591cbf..1b9c059 100644 --- a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.js +++ b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.js @@ -181,7 +181,15 @@ Component({ payload: { file: res, }, + cloudCustomData: JSON.stringify({ + order_inquiry_id:this.data.order_inquiry_id, + inquiry_type:this.data.inquiry_type, + message_rounds:this.data.msgData.msg_round, + patient_family_data:this.data.patient_family_data, + is_system:0 + }) }); + //this.sendCallback(); this.$sendTIMMessage(message); } } @@ -260,29 +268,32 @@ Component({ // 长按录音 handleLongPress(e) { - wx.aegis.reportEvent({ - name: 'messageType', - ext1: 'messageType-audio', - ext2: wx.$chat_reportType, - ext3: wx.$chat_SDKAppID, - }); - this.recorderManager.start({ - duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟) - sampleRate: 44100, // 采样率 - numberOfChannels: 1, // 录音通道数 - encodeBitRate: 192000, // 编码码率 - format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通 - }); - this.setData({ - startPoint: e.touches[0], - title: '正在录音', - // isRecording : true, - // canSend: true, - notShow: true, - isShow: false, - isRecording: true, - popupToggle: true, - }); + if(this.setMsgRound()){ + wx.aegis.reportEvent({ + name: 'messageType', + ext1: 'messageType-audio', + ext2: wx.$chat_reportType, + ext3: wx.$chat_SDKAppID, + }); + this.recorderManager.start({ + duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟) + sampleRate: 44100, // 采样率 + numberOfChannels: 1, // 录音通道数 + encodeBitRate: 192000, // 编码码率 + format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通 + }); + this.setData({ + startPoint: e.touches[0], + title: '正在录音', + // isRecording : true, + // canSend: true, + notShow: true, + isShow: false, + isRecording: true, + popupToggle: true, + }); + } + }, // 录音时的手势上划移动距离对应文案变化 @@ -377,7 +388,7 @@ Component({ sourceType: [type], mediaType: [mediaType], success: (res) => { - this.sendCallback(); + //this.sendCallback(); const mediaInfoList = res.tempFiles; mediaInfoList.forEach((mediaInfo) => { fileList.push({ type: res.type, tempFiles: [{ tempFilePath: mediaInfo.tempFilePath }] }); @@ -731,7 +742,7 @@ Component({ const to =this.getToAccount(); const text = flag ? msg : this.data.message; const { FEAT_NATIVE_CODE } = constant; - this.sendCallback(); + //this.sendCallback(); const message = wx.$TUIKit.createTextMessage({ to, conversationType: this.data.conversation.type, @@ -953,6 +964,7 @@ Component({ ext3: wx.$chat_SDKAppID, }); } + this.sendCallback(); }) .catch((error) => { logger.log(`| TUI-chat | message-input | sendMessageError: ${error.code} `); diff --git a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml index 4ba2d83..cefd355 100644 --- a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml +++ b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml @@ -13,17 +13,17 @@ - + + + + + + + 2、 + + 您是否有家族病史? + + + + + + + + + + + {{startIndex}}、 + + 您是否处于备孕、妊娠、哺乳期? + + + + + + + + + + + {{startIndex+1}}、 + + 是否做过手术 + + + + + + + + + + + {{startIndex+2}}、 + + 是否有饮酒史 + + + 从不 + 偶尔 + 经常 + 每天 + 已戒酒 + + + + + + {{startIndex+3}}、 + + 是否有吸烟史 + + + 从不 + 偶尔 + 经常 + 每天 + 已戒烟 + + + + + + {{startIndex+4}}、 + + 是否有接触过化学物 + + + 从不 + 偶尔 + 经常 + 每天 + + + + + + + + + + + + {{startIndex+45}}、 + + 确诊医院是? + + + + + + + + + {{startIndex+6}}、 + + 服用药品是? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/inquiryForm/inquiryForm.wxss b/pages/inquiryForm/inquiryForm.wxss new file mode 100644 index 0000000..597fbeb --- /dev/null +++ b/pages/inquiryForm/inquiryForm.wxss @@ -0,0 +1,146 @@ +/* pages/inquiryForm/inquiryForm.wxss */ +.page { + + display: flex; + flex-direction: column; + overflow: hidden; +} +.cellbox{ + background-color: #fff; +} +.questionbox{ + overflow-y: scroll; + margin-top: 172rpx; +} +.cellbox .cell{ + background-color: #fff; + align-items: center; + display: flex; + + padding:0 32rpx; + + + } + .cellrow{ + height:105rpx; + width:100%; + justify-content: space-between; + align-items: center; + display: flex; + border-bottom:1rpx solid #E3E4E5; + } + .cell:last-child .cellrow{ + border-bottom: none; + } + .iptbox{ + display: flex; + flex:1; + + justify-content: flex-end; + } + .righticon{ + width:24rpx; + height: 48rpx; + } + .name{ + display: flex; + align-items: center; + } + .name .red{ + margin-top: 20rpx; + color:#E34D59; + } + .placeholder{ + text-align: right; + font-size: 28rpx; + font-weight: 400; + color: #C5C8CB; + } + .ipt{ + width:100%; + text-align: right; + color: #666666; + font-size: 28rpx; + } + .basictitle{ + margin-top: 30rpx; + font-size: 34rpx; + padding:30rpx 32rpx 10rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 500; + color: #1C2023; + } + .sickHis{ + background-color: #fff; + /* margin-top: 20rpx; */ + padding:1rpx 52rpx 40rpx; + +} +.list .qa{ + display: flex; + margin-top: 30rpx; + border-bottom:1rpx solid #E3E4E5; +} +.titlebox{ + flex:1; + +} +textarea{ + position: relative; + z-index:1; + width:100%; + color:#333; + height:132rpx; +} +.radio{ + margin: 30rpx 0rpx 30rpx 0; +} +.group .van-radio--horizontal{ + margin-right: 11rpx; +} +.singlegroup .van-radio--horizontal{ + margin-right:44rpx; +} +.singlegroup .van-radio--horizontal:nth-child(2n){ + margin-right: 0rpx; +} +.group .van-radio--horizontal:nth-child(3n){ + margin-right: 0; +} +.radiotip{ + position: relative; + padding:24rpx 20rpx; + justify-content: center; + margin-top: 20rpx; + line-height: 42rpx; +background: #F2F2F2; +border-radius: 10rpx; +font-size: 28rpx; +color:#999; +margin-bottom: 20rpx; +} +.radiotip .textbox{ + top:20rpx; + left:20rpx; + margin-top: 0; + width:auto; + height: 100rpx; + font-weight: normal; + z-index: 0; + position: absolute; + right:20rpx; +} + +.radiotip text{ + white-space: nowrap; + color:#333; +} +.van-radio__label{ + padding-right:40rpx!important; +} +/* .van-radio__label:nth-child(3){ + padding-right:0rpx!important; +} */ +.van-radio{ + margin-bottom: 10rpx!important; +} \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index ab2effc..18a0f99 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -80,17 +80,21 @@ Page({  wx.setStorageSync('AUTH_TOKEN', data.token);  wx.setStorageSync('CLIENT_USER_ID',data.client_user_id);  wx.setStorageSync('USER_ID',data.user_id); - app.imLogin(); - let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index'; - if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){ + let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index'; + let handleGo=null; + if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1){ + handleGo=function(){ + wx.reLaunch({ + url:'/pages/index/index' + }) + } + }else{ wx.reLaunch({ - url:'/pages/index/index' + url:url }) - }else{ - wx.reLaunch({ - url:url - }) - } + } + app.imLogin({path:'pages/login/login'},handleGo); + }) }); }else if(e.detail.errMsg == 'getPhoneNumber:fail user deny'){ diff --git a/pages/mobileLogin/mobileLogin.js b/pages/mobileLogin/mobileLogin.js index 43ab2ca..8c9dbcb 100644 --- a/pages/mobileLogin/mobileLogin.js +++ b/pages/mobileLogin/mobileLogin.js @@ -131,19 +131,24 @@ Page({  wx.setStorageSync('AUTH_TOKEN', data.token);  wx.setStorageSync('CLIENT_USER_ID',data.client_user_id);  wx.setStorageSync('USER_ID',data.user_id); - app.imLogin(); let url=this.data.redirectUrl?this.data.redirectUrl:'/pages/index/index'; - // console.log('333333'); - // console.log(url) + let handleGO=null; if(url.indexOf('login')!=-1 || url.indexOf('mobileLogin')!=-1 ){ - wx.reLaunch({ - url:'/pages/index/index' - }) + handleGO=function(){ + wx.reLaunch({ + url:'/pages/index/index' + }) + } + }else{ - wx.reLaunch({ - url:url - }) - } + handleGO=function(){ + wx.reLaunch({ + url:url + }) + } + } + app.imLogin({path:'pages/mobileLogin/mobileLogin'},1,handleGO); + }) }); }), diff --git a/pages/search/search.wxml b/pages/search/search.wxml index 59851e7..fdc20a9 100644 --- a/pages/search/search.wxml +++ b/pages/search/search.wxml @@ -30,6 +30,9 @@ + + + diff --git a/pages/search/search.wxss b/pages/search/search.wxss index 6525a62..668d995 100644 --- a/pages/search/search.wxss +++ b/pages/search/search.wxss @@ -202,4 +202,7 @@ font-size: 30rpx; flex: 1; overflow-y: scroll; -webkit-overflow-scrolling: touch; +} +.viewcell .left{ + position: relative; } \ No newline at end of file diff --git a/pages/sickDetail/sickDetail.js b/pages/sickDetail/sickDetail.js new file mode 100644 index 0000000..659e909 --- /dev/null +++ b/pages/sickDetail/sickDetail.js @@ -0,0 +1,74 @@ +// pages/sickDetail/sickDetail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + previewImage(event) { + let id = event.currentTarget.dataset.id; + let urls = this.data.sick.diagnose_images; + wx.previewImage({ + current: urls[id], // 当前显示图片的http链接 + urls: urls // 需要预览的图片http链接列表 + }) + }, + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/sickDetail/sickDetail.json b/pages/sickDetail/sickDetail.json new file mode 100644 index 0000000..d90a5d7 --- /dev/null +++ b/pages/sickDetail/sickDetail.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "nav":"../../components/nav/nav", + "van-icon": "@vant/weapp/icon/index" + }, + "navigationStyle":"custom", + "navigationBarTitleText": "病情详情" +} \ No newline at end of file diff --git a/pages/sickDetail/sickDetail.wxml b/pages/sickDetail/sickDetail.wxml new file mode 100644 index 0000000..267a923 --- /dev/null +++ b/pages/sickDetail/sickDetail.wxml @@ -0,0 +1,130 @@ + + + + + + + 第一份病例 + 填写时间:2022-12-20 + + + + + 基础信息 + + + 贺俊青 + 男|30岁 + + + + 身高:170cm + 体重:170cm + 民族:170cm + 民族:170cm + 民族:170cm + + + + 所患疾病: + 肝炎 + + + 确诊日期: + 肝炎 + + + 确诊医院: + 肝炎 + + + + 正在服用的药品信息: + 肝炎 + + 详细描述:阿托伐他汀钙片8片 (用法用量 + + + 病情描述: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + 用药意向: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + + 复诊凭证(病例/处方单/检查报告/住院单) + + + + + + + + + + 其他信息 + + + + 过敏史: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + 家族史: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + + + 是否备孕、妊娠或者哺乳期: + 肝炎 + + 详细描述:阿托伐他汀钙片8片 (用法用量 + + + + 饮酒史: + 肝炎 + + + + + 吸烟史: + 肝炎 + + + + 手术史: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + + 接触化学物: + 肝炎 + + 详细描述:阿托伐他汀钙片8片 (用法用量 + + + + + + 处方信息 + + + 诊断: + 肝炎 + + + 时间: + 肝炎 + + + 药品: + 肝炎详细描述:阿托伐他汀钙片8片 (用法用量详细描述:阿托伐他汀钙片8片 (用法用量 + + + + + diff --git a/pages/sickDetail/sickDetail.wxss b/pages/sickDetail/sickDetail.wxss new file mode 100644 index 0000000..ca909aa --- /dev/null +++ b/pages/sickDetail/sickDetail.wxss @@ -0,0 +1,102 @@ +/* pages/sickDetail/sickDetail.wxss */ +.page{ + overflow: hidden; + display: flex; + flex-direction: column; +} +.content{ + overflow-y: scroll; +} +.countcell{ + margin: 192rpx 30rpx 0; + background:#fff; + display: flex; + padding:30rpx 20rpx; + border-radius: 10rpx; +align-items: flex-start; + justify-content: space-between; +} +.icon{ + font-size: 34rpx; + color: #666666; +} +.countcell .time{ + font-size: 30rpx; + color: #666666; + margin-top: 20rpx; +} +.basiccell{ + padding:23rpx 20rpx; + margin:0 30rpx; + background: #FFFFFF; +border-radius: 10rpx; +} +.infobox .title{ + margin:0 30rpx; + padding:30rpx 0; +} +.namebox{ + display: flex; + align-items: center; +} +.namebox .name{ + font-size: 34rpx; + color: #3CC7C0; +} +.age{ + margin-left: 30rpx; + font-size: 34rpx; + color: #666666; +} +.infocell{ + font-size: 30rpx; + margin-top: 20rpx; + flex-wrap: wrap; +padding:20rpx; + display: flex; + background: #FAFAFA; + border-radius: 10rpx; +} +.infocell .cell{ +line-height: 60rpx; +margin-right: 21rpx; +} +.infocell .cell:nth-child(3){ + margin-right: 0rpx; +} + +.cell .desc{ + font-size: 28rpx; +color: #666666; +} +.row{ + padding:0 20rpx; + margin-top: 20rpx; + display: flex; + align-items: center; +} +.row.top{ + align-items:flex-start +} + +.row .name{ + font-size: 30rpx; + flex-shrink: 0; + white-space: nowrap; +} +.row .desc{ + word-break: break-all; + font-size: 28rpx; + color: #666666; +} +.row.top .desc{ + margin-top: 5rpx; +} +.tip{ + margin-top: 10rpx; + background: #FAFAFA; + border-radius: 10rpx; + padding:20rpx; + font-size: 26rpx; +color: #999999; +} \ No newline at end of file diff --git a/pages/sickManage/sickManage.js b/pages/sickManage/sickManage.js new file mode 100644 index 0000000..3011869 --- /dev/null +++ b/pages/sickManage/sickManage.js @@ -0,0 +1,98 @@ + +const app = getApp() +import {family} from "../../api/familyDoc" +import {throttle} from "../../utils/util" +Page({ + + /** + * 页面的初始数据 + */ + data: { + isTriggered:false, + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', + list:[] + }, + handleRefresher(){ + this.handleFamily(); + }, + handleFamily(){ + family().then(data=>{ + this.setData({ + isTriggered:false, + list:data + }) + }) + }, + goBack(){ + wx.navigateBack({ + delta: 1, + }) + }, + goInfo:throttle(function(){ + app.method.navigateTo({ + url: '/pages/sickDetail/sickDetail', + }) + }), + goMember:throttle(function(event){ + let id=event.currentTarget.dataset.id; + app.method.navigateTo({ + url: '/pages/memberDetail/memberDetail?family_id='+id, + }) + }), + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({ + img_host:app.hostConfig().imghost + }); + this.handleFamily(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + +}) \ No newline at end of file diff --git a/pages/sickManage/sickManage.json b/pages/sickManage/sickManage.json new file mode 100644 index 0000000..d02e308 --- /dev/null +++ b/pages/sickManage/sickManage.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "nav":"../../components/nav/nav" + }, + "navigationStyle":"custom", + "navigationBarTitleText": "病情管理" +} \ No newline at end of file diff --git a/pages/sickManage/sickManage.wxml b/pages/sickManage/sickManage.wxml new file mode 100644 index 0000000..7943104 --- /dev/null +++ b/pages/sickManage/sickManage.wxml @@ -0,0 +1,24 @@ + + + + + + + + {{item.card_name}}(未知,{{item.age}}岁) + + + + + + + 当前暂未添加任何家庭成员哦~ + + 立即添加 + + + + +添加家庭成员 + + + diff --git a/pages/sickManage/sickManage.wxss b/pages/sickManage/sickManage.wxss new file mode 100644 index 0000000..ef5bd8c --- /dev/null +++ b/pages/sickManage/sickManage.wxss @@ -0,0 +1,96 @@ +/* pages/familyDoc/familyDoc.wxss */ +.noimg { + width: 206rpx; + height: 100rpx; +} +.scrollbox{ + flex:1; +} +.tips { + font-size: 24rpx; + + color: #999999; +} +.page{ + display: flex; + flex-direction: column; +} +.nodata { + margin-top: 172rpx; + width: 100%; + height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.nodata .btnbox,.hasdata .btnbox{ + width:100%; +} +.nodata .btn,.hasdata .btn{ + display: flex; + margin: 40rpx 32rpx 0; + box-sizing: border-box; + align-items: center; + height: 80rpx; + background: #3CC7C0; + color: #fff; + font-size: 30rpx; + justify-content: center; + border-radius: 8rpx; +} + +.namecell{ + display: flex; + margin:0 32rpx; + height: 142rpx; + align-items: center; + padding:0 20rpx 0 30rpx; + background: #FFFFFF; + border-radius: 10rpx; + justify-content: space-between; +} +.hasdata{ + flex:1; + margin-top: 172rpx; + overflow: hidden; + position: relative; + display: flex; +flex-direction: column; +} +.namebox{ + width:100%; + margin-top: 20rpx; + flex:1; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} +.namecell { + margin-bottom: 10rpx; +} +.namecll .name{ +font-size: 34rpx; +color: #333333; +} +.righticon{ + width:20rpx; + height:40rpx; +} +.add{ + background-color: #fff; + margin-bottom: 20rpx; +} +.memberimg{ + width:206rpx; + height:100rpx; +} +.nodata .tips{ + font-size: 24rpx; +color: #999999; +} +.nobtn{ + background-color: transparent; +} +.img { + padding:14rpx 29rpx; +} \ No newline at end of file diff --git a/pages/sickRecord/sickRecord.js b/pages/sickRecord/sickRecord.js new file mode 100644 index 0000000..751e4c8 --- /dev/null +++ b/pages/sickRecord/sickRecord.js @@ -0,0 +1,175 @@ + +const app = getApp() +import {pathographyList,pathographyListDelte} from "../../api/sickRecord" +import {throttle} from "../../utils/util" +Page({ + + /** + * 页面的初始数据 + */ + data: { + isTriggered:false, + family_id:'', + show:false, + message:'', + page:1, + currentId:'', + isLock:false, + per_page:10, + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', + list:[] + }, + handleRefresher(){ + this.setData({ + page:1, + isLock:false, + list:[] + }) + this.handleFamily(); + }, + onDel(event) { + let id=event.currentTarget.dataset.id; + const {instance } = event.detail; + instance.close(); + this.setData({ + show:true, + currentId:id, + message:"确定删除该病情记录?" + }) + }, + confirm:throttle(function(event){ + if(event.detail){ + this.handlePathographyListDelte(); + } +}), + handlePathographyListDelte(){ + pathographyListDelte(id).then(data=>{ + wx.showToast({ + title: '删除成功', + icon:'none' + }) + }) + }, + onChange(event) { + + this.setData({ + radio: event.detail, + }); + var pages = getCurrentPages(); // 当前页面 + + var beforePage = pages[pages.length - 2]; // 前一个页面 + beforePage.setData({ //修改上衣页面的参数 + 'pathography_id':event.detail, +}) +//返回上一个页面之前先处理一下数据或调用一下上个页面的方法 + wx.navigateBack({ + delta: 1, + success: function() { + + } + }); + }, + lower(e) { + if(!this.data.isLock){ + this.setData({ + page: ++this.data.page + }) + this.handleFamily() + } + }, + handleFamily(){ + let {family_id,page,per_page}=this.data; + pathographyList({ + family_id, + page, + per_page + }).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) + }) + }) + }, + goBack(){ + wx.navigateBack({ + delta: 1, + }) + }, + goInfo:throttle(function(){ + app.method.navigateTo({ + url: '/pages/memberDetail/memberDetail', + }) + }), + goMember:throttle(function(event){ + let id=event.currentTarget.dataset.id; + app.method.navigateTo({ + url: '/pages/memberDetail/memberDetail?family_id='+id, + }) + }), + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + family_id:options.family_id + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({ + img_host:app.hostConfig().imghost + }); + this.handleFamily(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + +}) \ No newline at end of file diff --git a/pages/sickRecord/sickRecord.json b/pages/sickRecord/sickRecord.json new file mode 100644 index 0000000..23bb3cf --- /dev/null +++ b/pages/sickRecord/sickRecord.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "nav":"../../components/nav/nav", + "van-radio": "@vant/weapp/radio/index", + "dialog":"../../components/dialog/dialog", + "van-swipe-cell": "@vant/weapp/swipe-cell/index", + "van-radio-group": "@vant/weapp/radio-group/index" + }, + "navigationStyle":"custom", + "navigationBarTitleText": "病情管理" +} \ No newline at end of file diff --git a/pages/sickRecord/sickRecord.wxml b/pages/sickRecord/sickRecord.wxml new file mode 100644 index 0000000..d677d69 --- /dev/null +++ b/pages/sickRecord/sickRecord.wxml @@ -0,0 +1,29 @@ + + + + + + + + + + + + {{item.created_at}} + + {{item.disease_class_name}} + + {{item.disease_desc}} + + + + + + 删除 + + + + + + + \ No newline at end of file diff --git a/pages/sickRecord/sickRecord.wxss b/pages/sickRecord/sickRecord.wxss new file mode 100644 index 0000000..c092d57 --- /dev/null +++ b/pages/sickRecord/sickRecord.wxss @@ -0,0 +1,130 @@ +/* pages/familyDoc/familyDoc.wxss */ +.noimg { + width: 206rpx; + height: 100rpx; +} +.scrollbox{ + flex:1; +} +.tips { + font-size: 24rpx; + + color: #999999; +} +.page{ + display: flex; + flex-direction: column; +} +.nodata { + margin-top: 172rpx; + width: 100%; + height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.nodata .btnbox,.hasdata .btnbox{ + width:100%; +} +.nodata .btn,.hasdata .btn{ + display: flex; + margin: 40rpx 32rpx 0; + box-sizing: border-box; + align-items: center; + height: 80rpx; + background: #3CC7C0; + color: #fff; + font-size: 30rpx; + justify-content: center; + border-radius: 8rpx; +} + +.namecell{ + display: flex; + margin:0 32rpx; + height: 142rpx; + align-items: center; + padding:0 20rpx 0 30rpx; + background: #FFFFFF; + box-sizing: content-box; + border-radius: 10rpx; + +} +.namecell .time{ + font-size: 34rpx; +color: #333333; +} +.rightcon{ + flex:1; +} +.namecell .disease{ + flex:1; + display: flex; + margin-top: 10rpx; + font-size: 24rpx; + color: #666666; +} +.disease{ + white-space: nowrap; +} +.disease_desc{ + flex:1; + margin-left: 8rpx; +} +.desctext{ + width:80%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + +} +.hasdata{ + flex:1; + margin-top: 172rpx; + overflow: hidden; + position: relative; + display: flex; +flex-direction: column; +} +.namebox{ + width:100%; + margin-top: 20rpx; + flex:1; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} +.namecell { + margin-bottom: 10rpx; +} +.namecll .name{ +font-size: 34rpx; +color: #333333; +} +.righticon{ + width:20rpx; + height:40rpx; +} +.add{ + background-color: #fff; + margin-bottom: 20rpx; +} +.memberimg{ + width:206rpx; + height:100rpx; +} +.nodata .tips{ + font-size: 24rpx; +color: #999999; +} +.nobtn{ + background-color: transparent; +} +.van-swipe-cell__right { + width:65px; + display: flex; + align-items: center; + justify-content: center; + background: #FA541C; + color: #fff; +} \ No newline at end of file diff --git a/pages/writeSick/writeSick.js b/pages/writeSick/writeSick.js index 462ef75..0c6f956 100644 --- a/pages/writeSick/writeSick.js +++ b/pages/writeSick/writeSick.js @@ -15,6 +15,7 @@ import { throttle } from "../../utils/util" import {client_type} from "../../utils/isPc" +import {isExist,pathographyDetail} from "../../api/sickRecord" let urlHost=app.hostConfig().agreehost; console.log(client_type); Page({ @@ -24,6 +25,7 @@ Page({ */ data: { prevData: null, + pathography_id:'', showdialog: false, showAgreeDialog: false, message: '', @@ -46,6 +48,7 @@ Page({ disease_desc: '', hideFamilysick: false, showBack: false, + is_exist:false, columns: [], fileList: [], lockBtn: false, @@ -127,91 +130,110 @@ Page({ getlocalInfo(id){ let sickInfo = wx.getStorageSync('sickInfo'); if (sickInfo) { - var InfoObj = JSON.parse(sickInfo); if (InfoObj instanceof Array) { - for (let i = 0; i < InfoObj.length; i++) { - if (InfoObj[i].family_id == id) { - Dialog.confirm({ - title: '温馨提示', - message: '是否加载之前保存的病情信息?', - }).then(() => { - this.setInfo(InfoObj[i]) - }) - .catch(() => { + let obj=null; + let isHas= InfoObj.some((item)=>{ + if(item.family_id==id){ + obj=item; + } + return item.family_id==id; + }) + if(isHas){ + this.setInfo(obj) + }else{ + this.handleOnlineSick(this.data.family_id); + } + // for (let i = 0; i < InfoObj.length; i++) { + // if (InfoObj[i].family_id == id) { + // Dialog.confirm({ + // title: '温馨提示', + // message: '是否加载之前保存的病情信息?', + // }).then(() => { + // this.setInfo(InfoObj[i]) + // }).catch(() => { - }); + // }); - break; - }; - } + // break; + // }; + // } } } }, - handleLastSick(id) { - lastSick(id).then(data => { - if (!data){ - this.getlocalInfo(id); - - } else { - let obj = { - disease_class_name: '', - disease_class_id: '', - diagnosis_date: '', - disease_desc: '', - is_allergy_history:null, - product: [], - is_taboo:null, - is_pregnant:null, - pregnant: '', - is_family_history:null, - allergy_history: '', - family_history: '', - } - for (const key in obj) { - if (key != "product") { - this.setData({ - [key]: data[key] - }) - } - - }; - if (data.disease_desc) { - this.setData({ - hideSick: true - }) - }; - if (data.pregnant) { - this.setData({ - hidePregnant: true - }) - }; - - if (data.allergy_history) { - this.setData({ - hideGuomin: true - }) - }; - if (data.family_history) { - this.setData({ - hideFamilysick: true - }) - }; - if (data.diagnose_images) { - this.setData({ - fileList: data.diagnose_images, - checkSign: false - }) - } else { - this.setData({ - checkSign: false - }) - } - + handleSetValue(data){ + if(data){ + let obj = { + disease_class_name: '', + disease_class_id: '', + diagnosis_date: '', + disease_desc: '', + is_allergy_history:null, + product: [], + is_taboo:null, + is_pregnant:null, + pregnant: '', + is_family_history:null, + allergy_history: '', + family_history: '', } + for (const key in obj) { + if (key != "product") { + this.setData({ + [key]: data[key] + }) + } + + }; + if (data.disease_desc) { + this.setData({ + hideSick: true + }) + }; + if (data.pregnant) { + this.setData({ + hidePregnant: true + }) + }; + + if (data.allergy_history) { + this.setData({ + hideGuomin: true + }) + }; + if (data.family_history) { + this.setData({ + hideFamilysick: true + }) + }; + if (data.diagnose_images) { + this.setData({ + fileList: data.diagnose_images, + checkSign: false + }) + } else { + this.setData({ + checkSign: false + }) + } + } + }, + handleOnlineSick(id){ + lastSick(id).then(data => { + this.handleSetValue(data); }) }, + // handleLastSick(id) { + // lastSick(id).then(data => { + // if (!data){ + // this.getlocalInfo(id); + // } else { + + + // } + // }) + // }, onConfirm(event) { const { @@ -331,6 +353,11 @@ Page({ showSick: false }) }, + goRecord:throttle(function(){ + app.method.navigateTo({ + url:'/pages/sickRecord/sickRecord?family_id='+this.data.family_id + }) + }), handleThrottle: throttle(function () { this.create_Order() }), @@ -552,6 +579,21 @@ Page({ diagnosis_date: dayjs(event.detail).format('YYYY-MM-DD') }); }, + handlepathographyDetail(id){ + pathographyDetail(id).then(data=>{ + this.handleSetValue(data); + }) + }, + handleIsExist(){ + let {family_id}=this.data; + isExist({ + family_id + }).then(data=>{ + this.setData({ + is_exist:data.is_exist==0?false:true + }) + }) + }, handelFocus(e) { let key = e.target.dataset.id; let value = e.target.dataset.value; @@ -630,9 +672,6 @@ Page({ }) } } - - - }, agreeConfirm(){ this.setData({ @@ -784,7 +823,9 @@ Page({ }) } //this.getSick(); - this.handleLastSick(options.family_id); + + this.handleIsExist(); + }, goAgreement:throttle(function(){ app.method.navigateTo({ @@ -806,7 +847,9 @@ Page({ img_host:app.hostConfig().imghost }); let { - prevData + prevData, + pathography_id, + family_id } = this.data; if (prevData) { this.setData({ @@ -814,6 +857,14 @@ Page({ disease_class_id: prevData.disease_class_id, }) } + console.log(pathography_id) + if(pathography_id){ + this.handlepathographyDetail(pathography_id) + }else{ + this.getlocalInfo(family_id); + //this.handleLastSick(options.family_id); + } + }, /** diff --git a/pages/writeSick/writeSick.wxml b/pages/writeSick/writeSick.wxml index 2e792a7..cb0188e 100644 --- a/pages/writeSick/writeSick.wxml +++ b/pages/writeSick/writeSick.wxml @@ -6,6 +6,10 @@ 填写病情 + + 病情历史 + 查看记录 + 所患疾病 diff --git a/pages/writeSick/writeSick.wxss b/pages/writeSick/writeSick.wxss index ee02134..ef5d57d 100644 --- a/pages/writeSick/writeSick.wxss +++ b/pages/writeSick/writeSick.wxss @@ -7,7 +7,27 @@ margin-top:172rpx; } - +.sickHisbox{ + display: flex; + height:94rpx; + align-items: center; + margin-bottom: 20rpx; + background-color: #fff; + padding:0 55rpx; + justify-content: space-between; +} +.hisBtn{ +width: 166rpx; +height: 60rpx; +color:#3CC7C0; +display: flex; +font-size: 26rpx; +align-items: center; +justify-content: center; +background: #E2FFFE; +border-radius: 6rpx; +border: 1rpx solid #3CC7C0; +} .info { border-bottom: 1rpx solid #E7E7E7; display: flex;