|
|
- "use strict";
- const common_vendor = require("../common/vendor.js");
- const common_assets = require("../common/assets.js");
- const _sfc_main = {
- data() {
- return {
- userInfo: {
- avatarUrl: "",
- nickName: ""
- },
- configData: []
- };
- },
- onShow() {
- },
- computed: {
- logoImage() {
- common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:53", getApp().globalData.configData, "getApp().globalData.configData");
- const item = getApp().globalData.configData.find((i) => i.keyName === "logo_image");
- return item ? item.keyContent : "";
- },
- logoName() {
- const item = getApp().globalData.configData.find((i) => i.keyName === "logo_name");
- return item ? item.keyContent : "";
- }
- },
- methods: {
- onChooseAvatar(res) {
- let self = this;
- self.$Oss.ossUpload(res.target.avatarUrl).then((url) => {
- common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:67", url);
- self.userInfo.avatarUrl = url;
- });
- },
- submit() {
- let self = this;
- common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:73", self.userInfo.avatarUrl, "111");
- common_vendor.index.createSelectorQuery().in(this).select("#nickName").fields({
- properties: ["value"]
- }).exec((res) => {
- var _a;
- const nickName = (_a = res == null ? void 0 : res[0]) == null ? void 0 : _a.value;
- self.userInfo.nickName = nickName;
- if (getApp().globalData.phone) {
- self.userInfo.phone = getApp().globalData.phone;
- }
- if (self.$utils.verificationAll(self.userInfo, {
- avatarUrl: "请选择头像",
- nickName: "请填写昵称"
- })) {
- return;
- }
- self.$api("updateInfo", self.userInfo, (res2) => {
- common_vendor.index.__f__("log", "at pages/wxUserInfo.vue:93", res2, self.userInfo);
- if (res2.code == 200) {
- common_vendor.index.switchTab({
- url: "/pages/component/home"
- });
- }
- });
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $options.logoImage,
- b: common_vendor.t($options.logoName),
- c: $data.userInfo.avatarUrl
- }, $data.userInfo.avatarUrl ? {
- d: $data.userInfo.avatarUrl
- } : {
- e: common_assets._imports_0$2
- }, {
- f: common_vendor.o((...args) => $options.onChooseAvatar && $options.onChooseAvatar(...args)),
- g: $data.userInfo.nickName,
- h: common_vendor.o(($event) => $data.userInfo.nickName = $event.detail.value),
- i: common_vendor.o((...args) => $options.submit && $options.submit(...args))
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-df0e33a3"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../.sourcemap/mp-weixin/pages/wxUserInfo.js.map
|