"use strict";const e=require("../../../common/vendor.js"),t=require("../../../request/api.js"),o=require("../../../utils/util.js"),c=require("../../../common/assets.js"),i={data:()=>({navH:e.inject("navHeight"),eventId:"",contentTop:"",investDetails:null,former:"",categoryList:["背景","推演","相关股票"],selectCategory:0,stockCategoryList:[{title:"全部股票",num:0,bgColor:"#D82A2A",color:"white"},{title:"大周期",num:0,bgColor:"#3A5D9C",color:"white"},{title:"TMT板块",num:0,bgColor:"#FFBF00",color:"white"},{title:"大金融地产",num:0,bgColor:"#FFF4D3"},{title:"大消费",num:0,bgColor:"#CDEEEE"},{title:"公共产业板块",num:0,bgColor:"#DEEBF7"}],accMul:o.accMul}),onLoad(t){this.contentTop=this.navH+.136*e.inject("windowWidth"),t.id&&(this.eventId=t.id,this.getEventDetailsData())},methods:{clickCategoryItem(e){this.selectCategory!=e&&(this.selectCategory=e)},clickLookRelatedStockItem(t){e.index.navigateTo({url:"/pages/index/stockDetails/stockDetails?type=2&code="+t.code+"&des="+t.description+"&name="+t.name})},getEventDetailsData(){t.investEventDetails(this.eventId).then((t=>{if(200==t.code){let e=t.data.detail;for(let t of this.stockCategoryList)t.num=e.sector_stats[t.title];this.investDetails=e,this.former=e.former.replace("<answer>","").replace("</answer>","")}else e.index.showToast({title:t.message,icon:"none"})})).catch((e=>{}))}}};if(!Array){(e.resolveComponent("navBar")+e.resolveComponent("ua-markdown"))()}Math||((()=>"../../../components/navBar/navBar.js")+(()=>"../../../components/ua-markdown/ua-markdown.js"))();const s=e._export_sfc(i,[["render",function(t,o,i,s,r,a){return e.e({a:e.p({leftText:"事件详情",hideNavBg:!0}),b:c._imports_0,c:e.f(r.categoryList,((t,o,c)=>({a:e.t(t),b:e.n("item relative "+(r.selectCategory==o?"select":"")),c:o,d:e.o((e=>a.clickCategoryItem(o)),o)}))),d:e.s("top:"+r.navH+"px;"),e:r.investDetails},r.investDetails?e.e({f:0==r.selectCategory},0==r.selectCategory?{g:e.p({source:r.former})}:{},{h:1==r.selectCategory},1==r.selectCategory?{i:e.p({source:r.investDetails.forecast})}:{},{j:2==r.selectCategory},2==r.selectCategory?{k:e.f(r.stockCategoryList,((t,o,c)=>({a:e.t(t.num),b:e.t(t.title),c:e.s("background-color:"+t.bgColor+";color:"+t.color+";"),d:o}))),l:e.f(r.investDetails.related_stocks,((t,o,c)=>e.e({a:e.t(t.code+" "+t.name),b:e.t(r.accMul(t.score,100)),c:t.sw_primary_sector},t.sw_primary_sector?{d:e.t(t.sw_primary_sector)}:{},{e:e.t(t.description),f:o,g:e.o((e=>a.clickLookRelatedStockItem(t)),o)})))}:{},{m:3==r.selectCategory},3==r.selectCategory?{n:e.f(t.conceptList,((o,c,i)=>e.e({a:e.t(o.concept),b:o.price_info},o.price_info?{c:e.t(t.getChgRateStr(o.price_info.avg_change_pct)),d:e.n("chg "+(t.getRateUpOrDown(o.price_info.avg_change_pct)?"down":"up"))}:{},{e:o.price_info},o.price_info?{f:e.t(o.stock_count),g:e.n("stockNum "+(t.getRateUpOrDown(o.price_info.avg_change_pct)?"down":"up"))}:{},{h:e.t(o.description),i:e.f(o.stocks.slice(0,3),((t,o,c)=>({a:e.t(t.stock_name),b:o}))),j:e.t(o.stock_count-3),k:e.o((e=>t.clickStockMore(o)),c),l:e.t(o.price_info?o.price_info.trade_date:""),m:e.o((e=>t.clickHistoricalTimeline(o)),c),n:c}))),o:c._imports_1$2}:{},{p:e.s("top:"+r.contentTop+"px;")}):{})}]]);wx.createPage(s);
