"use strict"; const common_vendor = require("../../common/vendor.js"); const utils_homeApi = require("../../utils/homeApi.js"); const common_assets = require("../../common/assets.js"); if (!Array) { const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons"); const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput"); const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item"); const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms"); const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); (_easycom_uni_icons2 + _easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_forms2 + _easycom_uni_popup2)(); } const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"; const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js"; const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js"; const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js"; const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"; if (!Math) { (_easycom_uni_icons + _easycom_uni_easyinput + _easycom_uni_forms_item + UploadImage + _easycom_uni_forms + _easycom_uni_popup)(); } const UploadImage = () => "../components/imageUpload.js"; const _sfc_main = { __name: "index", setup(__props) { const authStatus = common_vendor.ref(1); const nickName = common_vendor.ref(""); const headImg = common_vendor.ref(""); const popup = common_vendor.ref(null); const valiForm = common_vendor.ref(null); const imagesUp = common_vendor.ref(null); const formData = common_vendor.ref({ coverPhotosFileList: [], nickName: null, id: common_vendor.index.getStorageSync("userIdXGWXMN") }); const rules = common_vendor.ref({ nickName: { rules: [{ required: true, errorMessage: "昵称不能为空" }] }, coverPhotosFileList: { rules: [{ required: true, type: "array", errorMessage: "请上传头像" }] } }); function goPage(type) { if (type == "1") { common_vendor.index.navigateTo({ url: `./../concern/concern` }); } else if (type == "2") { common_vendor.index.navigateTo({ url: `./../forum/index` }); } else { common_vendor.index.navigateTo({ url: `./../instructions/instructions` }); } } function changeInfo() { popup.value.open(); formData.value.nickName = ""; formData.value.coverPhotosFileList = []; } function submitData() { valiForm.value.validate().then((res) => { let params = JSON.parse(JSON.stringify(formData.value)); utils_homeApi.wechartMiniuserUpdate(params).then((res2) => { common_vendor.index.showToast({ icon: "none", title: "提交成功" }); nickName.value = params.nickName; headImg.value = params.coverPhotosFileList[0].url; popup.value.close(); imagesUp.value.clearImages(); }); }).catch((err) => { console.log("err", err); }); } common_vendor.onMounted(() => { authStatus.value = common_vendor.index.getStorageSync("authStatusXGWXMN"); headImg.value = common_vendor.index.getStorageSync("headImgXGWXMN") || common_assets.defaultHeadImg; nickName.value = common_vendor.index.getStorageSync("nickNameXGWXMN") || "微信昵称"; }); return (_ctx, _cache) => { return common_vendor.e({ a: headImg.value, b: common_vendor.o(($event) => changeInfo()), c: common_vendor.t(nickName.value), d: authStatus.value == 0 }, authStatus.value == 0 ? {} : {}, { e: authStatus.value == 1 }, authStatus.value == 1 ? {} : {}, { f: authStatus.value == 2 }, authStatus.value == 2 ? {} : {}, { g: common_vendor.p({ type: "eye-filled", size: "40" }), h: common_vendor.p({ type: "right", size: "20" }), i: common_vendor.o(($event) => goPage("1")), j: common_vendor.p({ type: "videocam-filled", size: "40" }), k: common_vendor.p({ type: "right", size: "20" }), l: common_vendor.o(($event) => goPage("2")), m: common_vendor.p({ type: "chatboxes-filled", size: "40" }), n: common_vendor.p({ type: "right", size: "20" }), o: common_vendor.o(($event) => goPage("3")), p: common_vendor.o(($event) => formData.value.nickName = $event), q: common_vendor.p({ type: "text", autoHeight: true, placeholder: "请输入", modelValue: formData.value.nickName }), r: common_vendor.p({ label: "我的昵称", required: true, ["label-width"]: "100%", name: "nickName" }), s: common_vendor.sr(imagesUp, "045ae200-11,045ae200-10", { "k": "imagesUp" }), t: common_vendor.p({ saveFileArr: formData.value.coverPhotosFileList, limit: 1, refField: "headImg", refType: "public_wechart_miniuser" }), v: common_vendor.p({ label: "我的头像", required: true, ["label-width"]: "100%", name: "coverPhotosFileList" }), w: common_vendor.o(submitData), x: common_vendor.sr(valiForm, "045ae200-7,045ae200-6", { "k": "valiForm" }), y: common_vendor.p({ modelValue: formData.value, rules: rules.value }), z: common_vendor.sr(popup, "045ae200-6", { "k": "popup" }), A: common_vendor.p({ type: "bottom", ["mask-click"]: true }) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/项目/孝感海绵城市/XiaoGanWXMini/pages/mine/index.vue"]]); wx.createPage(MiniProgramPage);