You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

1 week ago
  1. "use strict";
  2. const common_vendor = require("../common/vendor.js");
  3. let goPage = (url, params = {}, type = "navigateTo") => {
  4. common_vendor.index.$u.route({
  5. url,
  6. params,
  7. type
  8. });
  9. };
  10. let detectOrient = (dome) => {
  11. var width = document.documentElement.clientWidth, height = document.documentElement.clientHeight, $wrapper = document.querySelector(dome), style = "";
  12. if (width >= height) {
  13. style += "width:" + width + "px;";
  14. style += "height:" + height + "px;";
  15. style += "-webkit-transform: rotate(0); transform: rotate(0);";
  16. style += "-webkit-transform-origin: 0 0;";
  17. style += "transform-origin: 0 0;";
  18. console.log(1);
  19. } else {
  20. style += "width:" + height + "px;";
  21. style += "height:" + width + "px;";
  22. style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);";
  23. style += "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;";
  24. style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;";
  25. console.log(2);
  26. }
  27. $wrapper.style.cssText = style;
  28. };
  29. let noDoFn = () => {
  30. common_vendor.index.$u.toast("正在开发中,敬请期待");
  31. };
  32. exports.detectOrient = detectOrient;
  33. exports.goPage = goPage;
  34. exports.noDoFn = noDoFn;