deviceDetail.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  1. <template>
  2. <!-- 设备详情 -->
  3. <view class="content">
  4. <view class="name_box">
  5. <view class="name_content">{{ devInfo.devName }}</view>
  6. </view>
  7. <view class="radar-box">
  8. <view
  9. :style="{
  10. width: `${length / 200}px`,
  11. height: `${width / 200}px`,
  12. position: 'relative',
  13. transform: `scale(${zoomTimes})`,
  14. border: `${9 / zoomTimes}rpx solid #333333`,
  15. }"
  16. :class="[
  17. width < 25500 && length < 25000 ? 'tranStyle' : 'center',
  18. ]"
  19. >
  20. <template v-if="modules.length > 0">
  21. <view
  22. v-for="(item, index) in modules"
  23. :key="index"
  24. class="moduleContent"
  25. >
  26. <view
  27. :class="item.type"
  28. :style="{
  29. width: `${item.width / 2}px`,
  30. height: `${item.length / 2}px`,
  31. top: `${item.top / 2}px`,
  32. left: `${item.left / 2}px`,
  33. transform: `rotate(${item.rotate}deg)`,
  34. 'transform-origin': 'center center',
  35. zIndex: 4444,
  36. }"
  37. >
  38. <image
  39. style="
  40. width: 100%;
  41. height: 100%;
  42. display: block;
  43. "
  44. :src="`../../static/furnitures/${item.type}.png`"
  45. mode=""
  46. />
  47. </view>
  48. </view>
  49. </template>
  50. <template>
  51. <view v-for="item in targetPoints" :key="item.id">
  52. <image
  53. class="action-icon-M"
  54. :style="{
  55. position: 'absolute',
  56. transform: `translate3d(${
  57. item.displayX / 2
  58. }px, ${
  59. -item.displayY / 2
  60. }px, 0) translate(-50%, -50%) scale(${
  61. 1.5 / zoomTimes
  62. })`,
  63. zIndex: 9999,
  64. transition: 'transform 1s linear',
  65. willChange: 'transform',
  66. }"
  67. :src="`../../static/${lnbAction}.png`"
  68. mode=""
  69. />
  70. </view>
  71. </template>
  72. </view>
  73. <image
  74. class="redar-pic"
  75. src="../../static/rander.png"
  76. mode=""
  77. :style="{
  78. transform: `translate(${-xOffset}rpx, ${-yOffset}rpx) rotate(${
  79. devInfo.northAngle
  80. }deg)`,
  81. }"
  82. />
  83. </view>
  84. <view class="switchBox">
  85. <text class="name">呼吸灯</text>
  86. <switch
  87. :checked="statusLight == 1"
  88. @change="handleLightChange"
  89. :active-value="1"
  90. :inactive-value="0"
  91. size="24px"
  92. active-color="#07c160"
  93. inactive-color="#eeeff1"
  94. style="transform: scale(0.8)"
  95. />
  96. </view>
  97. <view class="notice-info">
  98. <view class="notice_title" @click="discrepancy">
  99. <text style="color: #95a4b3; font-size: 28rpx">{{
  100. todayDate
  101. }}</text>
  102. <image src="../../static/rightArrow.png"></image>
  103. </view>
  104. <view
  105. @click="getFrenEcharts()"
  106. class="title"
  107. v-if="
  108. devInfo.installPosition == 'Bedroom' ||
  109. (breathRate !== 0 && breathRate !== '')
  110. "
  111. >
  112. <view
  113. class="title-text"
  114. style="color: #111111; font-size: 30rpx"
  115. >当前呼吸率</view
  116. >
  117. <view
  118. style="
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. "
  123. >
  124. <view
  125. class="title-btn"
  126. style="color: #111111; font-size: 30rpx"
  127. v-if="breathRate !== ''"
  128. >
  129. {{ breathRate }}次/分钟</view
  130. >
  131. <view
  132. v-else
  133. class="title-btn"
  134. style="color: #111111; font-size: 30rpx"
  135. >
  136. 暂无
  137. </view>
  138. <image
  139. src="../../static/rightArrow.png"
  140. style="margin-left: auto; width: 30rpx; height: 30rpx"
  141. ></image>
  142. </view>
  143. </view>
  144. <view class="title">
  145. <view class="title-text" style="color: #22dea7"
  146. >今日进出频次</view
  147. >
  148. <view class="title-btn" style="color: #22dea7">
  149. {{ freQuenceList.length || 0 }}次
  150. </view>
  151. </view>
  152. <view class="stayDetail" v-if="freQuenceList.length > 0">
  153. <!-- 只有一条时直接展示 -->
  154. <view v-if="freQuenceList.length === 1">
  155. <view
  156. v-for="item in freQuenceList"
  157. :key="item.id"
  158. class="stayDetail-item"
  159. >
  160. <view class="stayDetail-text">
  161. {{ formatTime(item.enterTime) }}目标进入
  162. </view>
  163. <view class="stayDetail-btn">
  164. {{ formatTime(item.leaveTime) }}目标离开
  165. </view>
  166. </view>
  167. </view>
  168. <!-- 多条时用 swiper 展示 -->
  169. <swiper
  170. v-else
  171. class="auto-scroll-swiper"
  172. :indicator-dots="false"
  173. :autoplay="false"
  174. :interval="3000"
  175. :circular="true"
  176. :display-multiple-items="1"
  177. :vertical="false"
  178. :current="currentIndex"
  179. @change="onSwiperChange"
  180. >
  181. <swiper-item
  182. v-for="item in freQuenceList"
  183. :key="item.id"
  184. class="stayDetail-item"
  185. >
  186. <view class="stayDetail-text">
  187. {{ formatTime(item.enterTime) }}目标进入
  188. </view>
  189. <view class="stayDetail-btn">
  190. {{ formatTime(item.leaveTime) }}目标离开
  191. </view>
  192. </swiper-item>
  193. </swiper>
  194. </view>
  195. </view>
  196. <view class="box" v-if="!breathShow">
  197. <view class="handle-btn">
  198. <view class="btn1" @click="shareDevice" v-if="shareJudge"
  199. >分享</view
  200. >
  201. <view class="noShareFlag" @click="noShareFlag" v-else
  202. >分享</view
  203. >
  204. <view
  205. class="btn1"
  206. @click="gotoSetting"
  207. v-if="devInfo.online == 1"
  208. >设置</view
  209. >
  210. <view class="noShareFlag" @click="gotoSetting" v-else
  211. >设置</view
  212. >
  213. <view class="btn2" @click="healthAlarm">守护计划</view>
  214. </view>
  215. </view>
  216. <view class="box" v-else>
  217. <view class="handle-btn">
  218. <view class="closeBreath" @click="breathShow = false"
  219. >关闭呼吸率曲线图</view
  220. >
  221. <view class="btn2" @click="saveBreath"> 保存呼吸率曲线图 </view>
  222. </view>
  223. </view>
  224. <!-- 遮罩层 -->
  225. <view class="mask" v-if="shareModel" @click="shareModel = false"></view>
  226. <!-- 弹窗内容 -->
  227. <view class="share-modal" v-if="shareModel">
  228. <view class="modal-header">
  229. <text class="cancel-btn" @click="shareModel = false">取消</text>
  230. <text class="modal-title">分享</text>
  231. <text class="confirm-btn" @click="onShareConfirm()">确认</text>
  232. </view>
  233. <view class="modal-body">
  234. <view class="info-row">
  235. <view class="label">设备序列号:</view>
  236. <view class="value">{{ devInfo.clientId }}</view>
  237. </view>
  238. <view class="info-row">
  239. <view class="label">设备名称:</view>
  240. <view class="value">{{ devInfo.devName }}</view>
  241. </view>
  242. <view class="input-row phoneInfo">
  243. <view>被分享人</view>
  244. <input
  245. class="input"
  246. placeholder="请输入手机号"
  247. type="number"
  248. v-model="sharedPhone"
  249. />
  250. </view>
  251. <view class="funChoice">
  252. <view class="funItem" @click="smChange()">
  253. <label class="simple-radio">
  254. <radio
  255. :value="messageFlag"
  256. color="#7c5345"
  257. :checked="messageFlag == true"
  258. class="hide-original"
  259. />
  260. <text>短信权限</text>
  261. </label>
  262. </view>
  263. <view class="funItem">
  264. <label class="simple-radio" @click="snChange()">
  265. <radio
  266. :value="serviceNumberFlag"
  267. color="#7c5345"
  268. :checked="serviceNumberFlag == true"
  269. class="hide-original"
  270. />
  271. <text>服务号通知</text>
  272. </label>
  273. </view>
  274. <view class="funItem">
  275. <label class="simple-radio" @click="vfChange()">
  276. <radio
  277. :value="voipFlag"
  278. color="#7c5345"
  279. :checked="voipFlag == true"
  280. class="hide-original"
  281. />
  282. <text>语音通话</text>
  283. </label>
  284. </view>
  285. </view>
  286. </view>
  287. </view>
  288. <view class="modal-mask" v-if="choiceVisible" @click="closeChoice">
  289. <view class="modal-container">
  290. <view class="modal-header">
  291. <text class="title">请选择分享方式</text>
  292. </view>
  293. <view class="modal-buttons">
  294. <!-- 手机号分析按钮 -->
  295. <button class="btn phone-btn" @click="handlePhoneAnalysis">
  296. <text>手机号分享</text>
  297. </button>
  298. <!-- 链接分享按钮 -->
  299. <button class="btn link-btn" @click="handleLinkShare">
  300. <text>链接分享</text>
  301. </button>
  302. </view>
  303. </view>
  304. </view>
  305. <!-- ECharts图标模块 -->
  306. <view v-if="breathShow" class="echartsClass">
  307. <image
  308. src="../../static/closePng.png"
  309. class="closePng"
  310. @click="breathShow = false"
  311. ></image>
  312. <l-echart
  313. id="chart-canvas"
  314. canvas-id="chart-canvas"
  315. ref="chartRef"
  316. @finished="initChart"
  317. v-if="breathShow"
  318. @click="breathShow = false"
  319. ></l-echart>
  320. </view>
  321. <alarModel v-if="showModle" ref="alarmModel" />
  322. </view>
  323. </template>
  324. <script>
  325. import * as echarts from "../../uni_modules/lime-echart/static/echarts.min";
  326. import MqttService from "../../utils/globalMqtt.js";
  327. export default {
  328. data() {
  329. return {
  330. clientId: "",
  331. width: 0, //检测区域宽度
  332. length: 0, //检测区域长度
  333. xOffset: 0,
  334. yOffset: 0,
  335. devInfo: "",
  336. actionName: "",
  337. startDate: "",
  338. endDate: "",
  339. softWare: "",
  340. statusLight: 0,
  341. lnbAction: "",
  342. stayDetail: "",
  343. todayDate: "",
  344. dev_id: "",
  345. nowTime: "",
  346. devName: "",
  347. devType: "",
  348. localPhone: uni.getStorageSync("phone"),
  349. freQuenceList: [],
  350. // mqtt相关
  351. currentIndex: 0,
  352. modules: [],
  353. autoPlayinterval: "",
  354. choiceVisible: "",
  355. // 手机号分享授权模块
  356. shareModel: false,
  357. alarmModel: false,
  358. sharedPhone: "",
  359. messageFlag: false,
  360. serviceNumberFlag: false,
  361. voipFlag: false,
  362. // mqtt模块
  363. targetPoints: {},
  364. inactivityTimer: null,
  365. left: 0,
  366. top: 0,
  367. breathRate: "",
  368. breathShow: false,
  369. breathRpmList: [],
  370. option: {
  371. title: [
  372. {
  373. text: "呼吸率曲线",
  374. left: "center",
  375. top: 20,
  376. textStyle: { fontSize: 14 },
  377. },
  378. {
  379. text: "BPM: 0 次/分钟",
  380. left: "center",
  381. top: 50,
  382. textStyle: { fontSize: 12, color: "#805246" },
  383. },
  384. {
  385. text: "时间 (秒)",
  386. left: "right",
  387. top: "bottom",
  388. textStyle: { fontSize: 12, color: "#888888" },
  389. },
  390. ],
  391. grid: { left: 60, right: 20, top: 80, bottom: 50 },
  392. xAxis: {
  393. type: "category",
  394. data: Array.from({ length: 60 }, (_, i) => i + 1),
  395. boundaryGap: false,
  396. splitLine: { show: false },
  397. },
  398. yAxis: {
  399. type: "value",
  400. min: 0,
  401. max: 40,
  402. name: "呼吸率(次)",
  403. nameLocation: "end",
  404. nameGap: 20,
  405. nameTextStyle: { fontSize: 12, color: "#888888" },
  406. splitLine: { show: true },
  407. },
  408. series: [
  409. {
  410. type: "line",
  411. smooth: true,
  412. symbol: "none",
  413. lineStyle: { color: "#805246", width: 2 },
  414. data: Array(60).fill(0),
  415. },
  416. ],
  417. animation: true,
  418. animationDuration: 100,
  419. },
  420. showModle: false,
  421. zoomTimes: 2,
  422. // 设备分享权限判断
  423. shareJudge: false,
  424. unsubscribeFn: null,
  425. fallingEventChange: null,
  426. lnbActionJudean: false,
  427. setIntervalVal: null,
  428. };
  429. },
  430. computed: {},
  431. methods: {
  432. getdevInfo(devId) {
  433. this.$http
  434. .get(`wap/device/queryDeviceInfoById`, {
  435. devId: devId,
  436. })
  437. .then((res) => {
  438. if (res.data.data) {
  439. this.devInfo = res.data.data;
  440. this.devType = this.devInfo.devType;
  441. this.width =
  442. Math.abs(
  443. this.devInfo.yyEnd - this.devInfo.yyStart
  444. ) * 100;
  445. this.length =
  446. Math.abs(
  447. this.devInfo.xxEnd - this.devInfo.xxStart
  448. ) * 100;
  449. this.statusLight = this.devInfo.statusLight;
  450. this.calculate(this.width, this.length);
  451. // 设备分享权限判断
  452. this.shareJudge =
  453. this.devInfo.userId == uni.getStorageSync("userId")
  454. ? true
  455. : false;
  456. }
  457. })
  458. .catch((err) => {});
  459. },
  460. getdevRoomInfo(devId) {
  461. this.$http
  462. .get(`wap/room/readRoom`, {
  463. devId: devId,
  464. })
  465. .then((res) => {
  466. if (res.data.data) {
  467. this.modules = res.data.data.furnitures;
  468. }
  469. });
  470. },
  471. handleLightChange(e) {
  472. let newValue = e.detail.value == true ? 1 : 0;
  473. this.$http
  474. .post(`wap/device/statusLight`, {
  475. statusLight: newValue,
  476. devId: this.devInfo.devId,
  477. })
  478. .then((res) => {
  479. if (res.data.code == 200) {
  480. uni.showToast({
  481. title: "操作成功",
  482. icon: "success",
  483. });
  484. this.statusLight = newValue;
  485. } else {
  486. wx.showToast({
  487. title: res.data.message,
  488. icon: "none",
  489. });
  490. }
  491. });
  492. },
  493. // 分享功能模块
  494. shareDevice() {
  495. this.choiceVisible = true;
  496. },
  497. noShareFlag() {
  498. uni.showToast({
  499. title: "您没有分享权限",
  500. icon: "none",
  501. });
  502. },
  503. onShareConfirm() {
  504. if (!this.sharedPhone) {
  505. uni.showModal({
  506. content: "请填写手机号!",
  507. showCancel: false,
  508. });
  509. return;
  510. }
  511. let reg_tel =
  512. /^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8}$/;
  513. if (!reg_tel.test(this.sharedPhone)) {
  514. uni.showModal({
  515. content: "请填写正确手机号!",
  516. showCancel: false,
  517. });
  518. return;
  519. }
  520. let shareParam = {
  521. sharerUserId: uni.getStorageSync("userId"),
  522. devId: this.devInfo.devId,
  523. sharerPhone: uni.getStorageSync("phone"),
  524. sharedUserId: "",
  525. sharedPhone: this.sharedPhone,
  526. messageFlag: this.messageFlag == true ? 0 : 1,
  527. serviceNumberFlag: this.serviceNumberFlag == true ? 0 : 1,
  528. voipFlag: this.voipFlag == true ? 0 : 1,
  529. };
  530. this.$http
  531. .post("wap/share/deviceShare", shareParam, {
  532. header: {
  533. "Content-Type": "application/json;charset=UTF-8",
  534. },
  535. })
  536. .then((res) => {
  537. if (res.data.code == 200) {
  538. uni.showToast({
  539. title: "分享成功",
  540. icon: "success",
  541. duration: 1500,
  542. });
  543. } else {
  544. uni.showToast({
  545. title: res.data.message,
  546. icon: "none",
  547. duration: 1500,
  548. });
  549. }
  550. });
  551. this.shareModel = false;
  552. },
  553. closeChoice() {
  554. this.choiceVisible = false;
  555. },
  556. handlePhoneAnalysis() {
  557. this.choiceVisible = false;
  558. this.shareModel = true;
  559. },
  560. handleLinkShare() {
  561. this.choiceVisible = false;
  562. uni.navigateTo({
  563. url:
  564. "/pagesA/linkShare/linkShare?devInfo=" +
  565. JSON.stringify(this.devInfo),
  566. });
  567. },
  568. smChange() {
  569. this.messageFlag = !this.messageFlag;
  570. },
  571. snChange() {
  572. this.serviceNumberFlag = !this.serviceNumberFlag;
  573. },
  574. vfChange() {
  575. this.voipFlag = !this.voipFlag;
  576. },
  577. gotoSetting() {
  578. if (this.devInfo.online == 0) {
  579. uni.showToast({
  580. title: "离线设备不支持设置",
  581. icon: "none",
  582. });
  583. return;
  584. }
  585. uni.navigateTo({
  586. url:
  587. "/pagesA/deviceSetting/deviceSetting?devInfo=" +
  588. JSON.stringify(this.devInfo),
  589. });
  590. },
  591. getFrequency(devId) {
  592. let params = {
  593. devId: devId,
  594. createTimeStart: this.$time(new Date()),
  595. createTimeEnd: this.$time(new Date()),
  596. pageNo: 1,
  597. pageSize: 999,
  598. };
  599. this.$http
  600. .post(`wap/stats/inOutEventQuery`, params, {
  601. header: {
  602. "Content-Type": "application/json;charset=UTF-8",
  603. },
  604. })
  605. .then((res) => {
  606. if (res.data.code == 200) {
  607. if (res.data.data.rows.length > 0) {
  608. this.freQuenceList = res.data.data.rows;
  609. } else {
  610. this.freQuenceList = [];
  611. }
  612. } else {
  613. uni.showToast({
  614. title: res.data.message,
  615. icon: "none",
  616. });
  617. }
  618. });
  619. },
  620. // 健康闹钟方法
  621. healthAlarm() {
  622. uni.navigateTo({
  623. url:
  624. "/pagesA/healthAlarm/healthAlarm?devInfo=" +
  625. JSON.stringify(this.devInfo),
  626. });
  627. },
  628. onSwiperChange(event) {
  629. const current = event.detail.current;
  630. const totalItems = this.freQuenceList.length;
  631. if (current === totalItems - 1) {
  632. this.autoplay = false;
  633. }
  634. this.currentIndex = current;
  635. },
  636. autoSwipe() {
  637. if (this.freQuenceList && this.freQuenceList.length > 0) {
  638. this.setIntervalVal = setInterval(() => {
  639. let nextIndex = this.currentIndex + 1;
  640. if (nextIndex >= this.freQuenceList.length) {
  641. nextIndex = 0; // 循环到第一个项目
  642. }
  643. this.currentIndex = nextIndex;
  644. }, 3000); // 每3秒自动滚动一次
  645. }
  646. },
  647. discrepancy() {
  648. uni.navigateTo({
  649. url:
  650. "/pagesA/discrepancy/discrepancy?freQuenceList=" +
  651. JSON.stringify(this.freQuenceList),
  652. });
  653. },
  654. receptionChange(val) {
  655. this.targetPoints = val;
  656. },
  657. receptHealth(val) {
  658. this.breathRate = val;
  659. this.setEcharts(val);
  660. },
  661. // echarts图表模块
  662. getOption(list) {
  663. // 固定 X 轴 [0 ~ 60]
  664. const xData = Array.from({ length: 61 }, (_, i) => i);
  665. const recent = list.slice(-61);
  666. const data = new Array(61).fill(null);
  667. for (let i = 0; i < recent.length; i++) {
  668. data[i] = recent[i];
  669. }
  670. return {
  671. title: [
  672. { text: "呼吸率曲线", left: "center", top: 20 },
  673. {
  674. text: `BPM: ${recent[recent.length - 1] || 0} 次/分钟`,
  675. left: "center",
  676. top: 50,
  677. textStyle: { fontSize: 12, color: "#805246" },
  678. },
  679. {
  680. text: "时间 (秒)",
  681. left: "right",
  682. top: "bottom",
  683. textStyle: {
  684. fontSize: 10,
  685. color: "#888888",
  686. fontWeight: "normal",
  687. },
  688. },
  689. ],
  690. grid: { left: 60, right: 20, top: 80, bottom: 50 },
  691. xAxis: {
  692. type: "category",
  693. data: xData,
  694. boundaryGap: false,
  695. },
  696. yAxis: {
  697. type: "value",
  698. min: 0,
  699. max: 40,
  700. name: "呼吸率(次)",
  701. nameLocation: "end",
  702. nameGap: 20,
  703. nameTextStyle: {
  704. fontSize: 10,
  705. color: "#888888",
  706. fontWeight: "normal",
  707. },
  708. splitLine: { show: true },
  709. },
  710. series: [
  711. {
  712. type: "line",
  713. smooth: true,
  714. symbol: "none",
  715. data: data,
  716. showSymbol: false,
  717. lineStyle: { color: "#7a4e42", width: 2 },
  718. },
  719. ],
  720. };
  721. },
  722. getFrenEcharts() {
  723. if (this.breathRate === "" || this.breathRate === null) {
  724. uni.showToast({
  725. title: "暂无呼吸率",
  726. icon: "none",
  727. duration: 1500,
  728. });
  729. return;
  730. }
  731. this.breathShow = true;
  732. this.$nextTick(() => {
  733. this.initChart();
  734. });
  735. },
  736. initChart() {
  737. if (!this.$refs.chartRef) return;
  738. if (this.chartInstance) {
  739. this.chartInstance.dispose();
  740. this.chartInstance = null;
  741. }
  742. this.$refs.chartRef.init(echarts, (chart) => {
  743. this.chartInstance = chart;
  744. chart.setOption(this.option, true);
  745. });
  746. },
  747. setEcharts(val) {
  748. if (!Array.isArray(this.breathRpmList)) {
  749. this.breathRpmList = [];
  750. }
  751. this.breathRpmList.push(val);
  752. if (!this.chartInstance) return;
  753. const option = this.getOption(this.breathRpmList);
  754. this.chartInstance.setOption(option, { notMerge: true });
  755. },
  756. saveBreath() {
  757. const chart = this.$refs.chartRef;
  758. if (!chart) {
  759. uni.showToast({ title: "图表未渲染", icon: "none" });
  760. return;
  761. }
  762. chart.canvasToTempFilePath({
  763. success: (res) => {
  764. uni.saveImageToPhotosAlbum({
  765. filePath: res.tempFilePath,
  766. success: () => {
  767. uni.showToast({
  768. title: "保存成功",
  769. icon: "success",
  770. });
  771. },
  772. fail: (err) => {
  773. uni.showToast({
  774. title: "保存失败",
  775. icon: "none",
  776. });
  777. },
  778. });
  779. },
  780. fail: (err) => {
  781. uni.showToast({
  782. title: "导出失败",
  783. icon: "none",
  784. });
  785. },
  786. });
  787. },
  788. handleMessage(topic, message, clientId) {
  789. // 清除不活动定时器
  790. clearTimeout(this.inactivityTimer);
  791. this.inactivityTimer = setTimeout(() => {
  792. this.targetPoints = {};
  793. console.log("没有点位,消除点位数据");
  794. }, 1500);
  795. // 验证topic格式
  796. const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
  797. if (!match || match[1] !== clientId) return;
  798. try {
  799. const data = JSON.parse(message.toString());
  800. console.log(data.tracker_targets, "点位消息");
  801. if (data.health) {
  802. if (
  803. data.health.breath_rpm ||
  804. data.health.breath_rpm === 0
  805. ) {
  806. this.receptHealth(Math.floor(data.health.breath_rpm));
  807. } else {
  808. }
  809. }
  810. this.processTrackerData(data.tracker_targets);
  811. // console.log(data.tracker_targets, "MQTT消息解析成功22222");
  812. } catch (e) {
  813. console.error("MQTT消息解析失败", e);
  814. }
  815. },
  816. processTrackerData(arr) {
  817. if (Array.isArray(arr) && arr.length > 0 && Array.isArray(arr[0])) {
  818. this.targetPoints = {};
  819. const currentIds = new Set();
  820. const newTargetPoints = {};
  821. // 处理每个追踪目标
  822. arr.forEach((item) => {
  823. if (!Array.isArray(item) || item.length < 4) return;
  824. const [x, y, z, id] = item;
  825. currentIds.add(id.toString());
  826. // 处理新点或更新现有点
  827. if (!this.targetPoints[id]) {
  828. newTargetPoints[id] = this.createNewTargetPoint(
  829. x,
  830. y,
  831. z,
  832. id
  833. );
  834. } else {
  835. newTargetPoints[id] = this.updateExistingTargetPoint(
  836. this.targetPoints[id],
  837. x,
  838. y,
  839. z,
  840. 2
  841. );
  842. }
  843. });
  844. // 移除不存在的点
  845. Object.keys(this.targetPoints).forEach((id) => {
  846. if (!currentIds.has(id)) {
  847. delete this.targetPoints[id];
  848. }
  849. });
  850. // 更新目标点
  851. this.targetPoints = {
  852. ...this.targetPoints,
  853. ...newTargetPoints,
  854. };
  855. if (Array.isArray(this.targetPoints)) {
  856. this.targetPoints = this.targetPoints.filter(
  857. (item) => item !== null && item !== undefined
  858. );
  859. }
  860. }
  861. },
  862. createNewTargetPoint(x, y, z, id) {
  863. return {
  864. x,
  865. y,
  866. z,
  867. id,
  868. displayX: x - Number(this.devInfo.xxStart),
  869. displayY: y - Number(this.devInfo.yyEnd),
  870. lastX: x,
  871. lastY: y,
  872. };
  873. },
  874. updateExistingTargetPoint(existingPoint, x, y, z, THRESHOLD) {
  875. const dx = x - existingPoint.lastX;
  876. const dy = y - existingPoint.lastY;
  877. const distance = Math.sqrt(dx * dx + dy * dy);
  878. if (distance > THRESHOLD) {
  879. return {
  880. ...existingPoint,
  881. x,
  882. y,
  883. z,
  884. lastX: x,
  885. lastY: y,
  886. displayX: x - Number(this.devInfo.xxStart),
  887. displayY: y - Number(this.devInfo.yyEnd),
  888. };
  889. }
  890. return existingPoint;
  891. },
  892. // 计算缩放比例
  893. calculate(width, length) {
  894. let zoomTime = width > length ? width : length;
  895. let practical = zoomTime / 100;
  896. this.zoomTimes = 710 / practical;
  897. // this.normalizeZoomTimes(this.zoomTimes);
  898. this.zoomTimes = this.zoomTimes - 0.2;
  899. this.zoomTimes = Number(this.zoomTimes.toFixed(2));
  900. this.xOffset = this.devInfo.xxStart + this.devInfo.xxEnd;
  901. this.yOffset = -(this.devInfo.yyStart + this.devInfo.yyEnd);
  902. console.log(this.xOffset, this.yOffset, this.zoomTimes, "偏移量");
  903. this.lnbActionJudean = true;
  904. },
  905. normalizeZoomTimes(num) {
  906. const intPart = Math.floor(num);
  907. const decimalPart = num - intPart;
  908. let result;
  909. if (decimalPart >= 0.1 && decimalPart < 0.5) {
  910. result = intPart;
  911. } else if (decimalPart >= 0.5 && decimalPart < 0.9) {
  912. result = intPart + 0.5;
  913. } else {
  914. result = num;
  915. }
  916. return Math.round(result * 100) / 100;
  917. },
  918. formatTime(time) {
  919. return time ? time.slice(11, 19) : "暂无";
  920. },
  921. initSubscriptions() {
  922. const topicList = [
  923. {
  924. topic: `/dev/${this.clientId}/tracker_targets`,
  925. key: "unsubscribeFn",
  926. callback: (message, msgTopic) => {
  927. const dataMatch = msgTopic.match(
  928. /^\/dev\/(.+)\/tracker_targets$/
  929. );
  930. const cmdMatch = msgTopic.match(
  931. /^\/mps\/wx_(.+)\/notice$/
  932. );
  933. if (dataMatch && dataMatch[1] === this.clientId) {
  934. this.handleMessage(
  935. msgTopic,
  936. message,
  937. this.clientId
  938. );
  939. } else if (cmdMatch) {
  940. this.$refs.alarmModel.hanOtherMessage(
  941. msgTopic,
  942. message
  943. );
  944. }
  945. },
  946. },
  947. {
  948. topic: `/dev/${this.clientId}/falling_event_change`,
  949. key: "fallingEventChange",
  950. callback: (message, msgTopic) => {
  951. const dataMatch = msgTopic.match(
  952. /^\/dev\/(.+)\/falling_event_change$/
  953. );
  954. if (dataMatch && dataMatch[1] === this.clientId) {
  955. const dataMessage = JSON.parse(message.toString());
  956. console.log(dataMessage, 888888);
  957. if (dataMessage.falling == 1) {
  958. this.falling = dataMessage.falling;
  959. this.lnbAction = "actionWarn";
  960. } else if (
  961. dataMessage.falling == 2 ||
  962. dataMessage.falling == 3
  963. ) {
  964. this.falling = dataMessage.falling;
  965. this.lnbAction = "actionSerious";
  966. } else {
  967. this.lnbAction = "action8";
  968. }
  969. }
  970. },
  971. },
  972. ];
  973. topicList.forEach((item) => {
  974. // 避免重复订阅
  975. if (this[item.key]) return;
  976. const subscribeFunc = () => {
  977. const unsubscribe = MqttService.subscribe(
  978. "DATA",
  979. item.topic,
  980. item.callback
  981. );
  982. if (unsubscribe) {
  983. this[item.key] = unsubscribe;
  984. console.log(`✅ 已成功订阅主题: ${item.topic}`);
  985. }
  986. };
  987. if (MqttService.dataConnected) {
  988. subscribeFunc();
  989. } else {
  990. // MQTT 未连接,等待重连成功再订阅
  991. const handler = () => {
  992. subscribeFunc();
  993. uni.$off("mqttData-ready", handler);
  994. };
  995. uni.$on("mqttData-ready", handler);
  996. }
  997. });
  998. },
  999. },
  1000. onLoad(options) {
  1001. this.lnbAction = "action8";
  1002. const devItem = JSON.parse(options.devItem);
  1003. const { devId, clientId } = devItem;
  1004. // 缓存到页面实例
  1005. this.clientId = clientId;
  1006. uni.setStorageSync("currentDevItem", devItem);
  1007. this.getFrequency(devId);
  1008. this.dev_id = devId;
  1009. this.todayDate = this.$time(new Date(), 2);
  1010. // 清理旧定时器
  1011. clearTimeout(this.autoPlayinterval);
  1012. this.autoPlayinterval = setTimeout(() => this.autoSwipe(), 3000);
  1013. if (MqttService.dataConnected && MqttService.dataClient) {
  1014. // 已连接,直接订阅
  1015. this.initSubscriptions();
  1016. }
  1017. },
  1018. onShow() {
  1019. this.showModle = true;
  1020. this.lnbAction = "action8";
  1021. // MQTT 初始化
  1022. const userId = uni.getStorageSync("userId");
  1023. if (!userId) return console.error("MQTT 初始化失败:缺少 userId");
  1024. if (!MqttService.dataConnected) {
  1025. // 未连接,先 connect
  1026. MqttService.connectData(userId)
  1027. .then((client) => {
  1028. // 页面订阅逻辑,等 connect 成功再执行
  1029. const handler = () => {
  1030. MqttService.resubscribeAll("DATA");
  1031. uni.$off("mqttData-ready", handler);
  1032. };
  1033. uni.$on("mqttData-ready", handler);
  1034. })
  1035. .catch((err) => console.error("DATA MQTT 初始化失败", err));
  1036. }
  1037. this.getdevInfo(this.dev_id);
  1038. this.getdevRoomInfo(this.dev_id);
  1039. },
  1040. onUnload() {
  1041. // 清理定时器
  1042. clearTimeout(this.autoPlayinterval);
  1043. // 清理自动滑动定时器
  1044. clearInterval(this.setIntervalVal);
  1045. this.setIntervalVal = null;
  1046. this.autoPlayinterval = null;
  1047. // 取消订阅
  1048. ["unsubscribeFn", "fallingEventChange"].forEach((key) => {
  1049. if (this[key]) {
  1050. this[key]();
  1051. this[key] = null;
  1052. }
  1053. });
  1054. },
  1055. onHide() {
  1056. this.showModle = false;
  1057. },
  1058. };
  1059. </script>
  1060. <style lang="less" scoped>
  1061. .content {
  1062. height: 100vh;
  1063. background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
  1064. box-sizing: border-box;
  1065. padding-top: 20rpx;
  1066. .name_box {
  1067. display: flex;
  1068. justify-content: center;
  1069. align-items: center;
  1070. margin: 0 auto 37rpx 0;
  1071. .name_content {
  1072. display: inline-flex;
  1073. background: rgba(255, 255, 255, 0.65);
  1074. border-radius: 37rpx;
  1075. padding: 6rpx 18rpx;
  1076. }
  1077. }
  1078. .radar-box {
  1079. margin: 0 auto;
  1080. position: relative;
  1081. display: flex;
  1082. align-items: center;
  1083. justify-content: center;
  1084. width: 710rpx;
  1085. height: 710rpx;
  1086. background: #ffffff;
  1087. border-radius: 37.5rpx;
  1088. box-sizing: border-box;
  1089. .center {
  1090. position: absolute;
  1091. overflow: hidden;
  1092. border: none;
  1093. background-repeat: no-repeat;
  1094. background-position: center;
  1095. &::before {
  1096. content: "";
  1097. position: absolute;
  1098. inset: 0;
  1099. background: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png")
  1100. no-repeat center;
  1101. background-size: 100% 100%;
  1102. z-index: 0;
  1103. }
  1104. .moduleContent {
  1105. position: relative;
  1106. view {
  1107. position: absolute;
  1108. }
  1109. .module-img {
  1110. width: 100%;
  1111. height: 100%;
  1112. display: block;
  1113. }
  1114. }
  1115. }
  1116. .tranStyle {
  1117. position: absolute;
  1118. overflow: hidden;
  1119. background-color: #fff;
  1120. border: none;
  1121. // outline: 10rpx solid #333333;
  1122. // background-image: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png");
  1123. background-repeat: no-repeat;
  1124. background-position: center;
  1125. &::before {
  1126. content: "";
  1127. position: absolute;
  1128. inset: 0;
  1129. background: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png")
  1130. no-repeat center;
  1131. background-size: 100% 100%;
  1132. z-index: 0; // 在最底层
  1133. }
  1134. .moduleContent {
  1135. // overflow: hidden;
  1136. // position: relative;
  1137. view {
  1138. position: absolute;
  1139. }
  1140. .module-img {
  1141. width: 100%;
  1142. height: 100%;
  1143. display: block;
  1144. }
  1145. }
  1146. }
  1147. .action-icon-G {
  1148. position: absolute;
  1149. width: 100rpx;
  1150. height: 100rpx;
  1151. }
  1152. .action-icon-M {
  1153. // position: absolute;
  1154. width: 50rpx;
  1155. height: 50rpx;
  1156. }
  1157. .redar-pic {
  1158. position: absolute;
  1159. // left: 50%;
  1160. // top: 50%;
  1161. width: 60rpx;
  1162. height: 60rpx;
  1163. transform: translate(-50%, -50%); /* 先居中 */
  1164. }
  1165. }
  1166. .switchBox {
  1167. width: 710rpx;
  1168. height: 94rpx;
  1169. margin: 18rpx auto;
  1170. padding: 0 37rpx;
  1171. display: flex;
  1172. align-items: center;
  1173. background: #ffffff;
  1174. border-radius: 37rpx;
  1175. box-sizing: border-box;
  1176. .name {
  1177. color: #111111;
  1178. font-size: 32rpx;
  1179. }
  1180. }
  1181. .notice-info {
  1182. width: 710rpx;
  1183. max-height: 300rpx;
  1184. // overflow: hidden;
  1185. padding: 30rpx 37rpx 10rpx 37rpx;
  1186. background: #ffffff;
  1187. border-radius: 37rpx;
  1188. box-sizing: border-box;
  1189. margin: 0 auto;
  1190. .notice_title {
  1191. display: flex;
  1192. align-items: space-between;
  1193. image {
  1194. margin-left: auto;
  1195. width: 30rpx;
  1196. height: 30rpx;
  1197. }
  1198. }
  1199. .title {
  1200. margin-top: 10rpx;
  1201. margin-bottom: 10rpx;
  1202. font-family: PingFang SC, PingFang SC;
  1203. font-weight: 500;
  1204. font-size: 34rpx;
  1205. color: #1757dd;
  1206. display: flex;
  1207. align-items: center;
  1208. justify-content: space-between;
  1209. .title-text {
  1210. font-size: 28rpx;
  1211. font-weight: 500;
  1212. color: #1757dd;
  1213. }
  1214. .title-btn {
  1215. font-size: 28rpx;
  1216. font-weight: 500;
  1217. color: #5a5a5a;
  1218. }
  1219. }
  1220. .stayDetail {
  1221. height: 80rpx;
  1222. // overflow: hidden;
  1223. margin-top: 10rpx;
  1224. margin-bottom: 10rpx;
  1225. padding-left: 20rpx;
  1226. font-family: PingFang SC, PingFang SC;
  1227. font-weight: 500;
  1228. font-size: 34rpx;
  1229. .stayDetail-item {
  1230. display: flex;
  1231. padding-bottom: 5rpx !important;
  1232. padding-top: 10rpx !important;
  1233. box-sizing: border-box;
  1234. line-height: 60rpx;
  1235. .stayDetail-text {
  1236. width: 40%;
  1237. font-size: 28rpx;
  1238. height: 30rpx !important;
  1239. }
  1240. .stayDetail-btn {
  1241. padding-left: 30rpx;
  1242. font-size: 28rpx;
  1243. height: 30rpx !important;
  1244. }
  1245. }
  1246. }
  1247. }
  1248. .box {
  1249. position: fixed;
  1250. bottom: 0;
  1251. left: 0;
  1252. width: 100vw;
  1253. height: 168rpx;
  1254. padding: 0 37rpx;
  1255. background: #ffffff;
  1256. box-sizing: border-box;
  1257. .handle-btn {
  1258. margin-top: 40rpx;
  1259. display: flex;
  1260. align-items: center;
  1261. justify-content: space-between;
  1262. .btn1 {
  1263. display: flex;
  1264. align-items: center;
  1265. justify-content: center;
  1266. width: 155rpx;
  1267. height: 94rpx;
  1268. background: #ffebe4;
  1269. border-radius: 28rpx;
  1270. font-weight: 500;
  1271. color: #111111;
  1272. font-size: 32rpx;
  1273. text-align: center;
  1274. }
  1275. .noShareFlag {
  1276. display: flex;
  1277. align-items: center;
  1278. justify-content: center;
  1279. width: 155rpx;
  1280. height: 94rpx;
  1281. border-radius: 28rpx;
  1282. font-weight: 500;
  1283. font-size: 32rpx;
  1284. text-align: center;
  1285. background: #f0f0f0;
  1286. color: #999999;
  1287. opacity: 0.6;
  1288. }
  1289. .btn2 {
  1290. display: flex;
  1291. align-items: center;
  1292. justify-content: center;
  1293. width: 328rpx;
  1294. height: 94rpx;
  1295. background: linear-gradient(
  1296. 105.95deg,
  1297. #a27867 0%,
  1298. #74483d 100%
  1299. );
  1300. border-radius: 28rpx;
  1301. box-shadow: 0rpx 4.69rpx 18.75rpx rgba(72, 41, 29, 0.15),
  1302. 0rpx 9.38rpx 9.38rpx rgba(154, 132, 89, 0.2),
  1303. 0rpx -4.69rpx 28.13rpx 4.69rpx #a16647 inset;
  1304. font-family: MiSans;
  1305. font-weight: 500;
  1306. color: #ffffff;
  1307. font-size: 32rpx;
  1308. }
  1309. .closeBreath {
  1310. display: flex;
  1311. align-items: center;
  1312. justify-content: center;
  1313. width: 328rpx;
  1314. height: 94rpx;
  1315. background: #ffebe4;
  1316. border-radius: 28rpx;
  1317. font-weight: 500;
  1318. color: #111111;
  1319. font-size: 32rpx;
  1320. text-align: center;
  1321. }
  1322. }
  1323. }
  1324. /* 弹窗部分样式 */
  1325. .mask {
  1326. position: fixed;
  1327. left: 0;
  1328. top: 0;
  1329. right: 0;
  1330. bottom: 0;
  1331. background: rgba(0, 0, 0, 0.3);
  1332. z-index: 100;
  1333. }
  1334. .share-modal {
  1335. position: fixed;
  1336. left: 0;
  1337. right: 0;
  1338. bottom: 0;
  1339. background: #fff;
  1340. border-radius: 24rpx 24rpx 0 0;
  1341. z-index: 101;
  1342. height: 750rpx;
  1343. .modal-header {
  1344. display: flex;
  1345. justify-content: space-between;
  1346. align-items: center;
  1347. padding: 32rpx 32rpx 0 32rpx;
  1348. font-size: 30rpx;
  1349. .cancel-btn {
  1350. color: #888;
  1351. font-size: 32rpx;
  1352. }
  1353. .modal-title {
  1354. color: #111111;
  1355. font-size: 36rpx;
  1356. }
  1357. .confirm-btn {
  1358. color: #996e5f;
  1359. font-size: 32rpx;
  1360. }
  1361. }
  1362. .modal-body {
  1363. padding: 50rpx;
  1364. .info-row {
  1365. display: flex;
  1366. margin-bottom: 24rpx;
  1367. font-size: 28rpx;
  1368. padding: 0 20rpx;
  1369. .label {
  1370. color: #111111;
  1371. width: 200rpx;
  1372. font-size: 32rpx;
  1373. text-align-last: justify;
  1374. }
  1375. .value {
  1376. text-align: right;
  1377. width: 65%;
  1378. color: #111111;
  1379. font-size: 32rpx;
  1380. }
  1381. }
  1382. .input-row {
  1383. display: flex;
  1384. align-items: center;
  1385. margin-top: 32rpx;
  1386. border-radius: 40rpx;
  1387. background: #f7f7f7;
  1388. padding: 0 24rpx;
  1389. height: 80rpx;
  1390. .input {
  1391. text-align: right;
  1392. flex: 1;
  1393. border: none;
  1394. background: transparent;
  1395. font-size: 28rpx;
  1396. color: #333;
  1397. }
  1398. }
  1399. .funChoice {
  1400. .funItem {
  1401. .simple-radio {
  1402. display: flex;
  1403. align-items: center;
  1404. padding: 20rpx 0;
  1405. }
  1406. }
  1407. }
  1408. }
  1409. }
  1410. // 分享弹窗样式
  1411. .modal-mask {
  1412. position: fixed;
  1413. top: 0;
  1414. left: 0;
  1415. right: 0;
  1416. bottom: 0;
  1417. background: rgba(0, 0, 0, 0.5);
  1418. display: flex;
  1419. justify-content: center;
  1420. align-items: center;
  1421. z-index: 333;
  1422. .modal-container {
  1423. width: 80%;
  1424. background: #fff;
  1425. border-radius: 16rpx;
  1426. // overflow: hidden;
  1427. animation: fadeIn 0.3s;
  1428. .modal-header {
  1429. padding: 30rpx;
  1430. text-align: center;
  1431. border-bottom: 1rpx solid #f5f5f5;
  1432. .title {
  1433. font-size: 36rpx;
  1434. display: block;
  1435. margin-bottom: 10rpx;
  1436. }
  1437. }
  1438. .modal-buttons {
  1439. display: flex;
  1440. flex-direction: column;
  1441. padding: 20rpx;
  1442. .btn {
  1443. flex: 1;
  1444. height: 90rpx;
  1445. margin: 15rpx 0;
  1446. border-radius: 45rpx;
  1447. display: flex;
  1448. align-items: center;
  1449. justify-content: center;
  1450. font-size: 32rpx;
  1451. border: none;
  1452. background: none;
  1453. position: relative;
  1454. }
  1455. .btn-icon {
  1456. width: 40rpx;
  1457. height: 40rpx;
  1458. margin-right: 15rpx;
  1459. }
  1460. .phone-btn {
  1461. background: linear-gradient(
  1462. 105.95deg,
  1463. #ba978a 0%,
  1464. #a27867 100%
  1465. );
  1466. color: white;
  1467. }
  1468. .link-btn {
  1469. background: linear-gradient(
  1470. 105.95deg,
  1471. #a27867 0%,
  1472. #74483d 100%
  1473. );
  1474. color: white;
  1475. }
  1476. }
  1477. }
  1478. }
  1479. .echartsClass {
  1480. position: absolute;
  1481. width: 650rpx;
  1482. height: 600rpx;
  1483. top: -8%;
  1484. left: -37%;
  1485. transform: translate(50%, 50%);
  1486. background: #ffffff;
  1487. .closePng {
  1488. width: 40rpx;
  1489. height: 40rpx;
  1490. position: fixed;
  1491. top: 10rpx;
  1492. right: 10rpx;
  1493. z-index: 333;
  1494. }
  1495. }
  1496. }
  1497. </style>