148 lines
5.2 KiB
JavaScript
148 lines
5.2 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const common_assets = require("../../common/assets.js");
|
|
require("../../uni_modules/uview-plus/index.js");
|
|
const api_api = require("../../api/api.js");
|
|
const hooks_useNav = require("../../hooks/useNav.js");
|
|
if (!Array) {
|
|
const _easycom_up_grid_item2 = common_vendor.resolveComponent("up-grid-item");
|
|
const _easycom_up_grid2 = common_vendor.resolveComponent("up-grid");
|
|
(_easycom_up_grid_item2 + _easycom_up_grid2)();
|
|
}
|
|
const _easycom_up_grid_item = () => "../../uni_modules/uview-plus/components/u-grid-item/u-grid-item.js";
|
|
const _easycom_up_grid = () => "../../uni_modules/uview-plus/components/u-grid/u-grid.js";
|
|
if (!Math) {
|
|
(_easycom_up_grid_item + _easycom_up_grid)();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "index",
|
|
setup(__props) {
|
|
const { nav, navTo } = hooks_useNav.useNav();
|
|
let getInfo = common_vendor.ref({});
|
|
common_vendor.ref({});
|
|
let devices = common_vendor.ref(0);
|
|
let teamDevices = common_vendor.ref(0);
|
|
let wallet = common_vendor.ref(0);
|
|
let income = common_vendor.ref(0);
|
|
let money_list = common_vendor.ref([
|
|
{
|
|
name: "收益统计",
|
|
type: "收益",
|
|
data: {}
|
|
},
|
|
{
|
|
name: "推广统计",
|
|
type: "推广",
|
|
data: {}
|
|
}
|
|
// {
|
|
// name: '邀请统计',
|
|
// type: '邀请',
|
|
// data: {}
|
|
// }
|
|
]);
|
|
common_vendor.ref(1);
|
|
common_vendor.onShow(async () => {
|
|
let _res = await api_api.userInfo();
|
|
getInfo.value = _res;
|
|
userStatCou();
|
|
let _data = await api_api.freezeTotal();
|
|
income.value = _data.income;
|
|
wallet.value = _data.wallet;
|
|
});
|
|
let userStatCou = async () => {
|
|
let _res = await api_api.userStat();
|
|
devices.value = _res.devices;
|
|
teamDevices.value = _res.teamDevices;
|
|
money_list.value.map((item, index) => {
|
|
if (item.type == "推广") {
|
|
item.data = {
|
|
day_money: _res.ordersToday,
|
|
week_money1: _res.ordersLastWeek,
|
|
week_money0: _res.ordersThisWeek,
|
|
total_money: _res.orders30Days
|
|
};
|
|
}
|
|
if (item.type == "收益") {
|
|
item.data = {
|
|
day_money: _res.pointDeviceToday,
|
|
week_money1: _res.pointDeviceLastWeek,
|
|
week_money0: _res.pointDeviceThisWeek,
|
|
total_money: _res.pointDevice30Days
|
|
};
|
|
}
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(common_vendor.unref(getInfo).points2 || "0.00"),
|
|
b: common_assets._imports_0,
|
|
c: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/wallet/incomeList`, true)),
|
|
d: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
e: common_assets._imports_1,
|
|
f: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/mine/transferBalance`, true)),
|
|
g: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
h: common_assets._imports_2,
|
|
i: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/mine/toUser`, true)),
|
|
j: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
k: common_assets._imports_3,
|
|
l: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/wallet/withdrawList`, true)),
|
|
m: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
n: common_assets._imports_4,
|
|
o: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/wallet/withdrawList`, true)),
|
|
p: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
q: common_assets._imports_5,
|
|
r: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/wallet/withdrawList`, true)),
|
|
s: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
t: common_vendor.p({
|
|
border: false,
|
|
col: "4"
|
|
}),
|
|
v: common_vendor.unref(getInfo).point2Give && common_vendor.unref(getInfo).point2Give == 1
|
|
}, common_vendor.unref(getInfo).point2Give && common_vendor.unref(getInfo).point2Give == 1 ? {
|
|
w: common_assets._imports_6,
|
|
x: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/mine/toUser2`, true)),
|
|
y: common_vendor.p({
|
|
bgColor: "#fff"
|
|
}),
|
|
z: common_vendor.p({
|
|
border: false,
|
|
col: "4"
|
|
})
|
|
} : {}, {
|
|
A: common_vendor.t(common_vendor.unref(devices) || 0),
|
|
B: common_vendor.t(common_vendor.unref(teamDevices) || 0),
|
|
C: common_vendor.f(common_vendor.unref(money_list), (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: common_vendor.t(item.data.day_money || 0),
|
|
c: common_vendor.t(item.type),
|
|
d: common_vendor.t(item.data.week_money1 || 0),
|
|
e: common_vendor.t(item.type),
|
|
f: common_vendor.t(item.data.week_money0 || 0),
|
|
g: common_vendor.t(item.type),
|
|
h: common_vendor.t(item.data.total_money || 0),
|
|
i: common_vendor.t(item.type),
|
|
j: index
|
|
};
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
|
|
_sfc_main.__runtimeHooks = 1;
|
|
wx.createPage(MiniProgramPage);
|