report.vue 13 KB

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