<wxs module="filters" src="../../utils/toFixed.wxs" />
<view wx:if="{{type==1}}">
  <view wx:if='{{id}}' class="detail">
    <view class="stock_name">{{info.name}} 
    <text>{{info.code}}</text>
    </view>
    <view class="stock_desc">{{info.desc}}</view>
    <view class="tab">
        <view bindtap="tab"   data-id='1' class="{{cur==1?'act':''}}">持仓选手<text></text></view>
        <!-- <view bindtap="tab" data-id='0' class="{{cur==0?'act':''}}">我要解读<text></text></view>
        <view bindtap="tab" data-id='2' class="{{cur==2?'act':''}}">牛人点评<text></text></view> -->
    </view>

    <view bindtap="blur" style="background: #fff;padding: 20rpx 0rpx 0rpx 20rpx;">
        <view class="content" wx:if='{{cur==0}}'>
          <view class="_list" wx:for="{{comment_list}}">
            <navigator url="../homepage/homepage?user_id={{item.user_id}}"><image src="{{item.user_avatar}}" ></image></navigator>
              <view class="msg">
                  <navigator url="../homepage/homepage?user_id={{item.user_id}}" class="_name">{{item.user_name}}</navigator>
                  <view class="_content">{{item.content}}</view>
                  <view class="answer" wx:if="{{item.children.length>0}}">
                      <view  wx:for="{{item.children}}" wx:for-item='i'>
                      <text>{{i.user_name}}：</text>
                      {{i.content}}</view>
                  </view>
                  <view class="addr">
                      <text>{{item.ctime}}</text><text>来自{{item.location}}</text>
                      <image wx:if="{{item.user_id==user_id}}" class="del" data-id='{{item.id}}' data-name='{{item.user_name}}' catchtap="delmsg" mode="widthFix" src="../../images/delete.png"></image>
                      <image data-id='{{item.id}}' data-name='{{item.user_name}}' catchtap="answer" mode="widthFix" src="../../images/msg.png"></image>
                  </view>
              </view>
          </view>
        </view>
        <scroll-view wx:if='{{cur==1}}' bindscrolltolower='next1' scroll-y='{{true}}' style="height:calc(100vh - 90rpx);">
            <navigator hover-class="none" class="player" wx:for='{{list}}' bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
              <view class="name">{{item.username}} 
              </view> 
              <view class="info">
                          资产：<view><label style="font-weight: 600;">{{item.today_fund}}w</label>(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
              </view>

              <view class="info" wx:if="{{role != 0}}">
                            持仓： 
                              <view wx:if='{{item.is_markt}}'>开超市</view>
                              <view wx:elif='{{item.today_stock.length>0}}'>
                                  <block wx:for="{{item.today_stock}}" wx:for-item='i'> {{i.name}}({{i.fund}}w) </block>
                              </view>
                              <view wx:else>空仓</view>
              </view>
            </navigator>
            <block wx:if='{{total1 >= 20}}'>
                <view class='loading' wx:if='{{list.length < total1}}'>加载更多...</view>
            </block>
        </scroll-view>
        <view wx:if='{{cur==2}}'>
          <view wx:for="{{nbComments}}" style="margin-bottom: 20rpx;">
            <image style="width: 100%;" mode="withFix" src="{{item.img}}"></image>
            <view class="desc">{{item.content}}</view>
            <view class="nr">{{filters.getDate(item.ctime)}}</view>
          </view>
        </view>
    </view>
    <!-- <view  class="post">
        <input value="{{comment}}" confirm-type='send' bindconfirm='sendmsg' placeholder-style="color:#999" maxlength="500" bindinput="inputchange1" focus='{{focus}}' type="text" placeholder="{{text}}"/>
    </view> -->
  </view>
  <view wx:else class="hot_list">
    <view class="top_bg">
      <image mode="widthFix" src="../../xiao/titlehot@2x.png"></image>
      <view class="top_title">顽 主 杯 热 榜
      <image bindtap="toSearch" class="search-img" mode="widthFix" src="../../xiao/search@2x.png"></image>
      <view style="font-size: 22rpx; color: white; word-spacing: 50%;">短线人气金榜</view>
        <picker mode="date" value="{{stock_date}}"  bindchange="bindDateChange">
                    <view class="date-picker">
                    
                      {{stock_date}}
                      <image style="width: 16rpx;" mode="widthFix" src="../../xiao/choosedown@2x.png"></image>
                    </view>
        </picker>
      </view>
    </view>
    
    <view class="paixu" bind:tap="paixu">
      <label>{{paixu}}</label>
      <image src="../../xiao/px.png"></image>
    </view>

    <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 20rpx;">
        <navigator hover-class="none" class="list" bind:tap="pushStocks" data-id="{{item.id}}" wx:for='{{list}}'>
          <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
          <text wx:else class="number">{{index+1}}</text>
          <view class="stock-name">
            {{item.stock_name}} <text class="cc">{{filters.toFix2(item.total_fund)}}w</text>
            <text class="code">{{item.stock_code}} <block wx:if="{{date==stock_date}}">{{item.stock_desc}}</block></text>
          </view>
        <view class="num"> <text>{{item.count}}</text> 人持仓 
          <image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image>
        </view>
      
        </navigator>
        <block wx:if='{{total >= 20}}'>
                <view class='loading' wx:if='{{list.length < total}}'>上拉加载更多...</view>
        </block>
    </scroll-view>
  </view>
</view>
<view wx:else>
  <view   style="background: #fff;padding: 20rpx;">
    <view class="search">
      <image mode="heightFix" src="../../images/ss1.png"></image>
      <input bindconfirm="inputChange" confirm-type='search' placeholder-style="color:#999;" placeholder="输入股票名称"></input>
    </view>
  </view>
  <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 30rpx;">
        <navigator hover-class="none" class="list" bind:tap="pushStocks" data-id="{{item.id}}" wx:for='{{searchList}}'>
          <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
          <text wx:else class="number">{{index+1}}</text>
          <view class="stock-name">
            {{item.stock_name}} <text class="cc">{{filters.toFix2(item.total_fund)}}w</text>
            <text class="code">{{item.stock_code}}</text>
          </view>
        <view class="num"> <text>{{item.count}}</text> 人持仓</view>
        </navigator>
    </scroll-view>
</view>