index.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651
  1. <template>
  2. <view class="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 page">
  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" @click="modalName = true">
  111. <image class="shrink-0 image_8" src="../../static/home/homeIconChange.png"/>
  112. <text class="font_3">切换</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" :hidden="modalName">
  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" :hidden="modalName">
  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 style="z-index: 9999999" class="cu-modal" :class="modalName ?'show':''" @tap="hideModal">
  261. <view style="background-image: linear-gradient(45deg, #4d9efa, #156fce);z-index: 9999999" class="cu-dialog" @tap.stop="">
  262. <view class="cu-bar justify-end">
  263. <view class="content">设备切换</view>
  264. </view>
  265. <radio-group class="block" @change="RadioChange">
  266. <view class="cu-list menu text-left">
  267. <view style="background-image: linear-gradient(45deg, #4d9efa, #156fce)" 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 text-white">{{ 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. activeBreak: false
  330. };
  331. },
  332. // onLoad() {
  333. // this.memberId = 50289
  334. // this.API_getDeviceList()
  335. // },
  336. onLoad() {
  337. wx.getSetting({
  338. complete: (res) => {
  339. if (!res.authSetting['scope.userInfo']) {
  340. return
  341. }
  342. console.log('222222222222222222222222222')
  343. const memberId = Storage.getItem('uid')
  344. if (memberId) {
  345. this.memberId = memberId
  346. console.log('this.memberId===', this.memberId)
  347. this.API_getDeviceList()
  348. const _this = this
  349. setTimeout(() => {
  350. console.log('_this.connected====', _this.connected)
  351. if (!_this.connected) {
  352. console.log('我要登录过...')
  353. _this.API_getDeviceList()
  354. }
  355. }, 1500)
  356. } else {
  357. this.checkHasLogin()
  358. const _this = this
  359. let initTimer = setInterval(function () {
  360. const memberId = Storage.getItem('uid')
  361. if (memberId) {
  362. _this.memberId = memberId
  363. clearInterval(initTimer)
  364. _this.API_getDeviceList()
  365. }
  366. }, 500)
  367. }
  368. }
  369. })
  370. },
  371. beforeDestroy() {
  372. this.activeBreak = true
  373. this.closeWebsocket()
  374. },
  375. watch: {
  376. connected() {
  377. if (!this.activeBreak && !this.connected) {
  378. console.log('监听到webSocket连接断开,现在开始连接')
  379. this.init()
  380. }
  381. }
  382. },
  383. // onShow() {
  384. // const imei = Storage.getItem('nowChangeDevice')
  385. // if (imei) {
  386. // this.homeFrom.nowDevice = imei
  387. // }
  388. // },
  389. onShow() {
  390. const imei = Storage.getItem('nowChangeDevice')
  391. if (imei) {
  392. this.homeFrom.nowDevice = imei
  393. this.deviceAdded = true
  394. if (!this.connected && this.memberId) {
  395. console.log('重新连接...')
  396. this.connect()
  397. }
  398. } else {
  399. this.deviceAdded = false
  400. }
  401. },
  402. methods: {
  403. handleShareClick() {
  404. uni.navigateTo({
  405. url: '/pages/shareUser/shareUser'
  406. })
  407. },
  408. API_getDeviceList() {
  409. const _this = this
  410. API_deviceMemberBind.getDeviceByDtypeAndMemberId({dtype: '睡眠床垫', memberId: this.memberId}).then(res => {
  411. if (res) {
  412. if (res.length === 0) {
  413. _this.deviceAdded = false
  414. } else {
  415. _this.deviceAdded = true
  416. _this.deviceList = res
  417. _this.homeFrom.nowDevice = res[0].imei
  418. Storage.setItem("nowChangeDevice", _this.homeFrom.nowDevice)
  419. Storage.setItem("myBindDevices", res)
  420. if (!this.connected) {
  421. _this.init()
  422. }
  423. }
  424. } else {
  425. console.log('获取床垫错误...')
  426. }
  427. })
  428. },
  429. init() {
  430. const _this = this
  431. setTimeout(() => {
  432. _this.nowChart1()
  433. _this.nowChart2()
  434. _this.connect()
  435. }, 800)
  436. },
  437. connect() {
  438. let _this = this
  439. this.connecting = true
  440. let wsUrl = API.base.replace('http', 'ws')
  441. this.mySocketTask = uni.connectSocket({
  442. url: wsUrl + '/sleep_report/monitor/' + this.memberId,
  443. // url: 'ws://wdkl.natapp1.cc/sleep_report/monitor/' + this.memberId,
  444. success(res) {
  445. // 这里是接口调用成功的回调,不是连接成功的回调,请注意
  446. },
  447. fail(err) {
  448. // 这里是接口调用失败的回调,不是连接失败的回调,请注意
  449. }
  450. })
  451. this.mySocketTask.onOpen(res => {
  452. this.connecting = false
  453. this.connected = true
  454. uni.hideLoading()
  455. let _this = this
  456. this.timer = setInterval(function () { //每隔5秒钟发送一次心跳,避免websocket连接因超时而自动断开
  457. if (Date.parse(new Date()) - _this.lastMsgTime > 5000) { // 5秒没有收到新消息,则判断为离线
  458. _this.homeFrom.status = '离线'
  459. _this.sleepStatus = '离线'
  460. _this.pjxl = '--'
  461. _this.pjhx = '--'
  462. }
  463. _this.mySocketTask.send({data: 'ping'})
  464. }, 30000) // 30秒的心跳包
  465. })
  466. this.mySocketTask.onError(err => {
  467. this.connecting = false
  468. this.connected = false
  469. uni.hideLoading()
  470. console.log('连接失败,可能是websocket服务不可用,请稍后再试!')
  471. // uni.showModal({
  472. // content: '连接失败,可能是websocket服务不可用,请稍后再试',
  473. // showCancel: false
  474. // })
  475. console.log('onError', err)
  476. })
  477. this.mySocketTask.onMessage(res => {
  478. let msg = res.data
  479. // console.log('收到消息:', msg)
  480. if (msg.length === 234) {
  481. if (this.homeFrom.nowDevice !== msg.substring(2, 14)) {
  482. return
  483. }
  484. this.homeFrom.status = '在线'
  485. this.lastMsgTime = Date.parse(new Date())
  486. this.getValue(msg)
  487. // this.getValue1(parseInt(msg.substring(22, 24), 16))
  488. // this.getValue2(parseInt(msg.substring(24, 26), 16))
  489. switch (msg.substring(26, 28)) {
  490. case "03":
  491. this.sleepStatus = '在床'
  492. break;
  493. case "04":
  494. this.sleepStatus = '离床'
  495. break;
  496. case "05":
  497. this.sleepStatus = '打鼾'
  498. break;
  499. case "06":
  500. this.sleepStatus = '体动'
  501. break;
  502. default:
  503. break;
  504. }
  505. } else if (msg.length === 7) {
  506. Storage.setItem('refreshSleepReport', true)
  507. } else {
  508. const data = JSON.parse(res.data)
  509. console.log('收到消息为:', data)
  510. if (data.sn && this.homeFrom.nowDevice === data.sn) {
  511. this.list_alerts.push(data)
  512. }
  513. }
  514. })
  515. this.mySocketTask.onClose(res => {
  516. console.log('webSocket关闭了...')
  517. this.connected = false
  518. this.msg = false
  519. clearInterval(this.timer)
  520. })
  521. },
  522. nowChart1() {
  523. this.onInit1(this.chartObj1)
  524. let canvas = this.$refs.xinlvRefChart.canvas
  525. echarts.setCanvasCreator(() => canvas)
  526. this.myChart1 = echarts.init(canvas, 'halloween', {
  527. width: this.chartObj1.width,
  528. height: this.chartObj1.height
  529. })
  530. this.options1 = Object.assign(this.getOptions('#FFFFFF', 800), {})
  531. this.options1.series.forEach((item) => {
  532. item.data = this.myData1
  533. })
  534. this.myChart1.setOption(this.options1)
  535. },
  536. nowChart2() {
  537. this.onInit2(this.chartObj2);
  538. let canvas = this.$refs.huxiRefChart.canvas;
  539. echarts.setCanvasCreator(() => canvas);
  540. this.myChart2 = echarts.init(canvas, 'halloween', {
  541. width: this.chartObj2.width,
  542. height: this.chartObj2.height
  543. });
  544. this.options2 = Object.assign(this.getOptions('#06f5d2', 400), {})
  545. this.options2.series.forEach((item) => {
  546. item.data = this.myData2
  547. })
  548. this.myChart2.setOption(this.options2)
  549. },
  550. onInit1(e) {
  551. this.chartObj1 = e
  552. },
  553. onInit2(e) {
  554. this.chartObj2 = e
  555. },
  556. getOptions(color, xMax) {
  557. return {
  558. visualMap: [
  559. {
  560. show: false,
  561. type: 'continuous',
  562. seriesIndex: 0,
  563. min: 0,
  564. max: 300,
  565. },
  566. ],
  567. color: color,
  568. title: {
  569. left: 'left',
  570. // text: title,
  571. },
  572. tooltip: {
  573. trigger: 'axis',
  574. axisPointer: {
  575. animation: false,
  576. },
  577. extraCssText: 'z-index: 2'
  578. },
  579. grid: {
  580. top: '15%',
  581. bottom: '10%',
  582. },
  583. xAxis: {
  584. type: 'category',
  585. boundaryGap: [0, '100%'],
  586. show: false, // 不显示x轴
  587. splitLine: {
  588. show: false,
  589. },
  590. triggerEvent: true
  591. },
  592. yAxis: {
  593. type: 'value',
  594. boundaryGap: [0, '100%'],
  595. min: function (value) {
  596. if (value === 0) {
  597. return 0
  598. } else {
  599. return value.min - 20
  600. }
  601. },
  602. max: function (value) {
  603. return value.max + 20
  604. },
  605. // min: 0,
  606. // min: 'dataMin', // 取数据在该轴上的最大值作为最小刻度
  607. // max: xMax,
  608. // max: 'dataMax', // 取数据在该轴上的最大值作为最大刻度
  609. splitLine: {
  610. show: true, // 是否显示分隔线
  611. lineStyle: {
  612. color: "rgba(168,162,162,0.6)",
  613. width: 1,
  614. type: 'dotted'
  615. }
  616. },
  617. axisLine: {
  618. show: false, // 是否显示坐标轴轴线
  619. lineStyle:{
  620. color:'#FFFFFF',
  621. width:1, //x轴线的宽度
  622. }
  623. },
  624. axisLabel: {
  625. fontSize: 8
  626. }
  627. },
  628. series: [
  629. {
  630. type: 'line',
  631. lineStyle: {
  632. width: 0.8
  633. },
  634. smooth: true, // 折线曲线
  635. showSymbol: false,
  636. hoverAnimation: false,
  637. data: [],
  638. },
  639. ]
  640. }
  641. },
  642. getValue(msg) {
  643. this.pjxl = parseInt(msg.substring(22, 24), 16)
  644. this.pjhx = parseInt(msg.substring(24, 26), 16)
  645. const bx = msg.substring(34, msg.length);
  646. const size = bx.length / 4
  647. const ii = size / 2;
  648. if (this.myData1.length > 100) {
  649. this.myData1.splice(0, ii)
  650. }
  651. if (this.myData2.length > 100) {
  652. this.myData2.splice(0, ii)
  653. }
  654. if (this.myCount1 > 300) {
  655. this.myCount1 = 0
  656. }
  657. if (this.myCount2 > 300) {
  658. this.myCount2 = 0
  659. }
  660. for (let i = 0; i < size; i++) {
  661. // bx.substring(i * 4, i * 4 + 4)
  662. const j = i * 4
  663. // console.log(bx.substring(j, j + 2), bx.substring(j + 2, j + 4))
  664. const s1 = bx.substring(j, j + 2)
  665. const s2 = bx.substring(j + 2, j + 4)
  666. let value = parseInt(s2 + s1 , 16)
  667. // if (parseInt(s1, 16) > parseInt(s2, 16)) {
  668. // value = parseInt(s2 + s1, 16)
  669. // } else {
  670. // value = parseInt(s1 + s2, 16)
  671. // }
  672. // if (value === 2) {
  673. // console.log(s1, s2)
  674. // if (parseInt(s1, 16) > parseInt(s2, 16)) {
  675. // console.log('111111111===', parseInt(s1, 16), parseInt(s2, 16), s2 + '' + s1, parseInt(s2 + '' + s1, 16))
  676. // } else {
  677. // console.log('2222222222=====', parseInt(s1, 16), parseInt(s2, 16), s1 + s2, parseInt(s1 + '' + s2, 16))
  678. // }
  679. // }
  680. // console.log('value=====', value)
  681. if (i % 2 === 0) {
  682. this.myCount1 ++
  683. this.myData1.push([this.myCount1, value])
  684. } else {
  685. this.myCount2 ++
  686. this.myData2.push([this.myCount2, value])
  687. }
  688. }
  689. this.myChart1.setOption(this.options1)
  690. this.myChart2.setOption(this.options2)
  691. },
  692. getValue1(value) {
  693. // console.log("心率是", value)
  694. this.pjxl = value
  695. if (this.myData1.length > 60) {
  696. this.myData1.splice(0,5)
  697. }
  698. if (value !== 0) {
  699. for (let i = 0; i < 5; i++) {
  700. this.myCount1 ++;
  701. value = parseInt(Math.random(100) * 500 + 300)
  702. this.myData1.push([this.myCount1, value])
  703. }
  704. } else {
  705. for (let i = 0; i < 5; i++) {
  706. this.myCount1 ++;
  707. value = 410 + parseInt(Math.random() * 50 - 30)
  708. this.myData1.push([this.myCount1, value])
  709. }
  710. }
  711. this.myChart1.setOption(this.options1)
  712. },
  713. getValue2(value) {
  714. // console.log("呼吸值是", value)
  715. this.pjhx = value
  716. if (this.myData2.length > 60) {
  717. this.myData2.splice(0,5)
  718. }
  719. if (value === 0) {
  720. for (let i = 0; i < 5; i++) {
  721. this.myCount2 ++;
  722. value = 220 + parseInt(Math.random() * 10 - 5)
  723. this.myData2.push([this.myCount2, value])
  724. }
  725. } else {
  726. value = parseInt((Math.random(10) * 200 + 100))
  727. for (let i = 0; i < 5; i++) {
  728. this.myCount2 ++;
  729. value += parseInt(Math.random() * 10 - 5)
  730. this.myData2.push([this.myCount2, value])
  731. }
  732. }
  733. this.myChart2.setOption(this.options2)
  734. },
  735. handleAlertSetting() {
  736. uni.navigateTo({
  737. url: "/pages/alertSetting/alertSetting?imei=" + this.homeFrom.nowDevice
  738. });
  739. },
  740. formatSosType(value) {
  741. switch (value) {
  742. case 1:
  743. return '心率过速'
  744. case 2:
  745. return '心率过缓'
  746. case 3:
  747. return '呼吸过速'
  748. case 4:
  749. return '呼吸过缓'
  750. case 5:
  751. return '离床预警'
  752. case 6:
  753. return '一键预警'
  754. case 7:
  755. return '离线预警'
  756. default:
  757. break;
  758. }
  759. },
  760. formatSosTime(value) {
  761. return value.substring(10, value.length - 3)
  762. },
  763. // 扫描条码
  764. scan() {
  765. let _this = this
  766. uni.scanCode({
  767. success: function (res) {
  768. console.log(res, res.result.length)
  769. if (res.result.length > 20) {
  770. if (res.scanType === 'QR_CODE') {
  771. const urlStr = res.result
  772. const qs = Foundation.getQueryObject(urlStr)
  773. if (qs.mac) {
  774. _this.bindSn = qs.mac
  775. } else {
  776. uni.showToast({
  777. title: '请扫码正确的睡眠床垫二维码',
  778. icon: 'none'
  779. })
  780. }
  781. } else {
  782. _this.bindSn = res.result
  783. }
  784. } else {
  785. _this.bindSn = res.result
  786. }
  787. },
  788. fail: (err) => {
  789. console.log(err)
  790. // #ifdef MP
  791. uni.getSetting({
  792. success: (res) => {
  793. let authStatus = res.authSetting['scope.camera'];
  794. if (!authStatus) {
  795. uni.showModal({
  796. title: '授权失败',
  797. content: 'app需要使用您的相机,请在设置界面打开相关权限',
  798. success: (res) => {
  799. if (res.confirm) {
  800. uni.openSetting()
  801. }
  802. }
  803. })
  804. }
  805. }
  806. })
  807. // #endif
  808. }
  809. })
  810. },
  811. bindDevice() {
  812. const params = {
  813. imei: this.bindSn,
  814. memberId: this.memberId,
  815. dtype: '睡眠床垫'
  816. }
  817. this.bindShow = false
  818. let _this = this
  819. API_deviceMemberBind.bindDeviceByDtype(params).then(res => {
  820. if (res.success) {
  821. _this.bindSn = ''
  822. uni.showToast({
  823. title: '绑定成功',
  824. })
  825. _this.API_getDeviceList()
  826. } else {
  827. uni.showToast({
  828. title: res.message,
  829. icon: 'none'
  830. })
  831. }
  832. })
  833. },
  834. addBindDevice() {
  835. if (this.memberId) {
  836. this.bindShow = 'show'
  837. } else {
  838. uni.showModal({
  839. title: '提示',
  840. content: "您还没有登录,是否前往登录?",
  841. confirmText: "确定",
  842. showCancel: true,
  843. success: function(res) {
  844. if (res.confirm) {
  845. uni.reLaunch({
  846. url:'/pages/auth/auth'
  847. })
  848. }
  849. }
  850. })
  851. }
  852. },
  853. closeWebsocket() {
  854. if (this.mySocketTask) {
  855. this.mySocketTask.close({
  856. success(res) {
  857. this.connected = false
  858. clearInterval(this.timer)
  859. console.log("关闭成功", res)
  860. },
  861. fail(err) {
  862. console.log("关闭失败", err)
  863. }
  864. })
  865. }
  866. },
  867. hideModal(e) {
  868. this.modalName = false
  869. },
  870. RadioChange(e) {
  871. console.log('1111111==', e.detail.value)
  872. this.homeFrom.nowDevice = e.detail.value
  873. Storage.setItem("nowChangeDevice", e.detail.value)
  874. }
  875. }
  876. };
  877. </script>
  878. <style lang="scss" scoped>
  879. .page {
  880. background-color: #000000;
  881. width: 100%;
  882. overflow-y: auto;
  883. overflow-x: hidden;
  884. height: 100%;
  885. }
  886. .echarts-wrap {
  887. width: 100%;
  888. height: 80px;
  889. /*padding: 10upx;*/
  890. margin-bottom: 0.3rem
  891. }
  892. .chartsBgColor{
  893. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  894. }
  895. .equal-division {
  896. .equal-division-item {
  897. padding: 0.25rem 0.38rem 0;
  898. flex: 1 1 10.81rem;
  899. }
  900. }
  901. .home_add_devive {
  902. margin-right: 1.25rem;
  903. margin: 1rem;
  904. padding: 3.75rem 0;
  905. background-color: #0233c699;
  906. border-radius: 1rem;
  907. backdrop-filter: blur(0.63rem);
  908. .image_4 {
  909. width: 1.5rem;
  910. height: 1.5rem;
  911. }
  912. .text_5 {
  913. color: #ffffff;
  914. font-size: 1.5rem;
  915. font-family: PingFangSC;
  916. line-height: 1.38rem;
  917. }
  918. }
  919. .space-x-10 {
  920. & > view:not(:first-child),
  921. & > text:not(:first-child),
  922. & > image:not(:first-child) {
  923. margin-left: 0.63rem;
  924. }
  925. }
  926. .home_ad {
  927. margin-left: 2.25rem;
  928. background: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/602647C38F5E4168B4F16AFFFE2270CA.png");
  929. background-repeat: no-repeat;
  930. background-size: contain;
  931. .text_6 {
  932. padding: 0.13rem 0;
  933. color: #ffffff;
  934. font-size: 1rem;
  935. font-family: PingFangSC;
  936. line-height: 0.94rem;
  937. }
  938. .section_4 {
  939. padding: 0.13rem 0.38rem;
  940. background-image: linear-gradient(90deg, #2c25f799 0%, #061599 100%);
  941. border-radius: 0.44rem;
  942. width: 2.88rem;
  943. height: 0.88rem;
  944. .font_2 {
  945. font-size: 0.69rem;
  946. font-family: PingFangSC;
  947. line-height: 0.63rem;
  948. color: #ffffff;
  949. }
  950. .text_7 {
  951. font-size: 0.63rem;
  952. line-height: 0.56rem;
  953. }
  954. .image_5 {
  955. width: 0.19rem;
  956. height: 0.31rem;
  957. }
  958. }
  959. }
  960. .space-x-6 {
  961. & > view:not(:first-child),
  962. & > text:not(:first-child),
  963. & > image:not(:first-child) {
  964. margin-left: 0.38rem;
  965. }
  966. }
  967. .group_5 {
  968. padding-left: 1rem;
  969. padding-right: 1rem;
  970. .font_2 {
  971. font-size: 0.69rem;
  972. font-family: PingFangSC;
  973. line-height: 0.63rem;
  974. color: #ffffff;
  975. }
  976. .text_8 {
  977. font-size: 0.63rem;
  978. line-height: 0.59rem;
  979. opacity: 0.6;
  980. }
  981. .home_blank_heart {
  982. margin-top: 1rem;
  983. opacity: 1;
  984. border-radius: 16px;
  985. background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
  986. backdrop-filter: blur(20px);
  987. padding:1rem 0rem 2rem 1rem;
  988. .group_7 {
  989. padding-bottom: 1.13rem;
  990. .image_6 {
  991. width: 1.13rem;
  992. height: 0.88rem;
  993. }
  994. .text_9 {
  995. line-height: 1.03rem;
  996. }
  997. }
  998. .view {
  999. margin-right: -20.13rem;
  1000. }
  1001. .text_10 {
  1002. margin-right: 18.75rem;
  1003. margin-top: 1rem;
  1004. }
  1005. }
  1006. .home_blank_breath {
  1007. margin-top: 1rem;
  1008. opacity: 1;
  1009. border-radius: 16px;
  1010. background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
  1011. backdrop-filter: blur(20px);
  1012. padding:1rem 0rem 2rem 1rem;
  1013. .group_10 {
  1014. padding-bottom: 1.25rem;
  1015. .image_7 {
  1016. width: 1.13rem;
  1017. height: 1.06rem;
  1018. }
  1019. .text_12 {
  1020. line-height: 1rem;
  1021. }
  1022. }
  1023. .view_2 {
  1024. margin-right: -20rem;
  1025. }
  1026. .text_13 {
  1027. margin-right: 18.63rem;
  1028. margin-top: 1rem;
  1029. }
  1030. }
  1031. .space-x-4 {
  1032. & > view:not(:first-child),
  1033. & > text:not(:first-child),
  1034. & > image:not(:first-child) {
  1035. margin-left: 0.25rem;
  1036. }
  1037. }
  1038. .font_1 {
  1039. font-size: 1.13rem;
  1040. font-family: PingFangSC;
  1041. line-height: 1.06rem;
  1042. color: #ffffff;
  1043. }
  1044. .section_5 {
  1045. background-color: #ffffff1a;
  1046. width: 15.94rem;
  1047. height: 0.063rem;
  1048. }
  1049. .font_3 {
  1050. font-size: 2.5rem;
  1051. font-family: PingFangSC;
  1052. line-height: 0.19rem;
  1053. color: #ffffff;
  1054. }
  1055. .group_8 {
  1056. margin-top: 1.38rem;
  1057. padding-left: 0.63rem;
  1058. .font_4 {
  1059. font-size: 0.69rem;
  1060. font-family: PingFangSC;
  1061. line-height: 0.63rem;
  1062. color: #ffffff80;
  1063. }
  1064. .text_11 {
  1065. font-size: 0.75rem;
  1066. line-height: 0.69rem;
  1067. }
  1068. }
  1069. }
  1070. .home_blank_alert {
  1071. margin: 1rem 1.25rem 0;
  1072. padding: 0.94rem;
  1073. background-color: #02299ecc;
  1074. border-radius: 1rem;
  1075. .image_8 {
  1076. width: 7.06rem;
  1077. height: 4.94rem;
  1078. }
  1079. .space-y-4 {
  1080. & > view:not(:first-child),
  1081. & > text:not(:first-child),
  1082. & > image:not(:first-child) {
  1083. margin-top: 0.25rem;
  1084. }
  1085. .font_5 {
  1086. font-size: 0.88rem;
  1087. font-family: PingFangSC;
  1088. line-height: 1.06rem;
  1089. color: #167df2;
  1090. }
  1091. }
  1092. }
  1093. .space-x-16 {
  1094. & > view:not(:first-child),
  1095. & > text:not(:first-child),
  1096. & > image:not(:first-child) {
  1097. margin-left: 1rem;
  1098. }
  1099. }
  1100. .container-bg {
  1101. position: fixed;
  1102. left: -130px;
  1103. top: -130px;
  1104. width: 480px;
  1105. height: 344px;
  1106. opacity: 1;
  1107. overflow: hidden;
  1108. border-radius: 63px;
  1109. -webkit-transform: rotate(-315deg);
  1110. transform: rotate(-315deg);
  1111. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  1112. }
  1113. .home-container {
  1114. padding-bottom: 2rem;
  1115. background-color: #000000;
  1116. width: 100%;
  1117. .home-module {
  1118. padding: 1.75rem 0 3.38rem;
  1119. overflow-y: auto;
  1120. z-index: 100;
  1121. .home-header {
  1122. padding: 0 1.25rem;
  1123. .home-header-title {
  1124. color: #ffffff;
  1125. font-size: 1.25rem;
  1126. font-family: PingFangSC;
  1127. line-height: 1.16rem;
  1128. }
  1129. .text_8 {
  1130. color: #ffffff;
  1131. opacity: 1;
  1132. }
  1133. .text_3 {
  1134. opacity: 0.6;
  1135. }
  1136. .home-header-subtitle {
  1137. line-height: 0.72rem;
  1138. }
  1139. .space-x-10 {
  1140. & > view:not(:first-child),
  1141. & > text:not(:first-child),
  1142. & > image:not(:first-child) {
  1143. margin-left: 0.63rem;
  1144. }
  1145. .text_10 {
  1146. line-height: 0.59rem;
  1147. }
  1148. .text_11 {
  1149. line-height: 0.47rem;
  1150. }
  1151. }
  1152. }
  1153. .space-y-10 {
  1154. & > view:not(:first-child),
  1155. & > text:not(:first-child),
  1156. & > image:not(:first-child) {
  1157. margin-top: 0.63rem;
  1158. }
  1159. }
  1160. .home-device {
  1161. margin: 1rem 1.25rem;
  1162. padding-bottom: 1rem;
  1163. //padding-bottom: 2rem;
  1164. background-color: #0233c699;
  1165. border-radius: 1rem;
  1166. backdrop-filter: blur(0.63rem);
  1167. .home-device-setting {
  1168. width: 70px;
  1169. height: 20px;
  1170. opacity: 1;
  1171. border-radius: 7px;
  1172. background: linear-gradient(90deg, rgba(255, 35, 247, 1) 0%, rgba(91, 30, 154, 1) 100%);
  1173. .image_8 {
  1174. width: 10px;
  1175. height: 10px;
  1176. }
  1177. font-size: 10px;
  1178. font-weight: 400;
  1179. line-height: 10px;
  1180. color: rgba(255, 255, 255, 1);
  1181. padding: 0.3rem;
  1182. }
  1183. .home-device-header {
  1184. background-color: #ffffff33;
  1185. border-radius: 1rem 1rem 0px 0px;
  1186. .equal-division {
  1187. padding: 0 1rem;
  1188. .equal-division-item {
  1189. padding: 0.38rem 0;
  1190. .text_5 {
  1191. opacity: 0.5;
  1192. }
  1193. }
  1194. .space-x-14 {
  1195. & > view:not(:first-child),
  1196. & > text:not(:first-child),
  1197. & > image:not(:first-child) {
  1198. margin-left: 0.88rem;
  1199. }
  1200. }
  1201. }
  1202. .section_5 {
  1203. padding: 0.38rem 0.5rem;
  1204. background-image: linear-gradient(90deg, #2c25f799 0%, #061599 100%);
  1205. border-radius: 0px 1rem 0px 0px;
  1206. height: 1.5rem;
  1207. .image_8 {
  1208. width: 0.75rem;
  1209. height: 0.75rem;
  1210. }
  1211. }
  1212. }
  1213. .home-device-status {
  1214. padding: 0.25rem 0 0.25rem 0.25rem;
  1215. background-color: #ffffff33;
  1216. border-radius: 0.75rem;
  1217. width: 7.88rem;
  1218. .text_7 {
  1219. opacity: 0.4;
  1220. }
  1221. }
  1222. }
  1223. .space-y-15 {
  1224. & > view:not(:first-child),
  1225. & > text:not(:first-child),
  1226. & > image:not(:first-child) {
  1227. margin-top: 0.94rem;
  1228. }
  1229. }
  1230. .font_3 {
  1231. font-size: 0.75rem;
  1232. font-family: PingFangSC;
  1233. line-height: 0.69rem;
  1234. color: #ffffff;
  1235. }
  1236. .home-report {
  1237. margin: 0 1.25rem;
  1238. padding: 1rem 0;
  1239. background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/050F95EFCA914FD6A72537F41ACEFC33.png");
  1240. background-size: contain;
  1241. background-repeat: no-repeat;
  1242. .space-y-6 {
  1243. & > view:not(:first-child),
  1244. & > text:not(:first-child),
  1245. & > image:not(:first-child) {
  1246. margin-top: 0.38rem;
  1247. }
  1248. }
  1249. }
  1250. .home-ad {
  1251. margin: 0 1.25rem;
  1252. padding: 1rem 0;
  1253. background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/602647C38F5E4168B4F16AFFFE2270CA.png");
  1254. background-size: contain;
  1255. background-repeat: no-repeat;
  1256. .space-y-6 {
  1257. & > view:not(:first-child),
  1258. & > text:not(:first-child),
  1259. & > image:not(:first-child) {
  1260. margin-top: 0.38rem;
  1261. }
  1262. }
  1263. }
  1264. .home-data {
  1265. background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
  1266. margin: 0rem 1.25rem;
  1267. padding: 1rem 0rem;
  1268. border-radius: 1rem;
  1269. padding: 1rem;
  1270. margin-top: 1rem;
  1271. z-index: 1000;
  1272. .home-data-item {
  1273. padding: 1rem 0rem;
  1274. margin: 0 0.3rem;
  1275. opacity: 1;
  1276. border-radius: 16px;
  1277. background: linear-gradient(180deg, rgba(52, 26, 75, 0.65) 0%, rgba(22, 125, 242, 1) 100%);
  1278. backdrop-filter: blur(20px);
  1279. }
  1280. }
  1281. .group_6 {
  1282. overflow-x: hidden;
  1283. width: 100%;
  1284. .group_7 {
  1285. overflow-x: hidden;
  1286. width: 10rem;
  1287. .group_9 {
  1288. margin-left: 2.25rem;
  1289. }
  1290. .text_14 {
  1291. margin-top: 3.5rem;
  1292. }
  1293. }
  1294. .group_8 {
  1295. width: 10rem;
  1296. .text_15 {
  1297. margin-top: 3.63rem;
  1298. }
  1299. }
  1300. .font_6 {
  1301. font-size: 3rem;
  1302. font-family: PingFangSC;
  1303. line-height: 2.19rem;
  1304. color: #ffffff;
  1305. }
  1306. .font_7 {
  1307. font-size: 0.75rem;
  1308. font-family: PingFangSC;
  1309. line-height: 0.69rem;
  1310. color: #ffffff80;
  1311. }
  1312. }
  1313. .space-y-40 {
  1314. & > view:not(:first-child),
  1315. & > text:not(:first-child),
  1316. & > image:not(:first-child) {
  1317. margin-top: 2.5rem;
  1318. }
  1319. }
  1320. .space-x-8 {
  1321. & > view:not(:first-child),
  1322. & > text:not(:first-child),
  1323. & > image:not(:first-child) {
  1324. margin-left: 0.5rem;
  1325. }
  1326. .text_8 {
  1327. padding: 0.13rem 0;
  1328. }
  1329. .section_7 {
  1330. padding: 0.13rem 0.38rem;
  1331. background-image: linear-gradient(90deg, #ff23f7 0%, #5b1e9a 100%);
  1332. border-radius: 0.44rem;
  1333. height: 0.88rem;
  1334. .text_9 {
  1335. line-height: 0.56rem;
  1336. }
  1337. .image_9 {
  1338. width: 0.19rem;
  1339. height: 0.31rem;
  1340. }
  1341. }
  1342. }
  1343. .font_4 {
  1344. font-size: 1rem;
  1345. font-family: PingFangSC;
  1346. line-height: 0.94rem;
  1347. color: #ffffff;
  1348. }
  1349. .font_5 {
  1350. font-size: 0.63rem;
  1351. font-family: PingFangSC;
  1352. color: #ffffff;
  1353. }
  1354. .space-x-6 {
  1355. & > view:not(:first-child),
  1356. & > text:not(:first-child),
  1357. & > image:not(:first-child) {
  1358. margin-left: 0.38rem;
  1359. }
  1360. .text_6 {
  1361. line-height: 0.56rem;
  1362. }
  1363. .image_7 {
  1364. width: 1.31rem;
  1365. height: 0.69rem;
  1366. }
  1367. .image_11 {
  1368. width: 1.13rem;
  1369. height: 0.94rem;
  1370. }
  1371. .font_9 {
  1372. font-size: 0.88rem;
  1373. font-family: PingFangSC;
  1374. line-height: 0.69rem;
  1375. color: #ced5dc;
  1376. }
  1377. .text_16 {
  1378. line-height: 0.63rem;
  1379. }
  1380. }
  1381. .space-x-4 {
  1382. & > view:not(:first-child),
  1383. & > text:not(:first-child),
  1384. & > image:not(:first-child) {
  1385. margin-left: 0.25rem;
  1386. }
  1387. .image_6 {
  1388. width: 0.94rem;
  1389. height: 0.75rem;
  1390. }
  1391. .image_10 {
  1392. width: 1.13rem;
  1393. height: 0.88rem;
  1394. }
  1395. .font_1 {
  1396. font-size: 1.13rem;
  1397. font-family: PingFangSC;
  1398. line-height: 1.03rem;
  1399. color: #ffffff;
  1400. }
  1401. .image_4 {
  1402. width: 1.13rem;
  1403. height: 1.06rem;
  1404. }
  1405. .text_12 {
  1406. line-height: 1rem;
  1407. }
  1408. .font_10 {
  1409. font-size: 1.13rem;
  1410. font-family: PingFangSC;
  1411. line-height: 0.81rem;
  1412. color: #ff465a;
  1413. }
  1414. }
  1415. .home-alert {
  1416. margin: 0rem 1.25rem 0 1.25rem;
  1417. padding: 1rem 0.88rem 0.13rem;
  1418. background-color: #0233c6cc;
  1419. border-radius: 1rem;
  1420. .home-alert-header {
  1421. }
  1422. .home-alert-list {
  1423. .list-item {
  1424. padding: 0.88rem 0;
  1425. border-bottom: solid 0.063rem #ffffff1a;
  1426. }
  1427. }
  1428. }
  1429. .space-y-4 {
  1430. & > view:not(:first-child),
  1431. & > text:not(:first-child),
  1432. & > image:not(:first-child) {
  1433. margin-top: 0.25rem;
  1434. }
  1435. }
  1436. .font_8 {
  1437. font-size: 0.88rem;
  1438. font-family: PingFangSC;
  1439. line-height: 0.81rem;
  1440. color: #ffffff;
  1441. }
  1442. }
  1443. .space-y-20 {
  1444. & > view:not(:first-child),
  1445. & > text:not(:first-child),
  1446. & > image:not(:first-child) {
  1447. margin-top: 1.25rem;
  1448. }
  1449. .text_13 {
  1450. line-height: 2.16rem;
  1451. }
  1452. }
  1453. }
  1454. .home-data {
  1455. margin-top: 3.5rem;
  1456. overflow-x: hidden;
  1457. .home-data-left {
  1458. .space-x-4 {
  1459. & > view:not(:first-child),
  1460. & > text:not(:first-child),
  1461. & > image:not(:first-child) {
  1462. margin-left: 0.25rem;
  1463. }
  1464. .image_10 {
  1465. width: 1.13rem;
  1466. height: 1.06rem;
  1467. }
  1468. .font_1 {
  1469. font-size: 1.13rem;
  1470. font-family: PingFangSC;
  1471. line-height: 1.03rem;
  1472. color: #ffffff;
  1473. }
  1474. .text_14 {
  1475. line-height: 1rem;
  1476. }
  1477. }
  1478. .home-data-left-title {
  1479. width: max-content;
  1480. }
  1481. .font_5 {
  1482. font-size: 2.5rem;
  1483. font-family: PingFangSC;
  1484. line-height: 1.81rem;
  1485. color: #ffffff;
  1486. }
  1487. .text_15 {
  1488. margin-top: 1.25rem;
  1489. }
  1490. .font_6 {
  1491. font-size: 0.75rem;
  1492. font-family: PingFangSC;
  1493. line-height: 0.69rem;
  1494. color: #ffffff80;
  1495. }
  1496. .text_16 {
  1497. margin-top: 0.75rem;
  1498. }
  1499. }
  1500. .home-data-chart {
  1501. overflow-x: hidden;
  1502. width: 85%;
  1503. .group_10 {
  1504. padding-left: 2.06rem;
  1505. padding-bottom: 2.25rem;
  1506. overflow-x: hidden;
  1507. .image_11 {
  1508. width: 8.75rem;
  1509. height: 3.44rem;
  1510. }
  1511. .image_12 {
  1512. width: 7.06rem;
  1513. height: 3.38rem;
  1514. }
  1515. .image_13 {
  1516. width: 10rem;
  1517. height: 3.44rem;
  1518. }
  1519. .pos_8 {
  1520. position: absolute;
  1521. left: 0;
  1522. bottom: 0.063rem;
  1523. }
  1524. .image_14 {
  1525. width: 6.06rem;
  1526. height: 3.44rem;
  1527. }
  1528. .pos_10 {
  1529. position: absolute;
  1530. right: 1.25rem;
  1531. bottom: 0;
  1532. }
  1533. .pos_9 {
  1534. position: absolute;
  1535. left: 0;
  1536. top: 2.31rem;
  1537. }
  1538. }
  1539. .section_9 {
  1540. background-color: #ffffff1a;
  1541. width: 15.94rem;
  1542. height: 0.063rem;
  1543. }
  1544. .pos_11 {
  1545. position: absolute;
  1546. left: 0;
  1547. top: 5.5rem;
  1548. }
  1549. }
  1550. }
  1551. .space-x-6 {
  1552. & > view:not(:first-child),
  1553. & > text:not(:first-child),
  1554. & > image:not(:first-child) {
  1555. margin-left: 0.38rem;
  1556. }
  1557. }
  1558. .home-btns {
  1559. .btn-home-btns2 {
  1560. background: linear-gradient(90deg, rgba(5, 96, 232, 1) 0%, rgba(100, 158, 245, 1) 100%);
  1561. }
  1562. .btn-home-btns1 {
  1563. background: linear-gradient(90deg, rgba(44, 37, 247, 0.6) 0%, rgba(6, 21, 153, 1) 100%);
  1564. }
  1565. .btn-home-btns {
  1566. border-radius: 1.3rem;
  1567. width: 8rem;
  1568. height: 2.6rem;
  1569. margin: 1rem 0.5rem;
  1570. text-align: center;
  1571. font-size: 1.1rem;
  1572. font-weight: 500;
  1573. letter-spacing: 0px;
  1574. line-height: 2.6rem;
  1575. .image_btn {
  1576. width: 1.4rem;
  1577. height: 1.4rem;
  1578. vertical-align: middle;
  1579. margin-right: 0.2rem;
  1580. }
  1581. .btn-home-text {
  1582. color: #ffffff;
  1583. }
  1584. }
  1585. }
  1586. </style>