report.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <template>
  2. <view class="">
  3. <navbar :title="$t('show_report')" size="48" :backtext="$t('back')" color="#fff"></navbar>
  4. </view>
  5. <uv-toast ref="toast"></uv-toast>
  6. <view class="app_content">
  7. <view class="page">
  8. <view class="bottomarc"></view>
  9. <uv-row justify="space-between" customStyle="margin-top: 30%">
  10. <uv-col span="10" offset="1" class="box1">
  11. <uv-row justify="space-between" class="item">
  12. <uv-col span="4" align="center">{{$t('illness_title')}}</uv-col>
  13. <uv-col span="4" align="center">{{$t('report_score')}}</uv-col>
  14. <uv-col span="4" align="center">{{$t('report_result')}}</uv-col>
  15. </uv-row>
  16. <uv-row justify="space-between" v-for="(item,index) in list" :key="index" class="item">
  17. <uv-col span="4" align="center"> {{item.diseasename}}</uv-col>
  18. <uv-col span="4">
  19. <uv-text :type="item.havrisk>0?'error':'success'" :text="item.scoreresult?item.scoreresult:0" align="center"></uv-text>
  20. </uv-col>
  21. <uv-col span="4">
  22. <uv-text :type="item.havrisk>0?'error':'success'" :text="item.havrisk>0?$t('risk'):$t('low_risk')" align="center"></uv-text>
  23. </uv-col>
  24. </uv-row>
  25. </uv-col>
  26. </uv-row>
  27. <view class="advicearea">
  28. <uv-row justify="space-between" class="item">
  29. <uv-col span="12" align="center">
  30. <view class="advicelabel">{{$t('report_detail')}}</view>
  31. </uv-col>
  32. </uv-row>
  33. </view>
  34. <view v-if="labellist.length>0">
  35. <uv-tabs :list="labellist" @click="click" customStyle="align-items: center"
  36. itemStyle="font-size:20px;height:40px;" current="0" @change="change"
  37. :activeStyle="activeStyle" lineWidth="30"
  38. ></uv-tabs>
  39. </view>
  40. <view class="info_div">
  41. <view class="" v-if="selectitem">
  42. <!-- <view class='diseasetitlestr'>
  43. {{selectitem.titlestr}}
  44. </view> -->
  45. <br />
  46. <view v-show="selectitem.havrisk==0">
  47. <uv-text :text="$t('report_text_1')+selectitem.risklimit+$t('report_text_1_1')" align="center" type="success"></uv-text>
  48. </view>
  49. <view v-if="selectitem.havrisk==1">
  50. <uv-text :text="selectitem.riskmsg" align="center" type="error" :customStyle="customStyleRiskmsg"></uv-text>
  51. <uv-text :text="$t('report_error_text_1')" align="center" :customStyle="customStyleErrorText"></uv-text>
  52. <uv-text :text="$t('report_error_text_2')" align="center" :customStyle="customStyleErrorText"></uv-text>
  53. <uv-text :text="$t('report_error_text_3')" align="center" :customStyle="customStyleErrorText"></uv-text>
  54. <uv-row customStyle="margin-top:20rpx">
  55. <uv-col span="12">
  56. <view v-show="selectitem.noticelist.length>0">
  57. <view v-for="(item,index) in selectitem.noticelist" :key="index">
  58. <uv-text :text="index+1+'、'+item"></uv-text>
  59. </view>
  60. </view>
  61. </uv-col>
  62. </uv-row>
  63. </view>
  64. <view v-show="selectitem.havrisk==1" class="noticearea">
  65. <uv-row customStyle="">
  66. <uv-col span="12" align="center">
  67. <view class="noticelabel">{{$t('health_advice')}}</view>
  68. </uv-col>
  69. </uv-row>
  70. <uv-row customStyle="">
  71. <uv-col span="12">
  72. <view v-show="selectitem.advicelist.length>0">
  73. <view v-for="(item,index) in selectitem.advicelist" :key="index">
  74. <uv-text :text="index+1+'、'+item"></uv-text>
  75. </view>
  76. </view>
  77. </uv-col>
  78. </uv-row>
  79. </view>
  80. </view>
  81. <view class="report_explain">
  82. <view class="advicearea">
  83. <uv-row justify="space-between" class="item">
  84. <uv-col span="12" align="center">
  85. <view class="advicelabel">{{$t('report_explain')}}</view>
  86. </uv-col>
  87. </uv-row>
  88. </view>
  89. <view class="info_div1">
  90. <uv-text v-if="info.age>=40" :text="$t('report_explain_text_1')" type="info" align="center"></uv-text>
  91. <uv-text v-if="info.gender=='男'" :text="$t('report_explain_text_2')" type="info" align="center"></uv-text>
  92. <uv-text v-if="info.bmi>24"
  93. :text="$t('report_explain_text_3')+info.bmi+$t('report_explain_text_3_1')+info.height+$t('report_explain_text_3_2')+info.weightbmi24+$t('report_explain_text_3_3')" type="info" align="center"></uv-text>
  94. <uv-text v-if="info.sbp>=140" :text="$t('report_explain_text_4')" type="info"></uv-text>
  95. </view>
  96. <view class='info_div1'>
  97. <uv-text v-if="info.fhstroke>0||info.fhheart>0" :text="$t('report_explain_text_5')" type="info" align="center"></uv-text>
  98. <uv-text v-if="info.issmoke>0||info.isdrink>0||info.isunsport>0" :text="$t('report_explain_text_6')" type="info" align="center"></uv-text>
  99. <uv-text v-if="info.age>=40&&info.issmoke>0" :text="$t('report_explain_text_7')" type="info" align="center"></uv-text>
  100. <view class="" v-if="info.isinspectabodomen>0||info.isteghtness>0">
  101. <uv-text v-if="info.isinspectabodomen>1" :text="$t('report_explain_text_8')" type="info" align="center"></uv-text>
  102. <uv-text v-if="info.isteghtness>1" :text="$t('report_explain_text_9')" type="info" align="center"></uv-text>
  103. </view>
  104. </view>
  105. </view>
  106. <uv-line color="#933333"></uv-line>
  107. <view class="healthinfolist">
  108. <view class="grid">
  109. <uv-row justify="space-between" class="item">
  110. <uv-col span="3" align="center">
  111. <uv-text :text="$t('healthy_habits')" :bold="true" align="center"></uv-text>
  112. </uv-col>
  113. <uv-col span="2" align="center">
  114. <uv-text :text="$t('y_n')" :bold="true" align="center"></uv-text>
  115. </uv-col>
  116. <uv-col span="7" align="center">
  117. <uv-text :text="$t('healthy_personal_ratios')" :bold="true" align="center"></uv-text>
  118. </uv-col>
  119. </uv-row>
  120. <uv-row justify="space-between" class="item" v-for="(item,index) in healthlist" :key="index">
  121. <uv-col span="3" align="center">
  122. <uv-text :text="item.disstr" align="center" size="12"></uv-text>
  123. </uv-col>
  124. <uv-col span="2" align="center">
  125. <uv-text :text="item.strvalue" align="center" size="12"></uv-text>
  126. </uv-col>
  127. <uv-col span="4" align="center">
  128. <uv-text :text="$t('all_people')+item.allpre+'%'" align="center" size="12"></uv-text>
  129. </uv-col>
  130. <uv-col span="3" align="center">
  131. <uv-text :text="$t('group_people')+item.agepre+'%'" align="center" size="12"></uv-text>
  132. </uv-col>
  133. </uv-row>
  134. </view>
  135. <uv-text :text="$t('report_text_4')" align="center" type="info" :bold="true"></uv-text>
  136. </view>
  137. <!-- <uv-line color="#933333"></uv-line>
  138. <view class="info_div1">
  139. <uv-text :text="$t('report_text_5')" align="center" :bold="true"></uv-text>
  140. <br />
  141. <uv-text :text="$t('report_text_6')" type="info"></uv-text>
  142. <uv-text :text="$t('report_text_7')" type="info"></uv-text>
  143. <uv-text :text="$t('report_text_8')" type="info"></uv-text>
  144. </view> -->
  145. <uv-line color="#933333"></uv-line>
  146. <view class="info_div1">
  147. <uv-text :text="$t('report_text_9')" :bold="true" align="center"></uv-text>
  148. </view>
  149. <uv-line color="#933333"></uv-line>
  150. <br />
  151. <!-- <share @dosharewechat="share"></share> -->
  152. <br>
  153. <view class="statement">
  154. <text class="statement_title">Data source:</text>
  155. <br />
  156. <text class="statement_item">【1】Guideline for the prevention and treatment of type 2 diabetes mellitus in China(2020 edition)(Part 1) [J]. Chinese Journal of Practical Internal Medicine, 2021, 41 (08): 668-695. DOI:10.19538/j.nk2021080106.</text>
  157. <br />
  158. <text class="statement_item">【2】Guideline for the prevention and treatment of type 2 diabetes mellitus in China(2020 edition)(Part 2) [J]. Chinese Journal of Practical Internal Medicine, 2021, 41 (09): 757-784. DOI:10.19538/j.nk2021090106.</text>
  159. <br />
  160. <text class="statement_item">【3】Yang X, Li J, Hu D, Chen J, Li Y, Huang J, Liu X, Liu F, Cao J, Shen C, Yu L, Lu F, Wu X, Zhao L, Wu X and Gu Dongfeng. Predicting the 10-Year Risks of Atherosclerotic Cardiovascular Disease in Chinese Population: The China-PAR Project (Prediction for ASCVD Risk in China). Circulation. 2016;134:1430-40.</text>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. </template>
  166. <script>
  167. import {querymergereportlistbyuserid,queryuserhealthinfobyuid,querystemperinfobyuserid} from "@/common/api/health.js"
  168. import {tohome} from "/common/js/common.js"
  169. import share from "@/components/share/share.vue"
  170. import {addlog} from "@/common/api/system.js"
  171. export default {
  172. data() {
  173. return {
  174. list:[],
  175. healthlist:[],
  176. info:{},
  177. userinfo:{},
  178. selectuser:{},
  179. labellist:[],
  180. activeStyle:{
  181. color:'#648EB8',
  182. fontWeight: 'bold',
  183. transform: 'scale(1.05)',
  184. // borderBottom:"2rpx double #648eb8"
  185. },
  186. selectitem:false,
  187. customStyleRiskmsg:{
  188. fontSize:'20px',
  189. marginBottom:'10rpx'
  190. },
  191. customStyleErrorText:{
  192. fontSize:'18px',
  193. marginBottom:'10rpx',
  194. color:"#648eb8"
  195. },
  196. share_userid:false,
  197. share_fmemberid:false
  198. }
  199. },
  200. methods: {
  201. getlist(){
  202. let data ={
  203. userid:this.share_userid?this.share_userid:this.userinfo.id,
  204. fmemberid:this.share_fmemberid?this.share_fmemberid:this.selectuser.fmemberid
  205. }
  206. querymergereportlistbyuserid(data).then(res=>{
  207. res = res.data
  208. if(0==res.code){
  209. this.$refs.toast.show({
  210. type: 'error',
  211. message: res.errmsg
  212. })
  213. return false
  214. }
  215. let list = res.resultData
  216. list.map((item,index)=>{
  217. item.noticelist =[];
  218. item.advicelist=[]
  219. if(parseInt(item.scoreresult)>parseInt(item.risklimit)){
  220. item.havrisk =1
  221. item.answerlist.map((alitem,alindex)=>{
  222. if(alitem.noticememo!=""){
  223. if(alitem.noticetype==1){
  224. item.noticelist.push(alitem.noticememo)
  225. }
  226. if(alitem.noticetype==2){
  227. item.advicelist.push(alitem.noticememo)
  228. }
  229. }
  230. })
  231. }else{
  232. item.havrisk =0
  233. }
  234. this.labellist.push({name:item.diseasename})
  235. })
  236. this.list = list
  237. this.selectitem = list[0]
  238. })
  239. },
  240. getinfo(){
  241. let data ={
  242. userid:this.share_userid?this.share_userid:this.userinfo.id,
  243. fmemberid:this.share_fmemberid?this.share_fmemberid:this.selectuser.fmemberid
  244. }
  245. queryuserhealthinfobyuid(data).then(res=>{
  246. res = res.data
  247. if(0==res.code){
  248. this.$refs.toast.show({
  249. type: 'error',
  250. message: res.errmsg
  251. })
  252. return false
  253. }
  254. if(200==res.code){
  255. this.info = res.resultData
  256. }
  257. })
  258. },
  259. gethealthlist(){
  260. let data ={
  261. userid:this.share_userid?this.share_userid:this.userinfo.id,
  262. fmemberid:this.share_fmemberid?this.share_fmemberid:this.selectuser.fmemberid
  263. }
  264. querystemperinfobyuserid(data).then(res=>{
  265. res = res.data
  266. if(0==res.code){
  267. this.$refs.toast.show({
  268. type: 'error',
  269. message: res.errmsg
  270. })
  271. return false
  272. }
  273. if(200==res.code){
  274. let list = res.resultData
  275. list.map(item=>{
  276. if(item.hvalue==1){
  277. item.strvalue=this.$t('y')
  278. }else{
  279. item.strvalue=this.$t('n')
  280. }
  281. })
  282. this.healthlist =list
  283. }
  284. })
  285. },
  286. click(item){
  287. let index = item.index
  288. this.selectitem = this.list[index]
  289. },
  290. change(){
  291. },
  292. share(data){
  293. // this.$refs.toast.show({
  294. // type: 'error',
  295. // message: data.shareimg
  296. // })
  297. uni.share({
  298. provider: "weixin",
  299. scene: "WXSceneSession",
  300. type: 0,
  301. href:"testapp://pages/report/report?userid="+this.userid+"&fmemberid="+this.selectuser.fmemberid,
  302. //title: this.$t('navigationBarTitleText')+"分享",
  303. title: "分享",
  304. summary: "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。",
  305. imageUrl: data.shareimg,
  306. success: function (res) {
  307. addlog({
  308. json: JSON.stringify(res),
  309. type: 'uniapp信息'
  310. })
  311. console.log("success:" + JSON.stringify(res));
  312. },
  313. fail: function (err) {
  314. addlog({
  315. json: JSON.stringify(err),
  316. type: 'uniapp错误'
  317. })
  318. console.log("fail:" + JSON.stringify(err));
  319. }
  320. })
  321. }
  322. },
  323. mounted() {
  324. this.userinfo = uni.getStorageSync("userinfo")
  325. this.selectuser = uni.getStorageSync("selectuser")
  326. uni.setNavigationBarTitle({
  327. title: this.$t('show_report')
  328. });
  329. this.getlist()
  330. this.getinfo()
  331. this.gethealthlist()
  332. },
  333. onLoad: function (option) {
  334. this.share_userid=option.userid
  335. this.share_fmemberid=option.fmemberid
  336. },
  337. onBackPress:function(option){
  338. if(this.share_userid){
  339. uni.redirectTo({
  340. url: '/pages/index/show'
  341. });
  342. }else{
  343. tohome()
  344. }
  345. return true
  346. }
  347. }
  348. </script>
  349. <style scoped>
  350. .page{
  351. overflow-y: auto;
  352. }
  353. .box1{
  354. background-color: #fff;
  355. border-radius:20rpx;
  356. box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.3);
  357. display:flex;
  358. flex-direction:column;
  359. align-items:center;
  360. width: 80%;
  361. padding: 1em;
  362. margin-bottom: 30rpx;
  363. }
  364. .box1 .item{
  365. margin-bottom: 10px;
  366. }
  367. .advicearea{
  368. width:100%;
  369. margin-top:35rpx;
  370. margin-bottom:15rpx;
  371. }
  372. .advicelabel{
  373. width:300rpx;
  374. height:100rpx;
  375. font-size:40rpx;
  376. color:#648EB8;
  377. /* border-radius:50rpx;*/
  378. border-top:2rpx double #648eb8;
  379. border-bottom:1rpx solid #648EB8;
  380. /* box-shadow: 1px 2px 3px 2px rgba(0, 0, 0, 0.1);*/
  381. display:flex;
  382. justify-content:center;
  383. align-items:center;
  384. }
  385. .diseasetitlestr{
  386. width:100%;
  387. display:flex;
  388. justify-content:center;
  389. font-size:36rpx;
  390. margin-bottom: 20rpx;
  391. margin-top: 30rpx;
  392. color:#993333;
  393. }
  394. .noticearea{
  395. width:100%;
  396. margin-top:35rpx;
  397. margin-bottom:15rpx;
  398. display:flex;
  399. flex-direction: column;
  400. justify-content:center;
  401. }
  402. .noticelabel{
  403. width:300rpx;
  404. height:100rpx;
  405. font-size:40rpx;
  406. color:#993333;
  407. /*border-radius:50rpx;*/
  408. border-top:2rpx double #993333;
  409. border-bottom:1rpx solid #993333;
  410. /* box-shadow: 1px 2px 3px 2px rgba(0, 0, 0, 0.1);*/
  411. display:flex;
  412. justify-content:center;
  413. align-items:center;
  414. margin-bottom:30rpx;
  415. }
  416. .info_div{
  417. width: 90%;
  418. margin: 0 auto;
  419. padding-left: 10rpx;
  420. padding-right: 10rpx;
  421. }
  422. .info_div1{
  423. margin-top:10rpx;
  424. margin-bottom:10rpx;
  425. }
  426. .report_explain{
  427. margin-bottom: 20rpx;
  428. }
  429. .healthinfolist{
  430. padding-top: 10rpx;
  431. padding-bottom: 10rpx;
  432. }
  433. .healthinfolist .item:first {
  434. margin-bottom: 8rpx;
  435. }
  436. .healthinfolist .item {
  437. margin-bottom: 7rpx;
  438. }
  439. .healthinfolist .item:last-child {
  440. margin-bottom: 10rpx;
  441. }
  442. .healthinfolist .grid {
  443. margin-bottom: 8rpx;
  444. }
  445. .app_content{
  446. }
  447. .bottomarc{
  448. height:30%;
  449. }
  450. .statement{
  451. padding: 10rpx;
  452. }
  453. .statement .statement_title{
  454. font-size: 24rpx;
  455. font-weight: bold;
  456. }
  457. .statement .statement_item{
  458. font-size:20rpx;
  459. line-height: 22rpx !important;
  460. display: inline-block;
  461. }
  462. </style>