爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.9 KiB

  1. "use strict";
  2. const common_vendor = require("../common/vendor.js");
  3. const common_assets = require("../common/assets.js");
  4. const _sfc_main = {
  5. data() {
  6. return {
  7. userInfo: {
  8. avatarUrl: "",
  9. nickName: ""
  10. },
  11. configData: []
  12. };
  13. },
  14. onShow() {
  15. },
  16. computed: {
  17. logoImage() {
  18. common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:53", getApp().globalData.configData, "getApp().globalData.configData");
  19. const item = getApp().globalData.configData.find((i) => i.keyName === "logo_image");
  20. return item ? item.keyContent : "";
  21. },
  22. logoName() {
  23. const item = getApp().globalData.configData.find((i) => i.keyName === "logo_name");
  24. return item ? item.keyContent : "";
  25. }
  26. },
  27. methods: {
  28. onChooseAvatar(res) {
  29. let self = this;
  30. self.$Oss.ossUpload(res.target.avatarUrl).then((url) => {
  31. common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:67", url);
  32. self.userInfo.avatarUrl = url;
  33. });
  34. },
  35. submit() {
  36. let self = this;
  37. common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:73", self.userInfo.avatarUrl, "111");
  38. common_vendor.index.createSelectorQuery().in(this).select("#nickName").fields({
  39. properties: ["value"]
  40. }).exec((res) => {
  41. var _a;
  42. const nickName = (_a = res == null ? void 0 : res[0]) == null ? void 0 : _a.value;
  43. self.userInfo.nickName = nickName;
  44. if (getApp().globalData.phone) {
  45. self.userInfo.phone = getApp().globalData.phone;
  46. }
  47. if (self.$utils.verificationAll(self.userInfo, {
  48. avatarUrl: "请选择头像",
  49. nickName: "请填写昵称"
  50. })) {
  51. return;
  52. }
  53. self.$api("updateInfo", self.userInfo, (res2) => {
  54. common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:93", res2, self.userInfo);
  55. if (res2.code == 200) {
  56. common_vendor.index.switchTab({
  57. url: "/pages/component/home"
  58. });
  59. }
  60. });
  61. });
  62. }
  63. }
  64. };
  65. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  66. return common_vendor.e({
  67. a: $options.logoImage,
  68. b: common_vendor.t($options.logoName),
  69. c: $data.userInfo.avatarUrl
  70. }, $data.userInfo.avatarUrl ? {
  71. d: $data.userInfo.avatarUrl
  72. } : {
  73. e: common_assets._imports_0$2
  74. }, {
  75. f: common_vendor.o((...args) => $options.onChooseAvatar && $options.onChooseAvatar(...args)),
  76. g: $data.userInfo.nickName,
  77. h: common_vendor.o(($event) => $data.userInfo.nickName = $event.detail.value),
  78. i: common_vendor.o((...args) => $options.submit && $options.submit(...args))
  79. });
  80. }
  81. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-df0e33a3"]]);
  82. wx.createPage(MiniProgramPage);
  83. //# sourceMappingURL=../../.sourcemap/mp-weixin/pages/wxUserInfo.js.map