314 lines
12 KiB
JavaScript
314 lines
12 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const request_api = require("../../../request/api.js");
|
|
const common_assets = require("../../../common/assets.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
navH: common_vendor.inject("navHeight"),
|
|
windowWidth: common_vendor.inject("windowWidth"),
|
|
contentTop: "",
|
|
otherTop: "",
|
|
stockCode: "000001",
|
|
//股票代码
|
|
tabList: ["盈利能力", "每股指标", "成长能力", "资产负债表", "现金流量指标", "现金流量表"],
|
|
activeIndex: 0,
|
|
topScrollWidth: 0,
|
|
topScrollLeft: 0,
|
|
filterList: ["全部", "年报", "中报", "一季度", "三季度"],
|
|
filterIndex: 0,
|
|
secondScrollWidth: 0,
|
|
secondScrollLeft: 0,
|
|
periodList: [
|
|
{
|
|
title: "最近4期",
|
|
period: 4
|
|
},
|
|
{
|
|
title: "最近8期",
|
|
period: 8
|
|
},
|
|
{
|
|
title: "最近12期",
|
|
period: 12
|
|
},
|
|
{
|
|
title: "最近16期",
|
|
period: 16
|
|
}
|
|
],
|
|
periodIndex: 1,
|
|
periodTop: "",
|
|
periodShow: false,
|
|
//是否显示弹窗
|
|
leftList: [
|
|
["净资产收益率(ROE)%", "净资产收益率(扣非)%", "净资产收益率(加权)%", "总资产报酬率(ROA)%", "毛利率%", "净利率%", "营业利润率%", "成本费用利润率%", "EBIT"],
|
|
["每股收益(EPS)%", "基本每股收益", "稀释每股收益", "扣非每股收益", "每股净资产", "每股经营现金流", "每股资本公积", "每股未分配利润"],
|
|
["营收增长率%", "净利润增长率%", "扣非净利润增长率%", "归母净利润增长率%", "经营现金流增长率%", "总资产增长率%", "净资产增长率%", "固定资产增长率%"],
|
|
["营收增长率%", "净利润增长率%", "扣非净利润增长率%", "归母净利润增长率%", "经营现金流增长率%", "总资产增长率%", "净资产增长率%", "固定资产增长率%"],
|
|
["货币资金", "交易性金融资产", "应收票据", "营收账款", "预付款项", "其他应收款", "存货", "存货", "其他流动资产"],
|
|
["经营现金流净额", "销售收现", "购买支付现金", "投资现金流净额", "筹资现金流净额", "现金净增加额", "期末现金余额", "自由现金流"]
|
|
],
|
|
financialMetricsList: [],
|
|
showDataList: []
|
|
};
|
|
},
|
|
onLoad(e) {
|
|
if (e.index) {
|
|
this.activeIndex = e.index;
|
|
}
|
|
if (e.code) {
|
|
this.stockCode = e.code;
|
|
}
|
|
this.contentTop = this.navH + 20 / 750 * common_vendor.inject("windowWidth");
|
|
this.otherTop = this.navH + 204 / 750 * common_vendor.inject("windowWidth");
|
|
this.getFinancialMetricsData();
|
|
},
|
|
onReady() {
|
|
common_vendor.index.createSelectorQuery().select("#topCategory").boundingClientRect((rect) => {
|
|
this.topScrollWidth = Math.round(rect.width);
|
|
}).exec();
|
|
common_vendor.index.createSelectorQuery().select("#filterList").boundingClientRect((rect) => {
|
|
if (rect) {
|
|
this.secondScrollWidth = Math.round(rect.width);
|
|
}
|
|
}).exec();
|
|
},
|
|
methods: {
|
|
clickTabItem(e, index) {
|
|
if (this.activeIndex != index) {
|
|
this.activeIndex = index;
|
|
let offsetLeft = e.currentTarget.offsetLeft;
|
|
this.topScrollLeft = offsetLeft - this.topScrollWidth / 2;
|
|
}
|
|
},
|
|
/**
|
|
* 点击选择筛选项
|
|
* @param {Object} index
|
|
*/
|
|
clickFilterItem(e, index) {
|
|
if (this.filterIndex != index) {
|
|
this.filterIndex = index;
|
|
let offsetLeft = e.currentTarget.offsetLeft;
|
|
this.secondScrollLeft = offsetLeft - this.secondScrollWidth / 2;
|
|
if (this.activeIndex == 0 || this.activeIndex == 1 || this.activeIndex == 2 || this.activeIndex == 4) {
|
|
this.getFinancialMetricsData();
|
|
}
|
|
}
|
|
},
|
|
/**
|
|
* 点击选择期数
|
|
* @param {Object} e
|
|
*/
|
|
clickSelectPeriod(e) {
|
|
this.periodTop = e.currentTarget.offsetTop + this.navH + (70 + 10) / 750 * this.windowWidth;
|
|
this.periodShow = true;
|
|
},
|
|
/**
|
|
* 点击选择期数
|
|
* @param {Object} index
|
|
*/
|
|
clickPeriodItem(index) {
|
|
if (this.periodIndex != index) {
|
|
this.periodIndex = index;
|
|
this.periodShow = false;
|
|
}
|
|
},
|
|
/**
|
|
* 获取财务指标数据
|
|
*/
|
|
getFinancialMetricsData() {
|
|
let code = this.stockCode;
|
|
let period = this.periodList[this.periodIndex].period;
|
|
let param = { limit: period };
|
|
request_api.financialMetrics(code, param).then((res) => {
|
|
this.financialMetricsList = res.data;
|
|
this.getFinancialMetricsShowData();
|
|
}).catch((error) => {
|
|
});
|
|
},
|
|
getFinancialMetricsShowData() {
|
|
let data = [];
|
|
if (this.filterIndex == 0) {
|
|
data = this.financialMetricsList;
|
|
} else if (this.filterIndex == 1) {
|
|
for (let item of this.financialMetricsList) {
|
|
if (item.report_type.indexOf("年报") > -1) {
|
|
data.push(item);
|
|
}
|
|
}
|
|
} else if (this.filterIndex == 2) {
|
|
for (let item of this.financialMetricsList) {
|
|
if (item.report_type.indexOf("中报") > -1) {
|
|
data.push(item);
|
|
}
|
|
}
|
|
} else if (this.filterIndex == 3) {
|
|
for (let item of this.financialMetricsList) {
|
|
if (item.report_type.indexOf("一季报") > -1) {
|
|
data.push(item);
|
|
}
|
|
}
|
|
} else if (this.filterIndex == 4) {
|
|
for (let item of this.financialMetricsList) {
|
|
if (item.report_type.indexOf("三季报") > -1) {
|
|
data.push(item);
|
|
}
|
|
}
|
|
}
|
|
this.showDataList = data;
|
|
common_vendor.index.__f__("log", "at pagesStock/stockCenterDetails/cwDetails/cwDetails.vue:272", this.showDataList);
|
|
},
|
|
/**
|
|
* 获取资产负债表数据
|
|
*/
|
|
getFinancialBalanceSheetData() {
|
|
let code = this.stockCode;
|
|
let period = this.periodList[this.periodIndex].period;
|
|
let param = { limit: period };
|
|
request_api.financialBalanceSheet(code, param).then((res) => {
|
|
this.financialBalanceList = res.data;
|
|
}).catch((error) => {
|
|
});
|
|
},
|
|
/**
|
|
* 获取现金流量表数据
|
|
*/
|
|
getCashFlowSheetData() {
|
|
let code = this.stockCode;
|
|
let period = this.periodList[this.periodIndex].period;
|
|
let param = { limit: period };
|
|
request_api.cashflowSheet(code, param).then((res) => {
|
|
this.cashFlowList = res.data;
|
|
}).catch((error) => {
|
|
});
|
|
},
|
|
/**
|
|
* 获取利润表数据
|
|
*/
|
|
getIncomeStatementSheetData() {
|
|
let code = this.stockCode;
|
|
let period = this.periodList[this.periodIndex].period;
|
|
let param = { limit: period };
|
|
request_api.incomeStatementSheet(code, param).then((res) => {
|
|
this.incomeStatementList = res.data;
|
|
}).catch((error) => {
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
|
_easycom_navBar2();
|
|
}
|
|
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
|
|
if (!Math) {
|
|
_easycom_navBar();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: common_vendor.p({
|
|
leftText: "平安银行(000001)",
|
|
hideNavBg: true
|
|
}),
|
|
b: common_assets._imports_0,
|
|
c: common_vendor.f($data.tabList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
b: index,
|
|
c: "tab-" + index,
|
|
d: index == $data.tabList.length - 1 ? "0" : "40rpx",
|
|
e: $data.activeIndex == index ? "#2B2B2B" : "#999999",
|
|
f: $data.activeIndex == index ? "28rpx" : "26rpx",
|
|
g: $data.activeIndex == index ? "1rpx solid #F2C369" : "none",
|
|
h: $data.activeIndex == index ? "bold" : "500",
|
|
i: common_vendor.o(($event) => $options.clickTabItem($event, index), index)
|
|
};
|
|
}),
|
|
d: $data.topScrollLeft,
|
|
e: common_vendor.f($data.filterList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
b: common_vendor.n("item flexCenter " + ($data.filterIndex == index ? "select" : "")),
|
|
c: index,
|
|
d: common_vendor.o(($event) => $options.clickFilterItem($event, index), index)
|
|
};
|
|
}),
|
|
f: $data.secondScrollLeft,
|
|
g: common_vendor.t($data.periodList[$data.periodIndex].title),
|
|
h: common_assets._imports_4$10,
|
|
i: common_vendor.o(($event) => $options.clickSelectPeriod($event)),
|
|
j: common_vendor.s("top:" + $data.contentTop + "px;"),
|
|
k: common_vendor.f($data.leftList[$data.activeIndex], (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
b: index,
|
|
c: index % 2 == 0 ? "#fff" : "#FAFAFC"
|
|
};
|
|
}),
|
|
l: common_vendor.f($data.showDataList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.report_type),
|
|
b: common_vendor.f($data.leftList[$data.activeIndex], (litem, lindex, i1) => {
|
|
return common_vendor.e($data.activeIndex == 0 ? common_vendor.e({
|
|
a: lindex == 0
|
|
}, lindex == 0 ? {
|
|
b: common_vendor.t($data.showDataList[index].profitability.roe ? $data.showDataList[index].profitability.roe.toFixed(2) : "-")
|
|
} : {}, {
|
|
c: lindex == 1
|
|
}, lindex == 1 ? {
|
|
d: common_vendor.t($data.showDataList[index].profitability.roe_deducted ? $data.showDataList[index].profitability.roe_deducted.toFixed(2) : "-")
|
|
} : {}, {
|
|
e: lindex == 2
|
|
}, lindex == 2 ? {
|
|
f: common_vendor.t($data.showDataList[index].profitability.roe_weighted ? $data.showDataList[index].profitability.roe_weighted.toFixed(2) : "-")
|
|
} : {}, {
|
|
g: lindex == 3
|
|
}, lindex == 3 ? {
|
|
h: common_vendor.t($data.showDataList[index].profitability.roa ? $data.showDataList[index].profitability.roa.toFixed(2) : "-")
|
|
} : {}, {
|
|
i: lindex == 4
|
|
}, lindex == 4 ? {
|
|
j: common_vendor.t($data.showDataList[index].profitability.gross_margin ? $data.showDataList[index].profitability.gross_margin.toFixed(2) : "-")
|
|
} : {}, {
|
|
k: lindex == 5
|
|
}, lindex == 5 ? {
|
|
l: common_vendor.t($data.showDataList[index].profitability.net_profit_margin ? $data.showDataList[index].profitability.net_profit_margin.toFixed(2) : "-")
|
|
} : {}, {
|
|
m: lindex == 6
|
|
}, lindex == 6 ? {
|
|
n: common_vendor.t($data.showDataList[index].profitability.operating_profit_margin ? $data.showDataList[index].profitability.operating_profit_margin.toFixed(2) : "-")
|
|
} : {}, {
|
|
o: lindex == 7
|
|
}, lindex == 7 ? {
|
|
p: common_vendor.t($data.showDataList[index].profitability.cost_profit_ratio ? $data.showDataList[index].profitability.cost_profit_ratio.toFixed(2) : "-")
|
|
} : {}, {
|
|
q: lindex == 8
|
|
}, lindex == 8 ? {
|
|
r: common_vendor.t($data.showDataList[index].profitability.ebit ? $data.showDataList[index].profitability.ebit.toFixed(2) : "-")
|
|
} : {}) : {}, {
|
|
s: lindex,
|
|
t: lindex % 2 == 0 ? "#fff" : "#FAFAFC"
|
|
});
|
|
}),
|
|
c: index
|
|
};
|
|
}),
|
|
m: $data.activeIndex == 0,
|
|
n: common_vendor.s("top:" + $data.otherTop + "px;"),
|
|
o: $data.periodShow
|
|
}, $data.periodShow ? {
|
|
p: common_vendor.f($data.periodList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.title),
|
|
b: index,
|
|
c: common_vendor.o(($event) => $options.clickPeriodItem(index), index)
|
|
};
|
|
}),
|
|
q: common_vendor.s("top:" + $data.periodTop + "px")
|
|
} : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pagesStock/stockCenterDetails/cwDetails/cwDetails.js.map
|