loginIndex.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. require("../../api/login.js");
  4. require("../../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. btnLoading: false,
  9. agree: false
  10. };
  11. },
  12. onLoad() {
  13. if (!this.$isLogin()) {
  14. let pages = getCurrentPages();
  15. let url = pages[pages.length - 3];
  16. if (pages.length > 2 && url && (url.route == "pages/auth/login" || url.route == "pages/auth/loginIndex" || url.route == "pages/common/launch")) {
  17. common_vendor.index.navigateBack({
  18. delta: 2
  19. });
  20. } else {
  21. if (String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger") {
  22. const pages2 = getCurrentPages();
  23. if (pages2.length > 1) {
  24. const url2 = pages2[pages2.length - 2];
  25. const options = url2.options;
  26. if (options && JSON.stringify(options) != "{}") {
  27. let allurl = "/" + url2.route + common_vendor.index.$u.queryParams(options);
  28. common_vendor.index.setStorageSync("beforLoginPage", allurl);
  29. } else {
  30. common_vendor.index.setStorageSync("beforLoginPage", "/" + url2.route);
  31. }
  32. common_vendor.index.redirectTo({
  33. url: "/pages/auth/h5WxLogin"
  34. });
  35. } else {
  36. this.submit();
  37. }
  38. } else {
  39. common_vendor.index.redirectTo({
  40. url: "/pages/auth/login"
  41. });
  42. }
  43. }
  44. }
  45. },
  46. onShow() {
  47. if (this.$isLogin()) {
  48. common_vendor.index.reLaunch({
  49. url: "../course/index",
  50. animationType: "none",
  51. animationDuration: 2e3
  52. });
  53. }
  54. },
  55. methods: {
  56. goToWeb(index) {
  57. common_vendor.index.setStorageSync("url", index == 0 ? "https://userapp.his.cdwjyyh.com/web/userAgreement" : "https://userapp.his.cdwjyyh.com/web/privacyPolicy");
  58. common_vendor.index.navigateTo({
  59. url: "/pages/index/h5"
  60. });
  61. },
  62. handleAgree() {
  63. this.agree = !this.agree;
  64. },
  65. submit() {
  66. this.$showLoginPage();
  67. },
  68. handleOtherLogin() {
  69. common_vendor.index.redirectTo({
  70. url: "/pages/auth/login"
  71. });
  72. },
  73. close(val) {
  74. this.$refs.popup.close();
  75. if (val == "agree") {
  76. this.agree = true;
  77. this.submit();
  78. }
  79. }
  80. }
  81. };
  82. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  83. return {
  84. a: $data.btnLoading,
  85. b: $data.btnLoading,
  86. c: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
  87. d: $data.btnLoading,
  88. e: common_vendor.o((...args) => $options.handleOtherLogin && $options.handleOtherLogin(...args)),
  89. f: !$data.agree,
  90. g: $data.agree,
  91. h: common_vendor.o((...args) => $options.handleAgree && $options.handleAgree(...args)),
  92. i: common_vendor.o(($event) => $options.goToWeb(0)),
  93. j: common_vendor.o(($event) => $options.goToWeb(1))
  94. };
  95. }
  96. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5122ae47"], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages/auth/loginIndex.vue"]]);
  97. wx.createPage(MiniProgramPage);