123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791 |
- <template>
- <view class="home-container">
- <view class="container-bg"></view>
- <cu-custom bgColor="#fff"><view slot="content" style="color: #FFFFFF">UU睡眠</view></cu-custom>
- <view class="flex-col home-module space-y-20 page">
- <!-- no device added -->
- <view v-if="!deviceAdded">
- <view class="flex-col items-start home-header space-y-10">
- <text class="home-header-title">欢迎回来!</text>
- <text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
- </view>
- <view class="flex-row justify-center items-center home_add_devive space-x-10" @click="addBindDevice">
- <image
- class="image_4"
- src="@/static/home/homeIconAdd.png"
- />
- <text class="text_5">添加设备</text>
- </view>
- <!-- <view class="home-ad flex-col group_5 space-y-40">-->
- <!-- <view class="flex-col home-header space-y-6">-->
- <!-- <view class="flex-row items-center space-x-8">-->
- <!-- <text class="font_4 text_8">UU AI智能UU睡眠仪</text>-->
- <!-- <view class="flex-row items-center section_7">-->
- <!-- <text class="font_5 text_9">去看看</text>-->
- <!-- <image-->
- <!-- class="shrink-0 image_9"-->
- <!-- src="@/static/home/homeIconGO.png"-->
- <!-- />-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="flex-row items-center space-x-10">-->
- <!-- <text class="font_5 text_3 text_10">AI时代,全家人的睡眠健康顾问</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="flex-col">
- <view class="flex-col group_5">
- <view class="flex-col home_blank_heart">
- <view class="flex-row items-center group_7 space-x-4">
- <image
- class="image_6"
- src="@/static/home/homeIconHeart.png"
- />
- <text class="font_1 text_9">心率</text>
- </view>
- <view class="flex-row justify-end items-start">
- <view class="section_5 view"></view>
- <text class="font_3 text_10">--</text>
- </view>
- <view class="flex-col group_8">
- <text class="self-start font_4 text_11">次/分</text>
- <view class="shrink-0 self-end section_5"></view>
- </view>
- </view>
- <view class="flex-col home_blank_breath">
- <view class="flex-row items-center group_10 space-x-4">
- <image
- class="image_7"
- src="@/static/home/homeIconBreath.png"
- />
- <text class="font_1 text_12">呼吸</text>
- </view>
- <view class="flex-row justify-end items-start">
- <view class="section_5 view_2"></view>
- <text class="font_3 text_13">--</text>
- </view>
- <view class="flex-col group_8">
- <text class="self-start font_4 text_11">次/分</text>
- <view class="shrink-0 self-end section_5"></view>
- </view>
- </view>
- </view>
- <view class="home-btns flex-row self-center">
- <view @click="handleShareClick" class="btn-home-btns btn-home-btns1 items-center">
- <image class="shrink-0 image_btn" src="@/static/home/homeIconHeart.png" />
- <text class="btn-home-text">远程关爱</text>
- </view>
- </view>
- <view class="flex-row items-center home_blank_alert space-x-16">
- <image
- class="image_8"
- src="@/static/home/homeIconGift.png"
- />
- <view class="flex-col items-start flex-auto space-y-4">
- <text class="font_5">昨晚您的睡眠质量很好</text>
- <text class="font_5">暂时没有预警信息</text>
- </view>
- </view>
- </view>
- </view>
- <!-- device added -->
- <view v-if="deviceAdded" class="flex-col">
- <view class="flex-col items-start home-header space-y-10">
- <text class="home-header-title">欢迎回来!</text>
- <text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
- </view>
- <!-- home device -->
- <view class="flex-col home-device space-y-15">
- <view class="flex-row home-device-header">
- <view class="flex-row justify-between flex-auto equal-division">
- <view class="flex-row equal-division-item space-x-4">
- <text class="font_3 text_5">当前设备</text>
- <text class="font_3">{{ homeFrom.nowDevice }}</text>
- </view>
- <view class="flex-row equal-division-item space-x-14">
- <view class="flex-row space-x-4 margin-left-xl">
- <image class="shrink-0 image_6" src="@/static/home/homeIconWifi.png" />
- <text class="font_3">{{ homeFrom.status }}</text>
- </view>
- <!-- <view class="flex-row items-center space-x-6">-->
- <!-- <text class="font_3 text_6">45%</text>-->
- <!-- <image class="shrink-0 image_7" src="@/static/home/homeIconPower.png" />-->
- <!-- </view>-->
- </view>
- </view>
- <view class="flex-row items-center section_5 space-x-4" @click="modalName = true">
- <image class="shrink-0 image_8" src="@/static/home/homeIconChange.png"/>
- <text class="font_3">切换</text>
- </view>
- </view>
- <view class="flex-row justify-center self-center home-device-status space-x-8">
- <text class="font_4 text_7">当前状态</text>
- <text class="font_4">{{ sleepStatus }}</text>
- </view>
- <!-- <view>-->
- <!--<!– <view class="cu-steps">–>-->
- <!--<!– <view class="cu-item" :class="index>basics?'':'text-orange'" v-for="(item, index) in list1" :key="index">–>-->
- <!--<!– <text :class="index>basics ?'cuIcon-title':'cuIcon-radioboxfill'"></text> {{item.name}}–>-->
- <!--<!– </view>–>-->
- <!--<!– </view>–>-->
- <!-- <uni-steps :options="list1" :active="active" />-->
- <!-- </view>-->
- <!-- <view class="flex-row self-center items-center home-device-setting">-->
- <!-- <image-->
- <!-- class="shrink-0 image_8"-->
- <!-- src="@/static/home/homeIconSet.png"-->
- <!-- />-->
- <!-- <text>设置目标</text>-->
- <!-- </view>-->
- </view>
- <!-- <view class="home-report flex-col group_5 space-y-40">-->
- <!-- <view class="flex-col home-header space-y-6">-->
- <!-- <view class="flex-row items-center space-x-8">-->
- <!-- <text class="font_4 text_8">睡眠报告</text>-->
- <!-- <view class="flex-row items-center section_7">-->
- <!-- <text class="font_5 text_9">去看看</text>-->
- <!-- <image-->
- <!-- class="shrink-0 image_9"-->
- <!-- src="@/static/home/homeIconGO.png"-->
- <!-- />-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="flex-row items-center space-x-10">-->
- <!-- <text class="font_5 text_3 text_10">小U已为您生成最后一份睡眠报告</text>-->
- <!-- <text class="font_5 text_3 text_11">2021-08-24</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="flex-row home-data space-x-6">
- <view class="flex-col flex-auto home-data-left">
- <view class="flex-row space-x-4 home-data-left-title">
- <image
- class="shrink-0 image_10"
- src="@/static/home/homeIconHeart.png"
- />
- <view class="font_1 text_14">心率</view>
- </view>
- <text class="self-start font_5 text_15">{{ pjxl }}</text>
- <text class="self-start font_6 text_16">次/分</text>
- </view>
- <view class="flex-col flex-auto justify-start shrink-0 relative home-data-chart content">
- <view class="echarts-wrap" :hidden="modalName">
- <mpvue-echarts class="ec-canvas" canvasId="canvasChart-1" ref="xinlvRefChart" @onInit="onInit1"></mpvue-echarts>
- </view>
- </view>
- </view>
- <view class="flex-row home-data space-x-6">
- <view class="flex-col flex-auto home-data-left">
- <view class="flex-row space-x-4 home-data-left-title">
- <image
- class="shrink-0 image_10"
- src="@/static/home/homeIconBreath.png"
- />
- <text class="font_1 text_14">呼吸</text>
- </view>
- <text class="self-start font_5 text_15">{{ pjhx }}</text>
- <text class="self-start font_6 text_16">次/分</text>
- </view>
- <view class="flex-col flex-auto justify-start shrink-0 relative home-data-chart content">
- <view class="echarts-wrap" :hidden="modalName">
- <mpvue-echarts class="ec-canvas" canvasId="canvasChart-2" ref="huxiRefChart" @onInit="onInit2"></mpvue-echarts>
- </view>
- </view>
- </view>
- <view class="home-btns flex-row self-center">
- <view @click="handleShareClick" class="btn-home-btns btn-home-btns1 items-center">
- <image class="shrink-0 image_btn" src="@/static/home/homeIconHeart.png" />
- <text class="btn-home-text">远程关爱</text>
- </view>
- <view @click="handleAlertSetting" class="btn-home-btns btn-home-btns2 items-center">
- <image class="shrink-0 image_btn" src="@/static/mine/myIconAlert.png" />
- <text class="btn-home-text">报警设置</text>
- </view>
- </view>
- <view class="flex-col home-alert space-y-4">
- <view class="flex-row items-center space-x-4 home-alert-header">
- <image
- class="image_10"
- src="@/static/home/homeIconHeart.png"
- />
- <text class="font_1">实时预警</text>
- </view>
- <view v-if="list_alerts.length === 0" class="flex-row items-center home_blank_alert space-x-16" @click="goWarnLogPage">
- <image class="image_8" src="@/static/home/homeIconGift.png"/>
- <view class="flex-col items-start flex-auto space-y-4">
- <text class="font_5">昨晚您的睡眠质量很好</text>
- <text class="font_5">暂时没有预警信息</text>
- </view>
- </view>
- <view v-else class="flex-col home-alert-list">
- <view class="flex-row justify-between items-center list-item" :key="i" v-for="(item, i) in list_alerts" @click="goWarnLogPage">
- <view class="flex-row items-center space-x-6">
- <image
- class="shrink-0 image_11"
- src="@/static/home/homeIconAlert.png"
- />
- <text class="font_8">{{ formatSosType(item.warn_type) }}</text>
- <text class="font_9 text_16">{{ formatSosTime(item.warn_time) }}</text>
- </view>
- <view class="flex-row items-baseline space-x-4">
- <text class="font_10">{{ item.warn_desc }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="cu-modal" :class="bindShow?'show':''">
- <view class="cu-dialog">
- <view class="cu-bar bg-white justify-end">
- <view style="color: black" class="content">设备绑定</view>
- <view class="action" @tap="bindShow=false">
- <text class="cuIcon-close text-red"></text>
- </view>
- </view>
- <view class="">
- <form>
- <view class="cu-form-group solid-bottom">
- <view class="title">扫描二维码</view>
- <input type="text" v-model="bindSn" placeholder="输入或扫描IMEI" class="text-left"/>
- <text class="cuIcon-scan text-xxl text-green" style="font-size: 50rpx;"
- @click="scan"></text>
- </view>
- </form>
- </view>
- <view class="cu-bar bg-white justify-end">
- <!-- <view class="action">-->
- <!-- <button class="cu-btn bg-cyan" @tap="goBuy">去购买</button>-->
- <!-- </view>-->
- <view class="action">
- <button class="cu-btn bg-green margin-left" @tap="bindDevice">确定</button>
- </view>
- </view>
- </view>
- </view>
- <view style="z-index: 9999999" class="cu-modal" :class="modalName ?'show':''" @tap="hideModal">
- <view style="background-image: linear-gradient(45deg, #4d9efa, #156fce);z-index: 9999999" class="cu-dialog" @tap.stop="">
- <view class="cu-bar justify-end">
- <view class="content">设备切换</view>
- </view>
- <radio-group class="block" @change="RadioChange">
- <view class="cu-list menu text-left">
- <view style="background-image: linear-gradient(45deg, #4d9efa, #156fce)" class="cu-item" v-for="(item, index) in deviceList" :key="index">
- <label class="flex justify-between align-center flex-sub">
- <view class="flex-sub text-white">{{ item.imei }}</view>
- <radio class="round" :class="homeFrom.nowDevice===item.imei?'checked':''" :checked="homeFrom.nowDevice === item.imei"
- :value="item.imei"></radio>
- </label>
- </view>
- </view>
- </radio-group>
- </view>
- </view>
- <!-- <tab-bar currentPage="home" /> -->
- </view>
- </template>
- <script>
- import echarts from '@/static/echarts.min.js'
- import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue'
- import { API } from '@/utils/request'
- import Storage from '@/utils/storage'
- import * as Foundation from '@/ui-utils/Foundation'
- import * as API_deviceMemberBind from '@/api/device_member_bind'
- import * as API_HOME from '@/api/home'
- import { addByShare } from '@/api/vitalSignsLook'
- import * as deviceDtypeEnum from '@/utils/enum/DeviceDTypeEnum'
- export default {
- components: {
- mpvueEcharts
- },
- data() {
- return {
- deviceAdded: false,
- list_alerts: [],
- active: 4,
- list1: [{
- title: '昨日就寝 11:24PM'
- }, {
- title: '就寝目标 11:00PM'
- }, {
- title: '起床目标 7:00AM'
- }, {
- title: '今日起床 7:14AM'
- }],
- chartObj1: null, // 心率图表
- chartObj2: null, // 呼吸图表
- myData1: [], // 心率数据
- myData2: [], // 呼吸数据
- myCount1: 0, // 心率x轴数字
- myCount2: 0, // 呼吸x轴数字
- pjxl: 0, // 平均心率
- pjhx: 0, // 平均呼吸
- sleepStatus: '离床',
- connecting: false,
- connected: false,
- mySocketTask: null,
- homeFrom: {
- nowDevice: '', // 当前设备
- status: '离线'
- },
- deviceList: [], // 设备列表
- lastMsgTime: 0, // 最后一次设备消息时间
- memberId: '',
- bindSn: '',
- bindShow: false,
- modalName: false,
- activeBreak: false,
- isConnect: false,
- mySns: '',
- closed: false
- };
- },
- // onLoad() {
- // this.memberId = 50289
- // this.API_getDeviceList()
- // },
- onLoad() {
- const memberId = Storage.getItem('uid')
- if (memberId) {
- this.memberId = memberId
- console.log('this.memberId===', this.memberId)
- this.API_getDeviceList()
- const _this = this
- setTimeout(() => {
- console.log('_this.connected====', _this.connected)
- if (!_this.connected) {
- console.log('我要登录过...')
- _this.API_getDeviceList()
- }
- // 解析二维码的内容
- _this.handleQRCodeMsg()
- // 获取提醒数据
- _this.GET_Reminds()
- }, 1500)
- } else {
- this.checkHasLogin()
- const _this = this
- let initTimer = setInterval(function () {
- const memberId = Storage.getItem('uid')
- if (memberId) {
- _this.memberId = memberId
- clearInterval(initTimer)
- _this.API_getDeviceList()
- // 解析二维码的内容
- _this.handleQRCodeMsg()
- // 获取提醒数据
- _this.GET_Reminds()
- }
- }, 500)
- }
- },
- beforeDestroy() {
- this.activeBreak = true
- this.closeWebsocket()
- },
- onShow() {
- const imei = Storage.getItem('nowChangeDevice')
- if (imei) {
- this.homeFrom.nowDevice = imei
- this.deviceAdded = true
- } else {
- this.deviceAdded = false
- }
- if (this.memberId) {
- this.API_getDeviceList()
- if (this.connected) {
- console.log('发送确认在线消息...')
- this.mySocketTask.send({data: '1'})
- const _this = this
- this.isConnect = false
- setTimeout(() => {
- if (_this.isConnect === false) {
- console.log('没有正常返回...')
- if (_this.myChart1) {
- _this.connect()
- } else {
- _this.init()
- }
- }
- }, 1000)
- } else {
- if (this.deviceList.length > 0) {
- console.log('重新连接...')
- this.connect()
- }
- }
- }
- },
- methods: {
- API_getDeviceList() {
- const _this = this
- API_deviceMemberBind.getDeviceByDtypeAndMemberId({dtype: deviceDtypeEnum.DEVICE_TYPE.SMCD, memberId: this.memberId}).then(res => {
- if (res) {
- _this.deviceList = res
- if (res.length === 0) {
- _this.deviceAdded = false
- if (this.homeFrom.nowDevice) {
- _this.homeFrom.nowDevice = ''
- _this.sendSns()
- }
- Storage.removeItem("nowChangeDevice")
- Storage.removeItem("myBindDevices")
- } else {
- _this.deviceAdded = true
- _this.sendSns()
- let nowDevice = Storage.getItem("nowChangeDevice")
- if (!nowDevice) {
- Storage.setItem("nowChangeDevice", res[0].imei)
- _this.homeFrom.nowDevice = res[0].imei
- } else {
- _this.homeFrom.nowDevice = nowDevice
- }
- Storage.setItem("myBindDevices", res)
- _this.init()
- }
- } else {
- console.log('获取床垫错误...')
- }
- })
- },
- init() {
- const _this = this
- setTimeout(() => {
- _this.nowChart1()
- _this.nowChart2()
- _this.connect()
- }, 800)
- },
- connect() {
- let _this = this
- if (this.connected || this.connecting) {
- console.log('webSocket已连接或者正在连接')
- return
- }
- this.connecting = true
- let wsUrl = API.base.replace('http', 'ws')
- const time = Math.round(new Date()) + "" + Math.round(Math.random()*100000)
- this.mySocketTask = uni.connectSocket({
- // url: wsUrl + '/sleep_report/monitor/' + time + '/' + this.memberId,
- url: wsUrl + '/sleep_report/monitor/' + time ,
- success(res) {
- // 这里是接口调用成功的回调,不是连接成功的回调,请注意
- },
- fail(err) {
- // 这里是接口调用失败的回调,不是连接失败的回调,请注意
- }
- })
- this.mySocketTask.onOpen(res => {
- this.connecting = false
- this.connected = true
- uni.hideLoading()
- let _this = this
- this.timer = setInterval(function () { //每隔5秒钟发送一次心跳,避免websocket连接因超时而自动断开
- if (Date.parse(new Date()) - _this.lastMsgTime > 5000) { // 5秒没有收到新消息,则判断为离线
- _this.homeFrom.status = '离线'
- _this.sleepStatus = '离线'
- _this.pjxl = '--'
- _this.pjhx = '--'
- }
- _this.mySocketTask.send({data: 'ping'})
- }, 60000) // 60秒的心跳包
- this.sendSns()
- })
- this.mySocketTask.onError(err => {
- this.connecting = false
- this.connected = false
- uni.hideLoading()
- console.log('连接失败,可能是websocket服务不可用,请稍后再试!')
- // uni.showModal({
- // content: '连接失败,可能是websocket服务不可用,请稍后再试',
- // showCancel: false
- // })
- console.log('onError', err)
- })
- this.mySocketTask.onMessage(res => {
- let msg = res.data
- // console.log('收到消息:', msg)
- switch (msg.length) {
- case 1:
- // 判断是否连接
- this.isConnect = true
- break
- case 234:
- // 实时睡眠数据
- if (this.homeFrom.nowDevice !== msg.substring(2, 14)) {
- return
- }
- this.homeFrom.status = '在线'
- this.lastMsgTime = Date.parse(new Date())
- this.getValue(msg)
- switch (msg.substring(26, 28)) {
- case "03":
- this.sleepStatus = '在床'
- break;
- case "04":
- this.sleepStatus = '离床'
- break;
- case "05":
- this.sleepStatus = '打鼾'
- break;
- case "06":
- this.sleepStatus = '体动'
- break;
- default:
- break;
- }
- break
- case 7: // REFRESH 有新的睡眠报告了
- Storage.setItem('refreshSleepReport', true)
- break
- case 13: // REMOVE_DEVICE 有其他人绑定了这台设备
- _this.API_getDeviceList()
- break
- default: // 报警信息
- const data = JSON.parse(res.data)
- console.log('收到消息为:', data)
- if (data.sn && this.homeFrom.nowDevice === data.sn) {
- this.list_alerts.push(data)
- }
- break
- }
- })
- this.mySocketTask.onClose(res => {
- console.log('webSocket关闭了...')
- this.connected = false
- this.closed = true
- clearInterval(this.timer)
- })
- },
- sendSns() {
- if (this.connected) {
- if (this.deviceList.length > 0) {
- let sns = []
- this.deviceList.forEach(item => {
- sns.push(item.imei)
- })
- const data = sns.join(',')
- if (!this.mySns) {
- this.mySns = data
- } else {
- if (data === this.mySns && !this.closed) {
- return
- } else {
- this.closed = false
- this.mySns = data
- }
- }
- console.log('发送imei给服务器...')
- this.mySocketTask.send({data: data})
- } else {
- this.mySns = ''
- this.mySocketTask.send({data: ''})
- }
- }
- },
- nowChart1() {
- this.onInit1(this.chartObj1)
- let canvas = this.$refs.xinlvRefChart.canvas
- echarts.setCanvasCreator(() => canvas)
- this.myChart1 = echarts.init(canvas, 'halloween', {
- width: this.chartObj1.width,
- height: this.chartObj1.height
- })
- this.options1 = Object.assign(this.getOptions('#FFFFFF', 800), {})
- this.options1.series.forEach((item) => {
- item.data = this.myData1
- })
- this.myChart1.setOption(this.options1)
- },
- nowChart2() {
- this.onInit2(this.chartObj2);
- let canvas = this.$refs.huxiRefChart.canvas;
- echarts.setCanvasCreator(() => canvas);
- this.myChart2 = echarts.init(canvas, 'halloween', {
- width: this.chartObj2.width,
- height: this.chartObj2.height
- });
- this.options2 = Object.assign(this.getOptions('#06f5d2', 400), {})
- this.options2.series.forEach((item) => {
- item.data = this.myData2
- })
- this.myChart2.setOption(this.options2)
- },
- onInit1(e) {
- this.chartObj1 = e
- },
- onInit2(e) {
- this.chartObj2 = e
- },
- getOptions(color, xMax) {
- return {
- visualMap: [
- {
- show: false,
- type: 'continuous',
- seriesIndex: 0,
- min: 0,
- max: 300,
- },
- ],
- color: color,
- title: {
- left: 'left',
- // text: title,
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- animation: false,
- },
- extraCssText: 'z-index: 2'
- },
- grid: {
- top: '15%',
- bottom: '10%',
- },
- xAxis: {
- type: 'category',
- boundaryGap: [0, '100%'],
- show: false, // 不显示x轴
- splitLine: {
- show: false,
- },
- triggerEvent: true
- },
- yAxis: {
- type: 'value',
- boundaryGap: [0, '100%'],
- min: function (value) {
- if (value === 0) {
- return 0
- } else {
- return value.min - 20
- }
- },
- max: function (value) {
- return value.max + 30
- },
- // min: 0,
- // min: 'dataMin', // 取数据在该轴上的最大值作为最小刻度
- // max: xMax,
- // max: 'dataMax', // 取数据在该轴上的最大值作为最大刻度
- splitLine: {
- show: true, // 是否显示分隔线
- lineStyle: {
- color: "rgba(168,162,162,0.6)",
- width: 1,
- type: 'dotted'
- }
- },
- axisLine: {
- show: false, // 是否显示坐标轴轴线
- lineStyle:{
- color:'#FFFFFF',
- width:1, //x轴线的宽度
- }
- },
- axisLabel: {
- fontSize: 8
- }
- },
- series: [
- {
- type: 'line',
- lineStyle: {
- width: 0.8
- },
- smooth: true, // 折线曲线
- showSymbol: false,
- hoverAnimation: false,
- data: [],
- },
- ]
- }
- },
- getValue(msg) {
- this.pjxl = parseInt(msg.substring(22, 24), 16)
- this.pjhx = parseInt(msg.substring(24, 26), 16)
- const bx = msg.substring(34, msg.length);
- const size = bx.length / 4
- const ii = size / 2;
- if (this.myData1.length > 100) {
- this.myData1.splice(0, ii)
- }
- if (this.myData2.length > 100) {
- this.myData2.splice(0, ii)
- }
- if (this.myCount1 > 300) {
- this.myCount1 = 0
- }
- if (this.myCount2 > 300) {
- this.myCount2 = 0
- }
- for (let i = 0; i < size; i++) {
- const j = i * 4
- const s1 = bx.substring(j, j + 2)
- const s2 = bx.substring(j + 2, j + 4)
- let value = parseInt(s2 + s1 , 16)
- if (i % 2 === 0) {
- this.myCount1 ++
- this.myData1.push([this.myCount1, value])
- } else {
- this.myCount2 ++
- this.myData2.push([this.myCount2, value])
- }
- }
- this.myChart1.setOption(this.options1)
- this.myChart2.setOption(this.options2)
- },
- handleAlertSetting() {
- uni.navigateTo({
- url: "/pages/user/alertSetting/index?imei=" + this.homeFrom.nowDevice
- });
- },
- formatSosType(value) {
- switch (value) {
- case 1:
- return '心率过速'
- case 2:
- return '心率过缓'
- case 3:
- return '呼吸过速'
- case 4:
- return '呼吸过缓'
- case 5:
- return '离床预警'
- case 6:
- return '一键预警'
- case 7:
- return '离线预警'
- default:
- break;
- }
- },
- formatSosTime(value) {
- return value.substring(10, value.length - 3)
- },
- // 扫描条码
- scan() {
- let _this = this
- uni.scanCode({
- success: function (res) {
- console.log(res, res.result.length)
- if (res.result.length > 20) {
- if (res.scanType === 'QR_CODE') {
- const urlStr = res.result
- const qs = Foundation.getQueryObject(urlStr)
- if (qs.mac && qs.type === 'MATTRESS') {
- _this.bindSn = qs.mac
- } else {
- uni.showToast({
- title: '请扫码正确的睡眠床垫二维码',
- icon: 'none',
- duration: 5000
- })
- }
- } else {
- _this.bindSn = res.result
- }
- } else {
- let str = res.result.split(':')
- if (str.length > 1) {
- _this.bindSn = str[1]
- } else {
- _this.bindSn = res.result
- }
- }
- },
- fail: (err) => {
- console.log(err)
- // #ifdef MP
- uni.getSetting({
- success: (res) => {
- let authStatus = res.authSetting['scope.camera'];
- if (!authStatus) {
- uni.showModal({
- title: '授权失败',
- content: 'app需要使用您的相机,请在设置界面打开相关权限',
- success: (res) => {
- if (res.confirm) {
- uni.openSetting()
- }
- }
- })
- }
- }
- })
- // #endif
- }
- })
- },
- bindDevice() {
- if (!this.bindSn) {
- uni.showToast({
- title: '请输入或绑定正确的二维码',
- icon: 'none',
- duration: 5000
- })
- return
- }
- const params = {
- imei: this.bindSn,
- memberId: this.memberId,
- dtype: deviceDtypeEnum.DEVICE_TYPE.SMCD
- }
- this.bindShow = false
- let _this = this
- API_deviceMemberBind.bindDeviceByDtype(params).then(res => {
- if (res.success) {
- _this.bindSn = ''
- uni.showToast({
- title: '绑定成功',
- })
- _this.API_getDeviceList()
- } else {
- uni.showModal({
- content: res.message,
- showCancel: false
- })
- }
- })
- },
- addBindDevice() {
- if (this.memberId) {
- this.bindShow = 'show'
- } else {
- uni.showModal({
- title: '提示',
- content: "您还没有登录,是否前往登录?",
- confirmText: "确定",
- showCancel: true,
- success: function(res) {
- if (res.confirm) {
- uni.reLaunch({
- url:'/pages/login/auth'
- })
- }
- }
- })
- }
- },
- closeWebsocket() {
- if (this.mySocketTask) {
- this.mySocketTask.close({
- success(res) {
- this.connected = false
- clearInterval(this.timer)
- console.log("关闭成功", res)
- },
- fail(err) {
- console.log("关闭失败", err)
- }
- })
- }
- },
- hideModal(e) {
- this.modalName = false
- },
- RadioChange(e) {
- this.homeFrom.nowDevice = e.detail.value
- Storage.setItem("nowChangeDevice", e.detail.value)
- this.homeFrom.status = '离线'
- this.sleepStatus = '离线'
- },
- handleShareClick() {
- if (!this.memberId) {
- uni.showModal({
- title: '提示',
- content: "您还没有登录,是否前往登录?",
- confirmText: "确定",
- showCancel: true,
- success: function(res) {
- if (res.confirm) {
- uni.reLaunch({
- url:'/pages/login/auth'
- })
- }
- }
- })
- return
- }
- // this.closeWebsocket()
- uni.navigateTo({
- url: '/pages/user/shareUser/index'
- })
- },
- goWarnLogPage() {
- const userInfo = Storage.getItem('userInfo')
- uni.navigateTo({
- url: '/pages/log/warn/index?unionId=' + userInfo.union_id
- })
- },
- // 绑定守护之影套包
- bindUUSH() {
- const params = {
- imei: this.bindSn,
- memberId: this.memberId
- }
- const _this = this
- API_deviceMemberBind.bindUUSH(params).then(res => {
- if (res.success) {
- _this.bindSn = ''
- uni.showToast({
- title: '绑定成功',
- })
- _this.API_getDeviceList()
- } else {
- uni.showModal({
- content: res.message,
- showCancel: false
- })
- }
- })
- },
- // 处理二维码或分享内容
- async handleQRCodeMsg() {
- const codeMsg = Storage.getItem('codeMsg')
- if (codeMsg) {
- Storage.removeItem('codeMsg')
- let params
- switch (codeMsg.type) {
- case 'VITAL_SHARE': // 亲友体征绑定
- uni.showModal({
- title: '提示',
- content: '是否同意该亲友的请求分享?',
- confirmText: "同意",
- showCancel: true,
- success: function(res) {
- if (res.confirm) {
- let memberId = Number(codeMsg.no)
- params = {
- memberId: memberId,
- type: codeMsg.lx,
- bool_sms: 1,
- bool_voice: 1
- }
- addByShare(params)
- }
- }
- })
- break
- case 'BROADCAST': // 播报设备
- params = {
- imei: codeMsg.mac,
- memberId: this.memberId,
- dtype: deviceDtypeEnum.DEVICE_TYPE.ZNYLB
- }
- await API_deviceMemberBind.bindDeviceByDtype(params)
- break
- case 'MATTRESS': // 床垫
- this.bindSn = codeMsg.mac
- this.init()
- this.bindDevice()
- break
- case 'UUSH': // 总包
- this.bindSn = codeMsg.mac
- this.init()
- this.bindUUSH()
- break
- default:
- break
- }
- }
- },
- // 获取需要提醒购买套餐
- async GET_Reminds() {
- if (API.base === 'http://192.168.1.199:7000') {
- return
- }
- if (this.deviceList.length > 0) {
- const userInfo = Storage.getItem('userInfo')
- // 获取提醒购买
- API_HOME.getRemindPackages({memberId: this.memberId, unionId: userInfo.union_id}).then(res => {
- if (res.iotLinks) {
- const nowData = Math.round(new Date() / 1000)
- res.iotLinks.forEach(item => {
- let date = item.expires_time - nowData
- let str = ''
- if (date < 0) {
- str = '已经到期'
- } else {
- str = '还有【' + Math.ceil(date / 86400) + '天】过期'
- }
- uni.showModal({
- title: '提示',
- content: "您的【" + item.device_name + '】' + str +'是否前往续费?',
- confirmText: "确定",
- showCancel: true,
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: '/pages/log/iot/iot-package/index?operators=' + item.operators + '&iccid=' + item.iccid + '&dtype=' + item.device_name
- })
- }
- }
- })
- })
- }
- if (res.warnSwitch) {
- if ((res.warnSwitch.sms_qty + res.warnSwitch.voice_qty) < 5) {
- uni.showModal({
- title: '提示',
- content: "您的短信、语音剩余额度即将不总,是否前往购买?",
- confirmText: "确定",
- showCancel: true,
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: '/pages/log/smsVoice/package?unionId=' + userInfo.union_id
- })
- }
- }
- })
- }
- }
- })
- // 获取卡的激活时间
- await API_HOME.getAllActivationTime(this.memberId)
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .page {
- background-color: #000000;
- width: 100%;
- overflow-y: auto;
- overflow-x: hidden;
- height: 100%;
- }
- .echarts-wrap {
- width: 100%;
- height: 80px;
- /*padding: 10upx;*/
- margin-bottom: 0.3rem
- }
- .chartsBgColor{
- background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
- }
- .equal-division {
- .equal-division-item {
- padding: 0.25rem 0.38rem 0;
- flex: 1 1 10.81rem;
- }
- }
- .home_add_devive {
- margin-right: 1.25rem;
- margin: 1rem;
- padding: 3.75rem 0;
- background-color: #0233c699;
- border-radius: 1rem;
- backdrop-filter: blur(0.63rem);
- .image_4 {
- width: 1.5rem;
- height: 1.5rem;
- }
- .text_5 {
- color: #ffffff;
- font-size: 1.5rem;
- font-family: PingFangSC;
- line-height: 1.38rem;
- }
- }
- .space-x-10 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.63rem;
- }
- }
- .space-x-6 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.38rem;
- }
- }
- .group_5 {
- padding-left: 1rem;
- padding-right: 1rem;
- .font_2 {
- font-size: 0.69rem;
- font-family: PingFangSC;
- line-height: 0.63rem;
- color: #ffffff;
- }
- .text_8 {
- font-size: 0.63rem;
- line-height: 0.59rem;
- opacity: 0.6;
- }
- .home_blank_heart {
- margin-top: 1rem;
- opacity: 1;
- border-radius: 16px;
- background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
- backdrop-filter: blur(20px);
- padding:1rem 0rem 2rem 1rem;
- .group_7 {
- padding-bottom: 1.13rem;
- .image_6 {
- width: 1.13rem;
- height: 0.88rem;
- }
- .text_9 {
- line-height: 1.03rem;
- }
- }
- .view {
- margin-right: -20.13rem;
- }
- .text_10 {
- margin-right: 18.75rem;
- margin-top: 1rem;
- }
- }
- .home_blank_breath {
- margin-top: 1rem;
- opacity: 1;
- border-radius: 16px;
- background: linear-gradient(180deg, rgba(52, 26, 75, 1) 0%, rgba(22, 125, 242, 1) 100%);
- backdrop-filter: blur(20px);
- padding:1rem 0rem 2rem 1rem;
- .group_10 {
- padding-bottom: 1.25rem;
- .image_7 {
- width: 1.13rem;
- height: 1.06rem;
- }
- .text_12 {
- line-height: 1rem;
- }
- }
- .view_2 {
- margin-right: -20rem;
- }
- .text_13 {
- margin-right: 18.63rem;
- margin-top: 1rem;
- }
- }
- .space-x-4 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.25rem;
- }
- }
- .font_1 {
- font-size: 1.13rem;
- font-family: PingFangSC;
- line-height: 1.06rem;
- color: #ffffff;
- }
- .section_5 {
- background-color: #ffffff1a;
- width: 15.94rem;
- height: 0.063rem;
- }
- .font_3 {
- font-size: 2.5rem;
- font-family: PingFangSC;
- line-height: 0.19rem;
- color: #ffffff;
- }
- .group_8 {
- margin-top: 1.38rem;
- padding-left: 0.63rem;
- .font_4 {
- font-size: 0.69rem;
- font-family: PingFangSC;
- line-height: 0.63rem;
- color: #ffffff80;
- }
- .text_11 {
- font-size: 0.75rem;
- line-height: 0.69rem;
- }
- }
- }
- .home_blank_alert {
- margin: 1rem 1.25rem 0;
- padding: 0.94rem;
- background-color: #02299ecc;
- border-radius: 1rem;
- .image_8 {
- width: 7.06rem;
- height: 4.94rem;
- }
- .space-y-4 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.25rem;
- }
- .font_5 {
- font-size: 0.88rem;
- font-family: PingFangSC;
- line-height: 1.06rem;
- color: #167df2;
- }
- }
- }
- .space-x-16 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 1rem;
- }
- }
- .container-bg {
- position: fixed;
- left: -130px;
- top: -130px;
- width: 480px;
- height: 344px;
- opacity: 1;
- overflow: hidden;
- border-radius: 63px;
- -webkit-transform: rotate(-315deg);
- transform: rotate(-315deg);
- background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
- }
- .home-container {
- padding-bottom: 2rem;
- background-color: #000000;
- width: 100%;
- .home-module {
- padding: 1.75rem 0 3.38rem;
- overflow-y: auto;
- z-index: 100;
- .home-header {
- padding: 0 1.25rem;
- .home-header-title {
- color: #ffffff;
- font-size: 1.25rem;
- font-family: PingFangSC;
- line-height: 1.16rem;
- }
- .text_8 {
- color: #ffffff;
- opacity: 1;
- }
- .text_3 {
- opacity: 0.6;
- }
- .home-header-subtitle {
- line-height: 0.72rem;
- }
- .space-x-10 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.63rem;
- }
- .text_10 {
- line-height: 0.59rem;
- }
- .text_11 {
- line-height: 0.47rem;
- }
- }
- }
- .space-y-10 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.63rem;
- }
- }
- .home-device {
- margin: 1rem 1.25rem;
- padding-bottom: 1rem;
- //padding-bottom: 2rem;
- background-color: #0233c699;
- border-radius: 1rem;
- backdrop-filter: blur(0.63rem);
- .home-device-setting {
- width: 70px;
- height: 20px;
- opacity: 1;
- border-radius: 7px;
- background: linear-gradient(90deg, rgba(255, 35, 247, 1) 0%, rgba(91, 30, 154, 1) 100%);
- .image_8 {
- width: 10px;
- height: 10px;
- }
- font-size: 10px;
- font-weight: 400;
- line-height: 10px;
- color: rgba(255, 255, 255, 1);
- padding: 0.3rem;
- }
- .home-device-header {
- background-color: #ffffff33;
- border-radius: 1rem 1rem 0px 0px;
- .equal-division {
- padding: 0 1rem;
- .equal-division-item {
- padding: 0.38rem 0;
- .text_5 {
- opacity: 0.5;
- }
- }
- .space-x-14 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.88rem;
- }
- }
- }
- .section_5 {
- padding: 0.38rem 0.5rem;
- background-image: linear-gradient(90deg, #2c25f799 0%, #061599 100%);
- border-radius: 0px 1rem 0px 0px;
- height: 1.5rem;
- .image_8 {
- width: 0.75rem;
- height: 0.75rem;
- }
- }
- }
- .home-device-status {
- padding: 0.25rem 0 0.25rem 0.25rem;
- background-color: #ffffff33;
- border-radius: 0.75rem;
- width: 7.88rem;
- .text_7 {
- opacity: 0.4;
- }
- }
- }
- .space-y-15 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.94rem;
- }
- }
- .font_3 {
- font-size: 0.75rem;
- font-family: PingFangSC;
- line-height: 0.69rem;
- color: #ffffff;
- }
- .home-report {
- margin: 0 1.25rem;
- padding: 1rem 0;
- background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/050F95EFCA914FD6A72537F41ACEFC33.png");
- background-size: contain;
- background-repeat: no-repeat;
- .space-y-6 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.38rem;
- }
- }
- }
- .home-ad {
- margin: 0 1.25rem;
- padding: 1rem 0;
- background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/602647C38F5E4168B4F16AFFFE2270CA.png");
- background-size: contain;
- background-repeat: no-repeat;
- .space-y-6 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.38rem;
- }
- }
- }
- .home-data {
- background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
- margin: 0rem 1.25rem;
- padding: 1rem 0rem;
- border-radius: 1rem;
- padding: 1rem;
- margin-top: 1rem;
- z-index: 1000;
- .home-data-item {
- padding: 1rem 0rem;
- margin: 0 0.3rem;
- opacity: 1;
- border-radius: 16px;
- background: linear-gradient(180deg, rgba(52, 26, 75, 0.65) 0%, rgba(22, 125, 242, 1) 100%);
- backdrop-filter: blur(20px);
- }
- }
- .group_6 {
- overflow-x: hidden;
- width: 100%;
- .group_7 {
- overflow-x: hidden;
- width: 10rem;
- .group_9 {
- margin-left: 2.25rem;
- }
- .text_14 {
- margin-top: 3.5rem;
- }
- }
- .group_8 {
- width: 10rem;
- .text_15 {
- margin-top: 3.63rem;
- }
- }
- .font_6 {
- font-size: 3rem;
- font-family: PingFangSC;
- line-height: 2.19rem;
- color: #ffffff;
- }
- .font_7 {
- font-size: 0.75rem;
- font-family: PingFangSC;
- line-height: 0.69rem;
- color: #ffffff80;
- }
- }
- .space-y-40 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 2.5rem;
- }
- }
- .space-x-8 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.5rem;
- }
- .text_8 {
- padding: 0.13rem 0;
- }
- .section_7 {
- padding: 0.13rem 0.38rem;
- background-image: linear-gradient(90deg, #ff23f7 0%, #5b1e9a 100%);
- border-radius: 0.44rem;
- height: 0.88rem;
- .text_9 {
- line-height: 0.56rem;
- }
- .image_9 {
- width: 0.19rem;
- height: 0.31rem;
- }
- }
- }
- .font_4 {
- font-size: 1rem;
- font-family: PingFangSC;
- line-height: 0.94rem;
- color: #ffffff;
- }
- .font_5 {
- font-size: 0.63rem;
- font-family: PingFangSC;
- color: #ffffff;
- }
- .space-x-6 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.38rem;
- }
- .text_6 {
- line-height: 0.56rem;
- }
- .image_7 {
- width: 1.31rem;
- height: 0.69rem;
- }
- .image_11 {
- width: 1.13rem;
- height: 0.94rem;
- }
- .font_9 {
- font-size: 0.88rem;
- font-family: PingFangSC;
- line-height: 0.69rem;
- color: #ced5dc;
- }
- .text_16 {
- line-height: 0.63rem;
- }
- }
- .space-x-4 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.25rem;
- }
- .image_6 {
- width: 0.94rem;
- height: 0.75rem;
- }
- .image_10 {
- width: 1.13rem;
- height: 0.88rem;
- }
- .font_1 {
- font-size: 1.13rem;
- font-family: PingFangSC;
- line-height: 1.03rem;
- color: #ffffff;
- }
- .image_4 {
- width: 1.13rem;
- height: 1.06rem;
- }
- .text_12 {
- line-height: 1rem;
- }
- .font_10 {
- font-size: 1.13rem;
- font-family: PingFangSC;
- line-height: 0.81rem;
- color: #ff465a;
- }
- }
- .home-alert {
- margin: 0rem 1.25rem 0 1.25rem;
- padding: 1rem 0.88rem 0.13rem;
- background-color: #0233c6cc;
- border-radius: 1rem;
- .home-alert-header {
- }
- .home-alert-list {
- .list-item {
- padding: 0.88rem 0;
- border-bottom: solid 0.063rem #ffffff1a;
- }
- }
- }
- .space-y-4 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 0.25rem;
- }
- }
- .font_8 {
- font-size: 0.88rem;
- font-family: PingFangSC;
- line-height: 0.81rem;
- color: #ffffff;
- }
- }
- .space-y-20 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-top: 1.25rem;
- }
- .text_13 {
- line-height: 2.16rem;
- }
- }
- }
- .home-data {
- margin-top: 3.5rem;
- overflow-x: hidden;
- .home-data-left {
- .space-x-4 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.25rem;
- }
- .image_10 {
- width: 1.13rem;
- height: 1.06rem;
- }
- .font_1 {
- font-size: 1.13rem;
- font-family: PingFangSC;
- line-height: 1.03rem;
- color: #ffffff;
- }
- .text_14 {
- line-height: 1rem;
- }
- }
- .home-data-left-title {
- width: max-content;
- }
- .font_5 {
- font-size: 2.5rem;
- font-family: PingFangSC;
- line-height: 1.81rem;
- color: #ffffff;
- }
- .text_15 {
- margin-top: 1.25rem;
- }
- .font_6 {
- font-size: 0.75rem;
- font-family: PingFangSC;
- line-height: 0.69rem;
- color: #ffffff80;
- }
- .text_16 {
- margin-top: 0.75rem;
- }
- }
- .home-data-chart {
- overflow-x: hidden;
- width: 85%;
- .group_10 {
- padding-left: 2.06rem;
- padding-bottom: 2.25rem;
- overflow-x: hidden;
- .image_11 {
- width: 8.75rem;
- height: 3.44rem;
- }
- .image_12 {
- width: 7.06rem;
- height: 3.38rem;
- }
- .image_13 {
- width: 10rem;
- height: 3.44rem;
- }
- .pos_8 {
- position: absolute;
- left: 0;
- bottom: 0.063rem;
- }
- .image_14 {
- width: 6.06rem;
- height: 3.44rem;
- }
- .pos_10 {
- position: absolute;
- right: 1.25rem;
- bottom: 0;
- }
- .pos_9 {
- position: absolute;
- left: 0;
- top: 2.31rem;
- }
- }
- .section_9 {
- background-color: #ffffff1a;
- width: 15.94rem;
- height: 0.063rem;
- }
- .pos_11 {
- position: absolute;
- left: 0;
- top: 5.5rem;
- }
- }
- }
- .space-x-6 {
- & > view:not(:first-child),
- & > text:not(:first-child),
- & > image:not(:first-child) {
- margin-left: 0.38rem;
- }
- }
- .home-btns {
- .btn-home-btns2 {
- background: linear-gradient(90deg, rgba(5, 96, 232, 1) 0%, rgba(100, 158, 245, 1) 100%);
- }
- .btn-home-btns1 {
- background: linear-gradient(90deg, rgba(44, 37, 247, 0.6) 0%, rgba(6, 21, 153, 1) 100%);
- }
- .btn-home-btns {
- border-radius: 1.3rem;
- width: 8rem;
- height: 2.6rem;
- margin: 1rem 0.5rem;
- text-align: center;
- font-size: 1.1rem;
- font-weight: 500;
- letter-spacing: 0px;
- line-height: 2.6rem;
- .image_btn {
- width: 1.4rem;
- height: 1.4rem;
- vertical-align: middle;
- margin-right: 0.2rem;
- }
- .btn-home-text {
- color: #ffffff;
- }
- }
- }
- </style>
|