index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_avatar2 = common_vendor.resolveComponent("u-avatar");
  5. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  6. (_easycom_u_avatar2 + _easycom_u_icon2)();
  7. }
  8. const _easycom_u_avatar = () => "../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
  9. const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
  10. if (!Math) {
  11. (_easycom_u_avatar + _easycom_u_icon)();
  12. }
  13. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  14. __name: "index",
  15. setup(__props) {
  16. var _a, _b;
  17. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  18. const $config = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  19. const config = common_vendor.ref({});
  20. common_vendor.ref({});
  21. common_vendor.onLoad(async () => {
  22. await searchConfig();
  23. await search();
  24. });
  25. const searchConfig = async () => {
  26. config.value = common_vendor.index.getStorageSync("config");
  27. };
  28. const search = async () => {
  29. };
  30. const toLogin = () => {
  31. common_vendor.index.navigateTo({
  32. url: `/pagesHome/login/index`
  33. });
  34. };
  35. const toCommon = (e) => {
  36. if (e) {
  37. common_vendor.index.navigateTo({
  38. url: `/${e}`
  39. });
  40. } else {
  41. try {
  42. common_vendor.index.clearStorage();
  43. common_vendor.index.reLaunch({
  44. url: "/pages/index/index"
  45. });
  46. } catch (e2) {
  47. }
  48. }
  49. };
  50. return (_ctx, _cache) => {
  51. return {
  52. a: common_vendor.p({
  53. text: "车",
  54. fontSize: "20",
  55. randomBgColor: true,
  56. colorIndex: 0
  57. }),
  58. b: common_vendor.p({
  59. bold: true,
  60. color: "#000",
  61. name: "arrow-right",
  62. size: "16"
  63. }),
  64. c: common_vendor.o(toLogin),
  65. d: common_vendor.f(common_vendor.unref($config).menuList, (item, index, i0) => {
  66. return {
  67. a: "f97bc692-2-" + i0,
  68. b: common_vendor.p({
  69. name: item.icon,
  70. size: "22"
  71. }),
  72. c: common_vendor.t(item.title || "暂无"),
  73. d: "f97bc692-3-" + i0,
  74. e: index,
  75. f: common_vendor.o(($event) => toCommon(item.route), index)
  76. };
  77. }),
  78. e: common_vendor.p({
  79. name: "arrow-right",
  80. size: "20"
  81. })
  82. };
  83. };
  84. }
  85. });
  86. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f97bc692"], ["__file", "D:/project/二手车/car_applet/pages/my/index.vue"]]);
  87. wx.createPage(MiniProgramPage);