健康同学微信公众号h5项目
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1259 行
29KB

  1. <!-- -->
  2. <template>
  3. <div class="pageContent monthReport">
  4. <NavBar title="月报" @on-click-left="onNavBack" right-text="历史"> </NavBar>
  5. <div class="periodSwitch">
  6. <div class="arrow arrowLeft">
  7. <van-icon name="arrow-left"></van-icon>
  8. </div>
  9. <div class="timearea">2023-11-15~2023-11-22</div>
  10. <div class="arrow arrowRight">
  11. <van-icon name="arrow"></van-icon>
  12. </div>
  13. </div>
  14. <div class="periodNav">
  15. <div
  16. class="periodItem minPeriodItem"
  17. :class="{ active: signActive == index }"
  18. v-for="(item, index) in signList"
  19. :key="index"
  20. @click="onSignClick(index)"
  21. >
  22. <span>{{ item.name }}</span>
  23. </div>
  24. </div>
  25. <div class="pieMain" v-show="signActive !== 2">
  26. <div class="label">
  27. <div class="left">今日{{ pieTitle }}趋势</div>
  28. <div class="right">
  29. <span>检测次数:15次</span>
  30. </div>
  31. </div>
  32. <div class="label history">
  33. <div class="left"></div>
  34. <div class="right">
  35. <span>历史监测</span>
  36. </div>
  37. </div>
  38. <div class="pie-chart-con">
  39. <div class="pie-chart-left">
  40. <div id="pieChart" ref="pieChart"></div>
  41. </div>
  42. <div class="pie-chart-right">
  43. <div class="list">
  44. <div class="item" v-for="(item, index) in pieRightList" :key="index">
  45. <div class="item-left">
  46. <div class="circle" :style="{ backgroundColor: item.color }"></div>
  47. <span class="text">{{ item.text || '--' }}</span>
  48. </div>
  49. <div class="item-right">
  50. <span :style="{ color: item.color }">{{ item.count ? item.count + '次' : '0次' }}</span>
  51. <label :style="{ color: item.color }">{{
  52. item.percentage ? '(' + item.percentage + '%' + ')' : '(0%)'
  53. }}</label>
  54. </div>
  55. <div class="status">
  56. <img :src="calcImg(item.percentage, item.lastPercentage)" alt="" />
  57. <span :style="{ color: calcImg(item.percentage, item.lastPercentage, true) != 0 ? item.color : '' }">{{
  58. calcImg(item.percentage, item.lastPercentage, true)
  59. ? Math.abs(calcImg(item.percentage, item.lastPercentage, true)) + '%'
  60. : '持平'
  61. }}</span>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="statistics">
  68. <div class="list">
  69. <div
  70. class="item"
  71. v-for="(item, index) in statisticsList"
  72. :key="index"
  73. :style="{ backgroundColor: item.bgColor }"
  74. >
  75. <div class="top">
  76. <span>{{ item.label || '--' }}</span>
  77. </div>
  78. <div class="middle">
  79. <span>{{ item.value || '--' }}</span>
  80. </div>
  81. <div class="bottom">
  82. <span>{{ item.time || '--' }}</span>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- todo 柱形图 -->
  89. <div class="bar-chart-con" v-show="signActive !== 2"></div>
  90. <div class="chart-title" v-show="signActive !== 2">
  91. <p>{{ pieTitle }}数据图</p>
  92. </div>
  93. <div class="ChatBox" :class="{ hiddenChart: signActive == 2 }">
  94. <div class="legendBox minLegendBox">
  95. <div class="legend">
  96. <div class="legendItem" :class="item.type" v-for="(item, index) in signGrid" :key="index">
  97. <span>{{ item.name }}</span>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="Chat signChart" id="signChart"></div>
  102. </div>
  103. <div class="ChatBox minChartBox" :class="{ hiddenChart: signActive != 2 }">
  104. <h4>运动步数</h4>
  105. <div class="Chat stepChart" id="stepChart"></div>
  106. <div class="result">
  107. <div class="wrapBox">
  108. <div class="text">
  109. <div class="left"><p>总步数:285</p></div>
  110. <div class="right">
  111. <img :src="upImg" alt="" />
  112. <span>923</span>
  113. </div>
  114. </div>
  115. <div class="text">
  116. <div class="left"><p>平均步数:285</p></div>
  117. <div class="right">
  118. <img :src="downImg" alt="" />
  119. <span>923</span>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="advice">
  126. <div class="content">
  127. <p class="title">健康建议</p>
  128. <!-- <p>{{ weekResult.Advice || '--' }}</p> -->
  129. <p>若要健,天天练,运动是健康的源泉</p>
  130. </div>
  131. </div>
  132. <div class="grid">
  133. <div
  134. class="gridItem"
  135. :class="{ minItem: signGrid.length % 3 == 0 }"
  136. :style="`background:${item.color};`"
  137. v-for="(item, index) in signGrid"
  138. :key="index"
  139. >
  140. <div class="time">
  141. <span class="number">5</span>
  142. <span>天</span>
  143. </div>
  144. <div class="title">{{ item.name }}</div>
  145. </div>
  146. </div>
  147. <div class="ChatBox minChartBox" :class="{ hiddenChart: signActive != 2 }">
  148. <h4>热量消耗</h4>
  149. <div class="Chat calorieChart" id="calorieChart"></div>
  150. <div class="result">
  151. <div class="wrapBox">
  152. <div class="text">
  153. <div class="left"><p>总消耗:285</p></div>
  154. <div class="right">
  155. <img :src="upImg" alt="" />
  156. <span>923</span>
  157. </div>
  158. </div>
  159. <div class="text">
  160. <div class="left"><p>平均消耗:285</p></div>
  161. <div class="right">
  162. <img :src="downImg" alt="" />
  163. <span>923</span>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </template>
  171. <script>
  172. import { isNotNull } from '@/services/utils-service';
  173. import NavBar from '@/components/NavBar';
  174. export default {
  175. components: {
  176. NavBar
  177. },
  178. data() {
  179. return {
  180. signActive: 0,
  181. emotionActive: 0,
  182. emotionList: [
  183. {
  184. name: '疲劳'
  185. },
  186. {
  187. name: '压力'
  188. },
  189. {
  190. name: '焦虑'
  191. }
  192. ],
  193. pieData: [],
  194. pieEcharts: null,
  195. emotionChart: null,
  196. signChart: null,
  197. stepChart: null,
  198. calorieChart: null,
  199. pieRightList: [
  200. {
  201. text: '心率偏低',
  202. count: 2,
  203. percentage: '80',
  204. color: '#8dc21f'
  205. },
  206. {
  207. text: '心率偏高',
  208. count: 1,
  209. percentage: '80',
  210. color: '#ff5f8b'
  211. },
  212. {
  213. text: '心率正常',
  214. count: 12,
  215. percentage: '80',
  216. color: '#179b3b'
  217. }
  218. ],
  219. upImg: require('@/assets/today/icons/up.png'),
  220. downImg: require('@/assets/today/icons/down.png'),
  221. statisticsList: [
  222. { label: '最大值', value: '75', time: '08:15', bgColor: '#ff5f8b' },
  223. { label: '最小值', value: '40', time: '10:15', bgColor: '#189b3b' },
  224. { label: '最近值', value: '50', time: '18:15', bgColor: '#2ea7e0' }
  225. ],
  226. signList: [
  227. {
  228. grid: 'heartRateList',
  229. name: '心率'
  230. },
  231. {
  232. grid: 'temperatureList',
  233. name: '体温'
  234. },
  235. {
  236. grid: 'stepList',
  237. name: '运动'
  238. }
  239. ],
  240. heartRateList: [
  241. {
  242. name: '正常',
  243. type: 'moderate',
  244. color: '#179B3B'
  245. },
  246. {
  247. name: '偏高',
  248. type: 'severe',
  249. color: '#FF5F8B'
  250. },
  251. {
  252. name: '偏低',
  253. type: 'mild',
  254. color: '#2EA7E0'
  255. }
  256. ],
  257. temperatureList: [
  258. {
  259. name: '正常',
  260. type: 'moderate',
  261. color: '#179B3B'
  262. },
  263. {
  264. name: '发烧',
  265. type: 'severe',
  266. color: '#FF5F8B'
  267. }
  268. ],
  269. stepList: [
  270. {
  271. name: '>=3000',
  272. type: 'moderate',
  273. color: '#179B3B'
  274. },
  275. {
  276. name: '<=3000',
  277. type: 'severe',
  278. color: '#FF5F8B'
  279. }
  280. ]
  281. };
  282. },
  283. computed: {
  284. pieOption() {
  285. return {
  286. tooltip: {
  287. trigger: 'item',
  288. textStyle: {
  289. fontSize: 14
  290. },
  291. position: 'right'
  292. },
  293. legend: {
  294. top: '5%',
  295. left: 'center',
  296. show: false
  297. },
  298. series: [
  299. {
  300. type: 'pie',
  301. radius: ['50%', '90%'],
  302. avoidLabelOverlap: false,
  303. startAngle: 270, // 设置逆时针渲染
  304. itemStyle: {
  305. borderRadius: 5,
  306. borderColor: '#fff',
  307. borderWidth: 2,
  308. fontSize: 16
  309. },
  310. label: {
  311. show: false,
  312. position: 'center',
  313. fontSize: 16
  314. },
  315. emphasis: {
  316. label: {
  317. show: false,
  318. fontSize: 16,
  319. fontWeight: 'bold'
  320. }
  321. },
  322. labelLine: {
  323. show: false
  324. },
  325. data: this.pieData
  326. }
  327. ]
  328. };
  329. },
  330. signGrid() {
  331. let list = [];
  332. if (this.signList[this.signActive].grid) {
  333. let temp = this[`${this.signList[this.signActive].grid}`];
  334. if (temp) {
  335. list = temp;
  336. }
  337. }
  338. return list;
  339. },
  340. heartRateMap() {
  341. let map = new Map();
  342. this.heartRateList.forEach(item => {
  343. map.set(item.name, item.color);
  344. });
  345. return map;
  346. },
  347. temperatureMap() {
  348. let map = new Map();
  349. this.temperatureList.forEach(item => {
  350. map.set(item.name, item.color);
  351. });
  352. return map;
  353. },
  354. stepMap() {
  355. let map = new Map();
  356. this.stepList.forEach(item => {
  357. map.set(item.name, item.color);
  358. });
  359. return map;
  360. },
  361. pieTitle() {
  362. return this.signList[this.signActive].name;
  363. }
  364. },
  365. watch: {
  366. active(val) {
  367. console.log(val);
  368. this.emotionActive = 0;
  369. this.signActive = 0;
  370. this.$nextTick(() => {
  371. this.initData();
  372. });
  373. },
  374. /* emotionActive(val) {
  375. console.log(val);
  376. this.$nextTick(() => {
  377. this.initEmotionChart();
  378. });
  379. }, */
  380. signActive(val) {
  381. console.log(val);
  382. this.$nextTick(() => {
  383. this.initSignChart();
  384. });
  385. }
  386. },
  387. created() {
  388. this.pieData = this.pieRightList.map(item => {
  389. item.value = item.count;
  390. item.itemStyle = {
  391. color: item.color
  392. };
  393. return item;
  394. });
  395. },
  396. mounted() {
  397. this.initPieEchart();
  398. this.initData();
  399. },
  400. methods: {
  401. onNavBack() {
  402. this.$router.push({
  403. name: 'Insight'
  404. });
  405. },
  406. onEmotionClick(index) {
  407. this.emotionActive = index;
  408. },
  409. onSignClick(index) {
  410. this.signActive = index;
  411. },
  412. initData() {
  413. if (!this.signChart) {
  414. this.signChart = this.$echarts.init(document.getElementById('signChart'));
  415. }
  416. if (!this.stepChart) {
  417. this.stepChart = this.$echarts.init(document.getElementById('stepChart'));
  418. }
  419. if (!this.calorieChart) {
  420. this.calorieChart = this.$echarts.init(document.getElementById('calorieChart'));
  421. }
  422. this.initSignChart();
  423. },
  424. initSignChart() {
  425. let option = this.getOption();
  426. if (this.signActive == 0) {
  427. //测试
  428. let data = [
  429. {
  430. time: '5.11',
  431. value: 50
  432. },
  433. {
  434. time: '5.12',
  435. value: 60
  436. },
  437. {
  438. time: '5.13',
  439. value: 70
  440. },
  441. {
  442. time: '5.14',
  443. value: 80
  444. },
  445. {
  446. time: '5.15',
  447. value: 120
  448. },
  449. {
  450. time: '5.16',
  451. value: 130
  452. },
  453. {
  454. time: '5.17',
  455. value: 150
  456. }
  457. ];
  458. this.formateHeartRateData(option, data);
  459. this.signChart.setOption(option);
  460. } else if (this.signActive == 1) {
  461. //测试
  462. let data = [
  463. {
  464. time: '5.11',
  465. value: 36
  466. },
  467. {
  468. time: '5.12',
  469. value: 38
  470. },
  471. {
  472. time: '5.13',
  473. value: 37
  474. },
  475. {
  476. time: '5.14',
  477. value: 36
  478. },
  479. {
  480. time: '5.15',
  481. value: 38
  482. },
  483. {
  484. time: '5.16',
  485. value: 37
  486. },
  487. {
  488. time: '5.17',
  489. value: 39
  490. }
  491. ];
  492. this.formateTemperatureData(option, data);
  493. this.signChart.setOption(option);
  494. } else if (this.signActive == 2) {
  495. option = this.getOption(false);
  496. let option2 = this.getOption(false);
  497. //测试
  498. let data = [
  499. {
  500. time: '5.11',
  501. value: 36
  502. },
  503. {
  504. time: '5.12',
  505. value: 38
  506. },
  507. {
  508. time: '5.13',
  509. value: 37
  510. },
  511. {
  512. time: '5.14',
  513. value: 36
  514. },
  515. {
  516. time: '5.15',
  517. value: 38
  518. },
  519. {
  520. time: '5.16',
  521. value: 37
  522. },
  523. {
  524. time: '5.17',
  525. value: 39
  526. }
  527. ];
  528. //测试
  529. let data2 = [
  530. {
  531. time: '5.11',
  532. value: 36
  533. },
  534. {
  535. time: '5.12',
  536. value: 38
  537. },
  538. {
  539. time: '5.13',
  540. value: 37
  541. },
  542. {
  543. time: '5.14',
  544. value: 36
  545. },
  546. {
  547. time: '5.15',
  548. value: 38
  549. },
  550. {
  551. time: '5.16',
  552. value: 37
  553. },
  554. {
  555. time: '5.17',
  556. value: 39
  557. }
  558. ];
  559. this.formateStepData(option, data);
  560. this.formateCalorieData(option2, data2);
  561. this.stepChart.setOption(option);
  562. this.calorieChart.setOption(option2);
  563. }
  564. },
  565. formateStepData(option, data) {
  566. let xdata = [];
  567. let ydata = [];
  568. data.forEach(item => {
  569. xdata.push(item.time);
  570. ydata.push({
  571. value: item.value,
  572. label: {
  573. show: true
  574. },
  575. itemStyle: {
  576. color: this.formateTemperatureColor(item.value)
  577. }
  578. });
  579. });
  580. option.xAxis.data = xdata;
  581. option.series[0].data = ydata;
  582. // 隐藏y轴
  583. option.yAxis.show = false;
  584. },
  585. formateTemperatureData(option, data) {
  586. let xdata = [];
  587. let ydata = [];
  588. let fill = [];
  589. let max = 0;
  590. data.forEach(item => {
  591. if (item.value > max) {
  592. max = item.value;
  593. }
  594. });
  595. data.forEach(item => {
  596. xdata.push(item.time);
  597. fill.push({
  598. value: max - item.value,
  599. label: {
  600. show: false
  601. },
  602. itemStyle: {
  603. color: this.formateTemperatureColor(item.value)
  604. }
  605. });
  606. ydata.push({
  607. value: item.value,
  608. label: {
  609. show: true
  610. },
  611. itemStyle: {
  612. color: this.formateTemperatureColor(item.value)
  613. }
  614. });
  615. });
  616. option.xAxis.data = xdata;
  617. option.series[0].data = ydata;
  618. option.series[1].data = fill;
  619. // 规定最小值
  620. option.yAxis.min = 35;
  621. // 规定最大值
  622. option.yAxis.max = max;
  623. },
  624. formateTemperatureColor(value) {
  625. if (value > 38) {
  626. return this.temperatureMap.get('发烧');
  627. } else {
  628. return this.temperatureMap.get('正常');
  629. }
  630. },
  631. formateCalorieData(option, data) {
  632. let xdata = [];
  633. let ydata = [];
  634. data.forEach(item => {
  635. xdata.push(item.time);
  636. ydata.push({
  637. value: item.value,
  638. label: {
  639. show: true
  640. },
  641. itemStyle: {
  642. color: this.formateTemperatureColor(item.value)
  643. }
  644. });
  645. });
  646. option.xAxis.data = xdata;
  647. option.series[0].data = ydata;
  648. // 隐藏y轴
  649. option.yAxis.show = false;
  650. },
  651. formateHeartRateData(option, data) {
  652. let xdata = [];
  653. let ydata = [];
  654. let fill = [];
  655. let max = 0;
  656. data.forEach(item => {
  657. if (item.value > max) {
  658. max = item.value;
  659. }
  660. });
  661. data.forEach(item => {
  662. xdata.push(item.time);
  663. fill.push({
  664. value: max - item.value,
  665. label: {
  666. show: false
  667. },
  668. itemStyle: {
  669. color: this.formateHeartRateColor(item.value)
  670. }
  671. });
  672. ydata.push({
  673. value: item.value,
  674. label: {
  675. show: true
  676. },
  677. itemStyle: {
  678. color: this.formateHeartRateColor(item.value)
  679. }
  680. });
  681. });
  682. option.xAxis.data = xdata;
  683. option.series[0].data = ydata;
  684. option.series[1].data = fill;
  685. // 规定最小值
  686. option.yAxis.min = 40;
  687. // 规定最大值
  688. option.yAxis.max = 150;
  689. //设置高压标线
  690. option.series[1].markLine = {
  691. data: [
  692. {
  693. symbol: 'pin',
  694. silent: true,
  695. yAxis: 120,
  696. lineStyle: {
  697. color: '#C1272D'
  698. },
  699. label: {
  700. color: '#C1272D'
  701. }
  702. }
  703. ]
  704. };
  705. },
  706. formateHeartRateColor(value) {
  707. if (value > 120) {
  708. return this.heartRateMap.get('偏高');
  709. } else if (value >= 60) {
  710. return this.heartRateMap.get('正常');
  711. } else {
  712. return this.heartRateMap.get('偏低');
  713. }
  714. },
  715. getOption(point = true) {
  716. let option = {
  717. grid: {
  718. top: '10%',
  719. left: '10%',
  720. right: '10%',
  721. bottom: '20%'
  722. },
  723. xAxis: {
  724. type: 'category',
  725. axisLine: {
  726. show: false
  727. },
  728. axisTick: {
  729. show: false
  730. }
  731. },
  732. yAxis: {
  733. type: 'value'
  734. },
  735. series: [
  736. {
  737. type: 'bar',
  738. barMaxWidth: 15,
  739. stack: 'value',
  740. stackStrategy: 'all',
  741. animation: false,
  742. label: {
  743. show: true,
  744. width: 15,
  745. height: 15,
  746. backgroundColor: '#fff',
  747. borderRadius: 50,
  748. borderWidth: 3,
  749. borderColor: 'inherit',
  750. verticalAlign: 'middle',
  751. position: 'insideTop',
  752. formatter: function () {
  753. return '';
  754. }
  755. },
  756. itemStyle: {
  757. borderRadius: [0, 0, 12, 12]
  758. }
  759. },
  760. {
  761. type: 'bar',
  762. barMaxWidth: 15,
  763. stack: 'value',
  764. stackStrategy: 'all',
  765. animation: false,
  766. itemStyle: {
  767. borderRadius: [12, 12, 0, 0]
  768. }
  769. }
  770. ]
  771. };
  772. if (!point) {
  773. option.series = [
  774. {
  775. type: 'bar',
  776. barMaxWidth: 15,
  777. label: {
  778. show: true,
  779. color: '#000',
  780. position: 'outside'
  781. },
  782. itemStyle: {
  783. borderRadius: 12
  784. }
  785. }
  786. ];
  787. }
  788. return option;
  789. },
  790. initPieEchart() {
  791. if (this.pieEcharts != null && this.pieEcharts != '' && this.pieEcharts != undefined) {
  792. this.pieEcharts.dispose();
  793. }
  794. this.pieEcharts = this.$echarts.init(this.$refs.pieChart);
  795. this.pieEcharts.setOption(this.pieOption);
  796. },
  797. /**
  798. *
  799. * @param { 本周情绪比例} current
  800. * @param { 上周情绪比例 } last
  801. * @param { 是否返回对比比例 } isCallBackCompare
  802. */
  803. calcImg(current, last, isCallBackCompare) {
  804. let imgUrl = '';
  805. let compare = '';
  806. if (isNotNull(current) && isNotNull(last)) {
  807. compare = Number(current) - Number(last);
  808. imgUrl = compare > 0 ? this.upImg : compare == 0 ? '' : this.downImg;
  809. }
  810. if (isCallBackCompare) {
  811. return compare;
  812. } else {
  813. return imgUrl;
  814. }
  815. }
  816. }
  817. };
  818. </script>
  819. <style scoped lang="scss">
  820. @import './include.scss';
  821. .monthReport {
  822. padding-top: 50px;
  823. .periodNav {
  824. display: flex;
  825. justify-content: space-around;
  826. align-items: center;
  827. .periodItem {
  828. width: 48%;
  829. font-size: 28px;
  830. color: black;
  831. text-align: center;
  832. padding: 12px;
  833. border-radius: 30px;
  834. background: #e6e6e6;
  835. &.active {
  836. color: white;
  837. background: #179b3b;
  838. }
  839. }
  840. .minPeriodItem {
  841. width: 32%;
  842. padding: 8px;
  843. }
  844. }
  845. .pie-chart-con {
  846. flex: 1;
  847. padding: 10px 0 20px 0;
  848. display: flex;
  849. justify-content: space-between;
  850. align-items: flex-start;
  851. background-color: #fff;
  852. .pie-chart-left {
  853. position: relative;
  854. height: 350px;
  855. width: 300px;
  856. padding-left: 30px;
  857. @include center();
  858. #pieChart {
  859. height: 350px;
  860. width: 350px;
  861. }
  862. }
  863. .pie-chart-right {
  864. height: 280px;
  865. width: 65%;
  866. display: flex;
  867. justify-content: flex-end;
  868. align-items: flex-end;
  869. .list {
  870. display: flex;
  871. justify-content: center;
  872. flex-direction: column;
  873. .item {
  874. width: 100%;
  875. display: flex;
  876. justify-content: space-between;
  877. align-items: center;
  878. font-size: 24px;
  879. padding: 18px 0;
  880. .item-left {
  881. display: flex;
  882. justify-content: flex-start;
  883. align-items: center;
  884. padding-right: 20px;
  885. .circle {
  886. height: 24px;
  887. width: 24px;
  888. margin: 0 8px;
  889. }
  890. span {
  891. font-size: 24px;
  892. }
  893. .text {
  894. color: #000;
  895. font-size: 24px;
  896. }
  897. }
  898. .item-right {
  899. @include center();
  900. span {
  901. font-size: 24px;
  902. }
  903. }
  904. .status {
  905. padding: 0 10px;
  906. @include center();
  907. img {
  908. height: 30px;
  909. width: 18px;
  910. padding: 0 6px;
  911. }
  912. }
  913. }
  914. }
  915. }
  916. }
  917. .periodSwitch {
  918. display: flex;
  919. width: 100%;
  920. justify-content: space-between;
  921. align-items: center;
  922. padding: 40px 0px;
  923. padding-bottom: 30px;
  924. .timearea {
  925. font-size: 28px;
  926. justify-self: center;
  927. color: gray;
  928. }
  929. .arrow {
  930. font-size: 45px;
  931. }
  932. }
  933. .bmi {
  934. display: flex;
  935. justify-content: flex-start;
  936. align-items: center;
  937. white-space: nowrap;
  938. padding: 40px 8px 0 8px;
  939. font-weight: bold;
  940. p {
  941. padding: 0 5px;
  942. font-size: 28px;
  943. }
  944. .van-button {
  945. padding: 5px 10px;
  946. margin-left: 50px;
  947. font-size: 14px;
  948. color: #333;
  949. border-radius: 30px;
  950. }
  951. }
  952. .label {
  953. position: relative;
  954. font-size: 40px;
  955. font-weight: bold;
  956. padding: 30px 10px 10px 0;
  957. display: flex;
  958. justify-content: space-between;
  959. align-items: center;
  960. .right {
  961. position: relative;
  962. font-size: 30px;
  963. color: $border_color;
  964. }
  965. &.history {
  966. padding: 0 20px;
  967. font-size: 36px;
  968. font-weight: 400;
  969. color: $border_color;
  970. }
  971. }
  972. .statistics {
  973. height: 100%;
  974. padding: 10px 20px;
  975. .list {
  976. display: grid;
  977. grid-template-columns: repeat(3, 1fr); //定义了一个 3x3 的网格布
  978. /* grid-template-rows: repeat(3, 1fr); */
  979. gap: 40px;
  980. font-size: 32px;
  981. .item {
  982. display: flex;
  983. justify-content: flex-start;
  984. align-items: flex-start;
  985. padding: 30px;
  986. /* height: px2rem(136); */
  987. flex-direction: column;
  988. border: 1px solid $border_color;
  989. border-radius: 30px;
  990. color: #fff;
  991. .top {
  992. font-size: 24px;
  993. }
  994. .middle {
  995. font-size: 48px;
  996. }
  997. .bottom {
  998. font-size: 18px;
  999. }
  1000. }
  1001. }
  1002. }
  1003. .chart-title {
  1004. padding: 30px 30px 0 30px;
  1005. font-size: 36px;
  1006. font-weight: bold;
  1007. color: #282828;
  1008. }
  1009. .ChatBox {
  1010. overflow: hidden;
  1011. width: calc(100vw - 60px);
  1012. height: 600px;
  1013. border: 2px solid #cdf348;
  1014. border-radius: 70px;
  1015. margin-top: 30px;
  1016. h4 {
  1017. padding: 40px 0 10px 60px;
  1018. }
  1019. .legendBox {
  1020. width: 100%;
  1021. height: 150px;
  1022. display: flex;
  1023. justify-content: flex-end;
  1024. align-items: center;
  1025. padding: 0 30px;
  1026. .legend {
  1027. display: flex;
  1028. flex-wrap: wrap;
  1029. justify-content: flex-end;
  1030. align-items: center;
  1031. font-size: 20px;
  1032. .legendItem {
  1033. position: relative;
  1034. width: 205px;
  1035. margin-top: 10px;
  1036. margin-right: 20px;
  1037. &:nth-child(2n) {
  1038. margin-right: 0;
  1039. }
  1040. }
  1041. .not {
  1042. .number {
  1043. color: #179b3b;
  1044. }
  1045. &::before {
  1046. content: '';
  1047. position: absolute;
  1048. top: 0;
  1049. bottom: 0;
  1050. left: -20px;
  1051. width: 15px;
  1052. height: 15px;
  1053. background: #179b3b;
  1054. border-radius: 50%;
  1055. margin: auto;
  1056. }
  1057. }
  1058. .mild {
  1059. .number {
  1060. color: #2ea7e0;
  1061. }
  1062. &::before {
  1063. content: '';
  1064. position: absolute;
  1065. top: 0;
  1066. bottom: 0;
  1067. left: -20px;
  1068. width: 15px;
  1069. height: 15px;
  1070. background: #2ea7e0;
  1071. border-radius: 50%;
  1072. margin: auto;
  1073. }
  1074. }
  1075. .moderate {
  1076. .number {
  1077. color: #8dc21f;
  1078. }
  1079. &::before {
  1080. content: '';
  1081. position: absolute;
  1082. top: 0;
  1083. bottom: 0;
  1084. left: -20px;
  1085. width: 15px;
  1086. height: 15px;
  1087. background: #8dc21f;
  1088. border-radius: 50%;
  1089. margin: auto;
  1090. }
  1091. }
  1092. .severe {
  1093. .number {
  1094. color: #ff5f8b;
  1095. }
  1096. &::before {
  1097. content: '';
  1098. position: absolute;
  1099. top: 0;
  1100. bottom: 0;
  1101. left: -20px;
  1102. width: 15px;
  1103. height: 15px;
  1104. background: #ff5f8b;
  1105. border-radius: 50%;
  1106. margin: auto;
  1107. }
  1108. }
  1109. }
  1110. }
  1111. .minLegendBox {
  1112. .legend {
  1113. .legendItem {
  1114. width: auto;
  1115. margin-right: 50px;
  1116. &:nth-child(2n) {
  1117. margin-right: 50px;
  1118. }
  1119. &:last-child {
  1120. margin-right: 0;
  1121. }
  1122. }
  1123. }
  1124. }
  1125. .Chat {
  1126. width: calc(100vw - 60px);
  1127. height: 500px;
  1128. }
  1129. .result {
  1130. height: 140px;
  1131. padding: 0 30px;
  1132. border-radius: 70px;
  1133. display: flex;
  1134. justify-content: center;
  1135. align-items: flex-start;
  1136. flex-direction: column;
  1137. .wrapBox {
  1138. padding: 10px 180px 10px 60px;
  1139. width: 100%;
  1140. background-color: #e6e6e6;
  1141. border-radius: 70px;
  1142. }
  1143. .text {
  1144. display: flex;
  1145. justify-content: space-between;
  1146. align-items: center;
  1147. .right {
  1148. @include center();
  1149. img {
  1150. height: 30px;
  1151. width: 30px;
  1152. object-fit: contain;
  1153. margin: 0 5px;
  1154. }
  1155. }
  1156. }
  1157. }
  1158. }
  1159. .minChartBox {
  1160. height: 760px;
  1161. }
  1162. .hiddenChart {
  1163. width: 0;
  1164. height: 0;
  1165. }
  1166. .grid {
  1167. display: flex;
  1168. flex-wrap: wrap;
  1169. justify-content: space-between;
  1170. color: white;
  1171. font-size: 30px;
  1172. .gridItem {
  1173. width: calc((100vw - 60px) * 0.48);
  1174. height: calc((100vw - 60px) * 0.48);
  1175. border-radius: 60px;
  1176. display: flex;
  1177. flex-direction: column;
  1178. justify-content: center;
  1179. align-items: center;
  1180. margin-top: 30px;
  1181. .time {
  1182. .number {
  1183. font-size: 90px;
  1184. font-weight: bold;
  1185. }
  1186. }
  1187. }
  1188. .minItem {
  1189. width: calc((100vw - 60px) * 0.32);
  1190. height: calc((100vw - 60px) * 0.32);
  1191. font-size: 28px;
  1192. .time {
  1193. .number {
  1194. font-size: 70px;
  1195. font-weight: bold;
  1196. }
  1197. }
  1198. }
  1199. }
  1200. .advice {
  1201. padding: 52px 20px 60px 20px;
  1202. .content {
  1203. background: #f2f6ff;
  1204. border-radius: 20px;
  1205. padding: 0px 10px;
  1206. text-align: left;
  1207. p {
  1208. font-size: 24px;
  1209. color: #707070;
  1210. line-height: 46px;
  1211. }
  1212. .title {
  1213. font-size: 26px;
  1214. font-weight: bold;
  1215. /* color: $green; */
  1216. line-height: 36px;
  1217. }
  1218. }
  1219. }
  1220. }
  1221. </style>