gree_leran/unpackage/dist/dev/mp-weixin/pages/user/user.js

87 lines
3.0 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_Auth = require("../../utils/Auth.js");
const comm_api = require("../../comm/api.js");
if (!Array) {
const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
const _easycom_up_cell2 = common_vendor.resolveComponent("up-cell");
const _easycom_up_list_item2 = common_vendor.resolveComponent("up-list-item");
const _easycom_up_list2 = common_vendor.resolveComponent("up-list");
(_easycom_up_avatar2 + _easycom_up_cell2 + _easycom_up_list_item2 + _easycom_up_list2)();
}
const _easycom_up_avatar = () => "../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
const _easycom_up_cell = () => "../../node-modules/uview-plus/components/u-cell/u-cell.js";
const _easycom_up_list_item = () => "../../node-modules/uview-plus/components/u-list-item/u-list-item.js";
const _easycom_up_list = () => "../../node-modules/uview-plus/components/u-list/u-list.js";
if (!Math) {
(_easycom_up_avatar + _easycom_up_cell + _easycom_up_list_item + _easycom_up_list)();
}
const _sfc_main = {
__name: "user",
setup(__props) {
const serviceList = common_vendor.reactive([
{
title: "个人信息",
thumb: "/static/icon/icon_wdgrxx.png",
page: "/pages/user/userInfo"
},
{
title: "设置中心",
thumb: "/static/icon/icon_wdszzx.png",
page: "/pages/user/setting"
}
]);
const user = common_vendor.ref({
avatar: "/static/icon/tx.png",
nickName: "点击登录"
});
function gologin() {
if (utils_Auth.isLogin()) {
return;
}
common_vendor.index.navigateTo({
url: "/pages/user/login"
});
}
async function getUserInfo() {
const resp = await comm_api.userInfo();
user.value = resp.data;
}
common_vendor.onShow(() => {
getUserInfo();
});
common_vendor.onLoad(() => {
});
return (_ctx, _cache) => {
return {
a: user.value.profilePicture || "/static/icon/tx.png",
b: common_vendor.t(user.value.username),
c: common_vendor.t(user.value.phoneNumber),
d: common_vendor.o(gologin),
e: common_vendor.f(serviceList, (item, index, i0) => {
return {
a: "0f7520f0-3-" + i0 + "," + ("0f7520f0-2-" + i0),
b: common_vendor.p({
shape: "square",
size: "35",
src: item.thumb,
customStyle: "margin: -3px 5px -3px 0"
}),
c: "0f7520f0-2-" + i0 + "," + ("0f7520f0-1-" + i0),
d: common_vendor.p({
title: item.title
}),
e: index,
f: "0f7520f0-1-" + i0 + ",0f7520f0-0"
};
}),
f: common_vendor.p({
scrollable: false
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0f7520f0"], ["__file", "E:/DAN/wexinxiaochengxude/NewCode2/gree_leran/pages/user/user.vue"]]);
wx.createPage(MiniProgramPage);