index.vue 41 KB

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