2.4 组件结构调整,调整会员权限判断
This commit is contained in:
@@ -1 +1 @@
|
||||
"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);
|
||||
"use strict";const t=require("../../common/vendor.js"),e=require("../../request/api.js"),a=require("../../common/assets.js"),s={data:()=>({navH:t.inject("navHeight"),contentTop:"",allStockData:[],filteredData:[],currentDate:"",searchResultTop:"",contentTop:"",keywords:"",searchShow:!1,searchResultList:[],selectSearchStockInfo:null,topLists:[{title:"超大盘股",value:"(>1000亿)"},{title:"大盘股",value:"(500-1000亿)"},{title:"中盘股",value:"(100-500亿)"}],list2Index:0}),onLoad(e){this.currentDate=e.currentDate,this.searchResultTop=this.navH+.12*t.inject("windowWidth"),this.contentTop=this.navH+115/750*t.inject("windowWidth"),this.marketHeatmap()},methods:{clickSearch(){this.keywords?this.getSearchStockInfoListData():this.selectSearchStockInfo=null},clickSearchResultBg(){this.searchShow=!1},clickSearchResultListItem(t){this.selectSearchStockInfo=t,this.searchShow=!1,this.getStockBasicInfoData()},getSearchStockInfoListData(){let t={q:this.keywords,limit:10};e.searchStockInfo(t).then((t=>{this.searchResultList=t.data,this.searchShow=this.searchResultList.length>0})).catch((t=>{}))},getStockBasicInfoData(){let e=this.stockCode;this.selectSearchStockInfo&&(e=this.selectSearchStockInfo.stock_code),t.index.navigateTo({url:"/pagesStock/stockCenterDetails/stockCenterDetails?code="+e})},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",s=t.change_percent?Number(t.change_percent):0;let c="",i="";return s>0?(c=`+${s}%`,i="positive"):s<0?(c=`${s}%`,i="negative"):(c="0%",i="zero"),[[t.stock_name,t.stock_code],[c,"",i],[`${e}亿元`],[`${a}亿元`],[t.industry||"暂无"]]},marketHeatmap(){let t={limit:500};this.currentDate&&"undefined"!==this.currentDate&&""!==this.currentDate.trim()&&(t.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 c=t._export_sfc(s,[["render",function(e,s,c,i,o,r){return t.e({a:t.p({leftText:"详情",hideNavBg:!0}),b:a._imports_0,c:a._imports_1,d:t.o([t=>o.keywords=t.detail.value,t=>r.clickSearch()]),e:o.keywords,f:t.s("top:"+o.navH+"px;"),g:o.searchShow},o.searchShow?{h:t.f(o.searchResultList,((e,a,s)=>({a:t.t(e.stock_code),b:t.t(e.stock_name),c:a,d:t.o((t=>r.clickSearchResultListItem(e)),a)}))),i:t.s("top:"+o.searchResultTop+"px;"),j:t.o((t=>r.clickSearchResultBg()))}:{},{k:t.f(o.topLists,((e,a,s)=>({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=>r.handleTypeClick(a)),a),f:a,g:o.list2Index==a?"1rpx solid #F2C369":"none"}))),l:t.f(["股票名称","涨跌幅","市值","成交额","行业"],((e,a,s)=>({a:t.t(e),b:a}))),m:t.f(o.filteredData,((e,a,s)=>({a:t.f(r.getTableItem(e),((e,a,s)=>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=>r.itemDetails(e))),c:a%2==0?"#fff":"#FAFAFC"}))),n:t.s("top:"+o.contentTop+"px;")})}]]);wx.createPage(c);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view><nav-bar wx:if="{{a}}" u-i="1d94e03e-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="searchC fixed flex" style="{{g}}"><image class="icon" src="{{c}}" mode="widthFix"></image><input class="flex1" type="text" placeholder="输入股票代码或名称" placeholder-style="color:#eeeeee" confirm-type="search" bindconfirm="{{d}}" value="{{e}}" bindinput="{{f}}"/></view><scroll-view scroll-y class="stockDetailsC fixed" style="{{k}}"><view><view style="display:grid;grid-template-columns:repeat(3, 1fr);gap:16rpx;margin:0 20rpx"><view wx:for="{{h}}" wx:for-item="item" wx:key="f" bindtap="{{item.e}}" style="{{'padding:12rpx' + ';' + ('border-bottom:' + item.g)}}"><view style="{{'font-size:24rpx;color:#070707;font-weight:bold;text-align:center' + ';' + ('color:' + item.b)}}">{{item.a}}</view><view style="{{'font-size:20rpx;font-weight:400;text-align:center' + ';' + ('color:' + item.d)}}">{{item.c}}</view></view></view><view style="height:1rpx;margin:0 20rpx;background-color:#E7E7E7"></view><view style="display:grid;grid-template-columns:repeat(5, 1fr);gap:10rpx;background-color:#FAFAFC;line-height:60rpx;margin:0 20rpx;margin-top:20rpx"><view wx:for="{{i}}" wx:for-item="item" wx:key="b" style="color:#666666;font-size:20rpx;font-weight:500;text-align:center">{{item.a}}</view></view><view wx:for="{{j}}" wx:for-item="obj" bindtap="{{obj.b}}" style="{{'display:grid;grid-template-columns:repeat(5, 1fr);gap:10rpx;min-height:60rpx;margin:0 20rpx' + ';' + ('background-color:' + obj.c)}}"><view wx:for="{{obj.a}}" wx:for-item="item" wx:key="d" style="{{'padding:10rpx 0;color:#666666;font-size:20rpx;font-weight:500;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column' + ';' + ('color:' + item.e)}}"><view>{{item.a}}</view><view wx:if="{{item.b}}" style="color:#666666;font-size:20rpx;font-weight:500">{{item.c}}</view></view></view><view style="height:25rpx"></view></view></scroll-view></view>
|
||||
<view><nav-bar wx:if="{{a}}" u-i="1d94e03e-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="searchC fixed flex" style="{{f}}"><image class="icon" src="{{c}}" mode="widthFix"></image><input class="flex1" type="text" placeholder="输入股票代码或名称" placeholder-style="color:#eeeeee" confirm-type="search" bindinput="{{d}}" value="{{e}}"/></view><view wx:if="{{g}}" class="searchResultList fixed" style="{{i}}" bindtap="{{j}}"><view class="list"><view wx:for="{{h}}" wx:for-item="item" wx:key="c" class="item" catchtap="{{item.d}}">{{item.a}} {{item.b}}</view></view></view><scroll-view scroll-y class="stockDetailsC fixed" style="{{n}}"><view><view style="display:grid;grid-template-columns:repeat(3, 1fr);gap:16rpx;margin:0 20rpx"><view wx:for="{{k}}" wx:for-item="item" wx:key="f" bindtap="{{item.e}}" style="{{'padding:12rpx' + ';' + ('border-bottom:' + item.g)}}"><view style="{{'font-size:24rpx;color:#070707;font-weight:bold;text-align:center' + ';' + ('color:' + item.b)}}">{{item.a}}</view><view style="{{'font-size:20rpx;font-weight:400;text-align:center' + ';' + ('color:' + item.d)}}">{{item.c}}</view></view></view><view style="height:1rpx;margin:0 20rpx;background-color:#E7E7E7"></view><view style="display:grid;grid-template-columns:repeat(5, 1fr);gap:10rpx;background-color:#FAFAFC;line-height:60rpx;margin:0 20rpx;margin-top:20rpx"><view wx:for="{{l}}" wx:for-item="item" wx:key="b" style="color:#666666;font-size:20rpx;font-weight:500;text-align:center">{{item.a}}</view></view><view wx:for="{{m}}" wx:for-item="obj" bindtap="{{obj.b}}" style="{{'display:grid;grid-template-columns:repeat(5, 1fr);gap:10rpx;min-height:60rpx;margin:0 20rpx' + ';' + ('background-color:' + obj.c)}}"><view wx:for="{{obj.a}}" wx:for-item="item" wx:key="d" style="{{'padding:10rpx 0;color:#666666;font-size:20rpx;font-weight:500;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column' + ';' + ('color:' + item.e)}}"><view>{{item.a}}</view><view wx:if="{{item.b}}" style="color:#666666;font-size:20rpx;font-weight:500">{{item.c}}</view></view></view><view style="height:25rpx"></view></view></scroll-view></view>
|
||||
@@ -1 +1 @@
|
||||
page{background-color:#070707}.topBg{top:0;left:0;width:100%;height:auto}.searchC{background-color:rgba(41,41,41,.7);left:0;right:0;margin:20rpx 25rpx 0;padding:0 25rpx;height:70rpx;border-radius:35rpx;font-size:22rpx;font-weight:500}.searchC .icon{margin-right:12rpx;width:25rpx;height:auto}.searchC input{height:100%;color:#fff}.stockDetailsC{left:25rpx;width:calc(100vw - 50rpx);bottom:env(safe-area-inset-bottom);background-color:#fff;border-radius:10rpx}
|
||||
page{background-color:#070707}.topBg{top:0;left:0;width:100%;height:auto}.searchC{background-color:rgba(41,41,41,.7);left:0;right:0;margin:20rpx 25rpx 0;padding:0 25rpx;height:70rpx;border-radius:35rpx;font-size:22rpx;font-weight:500}.searchC .icon{margin-right:12rpx;width:25rpx;height:auto}.searchC input{height:100%;color:#fff}.stockDetailsC{left:25rpx;width:calc(100vw - 50rpx);bottom:env(safe-area-inset-bottom);background-color:#fff;border-radius:10rpx}.searchResultList{background-color:rgba(0,0,0,.5);left:0;right:0;bottom:0;padding:0 25rpx;z-index:20}.searchResultList .list{background-color:#fff;border-radius:10rpx}.searchResultList .list .item{padding:0 42rpx;line-height:60rpx;font-size:22rpx;font-weight:500;color:#333}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
page{background-color:#070707}.topBg{top:0;left:0;width:100%;height:auto}.searchC{background-color:rgba(41,41,41,.7);left:0;right:0;margin:20rpx 25rpx 0;padding:0 25rpx;height:70rpx;border-radius:35rpx;font-size:22rpx;font-weight:500}.searchC .icon{margin-right:12rpx;width:25rpx;height:auto}.searchC input{height:100%;color:#fff}.stockDetailsC{left:25rpx;width:calc(100vw - 50rpx);bottom:calc(55px + env(safe-area-inset-bottom));background-color:#fff;border-radius:10rpx}.detailPopup{max-height:70%;background-color:#fff;color:red;border-radius:20rpx 20rpx 0 0;padding-bottom:env(safe-area-inset-bottom)}
|
||||
page{background-color:#070707}.topBg{top:0;left:0;width:100%;height:auto}.searchC{background-color:rgba(41,41,41,.7);left:0;right:0;margin:20rpx 25rpx 0;padding:0 25rpx;height:70rpx;border-radius:35rpx;font-size:22rpx;font-weight:500}.searchC .icon{margin-right:12rpx;width:25rpx;height:auto}.searchC input{height:100%;color:#fff}.stockDetailsC{left:25rpx;width:calc(100vw - 50rpx);bottom:calc(55px + env(safe-area-inset-bottom));background-color:#fff;border-radius:10rpx}.detailPopup{max-height:70%;background-color:#fff;color:red;border-radius:20rpx 20rpx 0 0;padding-bottom:env(safe-area-inset-bottom)}.searchResultList{background-color:rgba(0,0,0,.5);left:0;right:0;bottom:0;padding:0 25rpx;z-index:20}.searchResultList .list{background-color:#fff;border-radius:10rpx}.searchResultList .list .item{padding:0 42rpx;line-height:60rpx;font-size:22rpx;font-weight:500;color:#333}
|
||||
|
||||
Reference in New Issue
Block a user