index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. isChecked: true,
  7. isShake: false
  8. };
  9. },
  10. onLoad() {
  11. this.createUser();
  12. },
  13. methods: {
  14. //查询用户信息
  15. createUser() {
  16. this.$request.get({
  17. url: "system/temporaryUser",
  18. loadingTip: "加载中..."
  19. }).then((res) => {
  20. sessionStorage.setItem("user", JSON.stringify(res.data.user));
  21. sessionStorage.setItem("token", res.data.token);
  22. });
  23. },
  24. checkboxChange(e) {
  25. this.isChecked = !this.isChecked;
  26. },
  27. goTest() {
  28. if (!this.isChecked) {
  29. common_vendor.index.showToast({
  30. icon: "none",
  31. title: "请勾选并同意测评服务条款"
  32. });
  33. this.isShake = true;
  34. setTimeout(() => {
  35. this.isShake = false;
  36. }, 500);
  37. return;
  38. }
  39. common_vendor.index.navigateTo({
  40. url: "/newScale/EQtest/testPage"
  41. });
  42. },
  43. toggle() {
  44. this.$refs.popup.open();
  45. },
  46. close() {
  47. this.$refs.popup.close();
  48. this.isChecked = true;
  49. }
  50. }
  51. };
  52. if (!Array) {
  53. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  54. const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  55. (_easycom_uni_icons2 + _easycom_uni_popup2)();
  56. }
  57. const _easycom_uni_icons = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons.js";
  58. const _easycom_uni_popup = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.js";
  59. if (!Math) {
  60. (_easycom_uni_icons + _easycom_uni_popup)();
  61. }
  62. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  63. return {
  64. a: $data.isChecked,
  65. b: common_vendor.o((...args) => $options.checkboxChange && $options.checkboxChange(...args)),
  66. c: common_vendor.o((...args) => $options.toggle && $options.toggle(...args)),
  67. d: $data.isShake ? 1 : "",
  68. e: common_vendor.o((...args) => $options.goTest && $options.goTest(...args)),
  69. f: common_vendor.o(($event) => $options.close()),
  70. g: common_vendor.p({
  71. type: "clear",
  72. size: "30"
  73. }),
  74. h: common_vendor.o(($event) => $options.close()),
  75. i: common_vendor.sr("popup", "4f3adda6-0"),
  76. j: common_vendor.p({
  77. type: "bottom",
  78. ["background-color"]: "#fff"
  79. }),
  80. k: common_vendor.o(($event) => $options.toggle()),
  81. l: common_vendor.o(($event) => _ctx.agreeFun()),
  82. m: common_vendor.o(($event) => _ctx.unAgreeFun()),
  83. n: _ctx.modalFlag
  84. };
  85. }
  86. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4f3adda6"], ["__file", "E:/psy_web_share/newScale/EQtest/index.vue"]]);
  87. tt.createPage(MiniProgramPage);