- 添加uni-ui组件库依赖 - 实现微信静默登录功能 - 创建资产、策略、我的等核心页面 - 添加策略组合配置功能 - 实现持仓详情展示 - 完善用户信息展示 - 添加全局样式和工具类 - 配置小程序项目设置
106 lines
3.1 KiB
JavaScript
106 lines
3.1 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const utils_api = require("../../utils/api.js");
|
|
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();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "me",
|
|
setup(__props) {
|
|
const userInfo = common_vendor.ref({
|
|
userName: "",
|
|
memberLevel: "",
|
|
runningDays: 0
|
|
});
|
|
const userStats = common_vendor.ref({
|
|
signalsCaptured: 0,
|
|
winRate: 0
|
|
});
|
|
const appInfo = common_vendor.ref({
|
|
version: "",
|
|
currentDate: ""
|
|
});
|
|
const fetchUserInfo = async () => {
|
|
try {
|
|
const response = await utils_api.api.user.getUserInfo();
|
|
if (response.code === 200) {
|
|
userInfo.value = response.data;
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at pages/me/me.vue:86", "获取用户信息失败:", error);
|
|
}
|
|
};
|
|
const fetchUserStats = async () => {
|
|
try {
|
|
const response = await utils_api.api.user.getUserStats();
|
|
if (response.code === 200) {
|
|
userStats.value = response.data;
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at pages/me/me.vue:98", "获取用户统计数据失败:", error);
|
|
}
|
|
};
|
|
const fetchAppInfo = async () => {
|
|
try {
|
|
const response = await utils_api.api.app.getAppInfo();
|
|
if (response.code === 200) {
|
|
appInfo.value = response.data;
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at pages/me/me.vue:110", "获取应用信息失败:", error);
|
|
}
|
|
};
|
|
common_vendor.onMounted(async () => {
|
|
await Promise.all([
|
|
fetchUserInfo(),
|
|
fetchUserStats(),
|
|
fetchAppInfo()
|
|
]);
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.t(userInfo.value.userName),
|
|
b: common_vendor.t(userInfo.value.memberLevel),
|
|
c: common_vendor.t(userInfo.value.runningDays),
|
|
d: common_vendor.t(userStats.value.signalsCaptured.toLocaleString()),
|
|
e: common_vendor.t(userStats.value.winRate),
|
|
f: common_vendor.p({
|
|
type: "checkbox",
|
|
size: "20",
|
|
color: "#9CA3AF"
|
|
}),
|
|
g: common_vendor.p({
|
|
type: "right",
|
|
size: "16",
|
|
color: "#D1D5DB"
|
|
}),
|
|
h: common_vendor.p({
|
|
type: "gear",
|
|
size: "20",
|
|
color: "#9CA3AF"
|
|
}),
|
|
i: common_vendor.p({
|
|
type: "right",
|
|
size: "16",
|
|
color: "#D1D5DB"
|
|
}),
|
|
j: common_vendor.p({
|
|
type: "staff",
|
|
size: "20",
|
|
color: "#EF4444"
|
|
}),
|
|
k: common_vendor.t(appInfo.value.version),
|
|
l: common_vendor.t(appInfo.value.currentDate)
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-19c123a7"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/me.js.map
|