12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- __name: "index",
- setup(__props) {
- var _a, _b, _c;
- const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
- (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$app;
- (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$config;
- const config = common_vendor.ref({ logo: [] });
- common_vendor.onLoad(async () => {
- await searchConfig();
- await search();
- });
- const searchConfig = async () => {
- let res = await $api(`config`, "GET", {});
- if (res.errcode == 0) {
- config.value = res.data;
- common_vendor.index.setStorage({
- key: "config",
- data: res.data,
- success: function(arr) {
- },
- fail: function(err) {
- console.log(err);
- }
- });
- }
- };
- const search = async () => {
- common_vendor.index.getStorage({
- key: "openid",
- success: function(res) {
- common_vendor.index.reLaunch({
- url: `/pages/home/index`
- });
- },
- fail: function(err) {
- common_vendor.index.login({
- success: async function(res) {
- if (res.code) {
- common_vendor.index.reLaunch({
- url: `/pages/home/index`
- });
- } else {
- common_vendor.index.showToast({
- title: res.errMsg,
- icon: "none"
- });
- }
- }
- });
- }
- });
- };
- return (_ctx, _cache) => {
- return {
- a: config.value.logo[0].url || "/static/logo.png"
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/project/二手车/car_applet/pages/index/index.vue"]]);
- wx.createPage(MiniProgramPage);
|