<import src="../../../wxParse/wxParse.wxml" />
<view class="group_good">
  <view class="content">
    <view class="showicon {{hoet?'hoet':''}}">
      <view></view>
      <view class="show_b" wx:if="{{hoet}}">
        <view class="{{current == 1?'curr':''}}" id="1" bindtap="getTap">商品</view>
        <view class="{{current == 2?'curr':''}}" id="2" bindtap="getTap">评论</view>
        <view class="{{current == 3?'curr':''}}" id="3" bindtap="getTap">详情</view>
      </view>
      <view class="{{hoet?'cart hoet':'cart' }} " catchtap="gotoHome">
        <view class="back">
          <icon class="iconfont icon-ai-home"></icon>
        </view>
      </view>
      <view class="{{hoet?'member hoet':'member' }}" catchtap="gotoMember">
        <view class="back">
          <icon class="iconfont icon-wode-wode"></icon>
        </view>
      </view>
    </view>
    <view class="ithumb" style="position:relative">
      <swiper indicator-dots="{{true}}" autoplay="{{false}}" style="height:750rpx;" bindchange="bindchange"
        circular="{{true}}" indicator-active-color="#007aff">
        <swiper-item wx:if="{{gooddatas.goods_video}}">
          <video style="width: 100%;height:100%;" src="{{gooddatas.goods_video}}"
            poster="{{gooddatas.video_image}}"></video>
        </swiper-item>
        <block wx:for="{{gooddatas.thumb_url}}" wx:key="index" wx:for-item="ithumb" wx:for-index="index">
          <swiper-item>
            <image src="{{ithumb}}" mode='widthFix' style="width:100%;height:100%;" data-index="{{index}}"
              bindload="imageLoad" />
          </swiper-item>
        </block>
        <block wx:if="{{!gooddatas.thumb_url}}">
          <swiper-item>
            <image src="{{gooddatas.thumb}}" mode='widthFix' style="width:100%;height:100%;" />
          </swiper-item>
        </block>
      </swiper>
    </view>
    <view class="price_time">
      <view class="img">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/rob-time.png" width="16%;" />
      </view>
      <view class="text span">
        超值
        <!-- <br /> -->
        开团
      </view>
      <view class="price span">
        <view class="font">{{language['money']}}{{gooddatas.price}}起</view>
      </view>
      <view class="timeContainer">
          <block wx:if="{{gooddatas.end_time>nowTime}}">
            <view class="span" style="text-align:center;width:100%">{{isTime?'活动截止倒计时':'活动开始倒计时'}}</view>
            <view class="time" wx:if="{{isTime}}">
              <view class="date">{{countDownObj.day}}</view>
              <view class="mes">天</view>
              <view class="date">{{countDownObj.hou}}</view>
              <view class="mes">:</view>
              <view class="date">{{countDownObj.min}}</view>
              <view class="mes">:</view>
              <view class="date">{{countDownObj.sec}}</view>
            </view>
            <view class="time" wx:if="{{!isTime}}">
              <view class="date">{{beginDownObj.day}}</view>
              <view class="mes">天</view>
              <view class="date">{{beginDownObj.hou}}</view>
              <view class="mes">:</view>
              <view class="date">{{beginDownObj.min}}</view>
              <view class="mes">:</view>
              <view class="date">{{beginDownObj.sec}}</view>
            </view>
          </block>
          <block wx:else>截止倒计时：已结束</block>
      </view>
    </view>

    <view class="title_number">
      <view style="display:flex;font-size:40rpx;">
        <view class="h1 good_title" style="-webkit-box-orient: vertical;" style="width:85%;">
          {{gooddatas.activity_name}}
        </view>
        <view class="right" catchtap="postShow">
          <icon class="iconfont icon-erweima"></icon>
        </view>
        <view class="right" style="position:relative;">
          <icon class="iconfont icon-fenxiang" style="margin-left:20px;"></icon>
          <button style="position:absolute;width:100%;height:100%;opacity:0;top: 0;right: 0;" open-type="share"></button>
        </view>
        <view class="right share_text" >
          <view style="line-height: 80rpx;">分享</view>
          <button style="position:absolute;width:100%;height:100%;opacity:0;top: 0;right: 0;" open-type="share"></button>
        </view>
      </view>
      <view class="number ul">
        <view class="li">
          <text class="span">库存{{gooddatas.stock}}</text>
          <view class="span">销量{{gooddatas.show_sales}}件</view>
        </view>
      </view>
    </view>

    <view class="group_play">
      <view class="h2">星拼乐玩法</view>
      <view class="play ul">
        <view class="li">
          <text class="span">1</text>
          <text class="span">选择商品付款开团/参团</text>
        </view>
        <view class="li border_lr">
          <text class="span">2</text>
          <text class="span">邀请并等好友支付参团</text>
        </view>
        <view class="li">
          <text class="span">3</text>
          <text class="span">达到人数顺利抢团</text>
        </view>
      </view>
    </view>

    <view class="group_into" wx:if="{{team.length>0}}">
      <view class="h2">以下小伙伴拼团中，可直接参与</view>
      <view class="more" catchtap='gotoStarMusicListGroup'>
        <text class="span">查看更多</text>
        <van-icon class="fa fa-angle-right" />
      </view>
      <view class="into_user"  wx:for="{{team}}" wx:key="leader_id">
        <view class="user">
          <image src="{{item.avatar}}" />
        </view>
        <view class="time ul">
          <view class="time_a li">
            {{item.nickname}} 开{{item.limit_num}}人团
          </view>
          <view class="time_b li" style="display:flex;justify-content:flex-start;">
            <view>剩余</view>
            <count now-time="{{nowTime}}" over-time="{{item.end_time}}" style="text-align:center;" />
            <view>结束，仅差 {{item.surplus_member}} 人</view>
          </view>
        </view>
        <view style="width: 140rpx;height: 62rpx;">
          <button type="button" data-item="{{item}}" data-id="{{item.leader_id}}" catchtap="gotoStarMusicGroupDetails" wx:if="{{item.is_join==0}}" style="display:flex;align-items:center;justify-content: center;padding-left:0;padding-right:0;">加入该团
          </button>

          <button type="button" data-type="startGroupDetail" open-type="share" data-id="{{item.leader_id}}" wx:if="{{item.is_join==1}}" style="display:flex;align-items:center;justify-content: center;padding-left:0;padding-right:0;">
            邀请好友
          </button>

        </view>

      </view>

    </view>
    <view class="act-box">
      <!-- 参数 -->
      <view class="act" catchtap='showCan'>
        <view class="act1">参数</view>
        <view class="canTxt">
          <text>商品参数详情</text>
        </view>
        <view class="act3">
          <text></text>
        </view>
        <view class="ang_right">
          <view class="ang_right_icon">
            <van-icon name="arrow" size='32rpx' />
          </view>
        </view>
      </view>
    </view>

    <view class="sift">
      <view class="sift-title">
        <text>精选口碑</text>

        <view class="sift-right" catchtap="goKb">
          <text>查看全部({{third_content.length}})</text>
          <van-icon name="arrow" size='32rpx' />
        </view>
      </view>
      <swiper next-margin='140px' wx:if="{{thirKong}}">
        <block wx:for='{{third_content}}' wx:key='index'>
          <swiper-item>
            <view style="width:400rpx;height:193rpx" class="swiper-kb">
              <view class="figure">
                <image src="{{item.head_img_url}}"></image>
                <view class="figtxt">
                  <text>{{item.nick_name}}</text>
                  <van-rate disabled="{{true}}" disabled-color="#ff9900" value="{{item.level}}" size='14' />
                </view>
              </view>
              <view class="figure_right">{{item.content}}</view>
            </view>
          </swiper-item>
        </block>
      </swiper>
      <view wx:else style="width:100%;text-align: center;height:100rpx;line-height:100rpx;color: #7d7e80;">
        抱歉，暂无评论 ~
      </view>
    </view>

    <view class="group_btn" style="{{ipnonexbol?'padding-bottom: 34px;':''}}">
      <view class="item ul">
        <view class="item_a li" catchtap="gotoHome">
          <view class="icon" class="icon-box">
            <icon class="iconfont icon-info_store"></icon>
          </view>
          <view class="span">主页</view>
        </view>
        <view class="group_btn_box">

          <view class="item_c li" wx:if="{{gooddatas.status==1}}" bindtap="gotoStarMusicListGroup">
            <text class="span" style="text-align:center;">￥{{gooddatas.price}}起</text>
            <text class="span" style="text-align:center;">去参团</text>
          </view>
          <view class="item_c li endClass" wx:if="{{gooddatas.status!=1}}">
            <text class="span" style="text-align:center;">活动已结束</text>
          </view>
        </view>
      </view>
    </view>
    <view class="foShowBox" style="width:100%;margin-top:20rpx">
      <view class="pullBox {{xqBoxShow?'nondh':'rotadh'}}" style="margin-bottom:{{boxHeight}}px;">
        <image class="pullIcon {{xqBoxShow?'rotateImg':'normalImg'}}" src="{{imagUrl+'pull_up@2x.png'}}"></image>
        <text>上拉查看商品详情</text>
      </view>
      <view class="{{xqBoxShow?'actives':'noneBox'}}">
        <view style="text-align: center;width:100%;height:100rpx;line-height:100rpx;background:#fff;">商品详情</view>
        <block wx:if="{{article.nodes}}">
          <template is="wxParse" data="{{wxParseData:article.nodes}}" />
        </block>
        <block wx:else>
          <rich-text nodes="{{first_content}}"></rich-text>
        </block>
      </view>
    </view>
    <view class="posTopBtn" wx:if="{{hoet}}">
      <backup datas="{{btnData}}"></backup>
    </view>
    <van-popup show="{{showCs}}" closeable bind:close="closeCs" class="canshu" position="bottom"
      custom-style="width:100%;height:70%;overflow:auto;">
      <view class="parameter">
        <view class="showTitle">商品参数</view>
        <view class="par-info" wx:for="{{second_content}}" wx:key="index">
          <view class="name">{{item.title}}</view>
          <view class="value">{{item.value}}</view>
        </view>
      </view>
    </van-popup>

    <van-popup wx:if="{{posterShow}}" show="{{posterShow}}" close-on-click-overlay="true" bind:close="tapposterShow"
      custom-style="background:none;" class="posterPopup_style" position="bottom">
      <view class="code_box">
        <image wx:if="{{posterImg}}" src="{{posterImg}}" mode='widthFix' />
        <image wx:if="{{!posterImg}}" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/img_default.png" mode='widthFix' />
      </view>
      <view class="icon_btn">
        <view class="box">
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/poster_share.png" />
          <text>分享好友</text>
          <button style="position:absolute;width:100%;height:100%;opacity:0;top: 0;right: 0;"
            open-type="share"></button>
        </view>
        <view class="box" catchtap='saveImg'>
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/poster_save.png" />
          <text>保存海报</text>
        </view>
      </view>
      <!-- 关闭图标 -->
      <view class="icon_close" catchtap="tapposterShow" style="{{iPnoneBottomBol?'padding-bottom: 34px;':''}}">取消</view>
    </van-popup>
    <!-- <van-popup show="{{show2}}" position="center" round custom-class="border-radius: 16rpx;height:212rpx;" width="88%"
      bind:click-overlay="tapOverlay">
      <view class="open_group" style="width:660rpx;border-radius: 16rpx;">
        <view class="p">以下小伙伴{{goodType == 'groupBuy'?'拼购':'抢团'}}中，可直接参与</view>
        <view class="icon_close" catchtap="tapOverlay">
          <icon class="iconfont icon-close11"></icon>
        </view>
        <view class="into_bg_color">
          <view class="into_user" wx:for="{{team}}" wx:key="index" catchtap="clickAdd"
            data-id="{{goodType == 'groupBuy'?item.order_id:item.leader_id}}">
            <view class="user">
              <image src="{{item.avatar}}" />
            </view>
            <view class="time ul">
              <view class="time_a li">
                <view  class="name">{{item.nickname}}{{item.leader_id}}</view>
                <view style="color: #ff2c29;">
                  还差{{item.surplus_member}}人成团
                </view>
              </view>
              <view class="time_b li" style="display:flex;flex-wrap:wrap;">
                <view style="display: flex;">剩余
                  <count now-time="{{nowTime}}" over-time="{{item.end_time}}" style="text-align:center;" />
                </view>
                <view>{{goodType == 'groupBuy'?item.buy_number:gooddatas.limit_num}}人团</view>
              </view>
            </view>
            <view style="width: 114rpx;height: 50rpx;">
              <button wx:if="{{goodType == 'groupBuy'}}" type="button" open-type="{{item.is_self == 1?'share':''}}"
                data-id="{{item.order_id}}" catchtap="clickAdd">
                {{item.is_self == 0?"加入该团":"邀请好友"}}
              </button>
              <button wx:if="{{goodType == 'grabGroup'}}" type="button" open-type="{{item.is_oneself == 1?'share':''}}"
                data-id="{{item.leader_id}}" catchtap="clickAdd">
                {{item.is_oneself == 0?"加入该团":"邀请好友"}}
              </button>
            </view>

          </view>
        </view>
      </view>
    </van-popup> -->
    <van-popup show="{{show1}}" close-on-click-overlay="true" round="true">
      <view class="pop-content">
        <view class="pop-top">
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/kf_online_contect@2x.png"></image>
          <view>在线联系</view>
        </view>
        <!-- <button open-type="contact" bindcontact="handleContact" class="pop_button"></button> -->
      </view>
    </van-popup>

    <van-popup custom-style="width:100%;height:100%;overflow:auto;" show="{{streetShow}}" position="right"
      overlay="{{false}}">
      <view class="streetContent">
        <van-nav-bar title="全部评价" left-text="" right-text="" left-arrow bind:click-left="streetClose" />
        <view class="shopInfo">
          <view class="pj" wx:for="{{third_content}}" wx:key="index" wx:for-item="n" wx:for-index="index">
            <view class="user">
              <view class="imageshow">
                <image src="{{n.head_img_url}}" mode='widthFix' />
              </view>
              <view class="name">{{n.nick_name}}</view>
              <view class="time">{{n.created_at}}</view>
            </view>
            <van-rate disabled="{{true}}" disabled-color="#ff9900" value="{{n.level}}" />
            <view class="p">{{n.content}}</view>
            <view style="text-align:left;margin:10rpx 0;" wx:if="{{n.images&&n.images.length>0}}">
              <view style="margin-left:16rpx;">晒图：</view>
              <view style="display: flex;flex-wrap: wrap;">
                <view style="width:160rpx;height:160rpx;margin-left:16rpx;margin-bottom: 16rpx;" wx:for="{{n.images}}"
                  wx:key='index'>
                  <image src="{{item}}" style="width: 100%;height: 100%;" mode='aspectFill' data-index="{{index}}" data-pics="{{n.images}}" bindtap="seePicture"  />
                </view>
              </view>
            </view>
            <view wx:if="{{n.append}}">
              <view class="last_day p">
                追评
                <text>{{n.append.created_at}}</text>
              </view>
              <view class="p">{{n.append.content}}</view>
            </view>
            <view class="comment" wx:if="{{isCup}}">
              <text bindtap='toContentInfo' data-jsondata="{{n}}">评论数:{{n.reply_count}}</text>
            </view>
          </view>
        </view>
      </view>
    </van-popup>
    <van-popup show="{{showGoodslist}}" closeable close-on-click-overlay="true" bind:close="clicktapshow"
      custom-style="width:100%;height:50%;overflow:auto;" position="bottom" round>
      <view class="list" id="group_buy_goodslist">
        <view class="child" wx:for="{{gooddatas.another_goods}}" catchtap="gotoShopGoods" data-id="{{item.id}}">
          <image src="{{item.thumb}}" alt="" />
          <view class="child_right">
            <view class="title">{{ item.title }}</view>
            <view class="money">
              <text>{{language['money']}}</text> {{ item.price }}
            </view>
          </view>
        </view>
      </view>
    </van-popup>
    <!-- 规格start -->
    <!-- <view class="shadeMode {{popupSpecs?'shadeModeShow':''}}">
      <view class="specifications">
        <view class="icon_close" bindtap="popupSpecsbtn">
          <view class="guanbi_icon">
            <van-icon name="close" size='40rpx' />
          </view>
        </view>
        <view class="shopimg">
          <view class="chooser_img">
            <image src="{{popThumb == null || popThumb == '' || popThumb == undefined?gooddatas.thumb:popThumb}}" />
          </view>
          <view class="right">
            <view class="price">
              {{language['money']}}
              <text id="option_price">{{popPrice}}</text>
            </view>
            <view class="option">库存{{popStock}}{{gooddatas.sku}}</view>
            <view class="option">{{goodsDescription}}</view>
          </view>
        </view>
        <view class="shopinfoContent" wx:if="{{gooddatas.has_option == 1}}">
          <view class="shopinfo" wx:key="{{specsIdex}}" wx:for="{{gooddatas.has_many_specs}}" wx:for-index="specsIdex"
            wx:for-item="specs">
            <view class="dl">
              <view class="dt">{{specs.title}}</view>
              <view class="dd" data-descr="{{specs.description}}">
                <view wx:for="{{specs.specitem}}" wx:key="{{specitemIdex}}" wx:for-index="specitemIdex"
                  wx:for-item="specitem"
                  class="spec {{specs.description==specitem.id?'sele':''}} {{specitem.c?'disab':''}}"
                  data-specitem="{{specitem}}" data-specsidex="{{specsIdex}}" bindtap='selectSpecs'>
                  {{specitem.title}}
                </view>
              </view>
            </view>
          </view>
        </view>
        <view class="goodsnum" >
          <view class="num">购买数量：</view>
          <view class="calculation">
            <view class="leftnav" bindtap='reduceGoods'>-</view>
            <input type="number" class="shownum" value="{{goodsCount}}" bindinput="inputGoodsNum" disabled="{{goodType == 'grabGroup'?true:false}}"/>
            <view class="rightnav" bindtap='addGoods'>+</view>
          </view>
        </view>
        <view class="subbtn" bindtap="checkActivity" wx:if="{{popStock>=1}}">确认</view>
        <view class="subbtn" style="background-color:#999999;" wx:else>确认</view>
      </view>
    </view> -->

    <!-- 规格end -->
    <view style="height: 34px;" wx:if="{{ipnonexbol}}"></view>
  </view>
</view>
