<scroll-view class="container" style="height: {{winHeight}}rpx" scroll-y="true">
  <view>
  <view wx:if="{{showNavList}}" class="modal-wrap"></view>
  <view class="fast-nav">
    <contact-button wx:if="{{!showNavList}}" class="contact" size="25" type="primary" session-from="weapp"><text>找客服</text></contact-button>
    <view wx:if="{{!showNavList}}" class="nav" bindtap="toggleNav"><text>快捷</text><text>导航</text></view>
    <view class="nav-list" wx:if="{{showNavList}}">
      <view class="nav-item">
        <text class="nav-text">首页</text>
        <view class="nav-cell" bindtap="switchNav" data-name="index">
          <image src="../../static/images/nav-1.png"></image>
        </view>
      </view>
      <view class="nav-item">
        <text class="nav-text">足迹</text>
        <navigator class="nav-cell" url="../ucenter/footprint/footprint">
          <image src="../../static/images/nav-2.png"></image>
        </navigator>
      </view>
      <view class="nav-item">
        <text class="nav-text">搜索</text>
        <navigator class="nav-cell" url="../search/search">
          <image src="../../static/images/nav-3.png"></image>
        </navigator>
      </view>
      <view class="nav-item">
        <text class="nav-text">购物车</text>
        <view class="nav-cell" bindtap="switchNav" data-name="cart">
          <image src="../../static/images/nav-4.png"></image>
        </view>
      </view>
    </view>
    <view wx:if="{{showNavList}}" class="close" bindtap="toggleNav">X</view>
  </view>
    <swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
      <swiper-item wx:for="{{gallery}}" wx:key="{{item.id}}">
        <image src="{{item.img_url}}" background-size="cover"></image>
      </swiper-item>
    </swiper>
    <!-- <view class="service-policy">
      <view class="item">30分钟速达</view>
      <view class="item">每日优选生鲜</view>
      <view class="item">满88元免运费</view>
    </view> -->
    <view class="group-panel">
      <view class="group-title">拼团</view>
      <view class="group-desc">限时火拼·超值底价</view>
      <view class="group-deadline">
        <view class="desc">距结束仅剩</view>
        <view class="info">
          <text class="time-tag">{{group.dateformat.day}}</text>天<text class="time-tag">{{group.dateformat.hr}}</text>时<text class="time-tag">{{group.dateformat.min}}</text>分<text class="time-tag">{{group.dateformat.sec}}</text>秒</view>
      </view>
    </view>
    <view class="goods-info">
      <view class="c">
        <view class="goods-do">
          <text class="price">￥{{group.retail_min_price}}</text>
          <view class="group-desc">
            <text class="org-price line-through">￥{{group.retail_price}}</text>
            <text class="price-desc">{{group.min_open_group}}人拼团  拼团立省￥{{group.retail_price - group.retail_min_price}}</text>
          </view>
        </view>
        <!-- <text class='bizType'>{{goods.goodsBizType}}</text> -->
        <text class="name">{{goods.name}}</text>
        <text class="desc">{{goods.goods_brief}}</text>
      </view>
    </view>

      <view class='goods-close' wx:if="{{group.open_status!=1}}">已关闭</view>

    <!-- <view class="section-nav section-attr" bindtap="switchAttrPop">
      <view class="t">请选择规格数量</view>
      <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
    </view> -->
    <view class="join-group" wx:if="{{groupOpenList.length > 0}}">
      <view class="join-group-desc">以下小伙伴正在发起拼团，您可以直接参与：</view>
      <view class="join-group-list">
        <view class="join-group-item" wx:for="{{groupOpenList}}" wx:key="index">
          <view class="user">
            <image src="{{item.avatar}}"></image>
            <text>{{item.nickname}}</text>
          </view>
          <view class="box">
            <view class="desc">还差{{item.min_open_group - item.attend_num}}人成团</view>
            <view class="time">剩余 <text>{{item.dateformat.day}}天</text>
              <text>{{item.dateformat.hr}}</text>:<text>{{item.dateformat.min}}</text>:<text>{{item.dateformat.sec}}</text>
            </view>
          </view>
          <navigator url="../joinGroup/joinGroup?openId={{item.id}}&groupId={{item.group_id}}&goodsId={{group.id}}&min_open_group={{item.min_open_group}}&attend_num={{item.attend_num}}&end_time={{item.end_time}}">
            <view class="btn" wx:if="{{group.open_status==1}}">去参团</view>
          </navigator>
        </view>
      </view>
    </view>
    <view class="comments" wx:if="{{comment.count > 0}}">
      <view class="h">
        <navigator url="../comment/comment?valueId={{goods.id}}&typeId=0">
          <text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
          <text class="i">查看全部</text>
        </navigator>
      </view>
      <view class="b">
        <view class="item">
          <view class="info">
            <view class="user">
              <image src="{{comment.data.avatar}}"></image>
              <text>{{comment.data.nickname}}</text>
            </view>
            <view class="time">{{comment.data.add_time}}</view>
          </view>
          <view class="content">
            {{comment.data.content}}
          </view>
          <view class="imgs" wx:if="{{comment.data.pic_list.length > 0}}">
            <image class="img" wx:for="{{comment.data.pic_list}}" wx:key="{{item.id}}" src="{{item.pic_url}}"></image>
          </view>
          <!-- <view class="spec">白色 2件</view> -->
        </view>
      </view>
    </view>
    <view class="goods-attr">
      <view class="t">商品参数</view>
      <view class="l">
        <view class="item" wx:for="{{attribute}}" wx:key="{{item.name}}">
          <text class="left">{{item.name}}</text>
          <text class="right">{{item.value}}</text>
        </view>
      </view>
    </view>

    <view class="detail">
      <import src="../../lib/wxParse/wxParse.wxml" />
      <template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
    </view>


    <view class="common-problem">
      <view class="h">
        <view class="line"></view>
        <text class="title">常见问题</text>
      </view>
      <view class="b">
        <view class="item" wx:for="{{issueList}}" wx:key="{{item.id}}">
          <view class="question-box">
            <text class="spot"></text>
            <text class="question">{{item.question}}</text>
          </view>
          <view class="answer">
            {{item.answer}}
          </view>
        </view>
      </view>
    </view>

  </view>
  <view wx:if="{{openAttr}}" class="attr-pop">
    <view class="attr-close" bindtap="switchAttrPop">X</view>
    <view class="img-info">
      <image class="img" src="{{goods.list_pic_url}}"></image>
      <view class="info">
        <view class="c">
          <view class="p">价格：￥{{group.retail_min_price}}</view>
          <view class="a" wx:if="{{productList.length>0}}">已选择：{{checkedSpecText}}</view>
        </view>
      </view>
    </view>
    <view class="spec-con">
      <view class="spec-item" wx:for="{{specificationList}}" wx:key="{{item.specification_id}}">
        <view class="name">{{item.name}}</view>
        <view class="values">
          <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name-id="{{vitem.specification_id}}">{{vitem.value}}</view>
        </view>
      </view>

      <view class="number-item">
        <view class="name">数量</view>
        <view class="selnum">
          <view class="cut" bindtap="cutNumber">-</view>
          <input value="{{number}}" class="number" disabled="true" type="number" />
          <view class="add" bindtap="addNumber">+</view>
        </view>
      </view>
    </view>
  </view>
</scroll-view>
  <view class="bottom-btn"  wx:if="{{group.open_status==1}}">
      <view class="l l-home" bindtap="switchNav">
      <image class="icon" src="/static/images/nav-1.png"></image>
    </view>
    <view wx:if="{{!openAttr}}" class="l l-collect {{ openAttr ? 'back' : ''}}" bindtap="closeAttrOrCollect">
      <image class="icon" src="{{ collectBackImage }}"></image>
    </view>
    <navigator wx:if="{{!openAttr}}" url="../goods/goods?id={{group.goods_id}}">
      <view class="m">
        <text>￥{{group.retail_price}}</text>
        <text>单独购买</text>
      </view>
    </navigator>
    <view wx:if="{{!openAttr}}" class="r" bindtap="switchAttrPop">
      <text>￥{{group.retail_min_price}}</text>
      <text>{{group.min_open_group}}人拼团</text>
    </view>
    <view wx:if="{{openAttr}}" class="r" bindtap="checkProduct">
      <text>确认</text>
    </view>
  </view>