alarModel.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <template>
  2. <!-- 告警弹窗 -->
  3. <view>
  4. <view class="mask" v-if="alarmModel"></view>
  5. <view class="alarm-modal" v-if="alarmModel">
  6. <view class="alarm">
  7. <!-- <image src="../../images/alram.png" mode="" /> -->
  8. <image src="../../static/alarm.png"></image>
  9. </view>
  10. <view class="alarm-header">
  11. <image src="../../static/alarm_event.png" mode="" />
  12. </view>
  13. <view class="nowTime">
  14. {{ nowTime }}
  15. </view>
  16. <view class="alarm-info">
  17. <text style="color: #ff6d6d">{{ devName }}</text>
  18. 检测到可能发生跌倒事件,请立即处理!
  19. </view>
  20. <view class="backImg">
  21. <image src="../../static/actionRed.png" mode="" />
  22. </view>
  23. <view class="alarm-bottom">
  24. <template v-if="voipFlag">
  25. <view
  26. class="alarm-voice"
  27. v-if="authorizeFlag"
  28. @click="gotoCallPage"
  29. >
  30. 语音确认
  31. </view>
  32. <view class="alarm-voice" v-else @click="authorizeIot">
  33. 语音确认
  34. </view>
  35. </template>
  36. <view class="alarm-handle" @click="handleAlarm()">
  37. 已知晓
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import config from "../../data/config.js";
  45. import mqtt from "../../utils/mqtt";
  46. import {
  47. getSnTicket,
  48. authorize,
  49. getDeviceVoIPList,
  50. getContactList,
  51. getUser,
  52. } from "../../api/index.js";
  53. import {
  54. CameraStatus,
  55. AuthorizeStatus,
  56. CallPagePlugin,
  57. isWmpf,
  58. } from "../../const.js";
  59. import { AsyncValue } from "../../utils";
  60. const wmpfVoip = requirePlugin("wmpf-voip").default;
  61. const envVersion = wx.getAccountInfoSync().miniProgram.envVersion;
  62. const apiTypes = ["校园模式", "硬件模式", "呼叫安卓", "校园+硬件模式"];
  63. const apiTypesWMPF = [1, 0, 3];
  64. const apiTypesWechat = [2];
  65. const getEnvVersionForVoip = (function () {
  66. const _map = {
  67. develop: "developer",
  68. trial: "trial",
  69. release: "formal",
  70. };
  71. return () => {
  72. return _map[envVersion];
  73. };
  74. })();
  75. export default {
  76. comments: {
  77. name: "alarModel",
  78. },
  79. props: {
  80. clientIdProp: {
  81. default: null,
  82. },
  83. },
  84. data() {
  85. return {
  86. alarmModel: false,
  87. eventListId: "",
  88. nowTime: "",
  89. devName: "",
  90. authorizeFlag: true,
  91. clientId: "",
  92. mqttClientTwo: "",
  93. // voip相关
  94. isWmpf: isWmpf,
  95. name: "用户",
  96. voipDevices: [],
  97. sn: "",
  98. isShowPopUp: false,
  99. contactList: [],
  100. isWmpf,
  101. envVersion,
  102. apiTypesValid: (isWmpf ? apiTypesWMPF : apiTypesWechat).map(
  103. (id) => apiTypes[id]
  104. ),
  105. apiTypeIndex: 0,
  106. currentIndex: 0,
  107. voipFlag: "",
  108. mqttClientFlag: false,
  109. inactivityTimer: "",
  110. };
  111. },
  112. computed: {},
  113. methods: {
  114. authorizeIot() {
  115. this.hanledList("Voice");
  116. this.sn = this.clientId;
  117. this.alarmModel = false;
  118. // const { name, sn, voipDevices } = this;
  119. const name = this.name;
  120. const sn = this.clientId;
  121. const voipDevices = this.voipDevices;
  122. if (!name || name.length === 0 || !sn || sn.length === 0) {
  123. wx.showToast({
  124. title: "请输入授权人名称和设备clientId",
  125. icon: "none",
  126. });
  127. return;
  128. }
  129. const { modelId } = config;
  130. console.log(sn, modelId, 77777);
  131. const { snTicket } = getSnTicket({
  132. sn,
  133. modelId,
  134. });
  135. console.log(snTicket, sn, 99999999);
  136. var that = this;
  137. wx.requestDeviceVoIP({
  138. sn,
  139. snTicket,
  140. modelId,
  141. deviceName: sn,
  142. async success(res) {
  143. console.log(`requestDeviceVoIP`, res);
  144. await authorize({
  145. sn,
  146. name,
  147. });
  148. wx.showToast({
  149. title: "授权成功",
  150. icon: "none",
  151. });
  152. const key = `voipDevices[${voipDevices.length}]`;
  153. // that.setData({
  154. // [key]: {
  155. // sn,
  156. // modelId,
  157. // status: 1,
  158. // },
  159. // });
  160. that.voipDevices[voipDevices.length] = {
  161. sn,
  162. modelId,
  163. status: 1,
  164. };
  165. that.sn = sn;
  166. that.modelId = modelId;
  167. that.status = 1;
  168. that.gotoCallPage();
  169. },
  170. fail(err) {
  171. console.error(`requestDeviceVoIP failOne`, err);
  172. wx.showToast({
  173. title: "授权失败, 请前往设置页开启",
  174. icon: "none",
  175. });
  176. },
  177. });
  178. },
  179. handleAlarm() {
  180. this.hanledList("noVoice");
  181. this.alarmModel = false;
  182. },
  183. // voip相关方法
  184. async getVoipDevices() {
  185. const { list } = await getDeviceVoIPList();
  186. console.log("getDeviceVoIPList:", list);
  187. if (list && list.length > 0) {
  188. const authorizeFlag = list.some(
  189. (item) => item.sn === this.clientId
  190. );
  191. console.log("authorizeFlag:", list, authorizeFlag);
  192. this.authorizeFlag = authorizeFlag;
  193. }
  194. if (!list || list.length === 0) {
  195. this.authorizeFlag = false;
  196. }
  197. if (typeof list === "object") {
  198. this.voipDevices = list;
  199. }
  200. },
  201. async authorizeIot() {
  202. this.sn = this.clientId;
  203. // this.alarmModel = false;
  204. const name = this.name;
  205. const sn = this.sn;
  206. const voipDevices = this.voipDevices;
  207. console.log(name, sn, voipDevices, 9999999999999);
  208. // const { name, sn, voipDevices } = this;
  209. if (!name || name.length === 0 || !sn || sn.length === 0) {
  210. wx.showToast({
  211. title: "请输入授权人名称和设备dev_id",
  212. icon: "none",
  213. });
  214. return;
  215. }
  216. const { modelId } = config;
  217. console.log(sn, modelId, 77777);
  218. const { snTicket } = await getSnTicket({
  219. sn,
  220. modelId,
  221. });
  222. console.log(snTicket, sn, 99999999);
  223. var that = this;
  224. wx.requestDeviceVoIP({
  225. sn,
  226. snTicket,
  227. modelId,
  228. deviceName: sn,
  229. async success(res) {
  230. console.log(`requestDeviceVoIP`, res);
  231. await authorize({
  232. sn,
  233. name,
  234. });
  235. wx.showToast({
  236. title: "授权成功",
  237. icon: "none",
  238. });
  239. const key = `voipDevices[${voipDevices.length}]`;
  240. // that.key = {
  241. // sn,
  242. // modelId,
  243. // status: 1,
  244. // };
  245. that.voipDevices[voipDevices.length] = {
  246. sn,
  247. modelId,
  248. status: 1,
  249. };
  250. that.gotoCallPage();
  251. },
  252. fail(err) {
  253. console.error(`requestDeviceVoIP failTwo`, err);
  254. wx.showToast({
  255. title: "授权失败, 请前往设置页开启",
  256. icon: "none",
  257. });
  258. },
  259. });
  260. },
  261. async gotoCallPage() {
  262. this.hanledList("Voice");
  263. wx.showToast({
  264. title: "通话加载中...",
  265. icon: "loading",
  266. duration: 2000, //持续的时间
  267. });
  268. // this.alarmModel = false;
  269. this._caller = new AsyncValue();
  270. let options = {
  271. sn: this.sn,
  272. };
  273. await this.getSelf(options);
  274. await this.getContactList();
  275. let voiceCan = {
  276. sn: this.sn,
  277. idx: 1,
  278. type: "voice",
  279. };
  280. await this.call(voiceCan);
  281. },
  282. async getSelf(options = {}) {
  283. if (!this._caller.isPending()) {
  284. return;
  285. }
  286. if (isWmpf) {
  287. const { sn } = options;
  288. if (sn) {
  289. config.sn = sn;
  290. this.sn = sn;
  291. }
  292. this._caller.set({
  293. id: config.sn,
  294. name: config.sn,
  295. });
  296. } else {
  297. try {
  298. const resp = await getUser();
  299. console.log(`getUser`, resp);
  300. this._caller.set({
  301. id: resp.openid,
  302. name: resp.name,
  303. });
  304. } catch (error) {
  305. console.error(`getself error`, error);
  306. }
  307. }
  308. },
  309. async getContactList() {
  310. wx.showLoading();
  311. try {
  312. let contactList = [];
  313. const raw_contactList = await getContactList({
  314. sn: isWmpf ? config.sn : null,
  315. });
  316. console.log(`raw_contactList`, raw_contactList);
  317. if (!isWmpf) {
  318. // 微信呼叫设备
  319. const { list } = await getDeviceVoIPList();
  320. contactList = raw_contactList.map(({ sn, pushToken }) => {
  321. let canCall = true;
  322. if (typeof list === "object") {
  323. const canCallList = list
  324. .filter(
  325. (item) =>
  326. item.status === AuthorizeStatus.ACCEPT
  327. )
  328. .map((item) => item.sn);
  329. canCall = canCallList.includes(sn);
  330. }
  331. return {
  332. id: sn,
  333. name: sn,
  334. canCall,
  335. ticket: pushToken,
  336. };
  337. });
  338. } else {
  339. // 设备呼叫微信
  340. const raw_contactList = await getContactList({
  341. sn: config.sn,
  342. });
  343. console.log(`raw_contactList: 业务方存储`, raw_contactList);
  344. if (raw_contactList.length > 0) {
  345. const canCallList = (
  346. await wmpfVoip.getIotBindContactList({
  347. sn: config.sn,
  348. model_id: config.modelId,
  349. openid_list: raw_contactList.map(
  350. (item) => item.openid
  351. ),
  352. })
  353. ).contact_list
  354. .filter(
  355. (item) => item.status === AuthorizeStatus.ACCEPT
  356. )
  357. .map((item) => item.openid);
  358. console.log(`canCallList: 微信授权存储`, canCallList);
  359. contactList = raw_contactList.map((item) => {
  360. const canCall = canCallList.includes(item.openid);
  361. return {
  362. id: item.openid,
  363. name: item.name,
  364. canCall,
  365. ticket: "",
  366. };
  367. });
  368. }
  369. }
  370. console.log(`getContactList: `, contactList);
  371. this.contactList = contactList;
  372. } catch (error) {
  373. console.error(`getContactList error: `, error);
  374. }
  375. wx.hideLoading();
  376. },
  377. async call(e) {
  378. console.log(`call`, "走到了call方法");
  379. const { sn, idx, type: roomtype } = e;
  380. // console.log(e, this.contactList, 888870);
  381. const target = this.contactList.find((item) => item.id === sn);
  382. console.log("走到了这里了。。。。1", target);
  383. // const target = this.contactList[idx];
  384. const apiTypeName = this.apiTypesValid[this.apiTypeIndex];
  385. const businessType = apiTypes.indexOf(apiTypeName);
  386. try {
  387. if (!target.canCall) {
  388. wx.showToast({
  389. title: "用户未授权或设备不在线",
  390. icon: "none",
  391. });
  392. throw Error("target can not call");
  393. }
  394. console.log("走到了这里了。。。。2");
  395. const _caller = await this._caller.get();
  396. console.log(`caller: `, _caller);
  397. console.log(`listener: `, target);
  398. const { roomId } = await wmpfVoip.callDevice({
  399. roomType: "voice",
  400. sn: sn,
  401. modelId: "iFJ2BNIQcd9WlUIaT7_l4Q",
  402. nickName: "xx",
  403. isCloud: true,
  404. payload: "radar-power.cn",
  405. });
  406. wx.redirectTo({
  407. url: CallPagePlugin,
  408. });
  409. } catch (error) {
  410. console.log(`>>>>>>>>>>>>>>>>>>>>>>>>>>>`);
  411. console.error(`call error`, error);
  412. }
  413. },
  414. // mqtt相关方法
  415. connectMQTTwo() {
  416. if (this.mqttClientFlag) {
  417. console.log("主题已订阅");
  418. return;
  419. }
  420. const THRESHOLD = 2;
  421. const params = {
  422. keepalive: 6000,
  423. clean: true,
  424. connectTimeout: 30 * 1000,
  425. clientId:
  426. "wx_mqtt_" + Math.random().toString(16).substring(2, 8),
  427. username: "admin",
  428. password: "public",
  429. // 微信小程序特定配置
  430. wsOptions: {
  431. WebSocket: function (url) {
  432. return wx.connectSocket({
  433. url: url,
  434. header: {
  435. "content-type": "application/json",
  436. },
  437. protocols: ["mqtt"],
  438. });
  439. },
  440. },
  441. reconnectPeriod: 0,
  442. rejectUnauthorized: false, // 仅开发环境使用,生产环境应设为true或移除
  443. };
  444. let client = "";
  445. let selectedService = uni.getStorageSync("sercviceChoice");
  446. if (!selectedService || selectedService == "aloneServe") {
  447. if (__wxConfig.envVersion == "develop") {
  448. client = mqtt.connect(
  449. "wxs://cmd.radar-power.com:8084/mqtt",
  450. params
  451. );
  452. // client = mqtt.connect(
  453. // "wxs://radar-power.cn:8084/mqtt",
  454. // params
  455. // );
  456. }
  457. if (__wxConfig.envVersion == "trial") {
  458. client = mqtt.connect(
  459. "wxs://cmd.radar-power.com:8084/mqtt",
  460. params
  461. );
  462. }
  463. }
  464. // 存储client引用以便后续操作
  465. this.mqttClientTwo = client;
  466. client.on("connect", () => {
  467. console.log("MQTT连接成功");
  468. this.mqttClientFlag = true;
  469. let userId = uni.getStorageSync("userId");
  470. client.subscribe(`/mps/wx_${userId}/notice`, (err) => {
  471. if (err) {
  472. console.error("订阅失败", err);
  473. } else {
  474. console.log(
  475. `成功订阅设备主题: /mps/wx_${userId}/notice`
  476. );
  477. }
  478. });
  479. console.log(this.clientIdProp);
  480. // if (this.clientIdProp !== null) {
  481. // client.subscribe(
  482. // `/dev/${this.clientIdProp}/dsp_data`,
  483. // (err) => {
  484. // if (err) {
  485. // console.error("订阅clientId失败", err);
  486. // } else {
  487. // console.log(
  488. // `成功订阅设备主题: /dev/${this.clientIdProp}/dsp_data`
  489. // );
  490. // }
  491. // }
  492. // );
  493. // }
  494. });
  495. client.on("disconnect", () => {
  496. console.log("MQTT不在连接");
  497. });
  498. client.on("error", (err) => {
  499. this.mqttClientFlag = false;
  500. setTimeout(() => {
  501. this.connectMQTTwo();
  502. }, 1000);
  503. });
  504. client.on("reconnect", () => {});
  505. client.on("close", () => {});
  506. client.on("message", (topic, message) => {
  507. console.log(JSON.parse(message.toString()), "8870");
  508. // 处理点位消息
  509. if (this.clientIdProp !== null) {
  510. this.handleMessage(topic, message, this.clientIdProp);
  511. }
  512. let userId = uni.getStorageSync("userId");
  513. const noticeMatch = /^\/mps\/wx_(.+)\/notice$/;
  514. const match = topic.match(noticeMatch);
  515. if (!match) return;
  516. this.alarmModel = true;
  517. const data = JSON.parse(message.toString());
  518. this.clientId = data.clientId;
  519. this.devName = data.devName;
  520. this.sn = data.clientId;
  521. this.eventListId = data.eventListId;
  522. this.getVoipAuthor(this.clientId, userId);
  523. console.log(data, topic, "接收到消息222:");
  524. console.log(
  525. "接收到消息:",
  526. this.clientId,
  527. this.devName,
  528. this.sn,
  529. this.eventListId,
  530. data
  531. );
  532. const now = new Date();
  533. const year = now.getFullYear();
  534. const month = (now.getMonth() + 1).toString().padStart(2, "0");
  535. const day = now.getDate().toString().padStart(2, "0");
  536. const hours = now.getHours().toString().padStart(2, "0");
  537. const minutes = now.getMinutes().toString().padStart(2, "0");
  538. const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}`;
  539. this.nowTime = formattedTime;
  540. console.log("isWmpf:", isWmpf);
  541. if (!isWmpf) {
  542. console.log("isWmpf:", isWmpf);
  543. this.getVoipDevices();
  544. }
  545. console.log("接收到消息:", topic, data);
  546. });
  547. },
  548. hanledList(type) {
  549. this.$http
  550. .get(`wap/event/handleEvent`, {
  551. eventListId: this.eventListId,
  552. })
  553. .then((res) => {
  554. if (res.data.code == 200) {
  555. if (type === "noVoice") {
  556. uni.showToast({
  557. title: "已处理",
  558. icon: "success",
  559. duration: 1500,
  560. });
  561. }
  562. } else {
  563. uni.showToast({
  564. title: "处理失败",
  565. icon: "none",
  566. duration: 1500,
  567. });
  568. }
  569. });
  570. },
  571. closemqtt() {
  572. this.mqttClientFlag = false;
  573. if (this.mqttClientTwo) {
  574. this.mqttClientTwo.end();
  575. this.mqttClientTwo = null;
  576. console.log("MQTT连接已断开");
  577. }
  578. },
  579. getVoipAuthor(clientId, userId) {
  580. console.log(clientId, userId);
  581. this.$http
  582. .post(
  583. "wap/share/queryUserVoipPermission",
  584. {
  585. userId: userId,
  586. clientId: clientId,
  587. },
  588. {
  589. header: {
  590. "Content-Type": "application/json;charset=UTF-8",
  591. },
  592. }
  593. )
  594. .then((res) => {
  595. if (res.data.data) {
  596. console.log(res.data.data, 9999);
  597. if (res.data.data.voipFlag === 0) {
  598. this.voipFlag = true;
  599. } else {
  600. this.voipFlag = false;
  601. }
  602. }
  603. });
  604. },
  605. // 处理点位消息
  606. handleMessage(topic, message, clientId) {
  607. // 清除不活动定时器
  608. clearTimeout(this.inactivityTimer);
  609. this.inactivityTimer = setTimeout(() => {
  610. this.targetPoints = {};
  611. console.log("长时间没有点位,清除数据");
  612. this.sendChange();
  613. this.$emit("sendHealth", 0);
  614. }, 1500);
  615. // 验证topic格式
  616. const match = topic.match(/^\/dev\/(.+)\/dsp_data$/);
  617. if (!match || match[1] !== clientId) return;
  618. try {
  619. const data = JSON.parse(message.toString());
  620. if (data.health) {
  621. if (
  622. data.health.breath_rpm ||
  623. data.health.breath_rpm === 0
  624. ) {
  625. this.$emit(
  626. "sendHealth",
  627. Math.floor(data.health.breath_rpm)
  628. );
  629. } else {
  630. this.$emit("sendHealth", 0);
  631. }
  632. }
  633. this.processTrackerData(data.tracker_targets);
  634. } catch (e) {
  635. console.error("MQTT消息解析失败", e);
  636. }
  637. },
  638. processTrackerData(arr) {
  639. if (Array.isArray(arr) && arr.length > 0 && Array.isArray(arr[0])) {
  640. this.targetPoints = {};
  641. const currentIds = new Set();
  642. const newTargetPoints = {};
  643. // 处理每个追踪目标
  644. arr.forEach((item) => {
  645. if (!Array.isArray(item) || item.length < 4) return;
  646. const [x, y, z, id] = item;
  647. currentIds.add(id.toString());
  648. // 处理新点或更新现有点
  649. if (!this.targetPoints[id]) {
  650. newTargetPoints[id] = this.createNewTargetPoint(
  651. x,
  652. y,
  653. z,
  654. id
  655. );
  656. } else {
  657. newTargetPoints[id] = this.updateExistingTargetPoint(
  658. this.targetPoints[id],
  659. x,
  660. y,
  661. z,
  662. 2
  663. );
  664. }
  665. });
  666. // 移除不存在的点
  667. Object.keys(this.targetPoints).forEach((id) => {
  668. if (!currentIds.has(id)) {
  669. delete this.targetPoints[id];
  670. }
  671. });
  672. // 更新目标点
  673. this.targetPoints = {
  674. ...this.targetPoints,
  675. ...newTargetPoints,
  676. };
  677. if (Array.isArray(this.targetPoints)) {
  678. this.targetPoints = this.targetPoints.filter(
  679. (item) => item !== null && item !== undefined
  680. );
  681. }
  682. console.log("当前目标点11111", this.targetPoints);
  683. this.sendChange();
  684. }
  685. },
  686. sendChange() {
  687. this.$emit("sendChange", this.targetPoints);
  688. },
  689. // 创建新目标点
  690. createNewTargetPoint(x, y, z, id) {
  691. return {
  692. x,
  693. y,
  694. z,
  695. id,
  696. displayX: x,
  697. displayY: y,
  698. lastX: x,
  699. lastY: y,
  700. };
  701. },
  702. // 更新现有目标点
  703. updateExistingTargetPoint(existingPoint, x, y, z, THRESHOLD) {
  704. const dx = x - existingPoint.lastX;
  705. const dy = y - existingPoint.lastY;
  706. const distance = Math.sqrt(dx * dx + dy * dy);
  707. if (distance > THRESHOLD) {
  708. return {
  709. ...existingPoint,
  710. x,
  711. y,
  712. z,
  713. lastX: x,
  714. lastY: y,
  715. displayX: x,
  716. displayY: y,
  717. };
  718. }
  719. return existingPoint;
  720. },
  721. },
  722. mounted() {
  723. this.connectMQTTwo();
  724. },
  725. beforeDestroy() {
  726. this.closemqtt();
  727. },
  728. };
  729. </script>
  730. <style lang="less" scoped>
  731. /* 弹窗部分样式 */
  732. .mask {
  733. position: fixed;
  734. left: 0;
  735. top: 0;
  736. right: 0;
  737. bottom: 0;
  738. background: rgba(0, 0, 0, 0.3);
  739. z-index: 100;
  740. }
  741. .alarm-modal {
  742. width: 675rpx;
  743. height: 1100rpx;
  744. position: fixed;
  745. top: 50%;
  746. left: 50%;
  747. transform: translate(-50%, -50%);
  748. background: linear-gradient(180deg, #ffdfdf 0%, #ffffff 30.3%);
  749. border-radius: 37rpx 37rpx;
  750. z-index: 103;
  751. padding: 50rpx 55rpx;
  752. box-sizing: border-box;
  753. .alarm-header image {
  754. width: 315rpx;
  755. height: 40rpx;
  756. }
  757. .alarm image {
  758. position: fixed;
  759. top: 0;
  760. right: 0;
  761. width: 180rpx;
  762. height: 175rpx;
  763. }
  764. .nowTime {
  765. width: 270rpx;
  766. margin-top: 20rpx;
  767. text-align: center;
  768. align-items: center;
  769. line-height: 100%;
  770. background: #fed5d5;
  771. color: #111111;
  772. font-size: 28rpx;
  773. border-radius: 10rpx;
  774. padding: 5rpx 5rpx;
  775. }
  776. .alarm-info {
  777. margin-top: 40rpx;
  778. color: #111111;
  779. font-size: 28rpx;
  780. letter-spacing: 4%;
  781. }
  782. .backImg {
  783. margin: 37rpx auto;
  784. width: 400rpx;
  785. height: 600rpx;
  786. background-color: #fff;
  787. border: 12rpx solid #333333;
  788. background-image: url(http://jkld.radar-power.com//uploadFiles/framework/file/20250620/toilet_bg.png);
  789. background-repeat: no-repeat;
  790. background-position: center;
  791. image {
  792. position: absolute;
  793. top: 50%;
  794. left: 50%;
  795. width: 60rpx;
  796. height: 60rpx;
  797. }
  798. }
  799. .alarm-bottom {
  800. display: flex;
  801. justify-content: flex-end;
  802. align-items: center;
  803. .alarm-voice {
  804. width: 185rpx;
  805. height: 85rpx;
  806. background: #f3e2dd;
  807. border-radius: 28rpx;
  808. color: #111111;
  809. font-size: 32rpx;
  810. text-align: center;
  811. line-height: 85rpx;
  812. }
  813. .alarm-handle {
  814. margin-left: 20rpx;
  815. width: 185rpx;
  816. height: 85rpx;
  817. background: linear-gradient(114.23deg, #a27867 0%, #74483d 100%);
  818. border-radius: 28rpx;
  819. box-shadow: 0rpx 4.69rpx 18.75rpx rgba(72, 41, 29, 0.15),
  820. 0rpx 9.38rpx 9.38rpx rgba(154, 132, 89, 0.2),
  821. 0rpx -4.69rpx 28.13rpx 4.69rpx #a16647 inset;
  822. color: #ffffff;
  823. font-size: 32rpx;
  824. text-align: center;
  825. line-height: 85rpx;
  826. }
  827. }
  828. }
  829. </style>