index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549
  1. <template>
  2. <view class="flex-col justify-start home-container">
  3. <view class="container-bg"></view>
  4. <cu-custom bgColor="#fff"><view slot="content" style="color: #FFFFFF">UU睡眠</view></cu-custom>
  5. <view class="flex-col home-module space-y-20">
  6. <!-- no device added -->
  7. <view v-if="!deviceAdded">
  8. <view class="flex-col items-start home-header space-y-10">
  9. <text class="home-header-title">欢迎回来!</text>
  10. <text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
  11. </view>
  12. <view class="flex-row justify-center items-center home_add_devive space-x-10" @click="addBindDevice">
  13. <image
  14. class="image_4"
  15. src="../../static/home/homeIconAdd.png"
  16. />
  17. <text class="text_5">添加设备</text>
  18. </view>
  19. <!-- <view class="home-ad flex-col group_5 space-y-40">-->
  20. <!-- <view class="flex-col home-header space-y-6">-->
  21. <!-- <view class="flex-row items-center space-x-8">-->
  22. <!-- <text class="font_4 text_8">UU AI智能睡眠监测仪</text>-->
  23. <!-- <view class="flex-row items-center section_7">-->
  24. <!-- <text class="font_5 text_9">去看看</text>-->
  25. <!-- <image-->
  26. <!-- class="shrink-0 image_9"-->
  27. <!-- src="../../static/home/homeIconGO.png"-->
  28. <!-- />-->
  29. <!-- </view>-->
  30. <!-- </view>-->
  31. <!-- <view class="flex-row items-center space-x-10">-->
  32. <!-- <text class="font_5 text_3 text_10">AI时代,全家人的睡眠健康顾问</text>-->
  33. <!-- </view>-->
  34. <!-- </view>-->
  35. <!-- </view>-->
  36. <view class="flex-col">
  37. <view class="flex-col group_5">
  38. <view class="flex-col home_blank_heart">
  39. <view class="flex-row items-center group_7 space-x-4">
  40. <image
  41. class="image_6"
  42. src="../../static/home/homeIconHeart.png"
  43. />
  44. <text class="font_1 text_9">心率</text>
  45. </view>
  46. <view class="flex-row justify-end items-start">
  47. <view class="section_5 view"></view>
  48. <text class="font_3 text_10">--</text>
  49. </view>
  50. <view class="flex-col group_8">
  51. <text class="self-start font_4 text_11">次/分</text>
  52. <view class="shrink-0 self-end section_5"></view>
  53. </view>
  54. </view>
  55. <view class="flex-col home_blank_breath">
  56. <view class="flex-row items-center group_10 space-x-4">
  57. <image
  58. class="image_7"
  59. src="../../static/home/homeIconBreath.png"
  60. />
  61. <text class="font_1 text_12">呼吸</text>
  62. </view>
  63. <view class="flex-row justify-end items-start">
  64. <view class="section_5 view_2"></view>
  65. <text class="font_3 text_13">--</text>
  66. </view>
  67. <view class="flex-col group_8">
  68. <text class="self-start font_4 text_11">次/分</text>
  69. <view class="shrink-0 self-end section_5"></view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="flex-row items-center home_blank_alert space-x-16">
  74. <image
  75. class="image_8"
  76. src="../../static/home/homeIconGift.png"
  77. />
  78. <view class="flex-col items-start flex-auto space-y-4">
  79. <text class="font_5">昨晚您的睡眠质量很好</text>
  80. <text class="font_5">暂时没有预警信息</text>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- device added -->
  86. <view v-if="deviceAdded" class="flex-col">
  87. <view class="flex-col items-start home-header space-y-10">
  88. <text class="home-header-title">欢迎回来!</text>
  89. <text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
  90. </view>
  91. <!-- home device -->
  92. <view class="flex-col home-device space-y-15">
  93. <view class="flex-row home-device-header">
  94. <view class="flex-row justify-between flex-auto equal-division">
  95. <view class="flex-row equal-division-item space-x-4">
  96. <text class="font_3 text_5">当前设备</text>
  97. <text class="font_3">{{ homeFrom.nowDevice }}</text>
  98. </view>
  99. <view class="flex-row equal-division-item space-x-14">
  100. <view class="flex-row space-x-4 margin-left-xl">
  101. <image class="shrink-0 image_6" src="../../static/home/homeIconWifi.png" />
  102. <text class="font_3">{{ homeFrom.status }}</text>
  103. </view>
  104. <!-- <view class="flex-row items-center space-x-6">-->
  105. <!-- <text class="font_3 text_6">45%</text>-->
  106. <!-- <image class="shrink-0 image_7" src="../../static/home/homeIconPower.png" />-->
  107. <!-- </view>-->
  108. </view>
  109. </view>
  110. <view class="flex-row items-center section_5 space-x-4">
  111. <image class="shrink-0 image_8" src="../../static/home/homeIconChange.png"/>
  112. <text class="font_3" @click="modalName = 'RadioModal'">切换</text>
  113. </view>
  114. </view>
  115. <view class="flex-row justify-center self-center home-device-status space-x-8">
  116. <text class="font_4 text_7">当前状态</text>
  117. <text class="font_4">{{ sleepStatus }}</text>
  118. </view>
  119. <!-- <view>-->
  120. <!--&lt;!&ndash; <view class="cu-steps">&ndash;&gt;-->
  121. <!--&lt;!&ndash; <view class="cu-item" :class="index>basics?'':'text-orange'" v-for="(item, index) in list1" :key="index">&ndash;&gt;-->
  122. <!--&lt;!&ndash; <text :class="index>basics ?'cuIcon-title':'cuIcon-radioboxfill'"></text> {{item.name}}&ndash;&gt;-->
  123. <!--&lt;!&ndash; </view>&ndash;&gt;-->
  124. <!--&lt;!&ndash; </view>&ndash;&gt;-->
  125. <!-- <uni-steps :options="list1" :active="active" />-->
  126. <!-- </view>-->
  127. <!-- <view class="flex-row self-center items-center home-device-setting">-->
  128. <!-- <image-->
  129. <!-- class="shrink-0 image_8"-->
  130. <!-- src="../../static/home/homeIconSet.png"-->
  131. <!-- />-->
  132. <!-- <text>设置目标</text>-->
  133. <!-- </view>-->
  134. </view>
  135. <!-- <view class="home-report flex-col group_5 space-y-40">-->
  136. <!-- <view class="flex-col home-header space-y-6">-->
  137. <!-- <view class="flex-row items-center space-x-8">-->
  138. <!-- <text class="font_4 text_8">睡眠报告</text>-->
  139. <!-- <view class="flex-row items-center section_7">-->
  140. <!-- <text class="font_5 text_9">去看看</text>-->
  141. <!-- <image-->
  142. <!-- class="shrink-0 image_9"-->
  143. <!-- src="../../static/home/homeIconGO.png"-->
  144. <!-- />-->
  145. <!-- </view>-->
  146. <!-- </view>-->
  147. <!-- <view class="flex-row items-center space-x-10">-->
  148. <!-- <text class="font_5 text_3 text_10">小U已为您生成最后一份睡眠报告</text>-->
  149. <!-- <text class="font_5 text_3 text_11">2021-08-24</text>-->
  150. <!-- </view>-->
  151. <!-- </view>-->
  152. <!-- </view>-->
  153. <view class="flex-row home-data space-x-6">
  154. <view class="flex-col flex-auto home-data-left">
  155. <view class="flex-row space-x-4 home-data-left-title">
  156. <image
  157. class="shrink-0 image_10"
  158. src="../../static/home/homeIconHeart.png"
  159. />
  160. <view class="font_1 text_14">心率</view>
  161. </view>
  162. <text class="self-start font_5 text_15">{{ pjxl }}</text>
  163. <text class="self-start font_6 text_16">次/分</text>
  164. </view>
  165. <view class="flex-col flex-auto justify-start shrink-0 relative home-data-chart content">
  166. <view class="echarts-wrap">
  167. <mpvue-echarts class="ec-canvas" canvasId="canvasChart-1" ref="xinlvRefChart" @onInit="onInit1"></mpvue-echarts>
  168. </view>
  169. </view>
  170. </view>
  171. <view class="flex-row home-data space-x-6">
  172. <view class="flex-col flex-auto home-data-left">
  173. <view class="flex-row space-x-4 home-data-left-title">
  174. <image
  175. class="shrink-0 image_10"
  176. src="../../static/home/homeIconBreath.png"
  177. />
  178. <text class="font_1 text_14">呼吸</text>
  179. </view>
  180. <text class="self-start font_5 text_15">{{ pjhx }}</text>
  181. <text class="self-start font_6 text_16">次/分</text>
  182. </view>
  183. <view class="flex-col flex-auto justify-start shrink-0 relative home-data-chart content">
  184. <view class="echarts-wrap">
  185. <mpvue-echarts class="ec-canvas" canvasId="canvasChart-2" ref="huxiRefChart" @onInit="onInit2"></mpvue-echarts>
  186. </view>
  187. </view>
  188. </view>
  189. <view class="home-btns flex-row self-center">
  190. <view @click="handleShareClick" class="btn-home-btns btn-home-btns1 items-center">
  191. <image class="shrink-0 image_btn" src="../../static/home/homeIconHeart.png" />
  192. <text class="btn-home-text">远程关爱</text>
  193. </view>
  194. <view @click="handleAlertSetting" class="btn-home-btns btn-home-btns2 items-center">
  195. <image class="shrink-0 image_btn" src="../../static/mine/myIconAlert.png" />
  196. <text class="btn-home-text">报警设置</text>
  197. </view>
  198. </view>
  199. <view class="flex-col home-alert space-y-4">
  200. <view class="flex-row items-center space-x-4 home-alert-header">
  201. <image
  202. class="image_10"
  203. src="../../static/home/homeIconHeart.png"
  204. />
  205. <text class="font_1">实时预警</text>
  206. </view>
  207. <view v-if="list_alerts.length === 0" class="flex-row items-center home_blank_alert space-x-16">
  208. <image
  209. class="image_8"
  210. src="../../static/home/homeIconGift.png"
  211. />
  212. <view class="flex-col items-start flex-auto space-y-4">
  213. <text class="font_5">昨晚您的睡眠质量很好</text>
  214. <text class="font_5">暂时没有预警信息</text>
  215. </view>
  216. </view>
  217. <view v-else class="flex-col home-alert-list">
  218. <view class="flex-row justify-between items-center list-item" :key="i" v-for="(item, i) in list_alerts">
  219. <view class="flex-row items-center space-x-6">
  220. <image
  221. class="shrink-0 image_11"
  222. src="../../static/home/homeIconAlert.png"
  223. />
  224. <text class="font_8">{{ formatSosType(item.warn_type) }}</text>
  225. <text class="font_9 text_16">{{ formatSosTime(item.warn_time) }}</text>
  226. </view>
  227. <view class="flex-row items-baseline space-x-4">
  228. <text class="font_10">{{ item.warn_desc }}</text>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. <view class="cu-modal" :class="bindShow?'show':''">
  236. <view class="cu-dialog">
  237. <view class="cu-bar bg-white justify-end">
  238. <view style="color: black" class="content">设备绑定</view>
  239. <view class="action" @tap="bindShow=false">
  240. <text class="cuIcon-close text-red"></text>
  241. </view>
  242. </view>
  243. <view class="">
  244. <form>
  245. <view class="cu-form-group solid-bottom">
  246. <view class="title">扫描二维码</view>
  247. <input type="text" v-model="bindSn" placeholder="输入或扫描IMEI" class="text-left"/>
  248. <text class="cuIcon-scan text-xxl text-green" style="font-size: 50rpx;"
  249. @click="scan"></text>
  250. </view>
  251. </form>
  252. </view>
  253. <view class="cu-bar bg-white justify-end">
  254. <view class="action">
  255. <button class="cu-btn bg-green margin-left" @tap="bindDevice">确定</button>
  256. </view>
  257. </view>
  258. </view>
  259. </view>
  260. <view class="cu-modal" :class="modalName=='RadioModal'?'show':''" @tap="hideModal">
  261. <view class="cu-dialog" @tap.stop="">
  262. <view class="cu-bar bg-white justify-end">
  263. <view style="color: black" class="content">设备切换</view>
  264. </view>
  265. <radio-group class="block" @change="RadioChange">
  266. <view class="cu-list menu text-left">
  267. <view class="cu-item" v-for="(item, index) in deviceList" :key="index">
  268. <label class="flex justify-between align-center flex-sub">
  269. <view class="flex-sub">{{ item.imei }}</view>
  270. <radio class="round" :class="homeFrom.nowDevice===item.imei?'checked':''" :checked="homeFrom.nowDevice === item.imei"
  271. :value="item.imei"></radio>
  272. </label>
  273. </view>
  274. </view>
  275. </radio-group>
  276. </view>
  277. </view>
  278. <!-- <tab-bar currentPage="home" /> -->
  279. </view>
  280. </template>
  281. <script>
  282. import echarts from '@/static/echarts.min.js'
  283. import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue'
  284. import { API } from '@/utils/request'
  285. import Storage from '@/utils/storage'
  286. import * as API_deviceMemberBind from '@/api/device_member_bind'
  287. export default {
  288. components: {
  289. mpvueEcharts
  290. },
  291. data() {
  292. return {
  293. deviceAdded: false,
  294. list_alerts: [],
  295. active: 4,
  296. list1: [{
  297. title: '昨日就寝 11:24PM'
  298. }, {
  299. title: '就寝目标 11:00PM'
  300. }, {
  301. title: '起床目标 7:00AM'
  302. }, {
  303. title: '今日起床 7:14AM'
  304. }],
  305. chartObj1: null, // 心率图表
  306. chartObj2: null, // 呼吸图表
  307. myData1: [], // 心率数据
  308. myData2: [], // 呼吸数据
  309. myCount1: 0, // 心率x轴数字
  310. myCount2: 0, // 呼吸x轴数字
  311. allXl: 0, // 总心率
  312. pjxl: 0, // 平均心率
  313. allHx: 0, // 总呼吸
  314. pjhx: 0, // 平均呼吸
  315. sleepStatus: '离床',
  316. connecting: false,
  317. connected: false,
  318. mySocketTask: null,
  319. homeFrom: {
  320. nowDevice: '', // 当前设备
  321. status: '离线'
  322. },
  323. deviceList: [], // 设备列表
  324. lastMsgTime: 0, // 最后一次设备消息时间
  325. memberId: '',
  326. bindSn: '',
  327. bindShow: false,
  328. modalName: false
  329. };
  330. },
  331. // onLoad() {
  332. // this.memberId = 50289
  333. // this.API_getDeviceList()
  334. // },
  335. onLoad() {
  336. wx.getSetting({
  337. complete: (res) => {
  338. if (!res.authSetting['scope.userInfo']) {
  339. return
  340. }
  341. console.log('222222222222222222222222222')
  342. const memberId = Storage.getItem('uid')
  343. if (memberId) {
  344. this.memberId = memberId
  345. console.log('this.memberId===', this.memberId)
  346. this.API_getDeviceList()
  347. } else {
  348. this.checkHasLogin()
  349. const _this = this
  350. let initTimer = setInterval(function () {
  351. const memberId = Storage.getItem('uid')
  352. if (memberId) {
  353. _this.memberId = memberId
  354. clearInterval(initTimer)
  355. _this.API_getDeviceList()
  356. }
  357. }, 500)
  358. }
  359. }
  360. })
  361. },
  362. beforeDestroy() {
  363. this.closeWebsocket()
  364. },
  365. // onShow() {
  366. // const imei = Storage.getItem('nowChangeDevice')
  367. // if (imei) {
  368. // this.homeFrom.nowDevice = imei
  369. // }
  370. // },
  371. onShow() {
  372. const imei = Storage.getItem('nowChangeDevice')
  373. if (imei) {
  374. this.homeFrom.nowDevice = imei
  375. this.deviceAdded = true
  376. if (!this.connected && this.memberId) {
  377. this.init()
  378. }
  379. } else {
  380. this.deviceAdded = false
  381. }
  382. },
  383. methods: {
  384. handleShareClick() {
  385. uni.navigateTo({
  386. url: '/pages/shareUser/shareUser'
  387. })
  388. },
  389. API_getDeviceList() {
  390. const _this = this
  391. API_deviceMemberBind.getDeviceByDtypeAndMemberId({dtype: '睡眠床垫', memberId: this.memberId}).then(res => {
  392. if (res.length === 0) {
  393. _this.deviceAdded = false
  394. } else {
  395. _this.deviceAdded = true
  396. _this.deviceList = res
  397. _this.homeFrom.nowDevice = res[0].imei
  398. Storage.setItem("nowChangeDevice", _this.homeFrom.nowDevice)
  399. Storage.setItem("myBindDevices", res)
  400. if (!this.connected) {
  401. _this.init()
  402. }
  403. }
  404. })
  405. },
  406. init() {
  407. const _this = this
  408. setTimeout(() => {
  409. _this.nowChart1()
  410. _this.nowChart2()
  411. _this.connect()
  412. }, 800)
  413. },
  414. connect() {
  415. let _this = this
  416. this.connecting = true
  417. let wsUrl = API.base.replace('http', 'ws')
  418. this.mySocketTask = uni.connectSocket({
  419. url: wsUrl + '/sleep_report/monitor/' + this.memberId,
  420. // url: 'ws://wdkl.natapp1.cc/sleep_report/monitor/' + this.memberId,
  421. success(res) {
  422. // 这里是接口调用成功的回调,不是连接成功的回调,请注意
  423. },
  424. fail(err) {
  425. // 这里是接口调用失败的回调,不是连接失败的回调,请注意
  426. }
  427. })
  428. this.mySocketTask.onOpen(res => {
  429. this.connecting = false
  430. this.connected = true
  431. uni.hideLoading()
  432. let _this = this
  433. this.timer = setInterval(function () { //每隔5秒钟发送一次心跳,避免websocket连接因超时而自动断开
  434. if (Date.parse(new Date()) - _this.lastMsgTime > 5000) { // 5秒没有收到新消息,则判断为离线
  435. _this.homeFrom.status = '离线'
  436. _this.sleepStatus = '离线'
  437. _this.pjxl = '--'
  438. _this.pjhx = '--'
  439. }
  440. _this.mySocketTask.send({data: 'ping'})
  441. }, 30000) // 30秒的心跳包
  442. })
  443. this.mySocketTask.onError(err => {
  444. this.connecting = false
  445. this.connected = false
  446. uni.hideLoading()
  447. uni.showModal({
  448. content: '连接失败,可能是websocket服务不可用,请稍后再试',
  449. showCancel: false
  450. })
  451. console.log('onError', err)
  452. })
  453. this.mySocketTask.onMessage(res => {
  454. let msg = res.data
  455. // console.log('收到消息:', msg)
  456. if (msg.length === 30) {
  457. if (this.homeFrom.nowDevice !== msg.substring(2, 14)) {
  458. return
  459. }
  460. this.homeFrom.status = '在线'
  461. this.lastMsgTime = Date.parse(new Date())
  462. this.getValue1(parseInt(msg.substring(22, 24), 16))
  463. this.getValue2(parseInt(msg.substring(24, 26), 16))
  464. switch (msg.substring(26, 28)) {
  465. case "03":
  466. this.sleepStatus = '在床'
  467. break;
  468. case "04":
  469. this.sleepStatus = '离床'
  470. break;
  471. case "05":
  472. this.sleepStatus = '打鼾'
  473. break;
  474. case "06":
  475. this.sleepStatus = '体动'
  476. break;
  477. default:
  478. break;
  479. }
  480. } else if (msg.length === 7) {
  481. Storage.setItem('refreshSleepReport', true)
  482. } else {
  483. const data = JSON.parse(res.data)
  484. console.log('收到消息为:', data)
  485. if (data.sn && this.homeFrom.nowDevice === data.sn) {
  486. this.list_alerts.push(data)
  487. }
  488. }
  489. })
  490. this.mySocketTask.onClose(res => {
  491. this.connected = false
  492. this.msg = false
  493. clearInterval(this.timer)
  494. })
  495. },
  496. nowChart1() {
  497. this.onInit1(this.chartObj1)
  498. let canvas = this.$refs.xinlvRefChart.canvas
  499. echarts.setCanvasCreator(() => canvas)
  500. this.myChart1 = echarts.init(canvas, 'halloween', {
  501. width: this.chartObj1.width,
  502. height: this.chartObj1.height
  503. })
  504. this.options1 = Object.assign(this.getOptions('#FFFFFF', 800), {})
  505. this.options1.series.forEach((item) => {
  506. item.data = this.myData1
  507. })
  508. this.myChart1.setOption(this.options1)
  509. },
  510. nowChart2() {
  511. this.onInit2(this.chartObj2);
  512. let canvas = this.$refs.huxiRefChart.canvas;
  513. echarts.setCanvasCreator(() => canvas);
  514. this.myChart2 = echarts.init(canvas, 'halloween', {
  515. width: this.chartObj2.width,
  516. height: this.chartObj2.height
  517. });
  518. this.options2 = Object.assign(this.getOptions('#06f5d2', 400), {})
  519. this.options2.series.forEach((item) => {
  520. item.data = this.myData2
  521. })
  522. this.myChart2.setOption(this.options2)
  523. },
  524. onInit1(e) {
  525. this.chartObj1 = e
  526. },
  527. onInit2(e) {
  528. this.chartObj2 = e
  529. },
  530. getOptions(color, xMax) {
  531. return {
  532. visualMap: [
  533. {
  534. show: false,
  535. type: 'continuous',
  536. seriesIndex: 0,
  537. min: 0,
  538. max: 300,
  539. },
  540. ],
  541. color: color,
  542. title: {
  543. left: 'left',
  544. // text: title,
  545. },
  546. tooltip: {
  547. trigger: 'axis',
  548. axisPointer: {
  549. animation: false,
  550. },
  551. },
  552. grid: {
  553. top: '15%',
  554. bottom: '10%',
  555. },
  556. xAxis: {
  557. type: 'category',
  558. boundaryGap: [0, '100%'],
  559. show: false, // 不显示x轴
  560. splitLine: {
  561. show: false,
  562. },
  563. triggerEvent: true
  564. },
  565. yAxis: {
  566. type: 'value',
  567. boundaryGap: [0, '100%'],
  568. min: 0,
  569. max: xMax,
  570. // max: 'dataMax', // 取数据在该轴上的最大值作为最大刻度
  571. splitLine: {
  572. show: false, // 是否显示分隔线
  573. },
  574. axisLine: {
  575. show: false, // 是否显示坐标轴轴线
  576. lineStyle:{
  577. color:'#FFFFFF',
  578. width:1, //x轴线的宽度
  579. }
  580. },
  581. },
  582. series: [
  583. {
  584. type: 'line',
  585. lineStyle: {
  586. width: 0.8
  587. },
  588. smooth: true, // 折线曲线
  589. showSymbol: false,
  590. hoverAnimation: false,
  591. data: [],
  592. },
  593. ]
  594. }
  595. },
  596. getValue1(value) {
  597. // console.log("心率是", value)
  598. this.pjxl = value
  599. if (this.myData1.length > 60) {
  600. this.myData1.splice(0,5)
  601. }
  602. if (value !== 0) {
  603. for (let i = 0; i < 5; i++) {
  604. this.myCount1 ++;
  605. value = parseInt(Math.random(100) * 500 + 300)
  606. this.myData1.push([this.myCount1, value])
  607. }
  608. } else {
  609. for (let i = 0; i < 5; i++) {
  610. this.myCount1 ++;
  611. value = 410 + parseInt(Math.random() * 50 - 30)
  612. this.myData1.push([this.myCount1, value])
  613. }
  614. }
  615. this.myChart1.setOption(this.options1)
  616. },
  617. getValue2(value) {
  618. // console.log("呼吸值是", value)
  619. this.pjhx = value
  620. if (this.myData2.length > 60) {
  621. this.myData2.splice(0,5)
  622. }
  623. if (value === 0) {
  624. for (let i = 0; i < 5; i++) {
  625. this.myCount2 ++;
  626. value = 220 + parseInt(Math.random() * 10 - 5)
  627. this.myData2.push([this.myCount2, value])
  628. }
  629. } else {
  630. value = parseInt((Math.random(10) * 300 + 100))
  631. for (let i = 0; i < 5; i++) {
  632. this.myCount2 ++;
  633. value += parseInt(Math.random() * 10 - 5)
  634. this.myData2.push([this.myCount2, value])
  635. }
  636. }
  637. this.myChart2.setOption(this.options2)
  638. },
  639. handleAlertSetting() {
  640. uni.navigateTo({
  641. url: "/pages/alertSetting/alertSetting?imei=" + this.homeFrom.nowDevice
  642. });
  643. },
  644. formatSosType(value) {
  645. switch (value) {
  646. case 1:
  647. return '心率过速'
  648. case 2:
  649. return '心率过缓'
  650. case 3:
  651. return '呼吸过速'
  652. case 4:
  653. return '呼吸过缓'
  654. case 5:
  655. return '离床预警'
  656. case 6:
  657. return '一键预警'
  658. case 7:
  659. return '离线预警'
  660. default:
  661. break;
  662. }
  663. },
  664. formatSosTime(value) {
  665. return value.substring(10, value.length - 3)
  666. },
  667. // 扫描条码
  668. scan() {
  669. let _this = this
  670. uni.scanCode({
  671. success: function (res) {
  672. console.log(res, res.result.length)
  673. if (res.result.length > 20) {
  674. if (res.scanType === 'QR_CODE') {
  675. const urlStr = res.result
  676. const qs = Foundation.getQueryObject(urlStr)
  677. if (qs.mac) {
  678. _this.bindSn = qs.mac
  679. } else {
  680. uni.showToast({
  681. title: '请扫码正确的睡眠床垫二维码',
  682. icon: 'none'
  683. })
  684. }
  685. } else {
  686. _this.bindSn = res.result
  687. }
  688. } else {
  689. _this.bindSn = res.result
  690. }
  691. },
  692. fail: (err) => {
  693. console.log(err)
  694. // #ifdef MP
  695. uni.getSetting({
  696. success: (res) => {
  697. let authStatus = res.authSetting['scope.camera'];
  698. if (!authStatus) {
  699. uni.showModal({
  700. title: '授权失败',
  701. content: 'app需要使用您的相机,请在设置界面打开相关权限',
  702. success: (res) => {
  703. if (res.confirm) {
  704. uni.openSetting()
  705. }
  706. }
  707. })
  708. }
  709. }
  710. })
  711. // #endif
  712. }
  713. })
  714. },
  715. bindDevice() {
  716. const params = {
  717. imei: this.bindSn,
  718. memberId: this.memberId,
  719. dtype: '睡眠床垫'
  720. }
  721. this.bindShow = false
  722. let _this = this
  723. API_deviceMemberBind.bindDeviceByDtype(params).then(res => {
  724. if (res.success) {
  725. _this.bindSn = ''
  726. uni.showToast({
  727. title: '绑定成功',
  728. })
  729. _this.API_getDeviceList()
  730. } else {
  731. uni.showToast({
  732. title: res.message,
  733. icon: 'none'
  734. })
  735. }
  736. })
  737. },
  738. addBindDevice() {
  739. if (this.memberId) {
  740. this.bindShow = 'show'
  741. } else {
  742. uni.showModal({
  743. title: '提示',
  744. content: "您还没有登录,是否前往登录?",
  745. confirmText: "确定",
  746. showCancel: true,
  747. success: function(res) {
  748. if (res.confirm) {
  749. uni.reLaunch({
  750. url:'/pages/auth/auth'
  751. })
  752. }
  753. }
  754. })
  755. }
  756. },
  757. closeWebsocket() {
  758. if (this.mySocketTask) {
  759. this.mySocketTask.close({
  760. success(res) {
  761. this.connected = false
  762. clearInterval(this.timer)
  763. console.log("关闭成功", res)
  764. },
  765. fail(err) {
  766. console.log("关闭失败", err)
  767. }
  768. })
  769. }
  770. },
  771. hideModal(e) {
  772. this.modalName = null
  773. },
  774. RadioChange(e) {
  775. console.log('1111111==', e.detail.value)
  776. this.homeFrom.nowDevice = e.detail.value
  777. Storage.setItem("nowChangeDevice", e.detail.value)
  778. }
  779. }
  780. };
  781. </script>
  782. <style lang="scss" scoped>
  783. .echarts-wrap {
  784. width: 100%;
  785. height: 80px;
  786. /*padding: 10upx;*/
  787. margin-bottom: 0.3rem
  788. }
  789. .chartsBgColor{
  790. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  791. }
  792. .equal-division {
  793. .equal-division-item {
  794. padding: 0.25rem 0.38rem 0;
  795. flex: 1 1 10.81rem;
  796. }
  797. }
  798. .home_add_devive {
  799. margin-right: 1.25rem;
  800. margin: 1rem;
  801. padding: 3.75rem 0;
  802. background-color: #0233c699;
  803. border-radius: 1rem;
  804. backdrop-filter: blur(0.63rem);
  805. .image_4 {
  806. width: 1.5rem;
  807. height: 1.5rem;
  808. }
  809. .text_5 {
  810. color: #ffffff;
  811. font-size: 1.5rem;
  812. font-family: PingFangSC;
  813. line-height: 1.38rem;
  814. }
  815. }
  816. .space-x-10 {
  817. & > view:not(:first-child),
  818. & > text:not(:first-child),
  819. & > image:not(:first-child) {
  820. margin-left: 0.63rem;
  821. }
  822. }
  823. .home_ad {
  824. margin-left: 2.25rem;
  825. background: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/602647C38F5E4168B4F16AFFFE2270CA.png");
  826. background-repeat: no-repeat;
  827. background-size: contain;
  828. .text_6 {
  829. padding: 0.13rem 0;
  830. color: #ffffff;
  831. font-size: 1rem;
  832. font-family: PingFangSC;
  833. line-height: 0.94rem;
  834. }
  835. .section_4 {
  836. padding: 0.13rem 0.38rem;
  837. background-image: linear-gradient(90deg, #2c25f799 0%, #061599 100%);
  838. border-radius: 0.44rem;
  839. width: 2.88rem;
  840. height: 0.88rem;
  841. .font_2 {
  842. font-size: 0.69rem;
  843. font-family: PingFangSC;
  844. line-height: 0.63rem;
  845. color: #ffffff;
  846. }
  847. .text_7 {
  848. font-size: 0.63rem;
  849. line-height: 0.56rem;
  850. }
  851. .image_5 {
  852. width: 0.19rem;
  853. height: 0.31rem;
  854. }
  855. }
  856. }
  857. .space-x-6 {
  858. & > view:not(:first-child),
  859. & > text:not(:first-child),
  860. & > image:not(:first-child) {
  861. margin-left: 0.38rem;
  862. }
  863. }
  864. .group_5 {
  865. padding-left: 1rem;
  866. padding-right: 1rem;
  867. .font_2 {
  868. font-size: 0.69rem;
  869. font-family: PingFangSC;
  870. line-height: 0.63rem;
  871. color: #ffffff;
  872. }
  873. .text_8 {
  874. font-size: 0.63rem;
  875. line-height: 0.59rem;
  876. opacity: 0.6;
  877. }
  878. .home_blank_heart {
  879. margin-top: 1rem;
  880. opacity: 1;
  881. border-radius: 16px;
  882. background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
  883. backdrop-filter: blur(20px);
  884. padding:1rem 0rem 2rem 1rem;
  885. .group_7 {
  886. padding-bottom: 1.13rem;
  887. .image_6 {
  888. width: 1.13rem;
  889. height: 0.88rem;
  890. }
  891. .text_9 {
  892. line-height: 1.03rem;
  893. }
  894. }
  895. .view {
  896. margin-right: -20.13rem;
  897. }
  898. .text_10 {
  899. margin-right: 18.75rem;
  900. margin-top: 1rem;
  901. }
  902. }
  903. .home_blank_breath {
  904. margin-top: 1rem;
  905. opacity: 1;
  906. border-radius: 16px;
  907. background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
  908. backdrop-filter: blur(20px);
  909. padding:1rem 0rem 2rem 1rem;
  910. .group_10 {
  911. padding-bottom: 1.25rem;
  912. .image_7 {
  913. width: 1.13rem;
  914. height: 1.06rem;
  915. }
  916. .text_12 {
  917. line-height: 1rem;
  918. }
  919. }
  920. .view_2 {
  921. margin-right: -20rem;
  922. }
  923. .text_13 {
  924. margin-right: 18.63rem;
  925. margin-top: 1rem;
  926. }
  927. }
  928. .space-x-4 {
  929. & > view:not(:first-child),
  930. & > text:not(:first-child),
  931. & > image:not(:first-child) {
  932. margin-left: 0.25rem;
  933. }
  934. }
  935. .font_1 {
  936. font-size: 1.13rem;
  937. font-family: PingFangSC;
  938. line-height: 1.06rem;
  939. color: #ffffff;
  940. }
  941. .section_5 {
  942. background-color: #ffffff1a;
  943. width: 15.94rem;
  944. height: 0.063rem;
  945. }
  946. .font_3 {
  947. font-size: 2.5rem;
  948. font-family: PingFangSC;
  949. line-height: 0.19rem;
  950. color: #ffffff;
  951. }
  952. .group_8 {
  953. margin-top: 1.38rem;
  954. padding-left: 0.63rem;
  955. .font_4 {
  956. font-size: 0.69rem;
  957. font-family: PingFangSC;
  958. line-height: 0.63rem;
  959. color: #ffffff80;
  960. }
  961. .text_11 {
  962. font-size: 0.75rem;
  963. line-height: 0.69rem;
  964. }
  965. }
  966. }
  967. .home_blank_alert {
  968. margin: 1rem 1.25rem 0;
  969. padding: 0.94rem;
  970. background-color: #02299ecc;
  971. border-radius: 1rem;
  972. .image_8 {
  973. width: 7.06rem;
  974. height: 4.94rem;
  975. }
  976. .space-y-4 {
  977. & > view:not(:first-child),
  978. & > text:not(:first-child),
  979. & > image:not(:first-child) {
  980. margin-top: 0.25rem;
  981. }
  982. .font_5 {
  983. font-size: 0.88rem;
  984. font-family: PingFangSC;
  985. line-height: 1.06rem;
  986. color: #167df2;
  987. }
  988. }
  989. }
  990. .space-x-16 {
  991. & > view:not(:first-child),
  992. & > text:not(:first-child),
  993. & > image:not(:first-child) {
  994. margin-left: 1rem;
  995. }
  996. }
  997. .container-bg {
  998. position: fixed;
  999. left: -130px;
  1000. top: -130px;
  1001. width: 480px;
  1002. height: 344px;
  1003. opacity: 1;
  1004. overflow: hidden;
  1005. border-radius: 63px;
  1006. -webkit-transform: rotate(-315deg);
  1007. transform: rotate(-315deg);
  1008. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  1009. }
  1010. .home-container {
  1011. padding-bottom: 2rem;
  1012. background-color: #000000;
  1013. width: 100%;
  1014. overflow-y: auto;
  1015. overflow-x: hidden;
  1016. height: 100%;
  1017. .home-module {
  1018. padding: 1.75rem 0 3.38rem;
  1019. overflow-y: auto;
  1020. z-index: 100;
  1021. .home-header {
  1022. padding: 0 1.25rem;
  1023. .home-header-title {
  1024. color: #ffffff;
  1025. font-size: 1.25rem;
  1026. font-family: PingFangSC;
  1027. line-height: 1.16rem;
  1028. }
  1029. .text_8 {
  1030. color: #ffffff;
  1031. opacity: 1;
  1032. }
  1033. .text_3 {
  1034. opacity: 0.6;
  1035. }
  1036. .home-header-subtitle {
  1037. line-height: 0.72rem;
  1038. }
  1039. .space-x-10 {
  1040. & > view:not(:first-child),
  1041. & > text:not(:first-child),
  1042. & > image:not(:first-child) {
  1043. margin-left: 0.63rem;
  1044. }
  1045. .text_10 {
  1046. line-height: 0.59rem;
  1047. }
  1048. .text_11 {
  1049. line-height: 0.47rem;
  1050. }
  1051. }
  1052. }
  1053. .space-y-10 {
  1054. & > view:not(:first-child),
  1055. & > text:not(:first-child),
  1056. & > image:not(:first-child) {
  1057. margin-top: 0.63rem;
  1058. }
  1059. }
  1060. .home-device {
  1061. margin: 1rem 1.25rem;
  1062. padding-bottom: 1rem;
  1063. //padding-bottom: 2rem;
  1064. background-color: #0233c699;
  1065. border-radius: 1rem;
  1066. backdrop-filter: blur(0.63rem);
  1067. .home-device-setting {
  1068. width: 70px;
  1069. height: 20px;
  1070. opacity: 1;
  1071. border-radius: 7px;
  1072. background: linear-gradient(90deg, rgba(255, 35, 247, 1) 0%, rgba(91, 30, 154, 1) 100%);
  1073. .image_8 {
  1074. width: 10px;
  1075. height: 10px;
  1076. }
  1077. font-size: 10px;
  1078. font-weight: 400;
  1079. line-height: 10px;
  1080. color: rgba(255, 255, 255, 1);
  1081. padding: 0.3rem;
  1082. }
  1083. .home-device-header {
  1084. background-color: #ffffff33;
  1085. border-radius: 1rem 1rem 0px 0px;
  1086. .equal-division {
  1087. padding: 0 1rem;
  1088. .equal-division-item {
  1089. padding: 0.38rem 0;
  1090. .text_5 {
  1091. opacity: 0.5;
  1092. }
  1093. }
  1094. .space-x-14 {
  1095. & > view:not(:first-child),
  1096. & > text:not(:first-child),
  1097. & > image:not(:first-child) {
  1098. margin-left: 0.88rem;
  1099. }
  1100. }
  1101. }
  1102. .section_5 {
  1103. padding: 0.38rem 0.5rem;
  1104. background-image: linear-gradient(90deg, #2c25f799 0%, #061599 100%);
  1105. border-radius: 0px 1rem 0px 0px;
  1106. height: 1.5rem;
  1107. .image_8 {
  1108. width: 0.75rem;
  1109. height: 0.75rem;
  1110. }
  1111. }
  1112. }
  1113. .home-device-status {
  1114. padding: 0.25rem 0 0.25rem 0.25rem;
  1115. background-color: #ffffff33;
  1116. border-radius: 0.75rem;
  1117. width: 7.88rem;
  1118. .text_7 {
  1119. opacity: 0.4;
  1120. }
  1121. }
  1122. }
  1123. .space-y-15 {
  1124. & > view:not(:first-child),
  1125. & > text:not(:first-child),
  1126. & > image:not(:first-child) {
  1127. margin-top: 0.94rem;
  1128. }
  1129. }
  1130. .font_3 {
  1131. font-size: 0.75rem;
  1132. font-family: PingFangSC;
  1133. line-height: 0.69rem;
  1134. color: #ffffff;
  1135. }
  1136. .home-report {
  1137. margin: 0 1.25rem;
  1138. padding: 1rem 0;
  1139. background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/050F95EFCA914FD6A72537F41ACEFC33.png");
  1140. background-size: contain;
  1141. background-repeat: no-repeat;
  1142. .space-y-6 {
  1143. & > view:not(:first-child),
  1144. & > text:not(:first-child),
  1145. & > image:not(:first-child) {
  1146. margin-top: 0.38rem;
  1147. }
  1148. }
  1149. }
  1150. .home-ad {
  1151. margin: 0 1.25rem;
  1152. padding: 1rem 0;
  1153. background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/602647C38F5E4168B4F16AFFFE2270CA.png");
  1154. background-size: contain;
  1155. background-repeat: no-repeat;
  1156. .space-y-6 {
  1157. & > view:not(:first-child),
  1158. & > text:not(:first-child),
  1159. & > image:not(:first-child) {
  1160. margin-top: 0.38rem;
  1161. }
  1162. }
  1163. }
  1164. .home-data {
  1165. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  1166. margin: 0rem 1.25rem;
  1167. padding: 1rem 0rem;
  1168. border-radius: 1rem;
  1169. padding: 1rem;
  1170. margin-top: 1rem;
  1171. .home-data-item {
  1172. padding: 1rem 0rem;
  1173. margin: 0 0.3rem;
  1174. opacity: 1;
  1175. border-radius: 16px;
  1176. background: linear-gradient(180deg, rgba(52, 26, 75, 0.65) 0%, rgba(22, 125, 242, 1) 100%);
  1177. backdrop-filter: blur(20px);
  1178. }
  1179. }
  1180. .group_6 {
  1181. overflow-x: hidden;
  1182. width: 100%;
  1183. .group_7 {
  1184. overflow-x: hidden;
  1185. width: 10rem;
  1186. .group_9 {
  1187. margin-left: 2.25rem;
  1188. }
  1189. .text_14 {
  1190. margin-top: 3.5rem;
  1191. }
  1192. }
  1193. .group_8 {
  1194. width: 10rem;
  1195. .text_15 {
  1196. margin-top: 3.63rem;
  1197. }
  1198. }
  1199. .font_6 {
  1200. font-size: 3rem;
  1201. font-family: PingFangSC;
  1202. line-height: 2.19rem;
  1203. color: #ffffff;
  1204. }
  1205. .font_7 {
  1206. font-size: 0.75rem;
  1207. font-family: PingFangSC;
  1208. line-height: 0.69rem;
  1209. color: #ffffff80;
  1210. }
  1211. }
  1212. .space-y-40 {
  1213. & > view:not(:first-child),
  1214. & > text:not(:first-child),
  1215. & > image:not(:first-child) {
  1216. margin-top: 2.5rem;
  1217. }
  1218. }
  1219. .space-x-8 {
  1220. & > view:not(:first-child),
  1221. & > text:not(:first-child),
  1222. & > image:not(:first-child) {
  1223. margin-left: 0.5rem;
  1224. }
  1225. .text_8 {
  1226. padding: 0.13rem 0;
  1227. }
  1228. .section_7 {
  1229. padding: 0.13rem 0.38rem;
  1230. background-image: linear-gradient(90deg, #ff23f7 0%, #5b1e9a 100%);
  1231. border-radius: 0.44rem;
  1232. height: 0.88rem;
  1233. .text_9 {
  1234. line-height: 0.56rem;
  1235. }
  1236. .image_9 {
  1237. width: 0.19rem;
  1238. height: 0.31rem;
  1239. }
  1240. }
  1241. }
  1242. .font_4 {
  1243. font-size: 1rem;
  1244. font-family: PingFangSC;
  1245. line-height: 0.94rem;
  1246. color: #ffffff;
  1247. }
  1248. .font_5 {
  1249. font-size: 0.63rem;
  1250. font-family: PingFangSC;
  1251. color: #ffffff;
  1252. }
  1253. .space-x-6 {
  1254. & > view:not(:first-child),
  1255. & > text:not(:first-child),
  1256. & > image:not(:first-child) {
  1257. margin-left: 0.38rem;
  1258. }
  1259. .text_6 {
  1260. line-height: 0.56rem;
  1261. }
  1262. .image_7 {
  1263. width: 1.31rem;
  1264. height: 0.69rem;
  1265. }
  1266. .image_11 {
  1267. width: 1.13rem;
  1268. height: 0.94rem;
  1269. }
  1270. .font_9 {
  1271. font-size: 0.88rem;
  1272. font-family: PingFangSC;
  1273. line-height: 0.69rem;
  1274. color: #ced5dc;
  1275. }
  1276. .text_16 {
  1277. line-height: 0.63rem;
  1278. }
  1279. }
  1280. .space-x-4 {
  1281. & > view:not(:first-child),
  1282. & > text:not(:first-child),
  1283. & > image:not(:first-child) {
  1284. margin-left: 0.25rem;
  1285. }
  1286. .image_6 {
  1287. width: 0.94rem;
  1288. height: 0.75rem;
  1289. }
  1290. .image_10 {
  1291. width: 1.13rem;
  1292. height: 0.88rem;
  1293. }
  1294. .font_1 {
  1295. font-size: 1.13rem;
  1296. font-family: PingFangSC;
  1297. line-height: 1.03rem;
  1298. color: #ffffff;
  1299. }
  1300. .image_4 {
  1301. width: 1.13rem;
  1302. height: 1.06rem;
  1303. }
  1304. .text_12 {
  1305. line-height: 1rem;
  1306. }
  1307. .font_10 {
  1308. font-size: 1.13rem;
  1309. font-family: PingFangSC;
  1310. line-height: 0.81rem;
  1311. color: #ff465a;
  1312. }
  1313. }
  1314. .home-alert {
  1315. margin: 0rem 1.25rem 0 1.25rem;
  1316. padding: 1rem 0.88rem 0.13rem;
  1317. background-color: #0233c6cc;
  1318. border-radius: 1rem;
  1319. .home-alert-header {
  1320. }
  1321. .home-alert-list {
  1322. .list-item {
  1323. padding: 0.88rem 0;
  1324. border-bottom: solid 0.063rem #ffffff1a;
  1325. }
  1326. }
  1327. }
  1328. .space-y-4 {
  1329. & > view:not(:first-child),
  1330. & > text:not(:first-child),
  1331. & > image:not(:first-child) {
  1332. margin-top: 0.25rem;
  1333. }
  1334. }
  1335. .font_8 {
  1336. font-size: 0.88rem;
  1337. font-family: PingFangSC;
  1338. line-height: 0.81rem;
  1339. color: #ffffff;
  1340. }
  1341. }
  1342. .space-y-20 {
  1343. & > view:not(:first-child),
  1344. & > text:not(:first-child),
  1345. & > image:not(:first-child) {
  1346. margin-top: 1.25rem;
  1347. }
  1348. .text_13 {
  1349. line-height: 2.16rem;
  1350. }
  1351. }
  1352. }
  1353. .home-data {
  1354. margin-top: 3.5rem;
  1355. overflow-x: hidden;
  1356. .home-data-left {
  1357. .space-x-4 {
  1358. & > view:not(:first-child),
  1359. & > text:not(:first-child),
  1360. & > image:not(:first-child) {
  1361. margin-left: 0.25rem;
  1362. }
  1363. .image_10 {
  1364. width: 1.13rem;
  1365. height: 1.06rem;
  1366. }
  1367. .font_1 {
  1368. font-size: 1.13rem;
  1369. font-family: PingFangSC;
  1370. line-height: 1.03rem;
  1371. color: #ffffff;
  1372. }
  1373. .text_14 {
  1374. line-height: 1rem;
  1375. }
  1376. }
  1377. .home-data-left-title {
  1378. width: max-content;
  1379. }
  1380. .font_5 {
  1381. font-size: 2.5rem;
  1382. font-family: PingFangSC;
  1383. line-height: 1.81rem;
  1384. color: #ffffff;
  1385. }
  1386. .text_15 {
  1387. margin-top: 1.25rem;
  1388. }
  1389. .font_6 {
  1390. font-size: 0.75rem;
  1391. font-family: PingFangSC;
  1392. line-height: 0.69rem;
  1393. color: #ffffff80;
  1394. }
  1395. .text_16 {
  1396. margin-top: 0.75rem;
  1397. }
  1398. }
  1399. .home-data-chart {
  1400. overflow-x: hidden;
  1401. width: 85%;
  1402. .group_10 {
  1403. padding-left: 2.06rem;
  1404. padding-bottom: 2.25rem;
  1405. overflow-x: hidden;
  1406. .image_11 {
  1407. width: 8.75rem;
  1408. height: 3.44rem;
  1409. }
  1410. .image_12 {
  1411. width: 7.06rem;
  1412. height: 3.38rem;
  1413. }
  1414. .image_13 {
  1415. width: 10rem;
  1416. height: 3.44rem;
  1417. }
  1418. .pos_8 {
  1419. position: absolute;
  1420. left: 0;
  1421. bottom: 0.063rem;
  1422. }
  1423. .image_14 {
  1424. width: 6.06rem;
  1425. height: 3.44rem;
  1426. }
  1427. .pos_10 {
  1428. position: absolute;
  1429. right: 1.25rem;
  1430. bottom: 0;
  1431. }
  1432. .pos_9 {
  1433. position: absolute;
  1434. left: 0;
  1435. top: 2.31rem;
  1436. }
  1437. }
  1438. .section_9 {
  1439. background-color: #ffffff1a;
  1440. width: 15.94rem;
  1441. height: 0.063rem;
  1442. }
  1443. .pos_11 {
  1444. position: absolute;
  1445. left: 0;
  1446. top: 5.5rem;
  1447. }
  1448. }
  1449. }
  1450. .space-x-6 {
  1451. & > view:not(:first-child),
  1452. & > text:not(:first-child),
  1453. & > image:not(:first-child) {
  1454. margin-left: 0.38rem;
  1455. }
  1456. }
  1457. .home-btns {
  1458. .btn-home-btns2 {
  1459. background: linear-gradient(90deg, rgba(5, 96, 232, 1) 0%, rgba(100, 158, 245, 1) 100%);
  1460. }
  1461. .btn-home-btns1 {
  1462. background: linear-gradient(90deg, rgba(44, 37, 247, 0.6) 0%, rgba(6, 21, 153, 1) 100%);
  1463. }
  1464. .btn-home-btns {
  1465. border-radius: 1.3rem;
  1466. width: 8rem;
  1467. height: 2.6rem;
  1468. margin: 1rem 0.5rem;
  1469. text-align: center;
  1470. font-size: 1.1rem;
  1471. font-weight: 500;
  1472. letter-spacing: 0px;
  1473. line-height: 2.6rem;
  1474. .image_btn {
  1475. width: 1.4rem;
  1476. height: 1.4rem;
  1477. vertical-align: middle;
  1478. margin-right: 0.2rem;
  1479. }
  1480. .btn-home-text {
  1481. color: #ffffff;
  1482. }
  1483. }
  1484. }
  1485. </style>