<!--index.wxml-->
<view class="container">
  <view class="container" style="z-index: 1;">
    <web-view wx:if="{{Type === 1}}" src="{{ActivityDetail.Content}}"></web-view>
    <view class="MainPage" wx:if="{{Type === 2}}">

      <!-- 文章主体 -->
      <view class="article">
        <text class="title">{{ActivityDetail.Title}}</text>
        <view class="subInfo flex-h">
          <text class="flex-item">{{ActivityDetail.Publisher}}</text>
          <text>{{ActivityDetail.CreateDate}}</text>
        </view>
        <rich-text nodes="{{ActivityDetail.Content}}"></rich-text>
      </view>

      <!-- 评论主体 -->
      <view class="comment">
        <view class="top flex-h">
          <text class="flex-item">评论内容</text>
          <view class="addComment" bindtap="AddComment">
            <image mode="widthFix" src="/assets/images/icon29.png"></image>
            <text>添加评论</text>
          </view>
        </view>

        <!-- 评论列表 -->
        <view class="list">
          <view class="flex-h" wx:for="{{CommentList}}" wx:for-item="item" wx:for-index="idx" wx:key="key">

            <!-- 头像 -->
            <view class="userIcon">
              <view>
                <image mode="aspectFill" src="{{item.FloorUserIcon}}" class="centerLabel cover"></image>
              </view>
            </view>

            <!-- 评论内容主体 -->
            <view class="flex-item">
              <view class="itemBody">
                <view class="iHeader flex-h">
                  <view class="flex-item">
                    <text>{{item.FloorUserName}}</text>
                    <text>{{item.CreateDate}}</text>
                  </view>
                  <image wx:if="{{item.LikeNum - 0 === 0}}" mode="widthFix" src="/assets/images/icon30.png"></image>
                  <image wx:if="{{item.LikeNum - 0 !== 0}}" mode="widthFix" src="/assets/images/icon31.png"></image>
                  <text wx:if="{{item.LikeNum - 0 !== 0}}">{{item.LikeNum}}</text>
                </view>
                <text class="floorContent">{{item.Content}}</text>

                <!-- 评论图片列表 -->
                <view class="imgList">
                  <view wx:for="{{item.ImgList}}" wx:for-item="subItem" wx:for-index="subIdx" wx:key="subKey">
                    <image mode="aspectFit" src="{{subItem.imgUrl}}" class="centerLabel contain"></image>
                  </view>
                </view>

                <!-- 评论回复列表 -->
                <view class="subList">
                  <view class="subItem" wx:for="{{item.Childs}}" wx:for-item="subItem" wx:for-index="subIdx" wx:key="subKey">
                    <view class="iHeader flex-h">
                      <view class="flex-item">
                        <text>{{subItem.Name}} 回复</text>
                        <text>{{subItem.CreateDate}}</text>
                      </view>
                      <image wx:if="{{subItem.LikeNum - 0 === 0}}" mode="widthFix" src="/assets/images/icon30.png"></image>
                      <image wx:if="{{subItem.LikeNum - 0 !== 0}}" mode="widthFix" src="/assets/images/icon31.png"></image>
                      <text wx:if="{{subItem.LikeNum - 0 !== 0}}">{{subItem.LikeNum}}</text>
                    </view>
                    <text class="floorContent">{{subItem.Content}}</text>

                    <!-- 评论图片列表 -->
                    <view class="imgList">
                      <view wx:for="{{subItem.ImgList}}" wx:for-item="dSubItem" wx:for-index="dSubIdx" wx:key="dSubKey">
                        <image mode="aspectFit" src="{{dSubItem.imgUrl}}" class="centerLabel contain"></image>
                      </view>
                    </view>

                  </view>
                </view>

              </view>
            </view>
          </view>
        </view>
      </view>

      <view class="foot"></view>

    </view>
  </view>
  <view class="SignUp" hidden="{{Type !== 2}}">
    <view>
      <text bindtap="ShowSignUpPopup">我要报名</text>
    </view>
  </view>

  <!-- 报名弹窗 -->
  <view class="popup" hidden="{{!ShowPopup}}">
    <view class="layer" bindtap="ClosePopup"></view>
    <view class="centerLabel">
      <view class="SignUpForm">
        <view>
          <text>填写报名信息</text>
          <view class="line flex-h">
            <image mode="widthFix" src="/assets/images/icon32.png" style="width: 28rpx;"></image>
            <input class="flex-item" type="text" placeholder="姓名" bindinput="FormInput" data-name="customerName"></input>
          </view>
          <view class="line flex-h">
            <image mode="widthFix" src="/assets/images/icon34.png" style="width: 22rpx;"></image>
            <input type="number" class="flex-item" placeholder="手机号码" bindinput="FormInput" data-name="phone"></input>
          </view>
          <view class="line flex-h">
            <image mode="widthFix" src="/assets/images/icon33.png" style="width: 30rpx;"></image>
            <input type="idcard" class="flex-item" placeholder="身份证号" bindinput="FormInput" data-name="idNum"></input>
          </view>
          <view class="btn">
            <text bindtap="Submit">提交报名信息</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>