8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user