index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const services_task = require("../../services/task.js");
  5. if (!Array) {
  6. const _easycom_wd_button2 = common_vendor.resolveComponent("wd-button");
  7. _easycom_wd_button2();
  8. }
  9. const _easycom_wd_button = () => "../../node-modules/wot-design-uni/components/wd-button/wd-button.js";
  10. if (!Math) {
  11. _easycom_wd_button();
  12. }
  13. const _sfc_defineComponent = common_vendor.defineComponent({
  14. __name: "index",
  15. setup(__props) {
  16. const title = common_vendor.ref("Hello");
  17. common_vendor.onLoad(() => {
  18. common_vendor.index.getUserInfo({
  19. success: (success) => {
  20. console.log(success);
  21. }
  22. });
  23. });
  24. const onLogin = async () => {
  25. let form = {
  26. mobile: "18927563000",
  27. password: "123456"
  28. };
  29. let res = await services_task.postLoginAPI(form);
  30. if (res.code == 200) {
  31. console.log("1111111111111111");
  32. } else {
  33. return common_vendor.index.showToast({
  34. title: res.msg,
  35. icon: "none"
  36. });
  37. }
  38. };
  39. return (_ctx, _cache) => {
  40. return {
  41. a: common_assets._imports_0,
  42. b: common_vendor.t(title.value),
  43. c: common_vendor.o(onLogin),
  44. d: common_vendor.p({
  45. type: "success"
  46. })
  47. };
  48. };
  49. }
  50. });
  51. _sfc_defineComponent.__runtimeHooks = 1;
  52. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_defineComponent, [["__scopeId", "data-v-276ac604"]]);
  53. wx.createPage(MiniProgramPage);