"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const api_api = require("../../api/api.js");
const hooks_useNav = require("../../hooks/useNav.js");
if (!Array) {
  const _easycom_statusBar2 = common_vendor.resolveComponent("statusBar");
  const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
  const _easycom_cc_myTabbar2 = common_vendor.resolveComponent("cc-myTabbar");
  (_easycom_statusBar2 + _easycom_up_avatar2 + _easycom_cc_myTabbar2)();
}
const _easycom_statusBar = () => "../../components/statusBar/statusBar.js";
const _easycom_up_avatar = () => "../../uni_modules/uview-plus/components/u-avatar/u-avatar.js";
const _easycom_cc_myTabbar = () => "../../uni_modules/cc-myTabbar/components/cc-myTabbar/cc-myTabbar.js";
if (!Math) {
  (_easycom_statusBar + _easycom_up_avatar + _easycom_cc_myTabbar)();
}
const _sfc_main = {
  __name: "mine",
  setup(__props) {
    const { nav, navTo } = hooks_useNav.useNav();
    let info = common_vendor.ref({});
    let gridList = common_vendor.ref([
      {
        name: "我的电卡",
        img: "/static/icon/dk_mine.png",
        path: "/pages/mine/card",
        type: "nav"
      },
      {
        name: "充电订单",
        img: "/static/icon/cd_mine.png",
        path: "/pages/order/order",
        type: "switchTab"
      },
      {
        name: "余额明细",
        img: "/static/icon/ye_mine.png",
        path: "/pages/mine/incomeList",
        type: "nav"
      },
      {
        name: "客服中心",
        img: "/static/icon/kf_mine.png",
        call: true
      }
    ]);
    common_vendor.onShow(async () => {
      common_vendor.index.hideTabBar();
      let _res = await api_api.userInfo();
      info.value = _res;
    });
    const toEarnings = () => {
      common_vendor.index.navigateTo({
        url: "./sett"
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.p({
          size: "150rpx",
          src: common_vendor.unref(info).avatar
        }),
        b: common_vendor.t(common_vendor.unref(info).nickName),
        c: common_vendor.t(common_vendor.unref(info).phone || ""),
        d: common_vendor.o(toEarnings),
        e: common_assets._imports_0$2,
        f: common_vendor.t(common_vendor.unref(info).balance || 0),
        g: common_vendor.o(($event) => common_vendor.unref(navTo)("/pages/mine/incomeList")),
        h: common_vendor.o(($event) => common_vendor.unref(navTo)("/pages/mine/incomeList")),
        i: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pageMake/refund/refund?balance=${common_vendor.unref(info).refundableAmount}`)),
        j: common_vendor.o(($event) => common_vendor.unref(navTo)("/pages/money/recharge")),
        k: common_vendor.f(common_vendor.unref(gridList), (item, index, i0) => {
          return {
            a: item.img,
            b: common_vendor.t(item.name),
            c: index,
            d: common_vendor.o(($event) => common_vendor.unref(nav)(item), index)
          };
        }),
        l: common_vendor.p({
          tabBarShow: 4
        })
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7c2ebfa5"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/mine.js.map
