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.

132 lines
3.6 KiB
JavaScript

11 months ago
"use strict";
const common_vendor = require("../../common/vendor.js");
const store_index = require("../../store/index.js");
11 months ago
const utils_index = require("../../utils/index.js");
require("../../api/index.js");
11 months ago
require("../../api/request.js");
require("../../config/index.js");
11 months ago
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();
}
11 months ago
const _sfc_main = {
__name: "index",
setup(__props) {
store_index.useStore();
11 months ago
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"
11 months ago
});
}
11 months ago
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"
});
}
11 months ago
return (_ctx, _cache) => {
11 months ago
return common_vendor.e({
a: is_login.value ? avatar.value : "../../static/avatar.png",
b: common_vendor.t(is_login.value ? userinfo.value.nickname : "未登录"),
11 months ago
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
11 months ago
}, !is_login.value ? {
11 months ago
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))
});
11 months ago
};
}
};
11 months ago
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79e6a490"], ["__file", "F:/项目2023/视力表/vision-record/pages/user/index.vue"]]);
11 months ago
wx.createPage(MiniProgramPage);