8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<navBar leftText="相关概念详情"></navBar>
|
||||
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
|
||||
<view class="conceptDetailsC fixed" :style="'top:'+navH+'px;'">
|
||||
<view class="title">外骨骼机器人(250501)</view>
|
||||
<view class="time">2025-05-08 08:43</view>
|
||||
<view class="content">四部门联合启动的人力资源服务业与制造业融合发展试点,主要目的是推动人力资源服务向高端制造渗透,促进产业升级。而外骨骼机器人属于高端制造领域的重要创新产品之一,其发展需要人力资源服务业的支持,例如技术人才的输送、产业工人培训等。同时,外骨骼机器人在消费级市场的推广和应用也符合制造业与服务业融合发展的方向。因此,该政策试点对外骨骼机器人行业具有潜在利好影响。</view>
|
||||
</view>
|
||||
<web-view :src="url"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -16,7 +10,14 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navH:inject('navHeight')
|
||||
navH:inject('navHeight'),
|
||||
url:''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if(e.name)
|
||||
{
|
||||
this.url = 'https://valuefrontier.cn/htmls/'+e.name+'.html'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -28,22 +28,44 @@
|
||||
<view class="code">{{item.stock_code}}</view>
|
||||
</view>
|
||||
<view class="flex1">
|
||||
|
||||
<view style="width:140rpx; height:100rpx">
|
||||
<l-echart :ref="'chartRef'+index"></l-echart>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price flex1">{{item.trade_data.open_price}}</view>
|
||||
<view class="price flex1">{{item.trade_data.latest_price}}</view>
|
||||
<view :class="'chg flex1 '+(getRateUpOrDown(item.trade_data.change_pct)?'down':'up')">{{item.trade_data.change_pct}}%</view>
|
||||
<view class="price flex1">{{item.trade_data?item.trade_data.open_price:''}}</view>
|
||||
<view class="price flex1">{{item.trade_data?item.trade_data.latest_price:''}}</view>
|
||||
<view :class="'chg flex1 '+(getRateUpOrDown(item.trade_data?item.trade_data.change_pct:'')?'down':'up')">{{item.trade_data?item.trade_data.change_pct:''}}%</view>
|
||||
</view>
|
||||
<view class="content">{{item.relation_desc}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="selectCategory==1" class="conceptList">
|
||||
<view class="item relative" v-for="(item,index) in conceptList" :key="index" @click="clickConceptItem()">
|
||||
<image class="cover" :src="item.first_image" mode="aspectFill"></image>
|
||||
<view class="infoC absolute">
|
||||
<view v-if="selectCategory==1" class="conceptList flexWrap">
|
||||
<view class="conceptItem" v-for="(item,index) in conceptList" :key="index" @click="clickConceptItem(item.concept)">
|
||||
<view class="coverC relative">
|
||||
<image class="cover" src="" mode="aspectFill"></image>
|
||||
<view :class="'rateC absolute '+(getRateUpOrDown(item.price_info.avg_change_pct)?'down':'up')">
|
||||
<image v-if="getRateUpOrDown(item.price_info.avg_change_pct)" class="icon" src="/static/icon/home/conceptDownArrow.png" mode="widthFix"></image>
|
||||
<image v-else class="icon" src="/static/icon/home/conceptUpArrow.png" mode="widthFix"></image>
|
||||
<text>{{getRateStr(item.price_info.avg_change_pct)}}%</text>
|
||||
</view>
|
||||
<view class="totalC absolute">{{item.stock_count}}只股票</view>
|
||||
</view>
|
||||
<view class="infoC">
|
||||
<view class="title">{{item.concept}}</view>
|
||||
<view class="content relative">{{item.reason}}
|
||||
<text class="lookDetails absolute">查看详情</text>
|
||||
<view class="content">{{item.description}}</view>
|
||||
<view class="transactionDate">交易日期: {{item.price_info.trade_date}}</view>
|
||||
<view class="hotStockC">
|
||||
<view class="titleC flex">
|
||||
<text class="flex1">热门个股</text>
|
||||
<image class="arrow" src="/static/icon/home/stockArrow.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="stockList flexWrap">
|
||||
<view class="item" v-for="(item,index) in item.stocks" :key="index">{{item.stock_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dateHistoryTimeC flex">
|
||||
<view class="date flex1">{{item.happened_times[0]+(item.happened_times.length>1?('(共'+item.happened_times.length+'次)'):'')}}</view>
|
||||
<view class="historyTimeC">历史时间轴</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -65,7 +87,7 @@
|
||||
<view class="eventInfoC flex1">
|
||||
<view class="titleCorrelationC flex">
|
||||
<view class="title flex1">{{item.title}}</view>
|
||||
<view class="correlation">相关度: 98%</view>
|
||||
<view class="correlation">相关度: {{item.relevance*10}}%</view>
|
||||
</view>
|
||||
<view class="content">{{item.content}}</view>
|
||||
<scroll-view scroll-x class="increaseRateList">
|
||||
@@ -122,30 +144,30 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view class="item" v-for="(item,index) in commentList" :key="index">
|
||||
<view class="originComment">
|
||||
<image class="avatar" src="" mode="aspectFill"></image>
|
||||
<image class="avatar" :src="item.user.avatar_url" mode="aspectFill"></image>
|
||||
<view class="flex1">
|
||||
<view class="nickname">逸尘破晓</view>
|
||||
<view class="content">四部门联合启动的人力资源服务业与制造业融合发展点,主要目的是推动人力资源服务向高端制造渗透。</view>
|
||||
<view class="nickname">{{item.user.username}}</view>
|
||||
<view class="content">{{item.content}}</view>
|
||||
<view class="timeReplyLikeC flex between">
|
||||
<view class="timeReplyC flex">
|
||||
<view class="time">15:37</view>
|
||||
<view class="reply">回复</view>
|
||||
<view class="time">{{getLocaleHourMinute(item.created_at)}}</view>
|
||||
<view class="reply" @click.stop="clickReplyComment(item.post_id)">回复</view>
|
||||
</view>
|
||||
<view class="likeC flex">
|
||||
<view class="likeC flex" @click.stop="clickLikeComment(item.post_id,index,-1)">
|
||||
<image class="icon" src="/static/icon/home/like.png" mode="widthFix"></image>
|
||||
<view class="num">85</view>
|
||||
<view class="num">{{item.likes_count}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalCommentNumC flex">
|
||||
<!-- <view class="totalCommentNumC flex">
|
||||
<view class="line"></view>
|
||||
全部34条评论
|
||||
<image class="arrow" src="/static/icon/home/commentArrow.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="replyList">
|
||||
<!-- <view class="replyList">
|
||||
<view class="replyItem">
|
||||
<image class="avatar" src="" mode="aspectFill"></image>
|
||||
<view class="flex1">
|
||||
@@ -156,19 +178,19 @@
|
||||
<view class="time">15:37</view>
|
||||
<view class="reply">回复</view>
|
||||
</view>
|
||||
<view class="likeC flex">
|
||||
<view class="likeC flex" @click.stop="clickLikeComment(item.post_id)">
|
||||
<image class="icon" src="/static/icon/home/like.png" mode="widthFix"></image>
|
||||
<view class="num">85</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="popBottomC">
|
||||
<view class="inputC">
|
||||
<input type="text" placeholder="我来说两句..." placeholder-style="color:#666"/>
|
||||
<input type="text" v-model="replyComment" :focus="isFocus" placeholder="我来说两句..." placeholder-style="color:#666" confirm-type="send" @confirm="sendReplyComment()"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -197,7 +219,7 @@
|
||||
</view>
|
||||
<view class="sectorRateC">
|
||||
<view class="sector">{{item.sector}}</view>
|
||||
<view class="rateC">
|
||||
<view :class="'rateC '+(getRateUpOrDown(item.daily_change)?'down':'up')">
|
||||
当日涨幅:
|
||||
<image v-if="getRateUpOrDown(item.daily_change)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
|
||||
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
|
||||
@@ -214,8 +236,9 @@
|
||||
|
||||
<script>
|
||||
import { inject } from 'vue';
|
||||
import { eventRelatedConcept, eventHistoryEvent, eventRelatedStock, eventCommentList, commentEvent } from '@/request/api';
|
||||
import { getLocaleTime, getRateStr, getRateUpOrDown } from '@/utils/util';
|
||||
import { eventRelatedConcept, eventHistoryEvent, eventRelatedStock, eventCommentList, commentEvent, likeEventComment, replyComment, followEvent } from '@/request/api';
|
||||
import { getLocaleHourMinute, getLocaleTime, getRateStr, getRateUpOrDown } from '@/utils/util';
|
||||
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min.js');
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -224,19 +247,81 @@
|
||||
windowWidth:inject('windowWidth'),
|
||||
eventId:'', //事件id
|
||||
eventDetails:null, //事件详情
|
||||
categoryList:['相关标的','相关概念','历史事件','时间传导链分析','关联数据'],
|
||||
categoryList:['相关标的','相关概念','历史事件'],
|
||||
targetList:[], //相关标的
|
||||
conceptList:[], //相关概念
|
||||
historyEventList:[], //历史事件
|
||||
historyEventRelatedStockList:[], //历史事件相关股票
|
||||
selectCategory:0,
|
||||
headingList:['名称代码','分时图','开盘价','最新价','涨跌幅'],
|
||||
getLocaleHourMinute:getLocaleHourMinute,
|
||||
getLocaleTime:getLocaleTime,
|
||||
getRateUpOrDown:getRateUpOrDown,
|
||||
getRateStr:getRateStr,
|
||||
scoreTop:'',
|
||||
eventComment:'', //事件评论
|
||||
expectScore:0, //预期得分
|
||||
commentList:[], //评价列表
|
||||
eventComment:'', //事件评论内容
|
||||
replyId:'', //回复评论id
|
||||
replyPid:'', //回复评论父级id
|
||||
isFocus:false, //是否获取焦点
|
||||
replyComment:'', //评论回复内容
|
||||
option:{
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
confine: true
|
||||
},
|
||||
grid:{
|
||||
left: '0%',
|
||||
right: '0%',
|
||||
top: '0%',
|
||||
bottom: '20%',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisTick:{
|
||||
show:false
|
||||
},
|
||||
axisLine:{
|
||||
show:false
|
||||
},
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
show:false,
|
||||
axisTick: { show: false },
|
||||
scale:true
|
||||
}
|
||||
],
|
||||
series: {
|
||||
name: '分时图',
|
||||
type: 'line',
|
||||
label: {
|
||||
show:true,
|
||||
position:'top',
|
||||
fontSize:12,
|
||||
},
|
||||
data: [],
|
||||
itemStyle:{
|
||||
color:''
|
||||
},
|
||||
markLine:{
|
||||
symbol:['none','none'],
|
||||
lineStyle:{
|
||||
color:'#AAAAAA',
|
||||
type:'dashed'
|
||||
},
|
||||
data:[]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(e)
|
||||
@@ -249,6 +334,33 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
// chart 图表实例不能存在data里
|
||||
let that = this
|
||||
setTimeout(function() {
|
||||
that.targetList.map(function(item,index) {
|
||||
const chartDom = that.$refs['chartRef'+index][0]
|
||||
chartDom.init(echarts).then(res=>{
|
||||
let option = {...that.option}
|
||||
let valueData = []
|
||||
for (let item1 of item.minute_chart_data) {
|
||||
valueData.push(item1.close)
|
||||
}
|
||||
option.series.data = valueData
|
||||
let firstOpen = item.minute_chart_data[0].open
|
||||
option.series.markLine.data = [{yAxis:firstOpen}]
|
||||
// console.log(option.series.markLine.data)
|
||||
let lastClose = item.minute_chart_data.slice(-1)[0].close
|
||||
if(lastClose>=firstOpen)
|
||||
{
|
||||
option.series.itemStyle.color = '#EF5350'
|
||||
}else
|
||||
option.series.itemStyle.color = '#26A69A'
|
||||
res.setOption(option)
|
||||
})
|
||||
})
|
||||
}, 300);
|
||||
},
|
||||
/**
|
||||
* 点击切换分类
|
||||
*/
|
||||
@@ -278,16 +390,16 @@
|
||||
clickStockItem(code)
|
||||
{
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/stockDetails/stockDetails?code='+code
|
||||
url:'/pages/index/stockDetails/stockDetails?type=1&code='+code+'&id='+this.eventId
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 点击查看相关概念
|
||||
*/
|
||||
clickConceptItem()
|
||||
clickConceptItem(name)
|
||||
{
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/conceptDetails/conceptDetails'
|
||||
url:'/pages/index/conceptDetails/conceptDetails?name='+name
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -330,7 +442,14 @@
|
||||
let eventId = this.eventId
|
||||
let param = {content:this.eventComment}
|
||||
commentEvent(eventId,param).then(res=>{
|
||||
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
let that = this
|
||||
setTimeout(function() {
|
||||
that.getEventCommentListData()
|
||||
}, 1000);
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
@@ -364,6 +483,61 @@
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 点击回复评论
|
||||
*/
|
||||
clickReplyComment(id,pid)
|
||||
{
|
||||
this.replyId = id
|
||||
if(pid)
|
||||
{
|
||||
this.replyPid = pid
|
||||
}
|
||||
this.isFocus = true
|
||||
},
|
||||
sendReplyComment()
|
||||
{
|
||||
if(!this.replyComment)
|
||||
{
|
||||
uni.showToast({
|
||||
title:'请输入评论内容',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let param = {content:this.replyComment}
|
||||
if(this.replyPid)
|
||||
{
|
||||
param.parent_id = this.replyPid
|
||||
}
|
||||
replyComment(this.replyId,param).then(res=>{
|
||||
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 点赞评论
|
||||
*/
|
||||
clickLikeComment(id,index,cindex)
|
||||
{
|
||||
likeEventComment(id).then(res=>{
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
if(cindex==-1)
|
||||
{
|
||||
//一级评论回复
|
||||
this.commentList[index].likes_count = res.likes_count
|
||||
}else
|
||||
{
|
||||
|
||||
}
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取事件相关标的数据
|
||||
*/
|
||||
@@ -375,6 +549,7 @@
|
||||
{
|
||||
this.eventDetails = res.data
|
||||
this.targetList = res.data.related_stocks
|
||||
this.init()
|
||||
}else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
@@ -389,16 +564,17 @@
|
||||
*/
|
||||
getEventRelatedConceptData()
|
||||
{
|
||||
let eventId = this.eventId
|
||||
eventRelatedConcept(eventId).then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
this.conceptList = res.data.related_concepts
|
||||
}else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
let eventDetails = this.eventDetails
|
||||
let param = {query:eventDetails.event_title,size:4,page:1,sort_by:"_score",isJson:1}
|
||||
eventRelatedConcept(param).then(res=>{
|
||||
// if(res.code==200)
|
||||
// {
|
||||
this.conceptList = res.results
|
||||
// }else
|
||||
// uni.showToast({
|
||||
// title:res.message,
|
||||
// icon:'none'
|
||||
// })
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
@@ -430,7 +606,7 @@
|
||||
{
|
||||
let eventId = this.eventId
|
||||
eventCommentList(eventId).then(res=>{
|
||||
this.commentList = res.data.comments
|
||||
this.commentList = res.data.posts
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
@@ -581,29 +757,64 @@
|
||||
.conceptList
|
||||
{
|
||||
padding: 30rpx 25rpx;
|
||||
.item
|
||||
.conceptItem
|
||||
{
|
||||
margin-bottom: 20rpx;
|
||||
.cover
|
||||
box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.05);
|
||||
margin: 0 30rpx 30rpx 0;
|
||||
width: calc((100% - 30rpx)/2);
|
||||
border-radius: 10rpx;
|
||||
.coverC
|
||||
{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 350rpx;
|
||||
border-radius: 10rpx;
|
||||
.cover
|
||||
{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
}
|
||||
.rateC
|
||||
{
|
||||
top: 12rpx;
|
||||
left: 12rpx;
|
||||
padding: 0 10rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
.icon
|
||||
{
|
||||
width: 11rpx;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.rateC.up
|
||||
{
|
||||
background-color: #E53E3E;
|
||||
}
|
||||
.rateC.down
|
||||
{
|
||||
background-color: #38A169;
|
||||
}
|
||||
.totalC
|
||||
{
|
||||
background: linear-gradient(-90deg, #FAC915 0%, #F18D10 100%);
|
||||
top: 12rpx;
|
||||
right: 12rpx;
|
||||
padding: 0 9rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 20rpx;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
.infoC
|
||||
{
|
||||
background: linear-gradient(to bottom,#00000080,#000);
|
||||
padding: 20rpx 23rpx;
|
||||
left:0;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
border-radius: ;
|
||||
color: white;
|
||||
.title
|
||||
{
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.content
|
||||
{
|
||||
@@ -612,17 +823,76 @@
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
margin-top: 10rpx;
|
||||
line-height: 1.2rem;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.2rem;
|
||||
.lookDetails
|
||||
color: #666;
|
||||
}
|
||||
.transactionDate
|
||||
{
|
||||
margin-top: 12rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #AAA;
|
||||
}
|
||||
.hotStockC
|
||||
{
|
||||
background-color: #F7FAFC;
|
||||
margin-top: 16rpx;
|
||||
padding: 10rpx 13rpx;
|
||||
border-radius: 5rpx;
|
||||
.titleC
|
||||
{
|
||||
right: 0;
|
||||
color: #F97316;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
.arrow
|
||||
{
|
||||
width: 6rpx;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.stockList
|
||||
{
|
||||
margin-top: 10rpx;
|
||||
height: 35rpx;
|
||||
overflow: hidden;
|
||||
.item
|
||||
{
|
||||
background-color: #FFEADC;
|
||||
margin: 0 5rpx 5rpx 0;
|
||||
padding: 0 9rpx;
|
||||
line-height: 30rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dateHistoryTimeC
|
||||
{
|
||||
margin-top: 10rpx;
|
||||
font-size: 20rpx;
|
||||
.date
|
||||
{
|
||||
color: #666;
|
||||
}
|
||||
.historyTimeC
|
||||
{
|
||||
background-color: #F97316;
|
||||
padding: 0 6rpx;
|
||||
line-height: 38rpx;
|
||||
border-radius: 5rpx;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.conceptItem:nth-child(2n)
|
||||
{
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.historyEventList
|
||||
{
|
||||
@@ -1104,7 +1374,6 @@
|
||||
}
|
||||
.rateC
|
||||
{
|
||||
background-color: #C00000;
|
||||
display: inline-block;
|
||||
padding: 0 10rpx;
|
||||
height: 30rpx;
|
||||
@@ -1118,6 +1387,14 @@
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.rateC.up
|
||||
{
|
||||
background-color: #C00000;
|
||||
}
|
||||
.rateC.down
|
||||
{
|
||||
background-color: #355422;
|
||||
}
|
||||
}
|
||||
.content
|
||||
{
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="eventListC fixed" :style="'top:'+listTop+'px'" @scrolltolower="loadMoreData()">
|
||||
<!-- <view style="width:750rpx; height:400rpx">
|
||||
<view style="width:750rpx; height:400rpx">
|
||||
<l-echart ref="chartRef"></l-echart>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" @click="clickEventItem(item.id)" v-for="(item,index) in eventList" :key="index">
|
||||
<view class="flex">
|
||||
@@ -69,7 +69,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view scroll-x class="stockList">
|
||||
<view class="stockItem" v-for="(sitem,sindex) in item.related_stocks" :key="sindex" @click.stop="clickLookRelatedStockItem(sitem.stock_code)">{{sitem.stock_name}} <text class="change">{{(getRateUpOrDown(sitem.daily_change)?'':'+')+sitem.daily_change}}%</text></view>
|
||||
<view class="stockItem" v-for="(sitem,sindex) in item.related_stocks" :key="sindex" @click.stop="clickLookRelatedStockItem(item.id,sitem.stock_code)">{{sitem.stock_name}} <text class="change">{{(getRateUpOrDown(sitem.daily_change)?'':'+')+sitem.daily_change}}%</text></view>
|
||||
</scroll-view>
|
||||
<view class="timeToolBarC flex">
|
||||
<view class="time flex1">{{getLocaleTime(item.created_at)}}</view>
|
||||
@@ -159,27 +159,78 @@
|
||||
<block v-if="selectScreenCategory==1">
|
||||
<view class="section">选择体系</view>
|
||||
<view class="industryCategoryC flexWrap">
|
||||
<view :class="'item '+(selectIndustryTopCategory==index?'select':'')" v-for="(item,index) in industryTopCategoryList" :key="index" @click="clickSelectIndustryTopCategoryItem(index)">
|
||||
<view :class="'item '+(selectIndustryTopCategory==index?'select':'')" v-for="(item,index) in industryCategoryList" :key="index" @click="clickIndustryTopCategoryItem(index)">
|
||||
{{item.classification_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="industrySearchC flex">
|
||||
<image class="icon" src="/static/icon/home/search.png" mode="widthFix"></image>
|
||||
<input class="flex1" type="text" placeholder="搜索行业" placeholder-style="color:#94989A"/>
|
||||
<input class="flex1" type="text" v-model="industryKeywords" placeholder="搜索行业" placeholder-style="color:#94989A" @input="industrySearch"/>
|
||||
</view>
|
||||
<view class="industryList">
|
||||
<view class="selectCategoryList flexWrap">
|
||||
|
||||
<view v-if="industryKeywords.length>0" class="searchResultList">
|
||||
<block v-for="(item,index) in searchResultList" :key="index">
|
||||
<block v-for="(sitem,sindex) in item.hierarchy" :key="sindex">
|
||||
<block v-for="(titem,tindex) in sitem.level2_sectors" :key="tindex">
|
||||
<block v-for="(fitem,findex) in titem.level3_sectors" :key="findex">
|
||||
<view class="item" @click="clickIndustrySearchItem(fitem)">
|
||||
<text :class="industryKeywords.indexOf(citem)>-1?'key':''" v-for="(citem,cindex) in (fitem.level3_sector+'/'+titem.level2_sector+'/'+sitem.level1_sector)" :key="cindex">{{citem}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else class="industryList">
|
||||
<view v-if="selectIndustrySecondCategory>-1" class="selectCategoryList flexWrap">
|
||||
<view v-if="selectIndustrySecondCategory>-1" class="item flex" @click="deleteIndustrySecondCategoryItem()">
|
||||
{{industryCategoryList[selectIndustryTopCategory].hierarchy[selectIndustrySecondCategory].level1_sector}}
|
||||
<view class="deleteC">
|
||||
<image class="icon" src="/static/icon/home/delete.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="selectIndustryThirdCategory>-1" class="item flex" @click="deleteIndustryThirdCategoryItem()">
|
||||
{{industryCategoryList[selectIndustryTopCategory].hierarchy[selectIndustrySecondCategory].level2_sectors[selectIndustryThirdCategory].level2_sector}}
|
||||
<view class="deleteC">
|
||||
<image class="icon" src="/static/icon/home/delete.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="selectIndustryForthCategory>-1" class="item flex" @click="deleteIndustryForthCategoryItem()">
|
||||
{{industryCategoryList[selectIndustryTopCategory].hierarchy[selectIndustrySecondCategory].level2_sectors[selectIndustryThirdCategory].level3_sectors[selectIndustryForthCategory].level3_sector}}
|
||||
<view class="deleteC">
|
||||
<image class="icon" src="/static/icon/home/delete.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="topCategory">{{industryTopCategoryList[selectIndustryTopCategory].classification_name}}</view>
|
||||
<view class="topCategory">{{industryCategoryList[selectIndustryTopCategory].classification_name}}</view>
|
||||
<view class="secondList">
|
||||
<view class="secondItem">
|
||||
<view class="thirdList">
|
||||
<view class="thirdItem">
|
||||
|
||||
</view>
|
||||
<view class="secondItem" v-for="(sitem,sindex) in industryCategoryList[selectIndustryTopCategory].hierarchy" :key="sindex">
|
||||
<view :class="'categoryC flex '+(selectIndustrySecondCategory==sindex?'select':'')" @click.stop="clickIndustrySecondCategoryItem(sindex)">
|
||||
<view class="spread">{{(selectIndustrySecondCategory==sindex&&sitem.isSpread)?'-':'+'}}</view>
|
||||
<view class="category">{{sitem.level1_sector}}</view>
|
||||
</view>
|
||||
<block v-if="sitem.isSpread">
|
||||
<view class="thirdList" v-for="(titem,tindex) in industryCategoryList[selectIndustryTopCategory].hierarchy[sindex].level2_sectors" :key="tindex">
|
||||
<view class="thirdItem">
|
||||
<view :class="'categoryC flex '+(selectIndustrySecondCategory==sindex&&selectIndustryThirdCategory==tindex?'select':'')" @click.stop="clickIndustryThirdCategoryItem(sindex,tindex)">
|
||||
<view class="spread">{{(selectIndustrySecondCategory==sindex&&selectIndustryThirdCategory==tindex&&titem.isSpread)?'-':'+'}}</view>
|
||||
<view class="category">{{titem.level2_sector}}</view>
|
||||
</view>
|
||||
<block v-if="titem.isSpread">
|
||||
<view class="forthList" v-for="(fitem,findex) in industryCategoryList[selectIndustryTopCategory].hierarchy[sindex].level2_sectors[tindex].level3_sectors" :key="findex">
|
||||
<view class="forthItem" @click.stop="clickIndustryForthCategoryItem(sindex,tindex,findex)">
|
||||
<view :class="'categoryC flex '+(selectIndustrySecondCategory==sindex&&selectIndustryThirdCategory==tindex&&selectIndustryForthCategory==findex?'select':'')">
|
||||
<view class="category flex1">{{fitem.level3_sector}}</view>
|
||||
<view v-if="selectIndustrySecondCategory==sindex&&selectIndustryThirdCategory==tindex&&selectIndustryForthCategory==findex" class="selectC">
|
||||
<image class="icon" src="/static/icon/home/industry_s.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -217,7 +268,6 @@
|
||||
menuH: inject('menuHeight'),
|
||||
navH:inject('navHeight'),
|
||||
windowWidth:inject('windowWidth'),
|
||||
|
||||
contentTop:'',
|
||||
listTop:'',
|
||||
sortListTop:'',
|
||||
@@ -243,8 +293,13 @@
|
||||
monthDateList:[],
|
||||
selectMonthIndex:0, //选中月份下标
|
||||
selectMonth:'', //选中年月
|
||||
industryTopCategoryList:[], //行业一级分类
|
||||
selectIndustryTopCategory:0, //
|
||||
industryCategoryList:[], //行业分类数组
|
||||
industryKeywords:'', //行业分类搜索关键词
|
||||
searchResultList:[], //行业分类搜索结果数组
|
||||
selectIndustryTopCategory:0, //选中行业一级分类
|
||||
selectIndustrySecondCategory:-1, //选中行业二级分类
|
||||
selectIndustryThirdCategory:-1, //选中行业三级分类
|
||||
selectIndustryForthCategory:-1, //选中行业四级分类
|
||||
selectScreenCategory:0,
|
||||
importanceList:[], //重要性数组
|
||||
selectImportanceIndex:0, //选择重要性下标
|
||||
@@ -259,7 +314,7 @@
|
||||
grid:{
|
||||
left: '0%',
|
||||
right: '0%',
|
||||
top: '0%',
|
||||
top: '10%',
|
||||
bottom: '20%',
|
||||
},
|
||||
xAxis: [
|
||||
@@ -299,71 +354,10 @@
|
||||
position:'top',
|
||||
fontSize:12,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value:0,
|
||||
itemStyle: {color:'#355422'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:44,
|
||||
itemStyle: {color:'#35542299'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:315,
|
||||
itemStyle: {color:'#355422CC'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:1264,
|
||||
itemStyle: {color:'#355422'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:1064,
|
||||
itemStyle: {color:'#ACB0C0'},
|
||||
label:{
|
||||
textStyle: {color:'#666'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:1809,
|
||||
itemStyle: {color:'#C00000'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:602,
|
||||
itemStyle: {color:'#C00000CC'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:44,
|
||||
itemStyle: {color:'#C0000099'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
},
|
||||
},
|
||||
{
|
||||
value:0,
|
||||
itemStyle: {color:'#C00000'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
},
|
||||
},
|
||||
],
|
||||
itemStyle:{
|
||||
borderRadius:[5,5,0,0]
|
||||
},
|
||||
data: [],
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -376,14 +370,14 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.contentTop = this.navH + (75+20)/750*this.windowWidth
|
||||
this.contentTop = this.navH + (74+20)/750*this.windowWidth
|
||||
this.listTop = this.contentTop + (22+80+72)/750*this.windowWidth
|
||||
this.sortListTop = this.navH + (22+80+80)/750*this.windowWidth
|
||||
this.getEventFilterListData()
|
||||
this.getEventListData()
|
||||
this.getIndustryCategoryListData()
|
||||
this.getStockCategoryListData()
|
||||
// this.init()
|
||||
Promise.all([this.getEventFilterListData(),this.getIndustryCategoryListData(),this.getStockCategoryListData()]).then(res=>{
|
||||
this.getEventListData()
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
let currentDate = new Date();
|
||||
// 获取当前年份
|
||||
let currentYear = currentDate.getFullYear();
|
||||
@@ -572,13 +566,20 @@
|
||||
if(this.selectTopCategory!=index)
|
||||
{
|
||||
this.selectTopCategory = index
|
||||
this.selectSecondCategory = 0
|
||||
let offsetLeft = event.currentTarget.offsetLeft
|
||||
this.topScrollLeft = offsetLeft - this.topScrollWidth/2
|
||||
if(index==0)
|
||||
{
|
||||
this.listTop = this.contentTop + (22+80+72)/750*this.windowWidth
|
||||
}else
|
||||
this.listTop = this.contentTop + (22+80+72+44+44)/750*this.windowWidth
|
||||
this.listTop = this.contentTop + (22+80+72+42+42)/750*this.windowWidth
|
||||
if(this.selectTimeCategory==0)
|
||||
{
|
||||
//最新
|
||||
this.getEventListData()
|
||||
}else
|
||||
this.getHotEventListData()
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -592,6 +593,12 @@
|
||||
this.selectSecondCategory = index
|
||||
let offsetLeft = event.currentTarget.offsetLeft
|
||||
this.secondScrollLeft = offsetLeft - this.secondScrollWidth/2
|
||||
if(this.selectTimeCategory==0)
|
||||
{
|
||||
//最新
|
||||
this.getEventListData()
|
||||
}else
|
||||
this.getHotEventListData()
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -664,13 +671,140 @@
|
||||
/**
|
||||
* 选择行业分类一级分类
|
||||
*/
|
||||
clickSelectIndustryTopCategoryItem(index)
|
||||
clickIndustryTopCategoryItem(index)
|
||||
{
|
||||
if(this.selectIndustryTopCategory!=index)
|
||||
{
|
||||
this.selectIndustryTopCategory = index
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 行业分类搜索
|
||||
*/
|
||||
industrySearch(e)
|
||||
{
|
||||
let keywords = e.detail.value
|
||||
this.industryKeywords = keywords
|
||||
let arr = []
|
||||
for (let item of this.industryCategoryList) {
|
||||
let index = this.industryCategoryList.indexOf(item)
|
||||
for (let item1 of item.hierarchy) {
|
||||
let index1 = item.hierarchy.indexOf(item1)
|
||||
let arr1 = []
|
||||
if(item1.level1_sector.indexOf(keywords)>-1)
|
||||
{
|
||||
arr1.push(item1)
|
||||
arr.push({classification_name:item.classification_name,hierarchy: arr1})
|
||||
}
|
||||
for (let item2 of item1.level2_sectors) {
|
||||
let index2 = item1.level2_sectors.indexOf(item2)
|
||||
let arr2 = []
|
||||
if(item2.level2_sector.indexOf(keywords)>-1)
|
||||
{
|
||||
arr2.push(item2)
|
||||
arr1.push({level1_sector:item1.level1_sector,level2_sectors: arr2})
|
||||
arr.push({classification_name:item.classification_name,hierarchy: arr1})
|
||||
}
|
||||
for (let item3 of item2.level3_sectors) {
|
||||
let index3 = item2.level3_sectors.indexOf(item3)
|
||||
let arr3 = []
|
||||
if(item3.level3_sector.indexOf(keywords)>-1)
|
||||
{
|
||||
item3.index = index
|
||||
item3.index1 = index1
|
||||
item3.index2 = index2
|
||||
item3.index3 = index3
|
||||
arr3.push(item3)
|
||||
arr2.push({level2_sector:item2.level2_sector,level3_sectors: arr3})
|
||||
arr1.push({level1_sector:item1.level1_sector,level2_sectors: arr2})
|
||||
arr.push({classification_name:item.classification_name,hierarchy: arr1})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.searchResultList = arr
|
||||
},
|
||||
/**
|
||||
* 点击选择搜索结果
|
||||
* @param {Object} item
|
||||
*/
|
||||
clickIndustrySearchItem(item)
|
||||
{
|
||||
this.industryKeywords = ''
|
||||
this.selectIndustryTopCategory = item.index
|
||||
this.selectIndustrySecondCategory = item.index1
|
||||
this.selectIndustryThirdCategory = item.index2
|
||||
this.selectIndustryForthCategory = item.index3
|
||||
},
|
||||
/**
|
||||
* 选择行业分类二级分类
|
||||
*/
|
||||
clickIndustrySecondCategoryItem(index)
|
||||
{
|
||||
if(this.selectIndustrySecondCategory!=index)
|
||||
{
|
||||
this.selectIndustrySecondCategory = index
|
||||
}
|
||||
this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[index].isSpread = !this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[index].isSpread
|
||||
},
|
||||
/**
|
||||
* 选择行业分类三级分类
|
||||
*/
|
||||
clickIndustryThirdCategoryItem(sindex,index)
|
||||
{
|
||||
if(this.selectIndustrySecondCategory!=sindex)
|
||||
{
|
||||
this.selectIndustrySecondCategory = sindex
|
||||
}
|
||||
if(this.selectIndustryThirdCategory!=index)
|
||||
{
|
||||
this.selectIndustryThirdCategory = index
|
||||
}
|
||||
this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[sindex].level2_sectors[index].isSpread = !this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[sindex].level2_sectors[index].isSpread
|
||||
},
|
||||
/**
|
||||
* 选择行业分类四级分类
|
||||
*/
|
||||
clickIndustryForthCategoryItem(sindex,tindex,index)
|
||||
{
|
||||
if(this.selectIndustrySecondCategory!=sindex)
|
||||
{
|
||||
this.selectIndustrySecondCategory = sindex
|
||||
}
|
||||
if(this.selectIndustryThirdCategory!=tindex)
|
||||
{
|
||||
this.selectIndustryThirdCategory = tindex
|
||||
}
|
||||
if(this.selectIndustryForthCategory!=index)
|
||||
{
|
||||
this.selectIndustryForthCategory = index
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 删除选中的行业二级分类
|
||||
*/
|
||||
deleteIndustrySecondCategoryItem()
|
||||
{
|
||||
this.selectIndustrySecondCategory = -1
|
||||
this.selectIndustryThirdCategory = -1
|
||||
this.selectIndustryForthCategory = -1
|
||||
},
|
||||
/**
|
||||
* 删除选中的行业三级分类
|
||||
*/
|
||||
deleteIndustryThirdCategoryItem()
|
||||
{
|
||||
this.selectIndustryThirdCategory = -1
|
||||
this.selectIndustryForthCategory = -1
|
||||
},
|
||||
/**
|
||||
* 删除选中的行业四级分类
|
||||
*/
|
||||
deleteIndustryForthCategoryItem()
|
||||
{
|
||||
this.selectIndustryForthCategory = -1
|
||||
},
|
||||
/**
|
||||
* 点击选择重要性
|
||||
*/
|
||||
@@ -691,12 +825,13 @@
|
||||
},
|
||||
/**
|
||||
* 点击相关股票
|
||||
* @param {Object} code
|
||||
* @param {Object} id 事件id
|
||||
* @param {Object} code 股票代码
|
||||
*/
|
||||
clickLookRelatedStockItem(code)
|
||||
clickLookRelatedStockItem(id,code)
|
||||
{
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/stockDetails/stockDetails?code='+code
|
||||
url:'/pages/index/stockDetails/stockDetails?type=1&code='+code+'&id='+id
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -717,7 +852,7 @@
|
||||
/**
|
||||
* 查看事件详情
|
||||
*/
|
||||
clickEventItem(id)
|
||||
clickEventItem(id)
|
||||
{
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/eventDetails/eventDetails?id='+id
|
||||
@@ -728,48 +863,57 @@
|
||||
*/
|
||||
getEventFilterListData()
|
||||
{
|
||||
filterOptions().then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
let timeList = [...res.data.sort_options]
|
||||
this.timeCategoryList = timeList.splice(0,2)
|
||||
let sortList = [...res.data.sort_options]
|
||||
for (let item of sortList) {
|
||||
if(item.name=='最新')
|
||||
{
|
||||
item.icon = '/static/icon/home/new.png'
|
||||
}
|
||||
if(item.name=='热门')
|
||||
{
|
||||
item.icon = '/static/icon/home/hot.png'
|
||||
}
|
||||
if(item.name=='收益率')
|
||||
{
|
||||
item.icon = '/static/icon/home/yield.png'
|
||||
return new Promise((resolve,reject)=>{
|
||||
filterOptions().then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
resolve(1)
|
||||
let timeList = [...res.data.sort_options]
|
||||
this.timeCategoryList = timeList.splice(0,2)
|
||||
let sortList = [...res.data.sort_options]
|
||||
for (let item of sortList) {
|
||||
if(item.name=='最新')
|
||||
{
|
||||
item.icon = '/static/icon/home/new.png'
|
||||
}
|
||||
if(item.name=='热门')
|
||||
{
|
||||
item.icon = '/static/icon/home/hot.png'
|
||||
}
|
||||
if(item.name=='收益率')
|
||||
{
|
||||
item.icon = '/static/icon/home/yield.png'
|
||||
}
|
||||
}
|
||||
this.sortList = res.data.sort_options.splice(0,3)
|
||||
this.importanceList = res.data.importance_options
|
||||
this.importanceList.unshift({desc: "全部",key: "all",name: "全部"})
|
||||
}else
|
||||
{
|
||||
reject(1)
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
this.sortList = res.data.sort_options.splice(0,3)
|
||||
this.importanceList = res.data.importance_options
|
||||
this.importanceList.unshift({desc: "全部",key: "all",name: "全部"})
|
||||
}else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
|
||||
}).catch(error=>{
|
||||
|
||||
}).catch(error=>{
|
||||
reject(1)
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 获取行业分类
|
||||
*/
|
||||
getIndustryCategoryListData()
|
||||
{
|
||||
industryCategoryList().then(res=>{
|
||||
this.industryTopCategoryList = res.data
|
||||
}).catch(error=>{
|
||||
|
||||
return new Promise((resolve,reject)=>{
|
||||
industryCategoryList().then(res=>{
|
||||
this.industryCategoryList = res.data
|
||||
resolve(1)
|
||||
}).catch(error=>{
|
||||
reject(1)
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -777,21 +921,27 @@
|
||||
*/
|
||||
getStockCategoryListData()
|
||||
{
|
||||
stockCategoryList().then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
for (let item of res.data) {
|
||||
item.sub_sectors.unshift('全部')
|
||||
return new Promise((resolve,reject)=>{
|
||||
stockCategoryList().then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
for (let item of res.data) {
|
||||
item.sub_sectors.unshift('全部')
|
||||
}
|
||||
res.data.unshift({primary_sector:'全部',sub_sectors:[]})
|
||||
this.stockCategoryList = res.data
|
||||
resolve(1)
|
||||
}else
|
||||
{
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
reject(1)
|
||||
}
|
||||
res.data.unshift({primary_sector:'全部',sub_sectors:[]})
|
||||
this.stockCategoryList = res.data
|
||||
}else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
}).catch(error=>{
|
||||
|
||||
}).catch(error=>{
|
||||
reject(1)
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -799,7 +949,15 @@
|
||||
*/
|
||||
getEventListData()
|
||||
{
|
||||
let param = {page:this.page,keywords:this.keywords}
|
||||
let param = {page:this.page,q:this.keywords}
|
||||
if(this.selectTopCategory>0)
|
||||
{
|
||||
param.stock_sector = this.stockCategoryList[this.selectTopCategory].primary_sector
|
||||
}
|
||||
if(this.selectSecondCategory>0)
|
||||
{
|
||||
param.secondary_sector = this.stockCategoryList[this.selectTopCategory].sub_sectors[this.selectSecondCategory]
|
||||
}
|
||||
if(this.startDate)
|
||||
{
|
||||
param.start_date = this.startDate
|
||||
@@ -816,42 +974,143 @@
|
||||
{
|
||||
param.sort = this.selectSortKey
|
||||
}
|
||||
if(this.selectIndustryForthCategory>-1)
|
||||
{
|
||||
param.industry_level = 4
|
||||
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level2_sectors[this.selectIndustryThirdCategory].level3_sectors[this.selectIndustryForthCategory].level3_sector
|
||||
}else
|
||||
{
|
||||
if(this.selectIndustryThirdCategory>-1)
|
||||
{
|
||||
param.industry_level = 3
|
||||
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level2_sectors[this.selectIndustryThirdCategory].level2_sector
|
||||
}else
|
||||
{
|
||||
if(this.selectIndustrySecondCategory>-1)
|
||||
{
|
||||
param.industry_level = 2
|
||||
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level1_sector
|
||||
|
||||
}else
|
||||
{
|
||||
param.industry_level = 1
|
||||
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].classification_name
|
||||
}
|
||||
}
|
||||
}
|
||||
eventList(param).then(res=>{
|
||||
if(res.success)
|
||||
{
|
||||
let valueData = []
|
||||
let data = res.data.overall_stats.change_distribution
|
||||
valueData.push({
|
||||
value:data.limit_down,
|
||||
itemStyle: {color:'#35542266'},
|
||||
label:{
|
||||
textStyle: {color:'#35542266'},
|
||||
},
|
||||
})
|
||||
valueData.push({
|
||||
value:data.down_over_5,
|
||||
itemStyle: {color:'#35542299'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
},)
|
||||
valueData.push({
|
||||
value:data.down_5_to_1,
|
||||
itemStyle: {color:'#355422CC'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
})
|
||||
valueData.push({
|
||||
value:data.down_within_1,
|
||||
itemStyle: {color:'#355422'},
|
||||
label:{
|
||||
textStyle: {color:'#355422'},
|
||||
},
|
||||
})
|
||||
valueData.push({
|
||||
value:data.flat,
|
||||
itemStyle: {color:'#ACB0C0'},
|
||||
label:{
|
||||
textStyle: {color:'#666'},
|
||||
},
|
||||
},)
|
||||
valueData.push({
|
||||
value:data.up_within_1,
|
||||
itemStyle: {color:'#C00000'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
},
|
||||
})
|
||||
valueData.push({
|
||||
value:data.up_1_to_5,
|
||||
itemStyle: {color:'#C00000CC'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
}
|
||||
})
|
||||
valueData.push({
|
||||
value:data.up_over_5,
|
||||
itemStyle: {color:'#C0000099'},
|
||||
label:{
|
||||
textStyle: {color:'#C00000'},
|
||||
}
|
||||
})
|
||||
valueData.push({
|
||||
value:data.limit_up,
|
||||
itemStyle: {color:'#C0000066'},
|
||||
label:{
|
||||
textStyle: {color:'#C0000066'},
|
||||
}
|
||||
})
|
||||
this.option.series[0].data = valueData
|
||||
this.init()
|
||||
if(this.page==1)
|
||||
{
|
||||
this.eventList = res.data.events
|
||||
}else
|
||||
this.eventList = this.eventList.concat(res.data.events)
|
||||
|
||||
this.loadAll = !res.data.pagination.has_next
|
||||
}
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
let token = uni.getStorageSync('token')
|
||||
if(!token)
|
||||
{
|
||||
let param1 = {email:'1198731706@qq.com',password:'Aa123456',isJson:1}
|
||||
loginByEmail(param1).then(res=>{
|
||||
if (res.code==200) {
|
||||
uni.setStorageSync('token',res.data.token)
|
||||
} else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
})
|
||||
}).catch(error=>{
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* 获取热门事件数据
|
||||
*/
|
||||
getHotEventListData()
|
||||
{
|
||||
homeData().then(res=>{
|
||||
let param = {page:this.page,q:this.keywords}
|
||||
if(this.selectTopCategory>0)
|
||||
{
|
||||
param.stock_sector = this.stockCategoryList[this.selectTopCategory].primary_sector
|
||||
}
|
||||
if(this.selectSecondCategory>0)
|
||||
{
|
||||
param.secondary_sector = this.stockCategoryList[this.selectTopCategory].sub_sectors[this.selectSecondCategory]
|
||||
}
|
||||
if(this.startDate)
|
||||
{
|
||||
param.start_date = this.startDate
|
||||
}
|
||||
if(this.endDate)
|
||||
{
|
||||
param.end_date = this.endDate
|
||||
}
|
||||
if(this.selectImportanceIndex>0)
|
||||
{
|
||||
param.importance = this.importanceList[this.selectImportanceIndex].key
|
||||
}
|
||||
if(this.selectSortKey)
|
||||
{
|
||||
param.sort = this.selectSortKey
|
||||
}
|
||||
homeData(param).then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
if(this.page==1)
|
||||
@@ -1405,18 +1664,119 @@
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.searchResultList
|
||||
{
|
||||
.item
|
||||
{
|
||||
padding: 10rpx 44rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #444;
|
||||
.key
|
||||
{
|
||||
color: #F97316;
|
||||
}
|
||||
}
|
||||
}
|
||||
.industryList
|
||||
{
|
||||
margin-top: 24rpx;
|
||||
.selectCategoryList
|
||||
{
|
||||
padding: 0 22rpx;
|
||||
.item
|
||||
{
|
||||
background-color: #FFF1E7;
|
||||
margin-right: 15rpx;
|
||||
padding-left: 16rpx;
|
||||
line-height: 38rpx;
|
||||
border-radius: 10rpx;
|
||||
border: solid .5px #F97316;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
.deleteC
|
||||
{
|
||||
padding: 0 11rpx;
|
||||
.icon
|
||||
{
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.list
|
||||
{
|
||||
margin-top: 20rpx;
|
||||
.topCategory
|
||||
{
|
||||
padding: 0 30rpx;
|
||||
padding: 0 22rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #F97316;
|
||||
}
|
||||
.secondItem
|
||||
{
|
||||
padding: 0 22rpx;
|
||||
}
|
||||
.thirdItem
|
||||
{
|
||||
padding-left: 36rpx;
|
||||
}
|
||||
.forthItem
|
||||
{
|
||||
padding-left: 36rpx;
|
||||
.categoryC.select
|
||||
{
|
||||
border-bottom: solid .5px #F97316;
|
||||
}
|
||||
}
|
||||
.categoryC
|
||||
{
|
||||
height: 50rpx;
|
||||
.spread
|
||||
{
|
||||
margin-right: 12rpx;
|
||||
width: 24rpx;
|
||||
line-height: 22rpx;
|
||||
border: solid .5px #8C8C8C;
|
||||
font-size: 22rpx;
|
||||
color: #8C8C8C;
|
||||
text-align: center;
|
||||
}
|
||||
.category
|
||||
{
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #444;
|
||||
|
||||
}
|
||||
}
|
||||
.categoryC.select
|
||||
{
|
||||
.spread
|
||||
{
|
||||
color: #F97316;
|
||||
border: solid .5px #F97316;
|
||||
}
|
||||
.category
|
||||
{
|
||||
color: #F97316;
|
||||
}
|
||||
.selectC
|
||||
{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border: solid .5px #F97316;
|
||||
.icon
|
||||
{
|
||||
display: block;
|
||||
width: 20rpx;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.importanceList
|
||||
|
||||
@@ -2,18 +2,29 @@
|
||||
<view>
|
||||
<navBar :leftText="navTitle"></navBar>
|
||||
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
|
||||
<view class="tabC fixed" :style="'top:'+navH+'px;'">
|
||||
<view v-if="type==1" class="tabC fixed" :style="'top:'+navH+'px;'">
|
||||
<view :class="'item relative '+(selectCategory==index?'select':'')" v-for="(item,index) in categoryList" :key="index" @click="clickCategoryItem(index)">
|
||||
{{item}}
|
||||
<view v-if="selectCategory==index" class="line absolute"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentC fixed" :style="'top:'+contentTop+'px;'">
|
||||
<view style="width:750rpx; height:400rpx">
|
||||
<view :class="'contentC fixed '+(type==2?'radius':'')" :style="'top:'+contentTop+'px;'">
|
||||
<view v-if="type==1" style="width:750rpx; height:400rpx">
|
||||
<l-echart ref="chartRef"></l-echart>
|
||||
</view>
|
||||
<view class="section">关联描述</view>
|
||||
<view class="des">全球原油运输巨头,VLCC运力规模全球第一,直接受益于霍尔木兹海峡地缘风险带来的运价上涨及风险溢价。</view>
|
||||
<view class="des">{{relatedDesc}}</view>
|
||||
<view v-if="type==1&&sourceList.length>0" class="section">信息来源</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item,index) in sourceList" :key="index">
|
||||
<view class="content">{{item.sentences}}</view>
|
||||
<view class="article">——《{{item.report_title}}》</view>
|
||||
<view class="authorDateC flex">
|
||||
<view class="author flex1">{{item.author}}</view>
|
||||
<view class="date">{{getLocalDate(item.declare_date)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -21,6 +32,7 @@
|
||||
<script>
|
||||
import { inject } from 'vue';
|
||||
import { stockCandlestickChartData, stockDetails } from '@/request/api';
|
||||
import { getLocalDate } from '@/utils/util.js';
|
||||
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min.js');
|
||||
|
||||
export default {
|
||||
@@ -29,18 +41,33 @@
|
||||
navH:inject('navHeight'),
|
||||
contentTop:'',
|
||||
navTitle:'',
|
||||
type:'', //1事件详情2投资详情
|
||||
eventId:'', //事件id
|
||||
stockCode:'', //股票code
|
||||
categoryList:['分钟线','分时图','日K线'],
|
||||
categoryList:['分时图','日K线'],
|
||||
selectCategory:0,
|
||||
option:{
|
||||
title: {
|
||||
show:false
|
||||
},
|
||||
tooltip: {
|
||||
position:function (pos, params, dom, rect, size) {
|
||||
// 鼠标在左侧时 tooltip 显示到右侧,鼠标在右侧时 tooltip 显示到左侧。
|
||||
var obj = {top: '10%'};
|
||||
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5;
|
||||
|
||||
return obj;
|
||||
},
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
formatter: function (params) {
|
||||
console.log(params)
|
||||
let res = '日期:'+params[0].name+'\n'+'开盘价:'+params[0].data[1]+'\n'+'收盘价:'+params[0].data[2]+'\n'+'最低价:'+params[0].data[3]+'\n'+'最高价:'+params[0].data[4]
|
||||
console.log(res)
|
||||
return res; // 经过这么一加工,最终返回出去并渲染,最终就出现了我们所看的效果
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false
|
||||
@@ -81,117 +108,90 @@
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '日K',
|
||||
type: 'candlestick',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
color: '#ec0000',
|
||||
color0: '#8A0000',
|
||||
borderColor: '#00da3c',
|
||||
borderColor0: '#008F28'
|
||||
},
|
||||
markPoint: {
|
||||
label: {
|
||||
formatter: function (param) {
|
||||
return param != null ? Math.round(param.value) + '' : '';
|
||||
}
|
||||
},
|
||||
data: [
|
||||
{
|
||||
name: 'Mark',
|
||||
coord: ['2013/5/31', 2300],
|
||||
value: 2300,
|
||||
itemStyle: {
|
||||
color: 'rgb(41,60,85)'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'highest value',
|
||||
type: 'max',
|
||||
valueDim: 'highest'
|
||||
},
|
||||
{
|
||||
name: 'lowest value',
|
||||
type: 'min',
|
||||
valueDim: 'lowest'
|
||||
},
|
||||
{
|
||||
name: 'average value on close',
|
||||
type: 'average',
|
||||
valueDim: 'close'
|
||||
}
|
||||
],
|
||||
tooltip: {
|
||||
formatter: function (param) {
|
||||
return param.name + '<br>' + (param.data.coord || '');
|
||||
}
|
||||
}
|
||||
},
|
||||
markLine: {
|
||||
symbol: ['none', 'none'],
|
||||
data: [
|
||||
[
|
||||
{
|
||||
name: 'from lowest to highest',
|
||||
type: 'min',
|
||||
valueDim: 'lowest',
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'max',
|
||||
valueDim: 'highest',
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
{
|
||||
name: 'min line on close',
|
||||
type: 'min',
|
||||
valueDim: 'close'
|
||||
},
|
||||
{
|
||||
name: 'max line on close',
|
||||
type: 'max',
|
||||
valueDim: 'close'
|
||||
}
|
||||
]
|
||||
}
|
||||
name: '日K',
|
||||
type: 'candlestick',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
color: '#ec0000',
|
||||
color0: '#8A0000',
|
||||
borderColor: '#00da3c',
|
||||
borderColor0: '#008F28'
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
option1:{
|
||||
title: {
|
||||
show:false
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '10%',
|
||||
right: '12%',
|
||||
bottom: '10%'
|
||||
},
|
||||
xAxis: {
|
||||
type:'category'
|
||||
},
|
||||
yAxis: {
|
||||
scale:true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside'
|
||||
}
|
||||
],
|
||||
series: {
|
||||
name: '分时图',
|
||||
type: 'line',
|
||||
markLine: {
|
||||
silent: true,
|
||||
symbol:['none','none'],
|
||||
lineStyle: {
|
||||
width: 2,
|
||||
color: '#AAA'
|
||||
},
|
||||
data: []
|
||||
},
|
||||
}
|
||||
},
|
||||
relatedDesc:'', //关联描述
|
||||
sourceList:[], //来源列表
|
||||
getLocalDate:getLocalDate
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.contentTop = this.navH+(60+10)/750*inject('windowWidth')
|
||||
if(e.code)
|
||||
{
|
||||
this.stockCode = e.code
|
||||
this.getStockDetailsData()
|
||||
this.getStockCandlestickChartData()
|
||||
this.type = e.type
|
||||
if(e.type==1)
|
||||
{
|
||||
//事件详情
|
||||
this.contentTop = this.navH+(60+8)/750*inject('windowWidth')
|
||||
this.eventId = e.id
|
||||
this.stockCode = e.code
|
||||
this.getStockDetailsData()
|
||||
}else
|
||||
{
|
||||
//投资详情
|
||||
this.contentTop = this.navH
|
||||
this.navTitle = e.name+'('+e.code+')'
|
||||
this.relatedDesc = e.des
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
// chart 图表实例不能存在data里
|
||||
const chart = await this.$refs.chartRef.init(echarts);
|
||||
chart.setOption(this.option)
|
||||
if(this.selectCategory==0)
|
||||
{
|
||||
//分时图
|
||||
chart.setOption(this.option1)
|
||||
}else
|
||||
chart.setOption(this.option)
|
||||
},
|
||||
/**
|
||||
* 点击切换分类
|
||||
@@ -202,10 +202,12 @@
|
||||
if(this.selectCategory!=index)
|
||||
{
|
||||
this.selectCategory = index
|
||||
if(index==0||index==2)
|
||||
if(index==1)
|
||||
{
|
||||
//日k
|
||||
this.getStockCandlestickChartData()
|
||||
}
|
||||
}else
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -214,10 +216,48 @@
|
||||
getStockDetailsData()
|
||||
{
|
||||
let stockCode = this.stockCode
|
||||
stockDetails(stockCode).then(res=>{
|
||||
let eventId = this.eventId
|
||||
stockDetails(eventId,stockCode).then(res=>{
|
||||
if(res.code==200)
|
||||
{
|
||||
this.navTitle = res.data.basic_info.stock_name+'('+res.data.basic_info.stock_code+')'
|
||||
let data = res.data.minute_chart_data
|
||||
let categoryData = []
|
||||
let valueData = []
|
||||
for (let item of data) {
|
||||
categoryData.push(item.time)
|
||||
valueData.push(item.close)
|
||||
}
|
||||
this.option1.xAxis.data = categoryData
|
||||
this.option1.series.data = valueData
|
||||
this.option1.series.markLine.data = [{
|
||||
yAxis:data[0].open,
|
||||
label:{
|
||||
show:true,
|
||||
position:'start',
|
||||
// formatter:'111',
|
||||
color:'#333'
|
||||
},
|
||||
},
|
||||
{
|
||||
yAxis:data[0].open,
|
||||
label:{
|
||||
show:true,
|
||||
position:'end',
|
||||
formatter:'0.00%',
|
||||
color:'#333'
|
||||
},
|
||||
}]
|
||||
let relatedDesc = res.data.related_desc
|
||||
if(relatedDesc)
|
||||
{
|
||||
this.relatedDesc = relatedDesc.relation_desc
|
||||
if(relatedDesc.retrieved_sources)
|
||||
{
|
||||
this.sourceList = relatedDesc.retrieved_sources
|
||||
}
|
||||
}
|
||||
this.init()
|
||||
}else
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
@@ -234,17 +274,20 @@
|
||||
{
|
||||
let stockCode = this.stockCode
|
||||
let param = {chart_type:'minute'}
|
||||
if(this.selectCategory==2)
|
||||
if(this.selectCategory==1)
|
||||
{
|
||||
param.chart_type = 'daily'
|
||||
}
|
||||
stockCandlestickChartData(stockCode,param).then(res=>{
|
||||
let data = res.data
|
||||
let categoryData = []
|
||||
let valueData = []
|
||||
for (let item of data) {
|
||||
categoryData.push(item.time)
|
||||
valueData.push([item.open,item.close,item.low,item.high])
|
||||
}
|
||||
this.option.xAxis.data = categoryData
|
||||
this.option.series[0].data = valueData
|
||||
this.init()
|
||||
}).catch(error=>{
|
||||
|
||||
@@ -298,6 +341,7 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
.section
|
||||
{
|
||||
padding: 0 28rpx;
|
||||
@@ -308,11 +352,54 @@
|
||||
}
|
||||
.des
|
||||
{
|
||||
padding: 0 30rpx;
|
||||
padding: 0 0 30rpx;
|
||||
margin: 0 25rpx;
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
line-height: 1.4rem;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.list
|
||||
{
|
||||
padding: 0 25rpx;
|
||||
.item
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 30rpx 26rpx;
|
||||
border-radius: 10rpx;
|
||||
.content
|
||||
{
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
}
|
||||
.article
|
||||
{
|
||||
margin-top: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
text-align: right;
|
||||
}
|
||||
.authorDateC
|
||||
{
|
||||
margin-top: 30rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #AAA;
|
||||
.author
|
||||
{
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.contentC.radius
|
||||
{
|
||||
margin-top: 10rpx;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user