<scroll-view class="container">
  <scroll-view class="content">
    <import src="../../lib/wxParse/wxParse.wxml" />
    <template is="wxParse" data="{{wxParseData:topicDetail.nodes}}" />
  </scroll-view>
  <scroll-view class="sv-goods" wx:if="{{topicGoods.length > 0 }}">
    <view class="topic-goods">
      <view class="h">
        <text class="t">专题商品</text>
      </view>
      <view class="b">
        <view class="item" wx:for="{{topicGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
          <navigator url="/pages/goods/goods?id={{item.id}}">
            <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
            <view class="right">
              <view class="text">
                <text class="name">{{item.name}}</text>
                <text class="desc">{{item.brief}}</text>
                <text class="price">￥{{item.retailPrice}}</text>
              </view>
            </view>
          </navigator>
        </view>
      </view>
    </view>
  </scroll-view>
  <scroll-view class="comments">
    <view class="h">
      <text class="t">精选留言</text>
      <van-icon bindtap="postComment" class="i" name="comment-o" />      
    </view>
    <view class="has-comments" wx:if="{{commentList.length > 0 }}">
      <view class="b">
        <view class="item" wx:for="{{commentList}}" wx:key="id">
          <view class="info">
            <view class="user">
              <image class="avatar" src="{{item.userInfo.avatarUrl}}"></image>
              <text class="nickname">{{item.userInfo.nickName}}</text>
            </view>
            <view class="time">{{item.addTime}}</view>
          </view>
          <view class="comment">
            {{item.content}}
          </view>
        </view>
      </view>
      <view class="load" wx:if="{{commentCount > 5}}">
        <navigator url="/pages/topicComment/topicComment?valueId={{topic.id}}&type=1">查看更多</navigator>
      </view>
    </view>
    <view class="no-comments" wx:if="{{commentList.length <= 0}}">
      <text class="txt">等你来留言</text>
    </view>
  </scroll-view>
  <scroll-view class="rec-box">
    <view class="h">
      <text class="txt">专题推荐</text>
    </view>
    <view class="b">
      <navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
        <image class="img" src="{{item.picUrl}}"></image>
        <text class="title">{{item.title}}</text>
      </navigator>
    </view>
  </scroll-view>
</scroll-view>