8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示

This commit is contained in:
尚政杰
2025-08-28 17:42:22 +08:00
parent 58b3414bdd
commit bf2388c3ec
403 changed files with 19843 additions and 1602 deletions

View File

@@ -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
{