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