index.vue 41 KB

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