cancelAccount.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. methods: {
  5. submit() {
  6. common_vendor.index.showModal({
  7. title: "确认注销",
  8. content: "注销后所有数据将无法恢复,是否继续?",
  9. success: (res) => {
  10. if (res.confirm) {
  11. common_vendor.index.request({
  12. url: "http://localhost:9527/api/cancelAccount",
  13. method: "POST",
  14. data: { uid: common_vendor.index.getStorageSync("uid") },
  15. success: (res2) => {
  16. if (res2.statusCode === 200 && res2.data.code === 200) {
  17. common_vendor.index.showToast({ title: "注销成功", icon: "success" });
  18. setTimeout(() => {
  19. common_vendor.index.clearStorageSync();
  20. common_vendor.index.reLaunch({ url: "/pages/index/index" });
  21. }, 1e3);
  22. } else {
  23. common_vendor.index.showToast({ title: res2.data.message || "注销失败", icon: "none" });
  24. }
  25. }
  26. });
  27. }
  28. }
  29. });
  30. }
  31. }
  32. };
  33. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  34. return {
  35. a: common_vendor.o((...args) => $options.submit && $options.submit(...args))
  36. };
  37. }
  38. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4c3b2932"]]);
  39. wx.createPage(MiniProgramPage);
  40. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/cancelAccount.js.map