"use strict";
const common_vendor = require("../../common/vendor.js");
const store_index = require("../../store/index.js");
const utils_index = require("../../utils/index.js");
require("../../api/index.js");
require("../../api/request.js");
require("../../config/index.js");
const _sfc_main = {
  __name: "index",
  setup(__props) {
    store_index.useStore();
    common_vendor.onShow(() => {
      is_login.value = utils_index.custom.checkLogin();
      if (is_login.value) {
        userinfo.value = common_vendor.index.getStorageSync("userInfo");
        avatar.value = common_vendor.index.getStorageSync("avatarUrl");
        userinfo.value = JSON.parse(userinfo.value);
      }
    });
    const avatar = common_vendor.ref("");
    common_vendor.ref(null);
    const is_login = common_vendor.ref(null);
    const userinfo = common_vendor.ref(null);
    function toLogin() {
      common_vendor.index.navigateTo({
        url: "/pages/login/login"
      });
    }
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: is_login.value ? avatar.value : "../../static/avatar.png",
        b: common_vendor.t(is_login.value ? userinfo.value.nickname : "未登录"),
        c: !is_login.value
      }, !is_login.value ? {
        d: common_vendor.o(toLogin)
      } : {});
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79e6a490"], ["__file", "F:/项目2023/视力表/vision-record/pages/user/index.vue"]]);
wx.createPage(MiniProgramPage);
