index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <view class="content">
  3. <view class="tip" v-if="status==='1'">
  4. <text>请稍等一会会,医生真在认真诊断您的病情。</text>
  5. </view>
  6. <!-- 待确诊 -->
  7. <view class="cont" v-show="status==='1'||status==='4'">
  8. <view class="desc-container item">
  9. <view class="item-head">
  10. <view class="dot"></view>
  11. <text class="name">病情描述</text>
  12. <button type="primary" v-if="status==='4'" size="mini" @click="secondauxiliarydiagnosis">咨询</button>
  13. </view>
  14. <view class="desc" v-html="IllnessDescription"></view>
  15. <view class="tags">
  16. <view class="item" v-for="(IllnessTag,index) in IllnessTags" :key="index">
  17. <text>{{IllnessTag}}</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="image-container item">
  22. <view class="item-head">
  23. <view class="dot"></view>
  24. <text class="name">医学影像</text>
  25. </view>
  26. <view class="item-cont">
  27. <view class="imgbox" v-for="(image,index) in images" :key="index">
  28. <image :src="uploadServer+image.path" v-if="images.length>0" class="image-pic"></image>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="assist-container item">
  33. <view class="item-head">
  34. <text class="head-highlight">AI</text>
  35. <text class="name">辅助诊断</text>
  36. </view>
  37. <view class="item-cont aiDiagnose" v-html="aiDiagnose"></view>
  38. </view>
  39. </view>
  40. <!-- 待确认 -->
  41. <view class="cont" v-show="status==='2'||status==='3'">
  42. <view class="item doctor-info">
  43. <view class="item-head">
  44. <view class="dot"></view>
  45. <text class="name">主治医生简介</text>
  46. </view>
  47. <view class="cont">
  48. <view class="user">
  49. <image :src="doctor.avatar" @error="errorAvatar" class="avatar"></image>
  50. <view class="info">
  51. <view class="user-name">
  52. <text>{{doctor.name}}</text>
  53. </view>
  54. <view class="user-tags">
  55. <text>{{doctor.tags}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="hospital">
  60. <text class="hospital-name">{{doctor.hospitalName}}</text>
  61. <text class="hospital-level">{{doctor.hospitalLevel}}</text>
  62. </view>
  63. <view class="specialty">
  64. <text class="specialty-head">专业特长</text>
  65. <text class="specialty-message">{{doctor.specialty}}</text>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="item diagnoseResult">
  70. <view class="item-head between">
  71. <view class="title">
  72. <view class="dot"></view>
  73. <text class="name">诊断结果</text>
  74. </view>
  75. <view class="star" v-if="starNumber>0">
  76. <!-- 因为评星排版是反的所以数量为5-numer -->
  77. <zhcx-star class="star" :star="5-starNumber" color="#fff" defaultcolor="orange" />
  78. </view>
  79. </view>
  80. <view class="item-cont" v-html="diagnoseResult"></view>
  81. </view>
  82. <!-- <view class="item">
  83. <view class="item-head">
  84. <view class="dot"></view>
  85. <text class="name">推荐药物</text>
  86. </view>
  87. <view class="tags">
  88. <view class="item" v-for="(IllnessTag,index) in IllnessTags" :key="index">
  89. <text>{{IllnessTag}}</text>
  90. </view>
  91. </view>
  92. </view> -->
  93. <view class="item">
  94. <view class="item-head">
  95. <view class="dot"></view>
  96. <text class="name">病情描述</text>
  97. </view>
  98. <view class="desc" v-html="IllnessDescription"></view>
  99. <view class="tags">
  100. <view class="item" v-for="(IllnessTag,index) in IllnessTags" :key="index">
  101. <text>{{IllnessTag}}</text>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="image-container item">
  106. <view class="item-head">
  107. <view class="dot"></view>
  108. <text class="name">医学影像</text>
  109. </view>
  110. <view class="item-cont">
  111. <view class="imgbox" v-for="(image,index) in images" :key="index">
  112. <image :src="uploadServer+image.path" v-if="images.length>0" class="image-pic"></image>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="assist-container item">
  117. <view class="item-head">
  118. <text class="head-highlight">AI</text>
  119. <text class="name">辅助诊断</text>
  120. </view>
  121. <view class="item-cont aiDiagnose" v-html="aiDiagnose"></view>
  122. </view>
  123. <view class="handle-wrap">
  124. <view class="submit-BT" v-if="status==='2'" @click="submit(1)">
  125. <text>去评价</text>
  126. </view>
  127. <!-- <view class="submit-BT appraise" @click="submit(2)" >
  128. <text>待评价</text>
  129. </view> -->
  130. </view>
  131. </view>
  132. <view class="appraise-wrap" v-if="appraiseModal">
  133. <view class="appraise-wrap-mask">
  134. <view class="appraise-container">
  135. <view class="appraise-title">
  136. <text>评价</text>
  137. <view class="closeBt" @click="closeAppraise">
  138. <text class="close"></text>
  139. </view>
  140. </view>
  141. <view class="appraise-cont">
  142. <radio-group @change="appraiseChange">
  143. <view class="item" v-for="(item,index) in 5" :key="index">
  144. <label class="radio">
  145. <radio :value="index+1" />
  146. <zhcx-star class="star" :star="index+1" color="orange" defaultcolor="#fff" />
  147. </label>
  148. </view>
  149. </radio-group>
  150. </view>
  151. <view class="submit-BT" @click="submit(3)">
  152. <text>确认</text>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="submit-BT recommend" @click="recommend" v-if="status==='2'">
  158. <text>查看推荐</text>
  159. </view>
  160. <view class="consult" @click="consult" v-if="doctor.id">
  161. <image class="consult-icon" src="/static/images/order/phone.png" mode="widthFix"></image>
  162. </view>
  163. </view>
  164. </template>
  165. <script>
  166. import avatar from '@/static/images/login/doctor.png';
  167. import zhcxStar from '@/components/Star'
  168. import {patientInfo,patientAppraise,secondauxiliarydiagnosisApi} from '@/api/patient';
  169. import {notEmpty,parseTime} from '@/libs';
  170. import config from '@/config'
  171. export default{
  172. name:'patientDetail',
  173. props:{
  174. status:{
  175. type:[String,Number],
  176. default:1
  177. }
  178. },
  179. components:{
  180. zhcxStar
  181. },
  182. data(){
  183. return{
  184. uploadServer:config.uploadServer,
  185. seekId:null,
  186. appraiseModal:false,
  187. appraiseResult:0,
  188. starNumber:0,
  189. doctor:{
  190. avatar:"",
  191. name:"",
  192. department:"",
  193. hospitalName:''
  194. },
  195. aiDiagnose:"",
  196. IllnessDescription:"",
  197. IllnessTags:[],
  198. images:[],
  199. diagnoseResult:"",
  200. diseaseGrade:"",
  201. aiDiagnosisSite:undefined
  202. }
  203. },
  204. methods:{
  205. init({id,user,status}){
  206. this.seekId=id;
  207. this.getdetails(id);
  208. },
  209. getdetails(id){
  210. patientInfo(id).then((res)=>{
  211. this.doctor={
  212. avatar:res.data.headportrait||avatar,
  213. name:res.data.doctorName,
  214. tags:res.data.technicaltitle,
  215. hospitalName:res.data.hospitalname,
  216. hospitalLevel:res.data.hospitallevel,
  217. specialty:res.data.begoodat,
  218. id:res.data.doctorId
  219. }
  220. let diseaseImgDesc=JSON.parse(res.data.diseaseImgDesc);
  221. this.IllnessTags=this.formateSite(res.data.aiDiagnosisSite);
  222. this.aiDiagnosisSite=res.data.aiDiagnosisSite;
  223. let aiDiagnosisDesc=res.data.aiDiagnosisDesc;
  224. aiDiagnosisDesc = aiDiagnosisDesc.replace(/\<img/gi, '<img class="rich-img" ');
  225. this.aiDiagnose=aiDiagnosisDesc;
  226. this.IllnessDescription=res.data.diseaseDesc;
  227. this.diagnoseResult=res.data.doctorDiagnosis;
  228. this.starNumber=res.data.satisfaction
  229. this.images=diseaseImgDesc;
  230. this.diseaseGrade=res.data.aiPatientSeekDesc.diseaseGrade;
  231. })
  232. },
  233. errorAvatar({detail}){
  234. this.avatar=avatar;
  235. },
  236. submit(type){
  237. if(type===1){//待确定
  238. this.appraiseModal=true;
  239. }else if(type===2){//待评价
  240. this.appraiseModal=true;
  241. }else{//提交评价
  242. let appraiseResult=this.appraiseResult;
  243. this.appraiseModal=false;
  244. patientAppraise(this.seekId,appraiseResult).then((res)=>{
  245. uni.showToast({
  246. title:`你打了${appraiseResult}个星星!!`,
  247. icon:"none",
  248. complete:()=>{
  249. uni.reLaunch({
  250. url:"/views/record/index?type=appraise"
  251. })
  252. }
  253. });
  254. })
  255. }
  256. },
  257. appraiseChange({detail}){
  258. this.appraiseResult=detail.value;
  259. },
  260. closeAppraise(){
  261. this.appraiseModal=false;
  262. },
  263. formateSite(site){
  264. try{
  265. if(!site){
  266. return []
  267. }else{
  268. let tags=JSON.parse(site);
  269. if(Array.isArray(tags)&&site.length>0){
  270. tags=tags.map((item)=>{
  271. return item.illnessname;
  272. })
  273. return tags;
  274. }
  275. return [];
  276. }
  277. }catch(err){
  278. return [];
  279. }
  280. },
  281. consult(){
  282. var name=this.doctor.name;
  283. var id=this.doctor.id;
  284. if(!notEmpty(id)){
  285. uni.showToast({
  286. icon:'none',
  287. title:'咨询信息关闭,无法咨询'
  288. })
  289. return;
  290. }
  291. uni.navigateTo({
  292. url:`/views/IM/index/index?id=${id}&name=${name}`
  293. })
  294. },
  295. recommend(){
  296. let seekId=this.seekId;
  297. let status=this.status;
  298. let grade=this.diseaseGrade;
  299. uni.navigateTo({
  300. url:`/views/patientItems/recommend/index?status=${status}&id=${seekId}&grade=${grade}`
  301. })
  302. },
  303. secondauxiliarydiagnosis(){
  304. const diseaseImgDesc = JSON.stringify(this.images)
  305. const site = this.aiDiagnosisSite
  306. const diseaseDesc = this.IllnessDescription
  307. const seekId=this.seekId;
  308. secondauxiliarydiagnosisApi({
  309. diseaseDesc,
  310. seekTime: parseTime(new Date()),
  311. site,
  312. diseaseImgDesc
  313. }).then((res)=>{
  314. const aidiagnoseInfo = res.data
  315. uni.setStorageSync("aidiagnoseInfo",{
  316. ...aidiagnoseInfo,seekId
  317. })
  318. uni.navigateTo({
  319. url: '/views/patientItems/diagnose/index'
  320. });
  321. })
  322. }
  323. }
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. @import url('./index.css');
  328. .consult{
  329. width: 130upx;
  330. height: 130upx;
  331. border-radius: 50%;
  332. border:1px solid #ccc;
  333. color: #fff;
  334. position: fixed;
  335. right: 0;
  336. bottom: 200upx;
  337. overflow: hidden;
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. opacity: 0.8;
  342. .consult-icon{
  343. display: block;
  344. width: 80upx;
  345. height: 80upx;
  346. }
  347. }
  348. .aiDiagnose{
  349. &::v-deep .rich-img{
  350. display: block;
  351. width: 90%;
  352. margin: 20upx auto;
  353. }
  354. }
  355. </style>