setting.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. settingList: [
  7. { title: "账号安全", icon: "/static/logo.png" },
  8. { title: "隐私设置", icon: "/static/2.png" },
  9. { title: "清除缓存", icon: "/static/login.png" },
  10. { title: "关于我们", icon: "/static/logo.png" }
  11. ]
  12. };
  13. },
  14. methods: {
  15. onItem(item) {
  16. if (item.title === "清除缓存") {
  17. common_vendor.index.clearStorageSync();
  18. common_vendor.index.showToast({ title: "缓存已清除", icon: "success" });
  19. } else {
  20. common_vendor.index.showToast({ title: item.title, icon: "none" });
  21. }
  22. },
  23. logout() {
  24. common_vendor.index.showModal({
  25. title: "提示",
  26. content: "确定要退出登录吗?",
  27. success: (res) => {
  28. if (res.confirm) {
  29. common_vendor.index.clearStorageSync();
  30. common_vendor.index.reLaunch({ url: "/pages/login/index" });
  31. }
  32. }
  33. });
  34. }
  35. }
  36. };
  37. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  38. return common_vendor.e({
  39. a: common_vendor.f($data.settingList, (item, k0, i0) => {
  40. return {
  41. a: item.icon,
  42. b: common_vendor.t(item.title),
  43. c: item.title,
  44. d: common_vendor.o(($event) => $options.onItem(item), item.title)
  45. };
  46. }),
  47. b: _ctx.idx !== $data.settingList.length - 1
  48. }, _ctx.idx !== $data.settingList.length - 1 ? {
  49. c: common_vendor.f($data.settingList, (item, idx, i0) => {
  50. return {
  51. a: "d" + idx
  52. };
  53. })
  54. } : {}, {
  55. d: common_vendor.o((...args) => $options.logout && $options.logout(...args))
  56. });
  57. }
  58. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  59. wx.createPage(MiniProgramPage);
  60. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/setting.js.map