"use strict";const t=require("../../../common/vendor.js"),e=require("../../../request/api.js"),s=require("../../../common/assets.js"),n={data:()=>({navH:t.inject("navHeight"),listTop:"",conceptId:"",conceptName:"",weekList:["一","二","三","四","五","六","日"],monthDateList:[],selectMonthIndex:0,selectMonth:"",selectDateStr:"",quickTimeList:["今天","昨天","一周前","一月前"],stockList:[]}),onLoad(e){this.listTop=this.navH+68/750*t.inject("windowWidth");let s=new Date,n=s.getFullYear(),a=s.getMonth()+1,o=s.getDate();this.selectMonthIndex=240+a-1,this.selectMonth=n+"年"+a+"月",this.selectDateStr=n+"-"+(a>9?a:"0"+a)+"-"+(o>9?o:"0"+o),this.generateMonthDateListData(),e.id&&(this.conceptId=e.id,this.getConceptHotStockData())},methods:{generateMonthDateListData(){let t=new Date,e=t.getFullYear(),s=t.getMonth()+1,n=t.getDate(),a=[];for(var o=e-20;o9?a:"0"+a)+"-"+(h>9?h:"0"+h);p.push({date:r,year:o,month:a,day:h,isToday:o==e&&a==s&&h==n,isCurrentMonth:!0,timestamp:l})}for(c=0;c9?a:"0"+a)+"-"+(h>9?h:"0"+h);p.unshift({date:r,year:t,month:a,day:h,isToday:!1,isCurrentMonth:!1,timestamp:l})}let d=new Date(o,i+1,1),D=new Date(d-864e5).getDay()||7;for(c=1;c<8-D;c++){let t=o,e=i;e>11&&(e=0,t++);let s=new Date(t,e+1,c),n=s.getMonth()+1,a=s.getDate(),h=s.getTime(),l=t+"-"+(n>9?n:"0"+n)+"-"+(a>9?a:"0"+a);p.push({date:l,year:t,month:n,day:a,isToday:!1,isCurrentMonth:!1,timestamp:h})}a.push(p)}this.monthDateList=a},clickDateScreen(){this.$refs.datePopup.open()},clickExpandOrRetract(t){this.stockList[t].isExpand=!this.stockList[t].isExpand},clickCancel(){this.$refs.datePopup.close()},clickConfirm(){this.clickCancel(),this.getConceptHotStockData()},clickPreMonth(){if(this.selectMonthIndex>0){this.selectMonthIndex--;let t=this.monthDateList[this.selectMonthIndex],e="",s="";for(let n of t)if(n.isCurrentMonth){e=n.year,s=n.month;break}this.selectMonth=e+"年"+s+"月"}},clickNextMonth(){if(this.selectMonthIndex9?t:"0"+t)+"-"+(n>9?n:"0"+n)}else if(1==t){let t=new Date(e);t.setDate(t.getDate()-1);let n=t.getFullYear(),a=t.getMonth()+1,o=t.getDate();this.selectMonthIndex=12*(20-(s-n))+a-1,this.selectMonth=n+"年"+a+"月",this.selectDateStr=n+"-"+(a>9?a:"0"+a)+"-"+(o>9?o:"0"+o)}else if(2==t){let t=new Date(e);t.setDate(t.getDate()-7);let n=t.getFullYear(),a=t.getMonth()+1,o=t.getDate();this.selectMonthIndex=12*(20-(s-n))+a-1,this.selectMonth=n+"年"+a+"月",this.selectDateStr=n+"-"+(a>9?a:"0"+a)+"-"+(o>9?o:"0"+o)}else{let t=new Date(e);t.setDate(t.getDate()-30);let n=t.getFullYear(),a=t.getMonth()+1,o=t.getDate();this.selectMonthIndex=12*(20-(s-n))+a-1,this.selectMonth=n+"年"+a+"月",this.selectDateStr=n+"-"+(a>9?a:"0"+a)+"-"+(o>9?o:"0"+o)}},getConceptHotStockData(){let t={trade_date:this.selectDateStr};e.conceptDetails(this.conceptId,t).then((t=>{this.conceptName=t.concept,this.stockList=t.stocks;let s=this.stockList.map((t=>null!=t.code?t.code:""));console.log(s),e.conceptOtherDetails(this.conceptId,{days:1,codes:s,isJson:1}).then((t=>{this.stockList=this.stockList.map((e=>(null!=e.code&&(e.change_percent=t.data[e.code].stats.change_percent),e))),console.log("==============="),console.log(this.stockList)})).catch((t=>{console.log("=-=-=-=-=-=-=-=-=")}))})).catch((t=>{}))}}};if(!Array){(t.resolveComponent("navBar")+t.resolveComponent("uni-popup"))()}Math||((()=>"../../../components/navBar/navBar.js")+(()=>"../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"))();const a=t._export_sfc(n,[["render",function(e,n,a,o,i,c){return{a:t.p({leftText:"热门个股",hideNavBg:!0}),b:s._imports_0,c:t.t(i.conceptName),d:s._imports_1$9,e:t.o((t=>c.clickDateScreen())),f:t.s("top:"+i.navH+"px;"),g:t.f(i.stockList,((e,n,a)=>t.e({a:t.t(e.name),b:t.t(e.code),c:e.change_percent},e.change_percent?{d:t.t(e.change_percent>=0?"+"+e.change_percent:e.change_percent)}:{},{e:e.isExpand},e.isExpand?{f:s._imports_2$7}:{g:s._imports_3$7},{h:t.o((t=>c.clickExpandOrRetract(n)),n),i:e.isExpand},e.isExpand?{j:t.t(e.reason)}:{},{k:n}))),h:t.s("top:"+i.listTop+"px;"),i:t.o((t=>c.clickCancel())),j:t.o((t=>c.clickConfirm())),k:s._imports_4$1,l:t.o((t=>c.clickPreMonth())),m:t.t(i.selectMonth),n:t.o(((...t)=>c.monthChange&&c.monthChange(...t))),o:s._imports_1$2,p:t.o((t=>c.clickNextMonth())),q:t.f(i.weekList,((e,s,n)=>({a:t.t(e),b:s}))),r:t.f(i.monthDateList[i.selectMonthIndex],((e,s,n)=>t.e({a:e.date==i.selectDateStr},e.date==i.selectDateStr?{b:t.t(e.day)}:t.e({c:!e.isCurrentMonth},e.isCurrentMonth?{e:t.t(e.day)}:{d:t.t(e.day)}),{f:s,g:t.o((t=>c.clickSelectDate(e)),s)}))),s:t.f(i.quickTimeList,((e,s,n)=>({a:t.t(e),b:s,c:t.o((t=>c.clickQuickTimeItem(s)),s)}))),t:t.sr("datePopup","21efe432-1"),v:t.p({type:"bottom",safeArea:!1})}}]]);wx.createPage(a);