You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const api_index = require("../../api/index.js");
const _sfc_main = {
__name: "index",
setup(__props) {
const services = ["营销策划", "会议服务", "商务咨询", "庆典服务", "礼仪服务"];
const gotoAbout = () => {
common_vendor.index.navigateTo({
url: "/pages/about"
});
};
const handleLogin = async () => {
try {
const res = await common_vendor.wx$1.login();
if (res.code) {
common_vendor.index.__f__("log", "at pages/index/index.vue:48", res.code);
api_index.Login({
code: res.code
}).then((res2) => {
if (res2.status) {
if (res2.data.member !== null && res2.data.url !== null) {
common_vendor.index.navigateTo({
url: "/pages/h5?url=" + res2.data.url
});
}
}
});
} else {
common_vendor.index.__f__("error", "at pages/index/index.vue:61", "登录失败", res.errMsg);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:64", "登录异常", error);
}
};
common_vendor.onLoad(() => {
handleLogin();
});
return (_ctx, _cache) => {
return {
a: common_assets._imports_0,
b: common_vendor.o(gotoAbout),
c: common_vendor.f(services, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map