sign.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. <template>
  2. <view class="mb-5">
  3. <view class="" v-if="userData.id">
  4. <view class="header p-3">
  5. <view class="centerY">
  6. <span class="d-inline-block fs-18 text-white font-bold">个人档案</span>
  7. <span v-if="ipArr.find(item => item.ip == prodIp) && ipArr.find(item => item.ip == prodIp).name !== '兰溪'"
  8. class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="closet">
  9. [ 退出 ]
  10. </span>
  11. <span v-if="ipArr.find(item => item.ip == prodIp) && ipArr.find(item => item.ip == prodIp).name == '兰溪'"
  12. class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="operation">
  13. [ 切换 ]
  14. </span>
  15. </view>
  16. <view class="centerY mt-2" @click="$mf.clickNavto('/pages/userinfo/userinfo')">
  17. <view class="w-15 userhead">
  18. <view class="picbox">
  19. <image v-if="userData.sex == 1" src="@/static/img/defult/head1.png" mode="widthFix" class="picimg">
  20. </image>
  21. <image v-if="userData.sex == 2" src="@/static/img/defult/head2.png" mode="widthFix" class="picimg">
  22. </image>
  23. </view>
  24. </view>
  25. <view class="w-85 ml-3">
  26. <view class="text-white fs-16 font-bold">{{ userData.username || '' }}</view>
  27. <view class="centerY" style="margin-top:10rpx;">
  28. <view :class="{ 'iconfont text-white fs-16 font-bold': true,
  29. ' nv': userData.sex == 2||false, 'nanxing': userData.sex == 1||false }">
  30. </view>
  31. <!-- <view class="py-1 pl-2 text-center centerY text-gry80 bg-white ml-auto" style="border-radius: 6rpx;">
  32. <view class="">基础资料</view>
  33. <view class="iconfont youla2 fs-12 font-bold"></view>
  34. </view> -->
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="content p-3 bg-white mx-3 my-3 box-border08">
  40. <view class="" style="display:flex;flex-wrap: wrap !important;">
  41. <view class="w-100 border-box">
  42. <view class=""
  43. style="background: linear-gradient(180deg, rgb(151,220,249) 0%, rgb(110,197,246) 100%);border-radius: 16rpx;">
  44. <view class="px-3 pt-2 pb-3 ">
  45. <view class="centerY ">
  46. <view class="bule_line"></view>
  47. <text class="fs-18 ml-2 font-bold" style="color: #1C90D7;">个人体征</text>
  48. </view>
  49. <view class="mt-2" style="color: #000;">
  50. <view class="font-bold" style="display:flex;flex-wrap: wrap !important;">
  51. <view class="w-50 border-box pr-1">
  52. <view class=" d-flex px-2 py-1"
  53. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  54. 身高
  55. <span class="ml-auto ml-1">{{ physical.height || '-' }} cm</span>
  56. </view>
  57. </view>
  58. <view class="w-50 border-box pl-1">
  59. <view class=" d-flex px-2 py-1"
  60. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  61. 体重
  62. <span class="ml-auto ml-1">{{ physical.weight || '-' }} kg</span>
  63. </view>
  64. </view>
  65. <view class="w-50 border-box pr-1 mt-2">
  66. <view class=" d-flex px-2 py-1"
  67. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  68. BMI
  69. <span class="ml-auto ml-1">{{ physical.bmi || '-' }} kg/m^2</span>
  70. </view>
  71. </view>
  72. <view class="w-50 border-box pl-1 mt-2">
  73. <view class=" d-flex px-2 py-1"
  74. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  75. 血压
  76. <span class="ml-auto ml-1">{{ physical.diastole || '-' }}/{{ physical.shrink || '-' }}
  77. mmHg</span>
  78. </view>
  79. </view>
  80. <view class="w-50 border-box pr-1 mt-2">
  81. <view class=" d-flex px-2 py-1"
  82. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  83. 心率
  84. <span class="ml-auto ml-1">{{ physical.pulse || '-' }} bmp</span>
  85. </view>
  86. </view>
  87. <view class="w-50 border-box pl-1 mt-2">
  88. <view class=" d-flex px-2 py-1"
  89. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  90. 腰围
  91. <span class="ml-auto ml-1">{{ physical.waist || '-' }} cm</span>
  92. </view>
  93. </view>
  94. <view class="w-50 border-box pr-1 mt-2">
  95. <view class=" d-flex px-2 py-1"
  96. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  97. 血糖
  98. <span class="ml-auto ml-1">{{ physical.bloodGlucose || '-' }} mmol/L</span>
  99. </view>
  100. </view>
  101. <view class="w-50 border-box pl-1 mt-2">
  102. <view class=" d-flex px-2 py-1"
  103. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  104. 血氧
  105. <span class="ml-auto ml-1">{{ physical.spo2 || '-' }} mmHg</span>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="">
  115. <!-- 身体特征 -->
  116. <view class="centerY mt-3" v-if="dataAll.physicals && dataAll.physicals.length > 0">
  117. <view class="bule_line"></view>
  118. <text class="font-bold text-dark ml-2 fs-16 line-height1">体征</text>
  119. </view>
  120. <view class="card mb-2 fs-14 mt-3 p-3" style="color: #818181;"
  121. v-if="dataAll.physicals && dataAll.physicals.length > 0">
  122. <view class=" p-3" style="background-color: #F5F9FF;border-radius: 16rpx;">
  123. <view id="echarts1" class="echarts"></view>
  124. <view id="echarts2" class="echarts"></view>
  125. </view>
  126. <view class="fs-10 d-flex mt-2" style="color: #909092;">
  127. <view class="space-nowrap">提示:</view>
  128. <view class="">
  129. <view class="">1、身体体质指数范围 偏瘦<= 18.4,正常 18.5 ~ 23.9,过重 24.0 ~ 27.9,肥胖>= 28.0</view>
  130. <view class="mt-1">2、血压心率 收缩压成人 65岁以上 90~149(mmHg)65岁以下 90~139(mmHg),舒张压 60~90(mmHg)</view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="">
  137. <footer />
  138. </view>
  139. </view>
  140. <view class="">
  141. <uni-popup ref="popup1" type="top" :mask-click="false">
  142. <view class=" w-80 mx-auto" style="margin-top: 30vh;">
  143. <view class="bg-white p-3 w-100 border-box" style="border-radius: 16rpx;">
  144. <view class="text-center mb-3 fs-14 font-bold py-2">查询</view>
  145. <view class=" centerY mb-3 w-100 border-box" style="overflow: hidden; ">
  146. <input type="text" v-model="valueId" class="px-2 m-0 fs-12 w-75 border-box"
  147. style="height: 70rpx;border: 2px solid #007aff;border-top-left-radius: 4rpx;border-bottom-left-radius: 4rpx;"
  148. placeholder="请输入身份证号码" placeholder-class="fs-12" />
  149. <uni-button type="primary" class="my-button fs-12 ml-auto border-box w-25"
  150. style="height: 70rpx;line-height: 70rpx; padding: 0 ;border-top-right-radius: 12rpx;border-bottom-right-radius: 12rpx;"
  151. @click="search">
  152. 搜索
  153. </uni-button>
  154. </view>
  155. </view>
  156. </view>
  157. </uni-popup>
  158. <uni-popup ref="popup2" type="top" :mask-click="false">
  159. <view class=" w-80 mx-auto" style="margin-top: 30vh;">
  160. <view class="bg-white p-3 w-100 text-center border-box" style="border-radius: 16rpx;">
  161. <view class="text-center mb-3 fs-14 font-bold py-2">患者列表</view>
  162. <view class="text-left centerY mb-3" style="border-radius: 14rpx;border: 2px solid #007aff;">
  163. <uni-data-select v-model="userIndex" :localdata="userArr" @change="bindPickerChange"
  164. placeholder="请选择身份"></uni-data-select>
  165. </view>
  166. <view class="" v-if="userArr.length == 0">
  167. <empty title="还未绑定患者" />
  168. </view>
  169. </view>
  170. </view>
  171. </uni-popup>
  172. </view>
  173. </view>
  174. </template>
  175. <script>
  176. import ipArr from '@/config/servernet.config.js'
  177. console.log(ipArr)
  178. let globalData = getApp().globalData;
  179. import Empty from '@/component/empty/empty.vue';
  180. import Footer from '@/component/footer/footer.vue';
  181. import {
  182. config
  183. } from '@/static/js/defult_value.js';
  184. export default {
  185. components: {
  186. Empty,
  187. Footer
  188. },
  189. data() {
  190. return {
  191. userData: {},
  192. physical: {},
  193. valueId: '',
  194. prodIp: '',
  195. ipArr,
  196. userArr: [],
  197. userIndex: null,
  198. dataAll: {},
  199. config
  200. };
  201. },
  202. onLoad() {
  203. this.decrypt();
  204. },
  205. methods: {
  206. //正式
  207. async other() {
  208. let t = this;
  209. if (!uni.getStorageSync('idCard')) {
  210. t.$refs.popup1.open();
  211. uni.hideLoading();
  212. } else {
  213. t.getuserinfo(uni.getStorageSync('idCard'));
  214. }
  215. },
  216. //正式
  217. async zhengshi() {
  218. let t = this;
  219. if (!uni.getStorageSync('idCard')) {
  220. t.$refs.popup1.open();
  221. uni.hideLoading();
  222. } else {
  223. t.getuserinfo(uni.getStorageSync('idCard'));
  224. }
  225. },
  226. //兰溪
  227. lanxi() {
  228. let t = this;
  229. uni.getStorage({
  230. key: 'token',
  231. async success(res) {
  232. if (!res.data) return;
  233. let res2 = await t.$api.decrypt({
  234. toKen: res.data
  235. });
  236. if (res2.code !== -1) {
  237. if (!res2.data.uuid) {
  238. uni.showModal({
  239. title: '提示',
  240. content: '您还未登录请先去登录!',
  241. showCancel: false,
  242. success: function(res3) {
  243. if (res3.confirm) {
  244. console.log('用户点击确定');
  245. uni.navigateBack({
  246. delta: 1 //返回层数,2则上上页
  247. });
  248. }
  249. }
  250. });
  251. return;
  252. }
  253. if (res2.data.users && res2.data.users.length > 0) {
  254. t.$refs.popup2.open();
  255. t.userArr = [];
  256. res2.data.users.map((item, index) => {
  257. t.userArr.push({
  258. value: index,
  259. text: item.idcard
  260. });
  261. });
  262. uni.hideLoading();
  263. } else {
  264. t.$refs.popup2.open();
  265. t.userArr = [];
  266. res2.data.users.map((item, index) => {
  267. t.userArr.push({
  268. value: index,
  269. text: item.idcard
  270. });
  271. });
  272. uni.hideLoading();
  273. }
  274. } else {
  275. //返回数据出错
  276. errordata();
  277. }
  278. },
  279. fail(error) {
  280. //未获取到token或者出错
  281. errordata();
  282. }
  283. });
  284. function errordata() {
  285. if (!uni.getStorageSync('idCard')) {
  286. t.$refs.popup1.open();
  287. uni.hideLoading();
  288. } else {
  289. t.getuserinfo(uni.getStorageSync('idCard'));
  290. }
  291. }
  292. },
  293. decrypt() {
  294. //token解码
  295. uni.showLoading({
  296. title: '加载中'
  297. });
  298. let t = this;
  299. let timer = setInterval(() => {
  300. //等待获取ip
  301. if (globalData.configData.prodIp) {
  302. t.prodIp = globalData.configData.prodIp;
  303. clearInterval(timer);
  304. }
  305. ipArr.map(async item => {
  306. if (item.ip == globalData.configData.prodIp && item.name == '兰溪') {
  307. t.lanxi();
  308. return;
  309. }
  310. if (item.ip == globalData.configData.prodIp && item.name == '附海') {
  311. t.other();
  312. return;
  313. }
  314. if (item.ip == globalData.configData.prodIp && item.name == '正式') {
  315. t.zhengshi();
  316. return;
  317. }
  318. if (item.ip == globalData.configData.prodIp && item.name == '测试') {
  319. t.zhengshi();
  320. return;
  321. }
  322. if (item.ip == globalData.configData.prodIp && item.name == '开发') {
  323. t.other();
  324. return;
  325. }
  326. });
  327. }, 300);
  328. },
  329. //切换
  330. operation() {
  331. uni.clearStorage('idCard');
  332. uni.clearStorage('userData');
  333. this.valueId = '';
  334. this.userData = {};
  335. this.physical = {};
  336. this.$refs.popup2.open();
  337. },
  338. bindPickerChange(e) {
  339. if (this.userArr[e] && this.userArr[e].text) {
  340. this.getuserinfo(this.userArr[e].text);
  341. }
  342. },
  343. closet() {
  344. uni.clearStorage('idCard');
  345. uni.clearStorage('userData');
  346. this.valueId = '';
  347. this.userData = {};
  348. this.physical = {};
  349. this.$refs.popup1.open();
  350. },
  351. search() {
  352. if (!this.$mf.isCardID(this.valueId)) {
  353. uni.showToast({
  354. title: '请输入正确的身份证号',
  355. icon: 'error',
  356. duration: 2000,
  357. mask: true
  358. });
  359. return;
  360. }
  361. this.userData = {};
  362. this.physical = {};
  363. this.getuserinfo(this.valueId);
  364. },
  365. async find_physical() {
  366. uni.showLoading({
  367. title: '加载中'
  368. });
  369. let idCard = uni.getStorageSync('idCard');
  370. let {
  371. data,
  372. code
  373. } = await this.$api.find_physical({
  374. idCard
  375. });
  376. if (code == 0) {
  377. this.physical = data || {};
  378. uni.hideLoading();
  379. } else {
  380. uni.hideLoading();
  381. }
  382. uni.stopPullDownRefresh();
  383. },
  384. async getuserinfo(idCard) {
  385. //330222194512283184
  386. idCard = idCard || uni.getStorageSync('idCard');
  387. uni.showLoading({
  388. title: '加载中'
  389. });
  390. let {
  391. data,
  392. code
  393. } = await this.$api.getUserInfo({
  394. idCard
  395. });
  396. if (code == 0) {
  397. this.valueId = '';
  398. uni.setStorageSync('userData', data || {});
  399. uni.setStorageSync('idCard', (data && data.idCard) || '');
  400. this.userData = data || {};
  401. if (data && data.id) {
  402. this.find_physical();
  403. this.get_workspace(idCard)
  404. this.$refs.popup1.close();
  405. this.$refs.popup2.close();
  406. } else {
  407. uni.showToast({
  408. title: '未查询到患者',
  409. icon: 'error'
  410. });
  411. }
  412. uni.hideLoading();
  413. uni.stopPullDownRefresh();
  414. } else {
  415. this.valueId = '';
  416. uni.hideLoading();
  417. uni.stopPullDownRefresh();
  418. }
  419. },
  420. async get_workspace(idCard) {
  421. idCard = idCard || uni.getStorageSync('idCard');
  422. uni.showLoading({
  423. title: '加载中'
  424. });
  425. let {
  426. data,
  427. code
  428. } = await this.$api.find_workspace({
  429. idCard
  430. });
  431. if (code == 0) {
  432. this.dataAll = data
  433. uni.hideLoading();
  434. this.settingData()
  435. uni.stopPullDownRefresh();
  436. } else {
  437. uni.hideLoading();
  438. uni.stopPullDownRefresh();
  439. }
  440. },
  441. settingData() {
  442. let physical = this.dataAll.physicals;
  443. this.echarts1data = {
  444. time: [],
  445. data1: [],
  446. data2: [],
  447. data3: [],
  448. data4: [],
  449. data5: [],
  450. data6: [],
  451. data7: [],
  452. data8: [],
  453. data9: []
  454. };
  455. if (physical && physical.length) {
  456. physical.reverse().map(item => {
  457. this.echarts1data['data1'].push(item.height);
  458. this.echarts1data['data2'].push(item.weight);
  459. this.echarts1data['data3'].push(item.bmi);
  460. this.echarts1data['data4'].push(item.shrink);
  461. this.echarts1data['data5'].push(item.diastole);
  462. this.echarts1data['data6'].push(item.pulse);
  463. this.echarts1data['time'].push(item.createTime);
  464. });
  465. if (
  466. this.echarts1data.data1.length ||
  467. this.echarts1data.data2.length ||
  468. this.echarts1data.data3.length) {
  469. this.chartOption1(this.echarts1data, 'echarts1');
  470. }
  471. if (
  472. this.echarts1data.data4.length ||
  473. this.echarts1data.data5.length ||
  474. this.echarts1data.data6.length) {
  475. this.chartOption2(this.echarts1data, 'echarts2');
  476. }
  477. }
  478. },
  479. },
  480. onPullDownRefresh() {
  481. if (this.userData && this.physical) {
  482. if (uni.getStorageSync('idCard')) {
  483. this.find_physical();
  484. } else {
  485. uni.stopPullDownRefresh();
  486. }
  487. } else {
  488. uni.stopPullDownRefresh();
  489. }
  490. }
  491. };
  492. </script>
  493. <script module="echarts" lang="renderjs">
  494. import * as echarts from 'echarts';
  495. export default {
  496. mounted() {
  497. console.log(echarts)
  498. // this.initChart('echarts1', this.option)
  499. // this.initChart('echarts2', this.option2)
  500. },
  501. methods: {
  502. initChart(dom, option) {
  503. let chart = echarts.init(document.getElementById(dom))
  504. chart.setOption(option)
  505. },
  506. onClick(event, ownerInstance) {
  507. // 调用 service 层的方法
  508. },
  509. check({
  510. type,
  511. value,
  512. age,
  513. sex
  514. }) {
  515. age = age || false
  516. let userData = this.userData
  517. let arr = this.config
  518. if (type == 'shrink' && age) {
  519. if (userData.age > 65) {
  520. if (value > arr['shrinktop'][1]) {
  521. return true
  522. }
  523. if (value < arr['shrinktop'][0]) {
  524. return true
  525. }
  526. } else {
  527. if (value > arr['shrinklow'][1]) {
  528. return true
  529. }
  530. if (value < arr['shrinklow'][0]) {
  531. return true
  532. }
  533. }
  534. }
  535. if (sex) {
  536. if (userData.sex == 1) {
  537. if (value > arr[type][0][1]) {
  538. return true
  539. }
  540. if (value < arr[type][0][0]) {
  541. return true
  542. }
  543. } else {
  544. if (value > arr[type][1][1]) {
  545. return true
  546. }
  547. if (value < arr[type][1][0]) {
  548. return true
  549. }
  550. }
  551. }
  552. if (value > arr[type][1]) {
  553. return true
  554. }
  555. if (value < arr[type][0]) {
  556. return true
  557. }
  558. return false
  559. },
  560. chartOption1({
  561. time,
  562. data1,
  563. data2,
  564. data3
  565. }) {
  566. let arr = []
  567. time = time.map((res) => this.$mf.timeTrans({
  568. time: res,
  569. format: 'M/D'
  570. }))
  571. time.map((item, index) => {
  572. if (this.check({
  573. type: 'bmi',
  574. value: data3[index]
  575. })) {
  576. arr.push({
  577. value: [item, data3[index]],
  578. symbolSize: 10
  579. })
  580. }
  581. })
  582. var option = (option = {
  583. legend: {
  584. data: ['身高', '体重', 'BMI'],
  585. },
  586. // tooltip: {
  587. // trigger: 'axis',
  588. // axisPointer: {
  589. // type: 'cross',
  590. // label: {
  591. // backgroundColor: '#6a7985',
  592. // },
  593. // },
  594. // },
  595. grid: {
  596. top: '20%',
  597. left: '3%',
  598. right: '5%',
  599. bottom: '3%',
  600. containLabel: true,
  601. },
  602. xAxis: [{
  603. type: 'category',
  604. data: time,
  605. axisPointer: {
  606. type: 'shadow',
  607. },
  608. }, ],
  609. yAxis: [{
  610. type: 'value',
  611. }, ],
  612. series: [{
  613. name: 'BMI',
  614. label: {
  615. show: true,
  616. formatter: '{@score}',
  617. position: 'top',
  618. },
  619. smooth: true,
  620. type: 'line',
  621. data: data3,
  622. itemStyle: {
  623. color: '#9c5045'
  624. },
  625. },
  626. {
  627. name: '体重',
  628. label: {
  629. show: true,
  630. formatter: '{@score}',
  631. position: 'top',
  632. },
  633. smooth: true,
  634. type: 'line',
  635. barWidth: '60%',
  636. data: data2,
  637. itemStyle: {
  638. color: '#e74a2d'
  639. },
  640. },
  641. {
  642. name: '身高',
  643. label: {
  644. show: true,
  645. formatter: '{@score}',
  646. position: 'top'
  647. },
  648. type: 'line',
  649. data: data1,
  650. smooth: true,
  651. barWidth: '60%',
  652. itemStyle: {
  653. color: '#89b87b'
  654. },
  655. },
  656. {
  657. type: 'effectScatter',
  658. coordinateSystem: 'cartesian2d',
  659. data: arr,
  660. showEffectOn: 'render',
  661. // zlevel:1,
  662. rippleEffect: {
  663. // 波纹的绘制方式,可选'stroke'和'fill'
  664. brushType: 'fill',
  665. },
  666. hoverAnimation: false,
  667. },
  668. ],
  669. })
  670. this.$nextTick(() => {
  671. if (document.getElementById('echarts1')) {
  672. this.initChart('echarts1', option)
  673. }
  674. })
  675. },
  676. chartOption2({
  677. time,
  678. data4,
  679. data5,
  680. data6
  681. }) {
  682. // console.log(time, data4, data5, data6)
  683. let arr = []
  684. time = time.map((res) => this.$mf.timeTrans({
  685. time: res,
  686. format: 'M/D'
  687. }))
  688. time.map((item, index) => {
  689. console.log(this.check({
  690. type: 'shrink',
  691. value: data4[index],
  692. age: true
  693. }))
  694. if (this.check({
  695. type: 'shrink',
  696. value: data4[index],
  697. age: true
  698. })) {
  699. arr.push({
  700. value: [item, data4[index]],
  701. symbolSize: 10
  702. })
  703. }
  704. if (this.check({
  705. type: 'diastole',
  706. value: data5[index],
  707. age: false
  708. })) {
  709. arr.push({
  710. value: [item, data5[index]],
  711. symbolSize: 10
  712. })
  713. }
  714. if (this.check({
  715. type: 'pulse',
  716. value: data6[index],
  717. age: false
  718. })) {
  719. arr.push({
  720. value: [item, data6[index]],
  721. symbolSize: 10
  722. })
  723. }
  724. })
  725. var option = (option = {
  726. legend: {
  727. data: ['收缩压', '舒张压', '心率'],
  728. },
  729. // tooltip: {
  730. // trigger: 'axis',
  731. // axisPointer: {
  732. // type: 'cross',
  733. // label: {
  734. // backgroundColor: '#6a7985',
  735. // },
  736. // },
  737. // },
  738. grid: {
  739. top: '20%',
  740. left: '3%',
  741. right: '5%',
  742. bottom: '3%',
  743. containLabel: true,
  744. },
  745. xAxis: [{
  746. type: 'category',
  747. axisPointer: {
  748. type: 'shadow',
  749. },
  750. data: time,
  751. }, ],
  752. yAxis: [{
  753. type: 'value',
  754. }, ],
  755. series: [{
  756. name: '收缩压',
  757. label: {
  758. show: true,
  759. formatter: '{@score}',
  760. position: 'top'
  761. },
  762. smooth: true,
  763. type: 'line',
  764. data: data4,
  765. itemStyle: {
  766. color: '#8e3e1f'
  767. },
  768. },
  769. {
  770. name: '舒张压',
  771. label: {
  772. show: true,
  773. formatter: '{@score}',
  774. position: 'top',
  775. },
  776. smooth: true,
  777. type: 'line',
  778. data: data5,
  779. itemStyle: {
  780. color: '#3c3645'
  781. },
  782. },
  783. {
  784. name: '心率',
  785. label: {
  786. show: true,
  787. formatter: '{@score}',
  788. position: 'bottom',
  789. },
  790. smooth: true,
  791. type: 'line',
  792. data: data6,
  793. itemStyle: {
  794. color: '#33a3dc'
  795. },
  796. },
  797. {
  798. type: 'effectScatter',
  799. coordinateSystem: 'cartesian2d',
  800. data: arr,
  801. showEffectOn: 'render',
  802. // zlevel:1,
  803. rippleEffect: {
  804. // 波纹的绘制方式,可选'stroke'和'fill'
  805. brushType: 'fill',
  806. },
  807. hoverAnimation: false,
  808. },
  809. ],
  810. })
  811. console.log(1)
  812. this.$nextTick(() => {
  813. console.log(1)
  814. if (document.getElementById('echarts2')) {
  815. this.initChart('echarts2', option)
  816. }
  817. })
  818. },
  819. }
  820. }
  821. </script>
  822. <style lang="scss">
  823. page {
  824. background: #f5f9ff;
  825. }
  826. .header {
  827. background: linear-gradient(180deg, #096dcb 0%, #6faae1 100%);
  828. }
  829. .userhead {
  830. border-radius: 50%;
  831. box-shadow: 1px 1px 10px 1px #096dcb;
  832. }
  833. .text-gry80 {
  834. color: #808080;
  835. }
  836. .box-border08 {
  837. border-radius: 16rpx;
  838. }
  839. .echarts {
  840. width: 100%;
  841. height: 400rpx;
  842. }
  843. </style>