1
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_http = require("../../common/http.js");
|
||||
const common_constants = require("../../common/constants.js");
|
||||
const common_config = require("../../common/config.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
KPI_ICONS: common_config.KPI_ICONS,
|
||||
kpi: { todaySales: "0.00", monthSales: "0.00", monthProfit: "0.00", stockCount: "0" },
|
||||
activeTab: "home",
|
||||
notices: [],
|
||||
@@ -25,6 +27,19 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const hasToken = (() => {
|
||||
try {
|
||||
return !!common_vendor.index.getStorageSync("TOKEN");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (!hasToken) {
|
||||
this.kpi = { todaySales: "0.00", monthSales: "0.00", monthProfit: "0.00", stockCount: "0" };
|
||||
this.notices = [];
|
||||
common_vendor.index.showToast({ title: "请登录使用该功能", icon: "none" });
|
||||
return;
|
||||
}
|
||||
this.fetchMetrics();
|
||||
this.fetchNotices();
|
||||
},
|
||||
@@ -113,7 +128,7 @@ const _sfc_main = {
|
||||
},
|
||||
goDetail() {
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:177", "[index] goDetail → /pages/detail/index");
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:198", "[index] goDetail → /pages/detail/index");
|
||||
} catch (e) {
|
||||
}
|
||||
common_vendor.index.switchTab({ url: "/pages/detail/index" });
|
||||
@@ -153,11 +168,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, {
|
||||
b: $data.noticeError,
|
||||
d: !$data.notices.length,
|
||||
f: common_vendor.t($data.kpi.todaySales),
|
||||
g: common_vendor.t($data.kpi.monthSales),
|
||||
h: common_vendor.t($data.kpi.monthProfit),
|
||||
i: common_vendor.t($data.kpi.stockCount),
|
||||
j: common_vendor.f($data.features, (item, k0, i0) => {
|
||||
f: $data.KPI_ICONS.todaySales,
|
||||
g: common_vendor.t($data.kpi.todaySales),
|
||||
h: $data.KPI_ICONS.monthSales,
|
||||
i: common_vendor.t($data.kpi.monthSales),
|
||||
j: $data.KPI_ICONS.monthProfit,
|
||||
k: common_vendor.t($data.kpi.monthProfit),
|
||||
l: $data.KPI_ICONS.stockCount,
|
||||
m: common_vendor.t($data.kpi.stockCount),
|
||||
n: common_vendor.f($data.features, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.img
|
||||
}, item.img ? {
|
||||
|
||||
Reference in New Issue
Block a user