myCenter.js
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_login = require("../../common/login.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/aes.js");
if (!Array) {
const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
(_easycom_uni_list_item2 + _easycom_uni_list2)();
}
const _easycom_uni_list_item = () => "../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
const _easycom_uni_list = () => "../../uni_modules/uni-list/components/uni-list/uni-list.js";
if (!Math) {
(_easycom_uni_list_item + _easycom_uni_list)();
}
const _sfc_main = {
__name: "myCenter",
setup(__props) {
const user = common_vendor.ref({});
const app = getApp();
common_vendor.onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
console.log(app.globalData.isLogin);
if (app.globalData.userInfo) {
const currUser = app.globalData.userInfo;
user.value = currUser;
} else {
common_login.getInfo().then((res) => {
const currUser = app.globalData.userInfo;
user.value = currUser;
});
}
}
function goPath(path) {
if (path)
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return {
a: _ctx.avatarUrl,
b: common_vendor.t(user.value.nickName),
c: common_vendor.t(user.value.phonenumber),
d: common_vendor.o(($event) => goPath("/myCenter/mytrain/mytrain")),
e: common_vendor.p({
border: false,
title: "我的培训",
showArrow: true,
clickable: true
}),
f: common_vendor.p({
border: false
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-eea72321"], ["__file", "/Users/huamingqi/projects/ztx/ztx_wx_minapp/pages/myCenter/myCenter.vue"]]);
wx.createPage(MiniProgramPage);