2023-10-11 22:20:34 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
|
const store_index = require("../../store/index.js");
|
2023-10-18 21:00:42 +08:00
|
|
|
const utils_index = require("../../utils/index.js");
|
|
|
|
require("../../api/index.js");
|
2023-10-11 22:20:34 +08:00
|
|
|
require("../../api/request.js");
|
|
|
|
require("../../config/index.js");
|
2023-10-19 23:23:22 +08:00
|
|
|
if (!Array) {
|
|
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
|
|
_easycom_uni_icons2();
|
|
|
|
}
|
|
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
|
|
if (!Math) {
|
|
|
|
_easycom_uni_icons();
|
|
|
|
}
|
2023-10-11 22:20:34 +08:00
|
|
|
const _sfc_main = {
|
|
|
|
__name: "index",
|
|
|
|
setup(__props) {
|
|
|
|
store_index.useStore();
|
2023-10-18 21:00:42 +08:00
|
|
|
common_vendor.onShow(() => {
|
|
|
|
is_login.value = utils_index.custom.checkLogin();
|
|
|
|
if (is_login.value) {
|
|
|
|
userinfo.value = common_vendor.index.getStorageSync("userInfo");
|
|
|
|
avatar.value = common_vendor.index.getStorageSync("avatarUrl");
|
|
|
|
userinfo.value = JSON.parse(userinfo.value);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const avatar = common_vendor.ref("");
|
|
|
|
common_vendor.ref(null);
|
|
|
|
const is_login = common_vendor.ref(null);
|
|
|
|
const userinfo = common_vendor.ref(null);
|
|
|
|
function toLogin() {
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pages/login/login"
|
2023-10-11 22:20:34 +08:00
|
|
|
});
|
|
|
|
}
|
2023-10-19 23:23:22 +08:00
|
|
|
function toDetail(type) {
|
|
|
|
let url = "";
|
|
|
|
switch (type) {
|
|
|
|
case 1:
|
|
|
|
url = " ";
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
url = "./star";
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
url = "./setting";
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
url = "./feedback";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
url = " ";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function toUserInfo() {
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pages/user/userInfo"
|
|
|
|
});
|
|
|
|
}
|
2023-10-11 22:20:34 +08:00
|
|
|
return (_ctx, _cache) => {
|
2023-10-18 21:00:42 +08:00
|
|
|
return common_vendor.e({
|
|
|
|
a: is_login.value ? avatar.value : "../../static/avatar.png",
|
|
|
|
b: common_vendor.t(is_login.value ? userinfo.value.nickname : "未登录"),
|
2023-10-19 23:23:22 +08:00
|
|
|
c: is_login.value
|
|
|
|
}, is_login.value ? {
|
|
|
|
d: common_vendor.p({
|
|
|
|
type: "forward",
|
|
|
|
color: "white",
|
|
|
|
size: "20"
|
|
|
|
})
|
|
|
|
} : {}, {
|
|
|
|
e: common_vendor.o(toUserInfo),
|
|
|
|
f: !is_login.value
|
2023-10-18 21:00:42 +08:00
|
|
|
}, !is_login.value ? {
|
2023-10-19 23:23:22 +08:00
|
|
|
g: common_vendor.o(toLogin)
|
|
|
|
} : {
|
|
|
|
h: common_vendor.p({
|
|
|
|
type: "calendar",
|
|
|
|
color: "gray",
|
|
|
|
size: "30"
|
|
|
|
}),
|
|
|
|
i: common_vendor.p({
|
|
|
|
type: "notification",
|
|
|
|
color: "gray",
|
|
|
|
size: "30"
|
|
|
|
}),
|
|
|
|
j: common_vendor.o(($event) => toDetail(1)),
|
|
|
|
k: common_vendor.p({
|
|
|
|
type: "star",
|
|
|
|
color: "gray",
|
|
|
|
size: "30"
|
|
|
|
}),
|
|
|
|
l: common_vendor.p({
|
|
|
|
type: "forward",
|
|
|
|
color: "gray",
|
|
|
|
size: "20"
|
|
|
|
}),
|
|
|
|
m: common_vendor.o(($event) => toDetail(2)),
|
|
|
|
n: common_vendor.p({
|
|
|
|
type: "gear",
|
|
|
|
color: "gray",
|
|
|
|
size: "30"
|
|
|
|
}),
|
|
|
|
o: common_vendor.p({
|
|
|
|
type: "forward",
|
|
|
|
color: "gray",
|
|
|
|
size: "20"
|
|
|
|
}),
|
|
|
|
p: common_vendor.o(($event) => toDetail(3)),
|
|
|
|
q: common_vendor.p({
|
|
|
|
type: "chatbubble",
|
|
|
|
color: "gray",
|
|
|
|
size: "30"
|
|
|
|
}),
|
|
|
|
r: common_vendor.p({
|
|
|
|
type: "forward",
|
|
|
|
color: "gray",
|
|
|
|
size: "20"
|
|
|
|
}),
|
|
|
|
s: common_vendor.o(($event) => toDetail(4))
|
|
|
|
});
|
2023-10-11 22:20:34 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2023-10-18 21:00:42 +08:00
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79e6a490"], ["__file", "F:/项目2023/视力表/vision-record/pages/user/index.vue"]]);
|
2023-10-11 22:20:34 +08:00
|
|
|
wx.createPage(MiniProgramPage);
|