Files
JiaZhiQianYan/unpackage/dist/build/mp-weixin/pages/geGuCenter/detail.js

2 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";const t=require("../../common/vendor.js"),e=require("../../request/api.js"),a=require("../../common/assets.js"),i={data:()=>({navH:t.inject("navHeight"),contentTop:"",allStockData:[],filteredData:[],currentDate:"",topLists:[{title:"超大盘股",value:">1000亿"},{title:"大盘股",value:"500-1000亿"},{title:"中盘股",value:"100-500亿"}],list2Index:0}),onLoad(e){this.currentDate=e.currentDate,this.contentTop=this.navH+115/750*t.inject("windowWidth"),this.marketHeatmap()},methods:{handleTypeClick(t){this.list2Index=t,this.marketHeatmap()},getTableItem(t){const e=t.market_cap?t.market_cap.toFixed(2):"0.00",a=t.amount?t.amount.toFixed(2):"0.00",i=t.change_percent?Number(t.change_percent):0;let r="",s="";return i>0?(r=`+${i}%`,s="positive"):i<0?(r=`${i}%`,s="negative"):(r="0%",s="zero"),[[t.stock_name,t.stock_code],[r,"",s],[`${e}亿元`],[`${a}亿元`],[t.industry||"暂无"]]},marketHeatmap(){let t={limit:500,date:this.currentDate};e.marketHeatmap(t).then((t=>{this.allStockData=t.data||[],this.filterStockByMarketCap()})).catch((t=>{}))},filterStockByMarketCap(){const{list2Index:t,allStockData:e}=this;let a=[];switch(t){case 0:a=e.filter((t=>t.market_cap>1e3));break;case 1:a=e.filter((t=>t.market_cap>=500&&t.market_cap<=1e3));break;case 2:a=e.filter((t=>t.market_cap>=100&&t.market_cap<=500));break;default:a=e}this.filteredData=a},itemDetails(e){t.index.navigateTo({url:"/pagesStock/stockCenterDetails/stockCenterDetails?code="+e.stock_code})}}};if(!Array){t.resolveComponent("navBar")()}Math;const r=t._export_sfc(i,[["render",function(e,i,r,s,o,c){return{a:t.p({leftText:"详情",hideNavBg:!0}),b:a._imports_0,c:a._imports_1,d:t.o((t=>e.clickSearch())),e:e.keywords,f:t.o((t=>e.keywords=t.detail.value)),g:t.s("top:"+o.navH+"px;"),h:t.f(o.topLists,((e,a,i)=>({a:t.t(e.title),b:o.list2Index==a?"#BB8520":"#070707",c:t.t(e.value),d:o.list2Index==a?"#BB8520":"#070707",e:t.o((t=>c.handleTypeClick(a)),a),f:a,g:o.list2Index==a?"1rpx solid #F2C369":"none"}))),i:t.f(["股票名称","涨跌幅","市值","成交额","行业"],((e,a,i)=>({a:t.t(e),b:a}))),j:t.f(o.filteredData,((e,a,i)=>({a:t.f(c.getTableItem(e),((e,a,i)=>t.e({a:t.t(e[0]),b:0==a},0==a?{c:t.t(e[1])}:{},{d:a,e:0==a?"#222222":1==a?"positive"===e[2]?"#EC3440":"#01AB5D":"#666666"}))),b:t.o((t=>c.itemDetails(e))),c:a%2==0?"#fff":"#FAFAFC"}))),k:t.s("top:"+o.contentTop+"px;")}}]]);wx.createPage(r);