index.vue 44 KB

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