previewPicture.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <template>
  2. <div class="pop-up-main">
  3. <div class="paln-box">
  4. <div
  5. class="movableItem"
  6. :style="{ width: width, height: height }"
  7. @mousewheel="rollImg($event)"
  8. @mousedown="drag($event, 1)"
  9. ref="bigImage"
  10. >
  11. <!-- 图片不可选中 或不可拖拽到新标签打开-->
  12. <slot
  13. name="svg"
  14. oncontextmenu="return false;"
  15. onselectstart="return false;"
  16. draggable="false"
  17. ></slot>
  18. <template v-if="isEdit && iconWidth">
  19. <img
  20. ref="signImage"
  21. :src="iconImgUrl"
  22. @mousedown="dragSign($event, key)"
  23. v-for="(item, key) in equipment"
  24. :key="key"
  25. :style="{
  26. top: equipment[key].top + '%',
  27. left: equipment[key].left + '%',
  28. width: iconWidth,
  29. height: iconHeight,
  30. }"
  31. class="equipment"
  32. />
  33. </template>
  34. <el-popover
  35. width="200"
  36. placement="bottom-start"
  37. trigger="hover"
  38. :close-delay="100"
  39. content="暂无描述"
  40. v-else-if="!isEdit && iconWidth && arrIcon.length == equipment.length"
  41. v-for="(item, key) in equipment"
  42. :key="key"
  43. popper-class="preview-popover"
  44. >
  45. <!-- &&arrIcon.length==equipment.length -->
  46. <template>
  47. <div v-if="equipment[key].describe" class="describe">
  48. <p class="describe-top">
  49. {{ equipment[key].describe.deviceName }}
  50. </p>
  51. <p class="describe-center">
  52. {{ equipment[key].describe.remark }}
  53. </p>
  54. <p class="describe-bottom">
  55. {{ equipment[key].describe.location }}
  56. </p>
  57. </div>
  58. </template>
  59. <!-- <img oncontextmenu="return false;" onselectstart="return false;" draggable="false" slot="reference"
  60. ref="signImage" :src="$baseUrl + equipment[key].iconImgUrl"
  61. :style="{top:equipment[key].top+'%',left:equipment[key].left+'%',width:arrIcon[key].iconWidth,height:arrIcon[key].iconHeight}"
  62. class="equipment" /> -->
  63. </el-popover>
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. export default {
  70. props: {
  71. equipment: {
  72. type: Array,
  73. default: () => {
  74. return [
  75. {
  76. iconImgUrl: "",
  77. top: 0,
  78. left: 0,
  79. },
  80. ];
  81. },
  82. },
  83. isEdit: {
  84. default: false,
  85. },
  86. imgUrl: {},
  87. },
  88. data() {
  89. return {
  90. // 定时器
  91. timer: "",
  92. // 图片加载失败
  93. imgOnerror: false,
  94. imgIndex: 0,
  95. isChange: true,
  96. // 图片显示默认大小
  97. width: "1600px",
  98. height: "800px",
  99. // 可缩小倍数,为空则可无限缩小
  100. minification: 3,
  101. // 可放大倍数 为空则可无限放大
  102. magnification: "",
  103. bigMaxWidth: 1600,
  104. bigMaxHeight: 800,
  105. // 小图标信息
  106. iconImgUrl: "",
  107. iconWidth: "",
  108. // 存储每个小图标处理好的宽高
  109. iconHeight: "",
  110. arrIcon: [],
  111. iconMaxWidth: 32,
  112. iconMaxHeight: 32,
  113. tog: 1,
  114. };
  115. },
  116. methods: {
  117. // 获取图片大小
  118. getImgInfo(
  119. imgUrl,
  120. MaxWidth,
  121. MaxHeight,
  122. StrWidth,
  123. StrHeight,
  124. Array = false,
  125. arr,
  126. num = 0
  127. ) {
  128. var img = new Image();
  129. // img.src = imgUrl;
  130. img = document.getElementsByClassName("svg");
  131. let _this = this;
  132. img.onerror = () => {
  133. // console.log("加载失败!!", _this.arrIcon.length);
  134. // console.log(imgUrl, MaxWidth, MaxHeight, StrWidth, StrHeight);
  135. _this.imgOnerror = true;
  136. _this.imgIndex =
  137. _this.arrIcon.length - 1 < 0 ? 0 : _this.arrIcon.length - 1;
  138. this.timer = setTimeout(() => {
  139. if (num <= 5) {
  140. _this.getImgInfo(
  141. imgUrl,
  142. MaxWidth,
  143. MaxHeight,
  144. StrWidth,
  145. StrHeight,
  146. Array,
  147. arr,
  148. num + 1
  149. );
  150. }
  151. clearInterval(this.timer);
  152. }, 2000);
  153. };
  154. img.onload = function (e) {
  155. // 显示时 初始 最大宽度
  156. let maxWidth = MaxWidth;
  157. // 显示时 初始 最大高度
  158. let maxHeight = MaxHeight;
  159. if (
  160. e.path[0].naturalWidth <= maxWidth &&
  161. e.path[0].naturalHeight <= maxHeight
  162. ) {
  163. _this[StrWidth] = e.path[0].naturalWidth + "px";
  164. _this[StrHeight] = e.path[0].naturalHeight + "px";
  165. } else {
  166. _this[StrWidth] = e.path[0].naturalWidth + "px";
  167. _this[StrHeight] = e.path[0].naturalHeight + "px";
  168. if (
  169. e.path[0].naturalWidth > maxWidth &&
  170. e.path[0].naturalHeight <= maxHeight
  171. ) {
  172. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  173. _this[StrWidth] = "1600px";
  174. _this[StrHeight] = maxWidth / ratio + "px";
  175. } else if (
  176. e.path[0].naturalWidth <= maxWidth &&
  177. e.path[0].naturalHeight > maxHeight
  178. ) {
  179. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  180. _this[StrWidth] = maxHeight * ratio + "px";
  181. _this[StrHeight] = "800px";
  182. } else if (
  183. e.path[0].naturalWidth > maxWidth &&
  184. e.path[0].naturalHeight > maxHeight
  185. ) {
  186. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  187. let w = maxWidth;
  188. let h = w / ratio;
  189. if (h > maxHeight) {
  190. let ratio2 = w / h;
  191. h = maxHeight;
  192. w = h * ratio2;
  193. }
  194. _this[StrWidth] = w + "px";
  195. _this[StrHeight] = h + "px";
  196. }
  197. }
  198. if (Array) {
  199. _this[arr].push({
  200. iconWidth: _this[StrWidth],
  201. iconHeight: _this[StrHeight],
  202. });
  203. // console.log(
  204. // "tow#################################arrIcon",
  205. // _this[arr].length
  206. // );
  207. }
  208. // _this[StrWidth] = `${e.path[0].naturalWidth}px`;
  209. // _this[StrHeight] = `${e.path[0].naturalHeight}px`;
  210. // vm.$set(vm.imgInfo, "width", img.width);
  211. // vm.$set(vm.imgInfo, "height", img.height);
  212. // console.log("打印图片信息", imgUrl, _this[StrWidth], _this[StrHeight]); // 打印图片信息
  213. // console.log("打印图片信息", e.path[0].naturalHeight); // 打印图片信息
  214. // console.log("打印图片信息", e); // 打印图片信息
  215. // console.log("打印图片信息this.width", _this[StrWidth]); // 打印图片信息
  216. // console.log("打印图片信息this.height", _this[StrHeight]); // 打印图片信息
  217. };
  218. },
  219. // 缩放
  220. rollImg() {
  221. var that = this;
  222. // var oImg = document.getElementsByClassName("movableItem")[0];
  223. var oImg = this.$refs.bigImage;
  224. // console.log(
  225. // "length",
  226. // document.getElementsByClassName("movableItem").length
  227. // );
  228. // console.log("oImg", oImg);
  229. var _this = this;
  230. function fnWheel(obj, fncc) {
  231. obj.onmousewheel = fn;
  232. if (obj.addEventListener) {
  233. obj.addEventListener("DOMMouseScroll", fn, false);
  234. }
  235. function fn(ev) {
  236. var oEvent = ev || window.event;
  237. var down = true;
  238. if (oEvent.detail) {
  239. down = oEvent.detail > 0;
  240. } else {
  241. down = oEvent.wheelDelta < 0;
  242. }
  243. if (fncc) {
  244. fncc.call(this, down, oEvent);
  245. }
  246. if (oEvent.preventDefault) {
  247. oEvent.preventDefault();
  248. }
  249. return false;
  250. }
  251. }
  252. fnWheel(oImg, function (down, oEvent) {
  253. var oldWidth = this.offsetWidth;
  254. var oldHeight = this.offsetHeight;
  255. var oldLeft = this.offsetLeft;
  256. var oldTop = this.offsetTop;
  257. var parent = oEvent.path[2];
  258. // 获取父元素距离页面可视区域的位置
  259. var parentLeft = parent.getBoundingClientRect().left;
  260. var parentTop = parent.getBoundingClientRect().top;
  261. // 比例 = (点击位置距离可视窗口位置 - 父元素距离可视窗口位置 - 相对定位的left)/ 本身宽度
  262. var scaleX = (oEvent.clientX - parentLeft - oldLeft) / oldWidth; //比例
  263. var scaleY = (oEvent.clientY - parentTop - oldTop) / oldHeight;
  264. let nowWidth = this.style.width.split("p")[0];
  265. let initWidth = _this.width.split("p")[0];
  266. let initHeight = _this.height.split("p")[0];
  267. let miniFlag = true;
  268. let magniFlag = true;
  269. if (_this.minification) {
  270. // 限制缩小范围
  271. if (nowWidth <= parseInt(initWidth / _this.minification)) {
  272. miniFlag = false;
  273. // console.log("限制缩小范围");
  274. // console.log(
  275. // "限制缩小范围",
  276. // nowWidth,
  277. // parseInt(initWidth / _this.minification)
  278. // );
  279. this.style.width = parseInt(initWidth / _this.minification) + "px";
  280. this.style.height =
  281. parseInt(initHeight / _this.minification) + "px";
  282. }
  283. if (_this.magnification) {
  284. // 限制放大范围
  285. if (nowWidth >= parseInt(initWidth * _this.magnification)) {
  286. magniFlag = false;
  287. // console.log("限制放大范围");
  288. this.style.width =
  289. parseInt(initWidth * _this.magnification) + "px";
  290. this.style.height =
  291. parseInt(initHeight * _this.magnification) + "px";
  292. }
  293. }
  294. }
  295. if (down && miniFlag) {
  296. this.style.width = parseInt(this.offsetWidth * 0.9) + "px";
  297. this.style.height = parseInt(this.offsetHeight * 0.9) + "px";
  298. that.width = parseInt(this.offsetWidth * 0.9) + "px";
  299. that.height = parseInt(this.offsetHeight * 0.9) + "px";
  300. } else if (!down && magniFlag) {
  301. // console.log("放大");
  302. this.style.width = parseInt(this.offsetWidth * 1.1) + "px";
  303. this.style.height = parseInt(this.offsetHeight * 1.1) + "px";
  304. that.width = parseInt(this.offsetWidth * 1.1) + "px";
  305. that.height = parseInt(this.offsetHeight * 1.1) + "px";
  306. }
  307. var newWidth = this.offsetWidth;
  308. var newHeight = this.offsetHeight;
  309. // 新的相对位置left = 原先的相对位置left - 比例 *(本身新的宽度-旧的宽度)
  310. this.style.left =
  311. Math.round(this.offsetLeft - scaleX * (newWidth - oldWidth)) + "px";
  312. this.style.top =
  313. Math.round(this.offsetTop - scaleY * (newHeight - oldHeight)) + "px";
  314. });
  315. // console.log(that.width)
  316. },
  317. // },
  318. //拖拽
  319. drag(ev) {
  320. // var ie = document.all;
  321. var nn6 = document.getElementById && !document.all;
  322. var isdrag = false;
  323. var y, x;
  324. var nTY, nTX;
  325. var oDragObj;
  326. function moveMouse(e) {
  327. if (isdrag) {
  328. oDragObj.style.top =
  329. (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y) + "px";
  330. oDragObj.style.left =
  331. (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x) + "px";
  332. return false;
  333. }
  334. }
  335. function initDrag(e) {
  336. // console.log("点击图片initDrag");
  337. var oDragHandle = nn6 ? e.target : event.srcElement;
  338. var topElement = "HTML";
  339. while (
  340. oDragHandle.tagName != topElement &&
  341. oDragHandle.className != "movableItem"
  342. ) {
  343. oDragHandle = nn6
  344. ? oDragHandle.parentNode
  345. : oDragHandle.parentElement;
  346. }
  347. if (oDragHandle.className == "movableItem") {
  348. isdrag = true;
  349. oDragObj = oDragHandle;
  350. // 父元素宽高
  351. let width = e.path[2].offsetWidth;
  352. let height = e.path[2].offsetHeight;
  353. // 这里判断第一次获取不到style 样式 默认为 居中50%
  354. if (oDragObj.style.top == "") {
  355. nTY = 0;
  356. nTX = parseInt((50 * width) / 100 + 0);
  357. } else {
  358. nTY = parseInt(oDragObj.style.top + 0);
  359. nTX = parseInt(oDragObj.style.left + 0);
  360. }
  361. y = nn6 ? e.clientY : event.clientY;
  362. x = nn6 ? e.clientX : event.clientX;
  363. oDragObj.style.cursor = "move";
  364. document.onmousemove = moveMouse;
  365. return false;
  366. }
  367. }
  368. document.onmousemove = initDrag;
  369. // document.onmouseup = new Function("isdrag=false");
  370. document.onmouseup = function (e) {
  371. isdrag = false;
  372. document.onmousemove = null;
  373. document.onmouseup = null;
  374. var oDragHandle = nn6 ? e.target : event.srcElement;
  375. var topElement = "HTML";
  376. while (
  377. oDragHandle.tagName != topElement &&
  378. oDragHandle.className != "movableItem"
  379. ) {
  380. oDragHandle = nn6
  381. ? oDragHandle.parentNode
  382. : oDragHandle.parentElement;
  383. }
  384. if (oDragHandle.className == "movableItem") {
  385. oDragObj = oDragHandle;
  386. oDragObj.style.cursor = "Default";
  387. }
  388. };
  389. ev = event || window.event;
  390. // 取消事件冒泡行为
  391. // window.event ? (window.event.cancelBubble = true) : ev.stopPropagation();
  392. },
  393. // 拖拽标记
  394. // eslint-disable-next-line no-unused-vars
  395. dragSign(ev, key) {
  396. var nn6 = document.getElementById && !document.all;
  397. var isdrag = false;
  398. var y, x;
  399. var nTY, nTX;
  400. var oDragObj;
  401. let _this = this;
  402. function moveMouse(e) {
  403. if (isdrag) {
  404. this.equipmentKey = key;
  405. // console.log("thisequipmentKey", this.equipmentKey);
  406. let widthItem = e.path[1].style.width.split("p");
  407. let heightItem = e.path[1].style.height.split("p");
  408. let width = widthItem[0];
  409. // eslint-disable-next-line no-unused-vars
  410. let height = heightItem[0];
  411. let top =
  412. ((nn6
  413. ? (nTY / 100) * height + e.clientY - y
  414. : (nTY / 100) * height + event.clientY - y) /
  415. height) *
  416. 100;
  417. let left =
  418. ((nn6
  419. ? (nTX / 100) * width + e.clientX - x
  420. : (nTX / 100) * width + event.clientX - x) /
  421. width) *
  422. 100;
  423. if (top >= 0 && top <= 100) {
  424. _this.equipment[key].top = top;
  425. }
  426. if (left >= 0 && left <= 100) {
  427. _this.equipment[key].left = left;
  428. }
  429. return false;
  430. }
  431. }
  432. // eslint-disable-next-line no-unused-vars
  433. function initDrag(e) {
  434. // console.log("_this", _this);
  435. var oDragHandle = nn6 ? e.target : event.srcElement;
  436. var topElement = "HTML";
  437. while (
  438. oDragHandle.tagName != topElement &&
  439. oDragHandle.className.indexOf("equipment") == -1
  440. ) {
  441. oDragHandle = nn6
  442. ? oDragHandle.parentNode
  443. : oDragHandle.parentElement;
  444. }
  445. if (oDragHandle.className.indexOf("equipment") != -1) {
  446. isdrag = true;
  447. oDragObj = oDragHandle;
  448. // 父元素宽高
  449. let width = e.path[1].offsetWidth;
  450. // let height = e.path[1].offsetHeight;
  451. // console.log(width, height);
  452. // console.log("oDragObj.style", oDragObj.style);
  453. // 这里判断第一次获取不到style 样式 默认为 居中50%
  454. if (oDragObj.style.top == "") {
  455. // nTY = parseInt((50 * height) / 100 + 0);
  456. nTY = 0;
  457. nTX = parseInt((50 * width) / 100 + 0);
  458. } else if (oDragObj.style.top.indexOf("%") != -1) {
  459. nTY = oDragObj.style.top.split("%")[0];
  460. nTX = oDragObj.style.left.split("%")[0];
  461. } else {
  462. nTY = parseInt(oDragObj.style.top + 0);
  463. nTX = parseInt(oDragObj.style.left + 0);
  464. }
  465. y = nn6 ? e.clientY : event.clientY;
  466. x = nn6 ? e.clientX : event.clientX;
  467. oDragObj.style.cursor = "move";
  468. document.onmousemove = moveMouse;
  469. return false;
  470. }
  471. }
  472. // document.onmousedown = initDrag;
  473. document.onmousemove = initDrag;
  474. document.onmouseup = function (e) {
  475. isdrag = false;
  476. document.onmousemove = null;
  477. document.onmouseup = null;
  478. var oDragHandle = nn6 ? e.target : event.srcElement;
  479. var topElement = "HTML";
  480. while (
  481. oDragHandle.tagName != topElement &&
  482. oDragHandle.className != "equipment"
  483. ) {
  484. oDragHandle = nn6
  485. ? oDragHandle.parentNode
  486. : oDragHandle.parentElement;
  487. }
  488. if (oDragHandle.className == "equipment") {
  489. oDragObj = oDragHandle;
  490. oDragObj.style.cursor = "Default";
  491. }
  492. };
  493. // _this.equipmentKey = key;
  494. // _this.equipment[_this.equipmentKey].left = l;
  495. // _this.equipment[_this.equipmentKey].top = t;
  496. ev = event || window.event;
  497. // 取消事件冒泡行为
  498. window.event ? (window.event.cancelBubble = true) : ev.stopPropagation();
  499. },
  500. },
  501. watch: {
  502. equipment() {
  503. if (this.equipment.length != 0) {
  504. this.arrIcon = [];
  505. let finish = true;
  506. this.equipment.filter((item) => {
  507. if (!item.iconImgUrl) {
  508. finish = false;
  509. }
  510. return true;
  511. });
  512. // console.log("finish", finish);
  513. if (finish) {
  514. this.equipment.filter((item, index) => {
  515. if (index >= this.imgIndex) {
  516. console.log("iconImgUrl", this.equipment[index].iconImgUrl);
  517. this.getImgInfo(
  518. this.$baseUrl + item.iconImgUrl,
  519. this.iconMaxWidth,
  520. this.iconMaxHeight,
  521. "iconWidth",
  522. "iconHeight",
  523. true,
  524. "arrIcon"
  525. );
  526. }
  527. console.log("22filter", index);
  528. return true;
  529. });
  530. }
  531. }
  532. },
  533. },
  534. created() {
  535. this.getImgInfo(
  536. this.imgUrl,
  537. this.bigMaxWidth,
  538. this.bigMaxHeight,
  539. "width",
  540. "height"
  541. );
  542. if (this.equipment.length != 0) {
  543. this.arrIcon = [];
  544. let finish = true;
  545. this.equipment.filter((item) => {
  546. if (!item.iconImgUrl) {
  547. finish = false;
  548. }
  549. return true;
  550. });
  551. // console.log("finish", finish);
  552. if (finish) {
  553. this.equipment.filter((item, index) => {
  554. if (index >= this.imgIndex) {
  555. // console.log("iconImgUrl", this.equipment[index].iconImgUrl);
  556. this.getImgInfo(
  557. this.$baseUrl + item.iconImgUrl,
  558. this.iconMaxWidth,
  559. this.iconMaxHeight,
  560. "iconWidth",
  561. "iconHeight",
  562. true,
  563. "arrIcon"
  564. );
  565. }
  566. // console.log("22filter", index);
  567. return true;
  568. });
  569. }
  570. }
  571. this.iconImgUrl = JSON.parse(
  572. JSON.stringify(this.$baseUrl + this.equipment[0].iconImgUrl)
  573. );
  574. // console.log("imgUrl", this.imgUrl);
  575. // console.log("equipment", this.equipment);
  576. // //禁止鼠标右键
  577. // document.oncontextmenu = function() {
  578. // return false;
  579. // };
  580. },
  581. };
  582. </script>
  583. <style lang="less">
  584. .preview-popover {
  585. background-color: #d3edf7dd;
  586. padding: 12px;
  587. .popper__arrow::after {
  588. border-bottom-color: #d3edf7dd !important;
  589. }
  590. .describe {
  591. p {
  592. padding-bottom: 5px;
  593. &:last-child {
  594. padding-bottom: 0px;
  595. }
  596. }
  597. .describe-top {
  598. // color: sandybrown;
  599. // color: red;
  600. color: rgb(21, 110, 110);
  601. }
  602. .describe-center {
  603. color: rgb(79, 21, 206);
  604. }
  605. .describe-bottom {
  606. color: rgb(30, 31, 29);
  607. }
  608. }
  609. }
  610. </style>
  611. <style lang="less" scoped>
  612. .pop-up-main {
  613. width: 100%;
  614. height: calc(100vh - 12vh);
  615. overflow-y: hidden;
  616. .paln-box {
  617. width: 100%;
  618. height: 100%;
  619. position: relative;
  620. .movableItem {
  621. position: absolute;
  622. // top: 75%;
  623. left: 50%;
  624. transform: translate(-50%, 0%);
  625. img,
  626. .svg {
  627. z-index: 1;
  628. width: 100%;
  629. height: 100%;
  630. }
  631. .equipment {
  632. position: absolute;
  633. top: 0;
  634. left: 0;
  635. transform: translate(-50%, -50%);
  636. z-index: 2;
  637. font-size: 40px;
  638. // color: red;
  639. // background: blue;
  640. zoom: 1;
  641. }
  642. }
  643. .shuaxin {
  644. position: absolute;
  645. z-index: 2;
  646. font-size: 40px;
  647. top: 20px;
  648. left: 20px;
  649. cursor: pointer;
  650. &:hover {
  651. color: yellowgreen;
  652. }
  653. }
  654. .equipment {
  655. color: white;
  656. }
  657. &/deep/.el-button {
  658. z-index: 2;
  659. position: absolute;
  660. bottom: 60px;
  661. right: 20px;
  662. width: 60px;
  663. height: 35px;
  664. span {
  665. display: inline-block;
  666. position: absolute;
  667. top: 50%;
  668. left: 50%;
  669. transform: translate(-50%, -50%);
  670. }
  671. i {
  672. display: inline-block;
  673. position: absolute;
  674. top: 50%;
  675. left: 25%;
  676. transform: translate(-50%, -50%);
  677. }
  678. }
  679. }
  680. }
  681. // body {
  682. // height: 100%;
  683. // overflow: hidden;
  684. // margin: 0;
  685. // padding: 0;
  686. // }
  687. </style>