index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const ErpNavBar = () => "../../../components/erp-nav-bar.js";
  4. const _sfc_main = {
  5. components: { ErpNavBar },
  6. data() {
  7. return {
  8. myInfo: {
  9. avatarUrl: "https://img.icons8.com/clouds/200/manager.png",
  10. nickName: "张经理",
  11. phoneNum: "138-8888-8888",
  12. orgName: "广东粤铝材实业有限公司"
  13. }
  14. };
  15. },
  16. methods: {
  17. goBack() {
  18. common_vendor.index.navigateBack();
  19. },
  20. doChooseImage() {
  21. common_vendor.index.chooseImage({
  22. count: 1,
  23. success: (res) => {
  24. this.myInfo.avatarUrl = res.tempFilePaths[0];
  25. common_vendor.index.showToast({ title: "头像已选好", icon: "none" });
  26. }
  27. });
  28. },
  29. doEditName() {
  30. common_vendor.index.showModal({
  31. title: "设置昵称",
  32. content: this.myInfo.nickName,
  33. editable: true,
  34. confirmColor: "#C1001C",
  35. // 重点修复点:弹窗确认按钮强制采用主题红
  36. success: (res) => {
  37. if (res.confirm) {
  38. this.myInfo.nickName = res.content || "未命名";
  39. }
  40. }
  41. });
  42. },
  43. saveProfile() {
  44. common_vendor.index.showLoading({ title: "保存中" });
  45. setTimeout(() => {
  46. common_vendor.index.hideLoading();
  47. common_vendor.index.showToast({ title: "保存成功" });
  48. setTimeout(() => {
  49. common_vendor.index.navigateBack();
  50. }, 1200);
  51. }, 600);
  52. }
  53. }
  54. };
  55. if (!Array) {
  56. const _component_erp_nav_bar = common_vendor.resolveComponent("erp-nav-bar");
  57. _component_erp_nav_bar();
  58. }
  59. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  60. return {
  61. a: common_vendor.p({
  62. title: "个人资料设置"
  63. }),
  64. b: $data.myInfo.avatarUrl,
  65. c: common_vendor.o((...args) => $options.doChooseImage && $options.doChooseImage(...args), "3d"),
  66. d: common_vendor.t($data.myInfo.nickName),
  67. e: common_vendor.o((...args) => $options.doEditName && $options.doEditName(...args), "24"),
  68. f: common_vendor.t($data.myInfo.phoneNum),
  69. g: common_vendor.t($data.myInfo.orgName),
  70. h: common_vendor.o((...args) => $options.saveProfile && $options.saveProfile(...args), "cb")
  71. };
  72. }
  73. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2f058983"]]);
  74. wx.createPage(MiniProgramPage);
  75. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/mine/settings/index.js.map