1.29 财务分析模块完善
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
<template>
|
||||
<view>
|
||||
<navBar leftText="平安银行(000001)" :hideNavBg="true"></navBar>
|
||||
<navBar :leftText="navTitle" :hideNavBg="true"></navBar>
|
||||
<image class="topBg absolute" src="/static/image/index/conceptTopBg.png" mode="widthFix"></image>
|
||||
<view class="searchC fixed flex" :style="'top:'+navH+'px;'">
|
||||
<image class="icon" src="/static/icon/home/conceptCenter/search.png" mode="widthFix"></image>
|
||||
<input class="flex1" type="text" v-model="keywords" placeholder="输入股票代码或名称"
|
||||
placeholder-style="color:#eeeeee" confirm-type="search" @confirm="clickSearch()" />
|
||||
placeholder-style="color:#eeeeee" @input="clickSearch()"/>
|
||||
</view>
|
||||
<view v-if="searchShow" class="searchResultList fixed" :style="'top:'+searchResultTop+'px;'" @click="clickSearchResultBg()">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item,index) in searchResultList" :key="index" @click.stop="clickSearchResultListItem(item)">
|
||||
{{item.stock_code}} {{item.stock_name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="stockDetailsC fixed" :style="'top:'+contentTop+'px;'">
|
||||
<view v-if="stockBasicInfo" class="basicInfoC">
|
||||
@@ -182,7 +189,7 @@
|
||||
<zysj-view :stockInfo="financialStockInfo" :barCategoryList="mainBussinessBarCategoryList" :barList="mainBussinessBarList" :lineList="mainBussinessLineList" :productClassificationList="productClassificationList" ></zysj-view>
|
||||
</block>
|
||||
<block v-if="selectCaiwu==1">
|
||||
<cwfx-view></cwfx-view>
|
||||
<cwfx-view :dataList="financialMetricsList"></cwfx-view>
|
||||
</block>
|
||||
<block v-if="selectCaiwu==2">
|
||||
<cwsj-view></cwsj-view>
|
||||
@@ -209,11 +216,11 @@
|
||||
<image class="icon" src="/pagesStock/static/icon/contrast.png" mode="heightFix"></image>
|
||||
<view>对比</view>
|
||||
</view>
|
||||
<view class="item" @click="clickComment()">
|
||||
<view class="item" @click="clickOptional()">
|
||||
<image class="icon" src="/pagesStock/static/icon/optional.png" mode="heightFix"></image>
|
||||
<view>自选</view>
|
||||
</view>
|
||||
<view class="item" @click="clickFollow()">
|
||||
<view class="item" @click="clickShare()">
|
||||
<image class="icon" src="/pagesStock/static/icon/share.png" mode="heightFix"></image>
|
||||
<view>分享</view>
|
||||
</view>
|
||||
@@ -367,9 +374,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin: 30rpx 0; font-weight: bold; font-size: 28rpx;">相关公司</view>
|
||||
|
||||
<view v-for="(item,index) in relatedCompanyList" :key="index" style="margin: 20rpx 0; border: 1rpx solid #E7E7E7; border-radius: 10rpx; padding: 25rpx 20rpx;">
|
||||
<view>
|
||||
<text style="font-size: 28rpx; font-weight: bold;">{{item.stock_name}}</text>
|
||||
@@ -391,7 +396,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="detailInfoPopup" type="bottom" :safeArea="false">
|
||||
<view class="industryRankPop" style="padding-bottom: env(safe-area-inset-bottom);">
|
||||
<view class="popTitle">详情</view>
|
||||
@@ -426,16 +430,20 @@
|
||||
|
||||
<script>
|
||||
import { inject } from 'vue'
|
||||
import { actualControl, branchesList, companyAnnouncementsList, comprehensiveAnalysis, eventList, financialComparison, financialMainBusiness, financialStockInfo, industryRankList, keyFactorsTimeline, managementTeam, ownershipConcentration, quoteDetailsInfo, stockBasicInfo, topCirculatingShareholdersList, topShareholdersList, valueChainAnalysis, valueChainRelatedCompany } from '@/request/api'
|
||||
import { actualControl, branchesList, companyAnnouncementsList, comprehensiveAnalysis, eventList, financialComparison, financialMainBusiness, financialMetrics, financialStockInfo, industryRankList, keyFactorsTimeline, managementTeam, ownershipConcentration, quoteDetailsInfo, searchStockInfo, stockBasicInfo, topCirculatingShareholdersList, topShareholdersList, valueChainAnalysis, valueChainRelatedCompany } from '@/request/api'
|
||||
import { getLastNameStr, getLocalDate, getNumStr, getRateUpOrDown, getAgeByBirthYear } from '@/utils/util'
|
||||
const echarts = require('../../uni_modules/lime-echart/static/echarts.min.js');
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navH: inject('navHeight'),
|
||||
navH: inject('navHeight'),
|
||||
navTitle:'', //标题
|
||||
searchResultTop:'', //搜索结果
|
||||
contentTop: '',
|
||||
keywords: '', //搜索关键字
|
||||
keywords: '', //搜索关键字
|
||||
searchShow:false, //是否展示搜索结果
|
||||
searchResultList:[], //搜索结果
|
||||
selectSearchStockInfo:null, //选中的搜索股票信息
|
||||
stockCode:'300700', //股票代码 600759 000009 002004 300700
|
||||
stockBasicInfo:null, //股票基本信息
|
||||
quoteDetailsInfo:null, //股票事实市场价格信息
|
||||
@@ -572,6 +580,7 @@
|
||||
}
|
||||
], //财务全景分类
|
||||
selectCaiwu: 0,
|
||||
financialMetricsList:[], //财务分析列表数据
|
||||
financialStockInfo:null,
|
||||
mainBussinessBarCategoryList:[], //主营业务柱状图,折线图分类
|
||||
mainBussinessBarList:[], //主营业务柱状图数据
|
||||
@@ -594,8 +603,13 @@
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.contentTop = this.navH + (20 + 70 + 30) / 750 * inject('windowWidth')
|
||||
onLoad(e) {
|
||||
this.searchResultTop = this.navH + (20 + 70) / 750 * inject('windowWidth')
|
||||
this.contentTop = this.searchResultTop + 30 / 750 * inject('windowWidth')
|
||||
if(e.code)
|
||||
{
|
||||
this.stockCode = e.code
|
||||
}
|
||||
this.getStockBasicInfoData()
|
||||
this.getQuoteDetailsData()
|
||||
this.getActualControlData()
|
||||
@@ -608,6 +622,24 @@
|
||||
* 点击搜索
|
||||
*/
|
||||
clickSearch() {
|
||||
if(this.keywords) {
|
||||
this.getSearchStockInfoListData()
|
||||
}else
|
||||
this.selectSearchStockInfo = null
|
||||
},
|
||||
/**
|
||||
* 点击搜索结果背景
|
||||
*/
|
||||
clickSearchResultBg()
|
||||
{
|
||||
this.searchShow = false
|
||||
},
|
||||
/**
|
||||
* 点击搜索结果列表项
|
||||
*/
|
||||
clickSearchResultListItem(item) {
|
||||
this.selectSearchStockInfo = item
|
||||
this.searchShow = false
|
||||
this.getStockBasicInfoData()
|
||||
this.getQuoteDetailsData()
|
||||
},
|
||||
@@ -679,6 +711,9 @@
|
||||
clickCaiWuItem(index) {
|
||||
if (this.selectCaiwu != index) {
|
||||
this.selectCaiwu = index
|
||||
if(index==1) {
|
||||
this.getFinancialMetricsData()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -734,16 +769,43 @@
|
||||
{
|
||||
this.$refs["valueChainPopup"].close()
|
||||
},
|
||||
/**
|
||||
* 点击自选
|
||||
*/
|
||||
clickOptional()
|
||||
{
|
||||
|
||||
},
|
||||
/**
|
||||
* 点击分享
|
||||
*/
|
||||
clickShare()
|
||||
{
|
||||
|
||||
},
|
||||
/**
|
||||
* 根据输入内容获取搜索列表项
|
||||
*/
|
||||
getSearchStockInfoListData() {
|
||||
let param = {q:this.keywords,limit:10}
|
||||
searchStockInfo(param).then(res=>{
|
||||
this.searchResultList = res.data
|
||||
this.searchShow = this.searchResultList.length>0
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取股票基本信息
|
||||
*/
|
||||
getStockBasicInfoData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
stockBasicInfo(code).then(res=>{
|
||||
this.stockBasicInfo = res.data
|
||||
this.navTitle = res.data.SECNAME+'('+res.data.SECCODE+')'
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
@@ -753,8 +815,8 @@
|
||||
*/
|
||||
getQuoteDetailsData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
quoteDetailsInfo(code).then(res=>{
|
||||
this.quoteDetailsInfo = res.data
|
||||
@@ -767,8 +829,8 @@
|
||||
*/
|
||||
getActualControlData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
actualControl(code).then(res=>{
|
||||
this.actualControlInfo = res.data[0]
|
||||
@@ -781,8 +843,8 @@
|
||||
*/
|
||||
getOwnershipConcentration() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
ownershipConcentration(code).then(res=>{
|
||||
this.concentrationList = res.data.slice(0,8)
|
||||
@@ -795,8 +857,8 @@
|
||||
*/
|
||||
getTopShareholdersData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
topShareholdersList(code,{'limit':10}).then(res=>{
|
||||
this.topShareholdersList = res.data
|
||||
@@ -809,8 +871,8 @@
|
||||
*/
|
||||
getTopCirculatingShareholdersData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
topCirculatingShareholdersList(code,{'limit':10}).then(res=>{
|
||||
this.topCirculatingShareholdersList = res.data
|
||||
@@ -823,8 +885,8 @@
|
||||
*/
|
||||
getManagementTeamData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
managementTeam(code,{active_only:true}).then(res=>{
|
||||
let data = res.data
|
||||
@@ -869,8 +931,8 @@
|
||||
*/
|
||||
getBranchListData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
branchesList(code).then(res=>{
|
||||
this.branchList = res.data
|
||||
@@ -883,8 +945,8 @@
|
||||
*/
|
||||
getComprehensiveAnalysisData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
comprehensiveAnalysis(code).then(res=>{
|
||||
this.qualitativeAnalysisInfo = res.data.qualitative_analysis
|
||||
@@ -919,8 +981,8 @@
|
||||
*/
|
||||
getIndustryRankListData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
industryRankList(code).then(res=>{
|
||||
this.industryRankList = res.data
|
||||
@@ -933,8 +995,8 @@
|
||||
*/
|
||||
getValueChainAnalysisData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
valueChainAnalysis(code).then(res=>{
|
||||
this.valueChainAnalysisInfo = res.data.analysis_summary
|
||||
@@ -967,8 +1029,8 @@
|
||||
*/
|
||||
getKeyFactorsTimelineData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
keyFactorsTimeline(code).then(res=>{
|
||||
this.keyFactorsInfo = res.data.key_factors
|
||||
@@ -985,18 +1047,40 @@
|
||||
getFinancialStockInfoData()
|
||||
{
|
||||
let code = this.stockCode
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
financialStockInfo(code).then(res=>{
|
||||
this.financialStockInfo = res.data
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取财务指标数据
|
||||
*/
|
||||
getFinancialMetricsData()
|
||||
{
|
||||
let code = this.stockCode
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
let param = {limit:8}
|
||||
financialMetrics(code,param).then(res=>{
|
||||
this.financialMetricsList = res.data
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取财务比较数据
|
||||
*/
|
||||
getFinancialComparisonData()
|
||||
{
|
||||
let code = this.stockCode
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
let param = {periods:8}
|
||||
financialComparison(code,param).then(res=>{
|
||||
let data = res.data
|
||||
@@ -1004,7 +1088,11 @@
|
||||
this.mainBussinessBarList = []
|
||||
this.mainBussinessLineList = []
|
||||
for (let item of data) {
|
||||
this.mainBussinessBarCategoryList.unshift(item.report_type.replace('三季报','Q3'))
|
||||
let type = item.report_type
|
||||
type = type.replace('年三季报','Q3')
|
||||
type = type.replace('年中报','中报')
|
||||
type = type.replace('年年报','年报')
|
||||
this.mainBussinessBarCategoryList.unshift(type)
|
||||
this.mainBussinessBarList.unshift((parseFloat(item.performance.revenue)/100000000).toFixed(2))
|
||||
this.mainBussinessLineList.unshift((parseFloat(item.performance.net_profit)/100000000).toFixed(2))
|
||||
}
|
||||
@@ -1018,6 +1106,9 @@
|
||||
getFinancialMainBussinessData()
|
||||
{
|
||||
let code = this.stockCode
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
let param = {periods:4}
|
||||
financialMainBusiness(code,param).then(res=>{
|
||||
this.productClassificationList = res.data.product_classification
|
||||
@@ -1047,8 +1138,8 @@
|
||||
*/
|
||||
getCompanyAnnouncementsData() {
|
||||
let code = this.stockCode
|
||||
if (this.keywords) {
|
||||
code = this.keywords
|
||||
if (this.selectSearchStockInfo) {
|
||||
code = this.selectSearchStockInfo.stock_code
|
||||
}
|
||||
let param = {limit:20}
|
||||
companyAnnouncementsList(code,param).then(res=>{
|
||||
@@ -1094,6 +1185,27 @@
|
||||
height: 100%;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
.searchResultList {
|
||||
background-color: #00000080;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 0 25rpx;
|
||||
.list
|
||||
{
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
.item
|
||||
{
|
||||
padding: 0 42rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.stockDetailsC {
|
||||
|
||||
Reference in New Issue
Block a user