<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
<!---- //文字"-->
<view wx:if="{{is_show}}">

  <view class='center'>
    <view class='cenleft'>
      <image src='{{image}}' binderror='img_show_err' data-err="image"></image>
    </view>
    <view class='cenright'>
      <!----//图片区域---->
      <view class='cenrt'>
        <view class='xc-goods-details ellipsis-2 fs30'>
          {{goods.goods_name}}
        </view>
      </view>
      <view class='cenrcen flex-vertical-between'>
        <view>
          <view class="fs40 xc-wc" style='font-size:40rpx'>
            <span class="fs28 xc-rmbs" style="font-weight:500;">￥</span>{{teamlist.price}}</view>
          <view class="fs22 word-line xc-wc" style="width:172rpx;">
            ￥{{goods.shop_price}}
          </view>
        </view>
        <view class="xc-wc fs24">
          <view>
            <view class="">已拼{{teamlist.buy_num+teamlist.virtual}}件</view>
            <view class="flex xc-valframe t-c">
              <view class="xc-frame-img">
                <image class="picture" src="{{iurl}}/miniapp/images/bai-ren.png"></image>
              </view>
              <view class="xc-people-val">
                {{teamlist.ct_num}}人拼
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <view class='clear'></view>
  </view>
  <!----以上商品显示完成---->


  <view class='body'>
    <!-- 阶梯团 -->
    <view class='bodytop' wx:if="{{teamlist.kttype==3&& p_status==1}}">
      当前价格
      <text class="xc-wc">¥{{ct_price}}</text>, 
      <block  wx:if="{{max_num-ordertx.length>0}}">
          <text class="xc-wc">还差{{max_num-ordertx.length}}</text>人享受最低价格<text class="xc-wc">￥{{min_price}}</text>
      </block>
      <block wx:else>
        该团已经拼购到最低价了哦~
      </block>
    </view>
    <!-- 拼团成功 -->
    <view class="xc-ptcomplete-ladder flex-level fs28" wx:if="{{teamlist.kttype==3&&p_status==2}}">
      <view class="xc-wc">拼团成功</view>,当前价格
      <text class="xc-wc">￥{{ct_price}}</text>
      <view class="xc-img-frame oh">
        <image class="img" src="{{iurl}}/miniapp/images/xc_qtcg.png"></image>
      </view>
    </view>

    <view style="height: 20rpx" wx:if="{{teamlist.kttype==3&&p_status==4}}"></view>


    <!-- 阶梯团失败 -->
    <view class=".xc-fail-ladder flex-level fs28" wx:if="{{pay_f==1 || order.pt_status==3}}">
      <view class="xc-wc">拼团失败</view>
      <view class="xc-img-frame oh" >
        <image class="img" src="{{iurl}}/miniapp/images/xc-qtshibai.png"></image>
      </view>
    </view>

    <!-- 会员团和商家团 -->
    <view class='bodytop' wx:if="{{(teamlist.kttype==2 || teamlist.kttype==1) && p_status==1}}">
      还差
      <text class="xc-wc">{{teamlist.ct_num-ordertx.length}}</text>人成团,组团成功为您节省
      <text class="xc-wc">{{filters.toFix(goods.market_price-teamlist.price,2)}}</text>元
    </view>
    <!-- 拼团成功 -->
    <view class="xc-ptcomplete flex-level fs28" wx:if="{{p_status==2 && (teamlist.kttype==2||teamlist.kttype==1)}}">
      <view class="xc-wc">拼团成功</view>,为您节省
      <text class="xc-wc">{{filters.toFix(goods.market_price-teamlist.price,2)}}</text>元
      <view class="xc-img-frame oh">
        <image class="img" src="{{iurl}}/miniapp/images/xc_qtcg.png"></image>
      </view>
    </view>

    <!----//// //头像---->
    <view class="flex_tou">
      <view class='bodyimg flex-level'>
        <view class='d' wx:for="{{ordertx2}}" wx:key>
          <image src='{{item.head_pic}}'></image>
          <span wx:if="{{item.is_pt_tz==1}}">团长</span>
        </view>
        <view class='d' wx:for="{{sf_arr}}">
           <image wx:if="{{teamgroup.is_xuni_ct}}"  src='{{iurl}}/miniapp/images/anonymous/anonymous{{item}}.png'></image>
           <image wx:else src='{{iurl}}/miniapp/images/shafa.png'></image>
        </view>

        <view class='xc-ellipsis-img flex-vertical' wx:if="{{ordertx.length>5}}">
          <image class="pictures " src="{{iurl}}/miniapp/images/xc_ellipsis.png"></image>
        </view>
      </view>
    </view>

    <view class='bodytime'>
      <!----/ //旁边直线---->
      <view class='bodytimeleft'>
        <view class='xian'></view>
      </view>

      <!-- 阶梯团 开始-->
      <view class='bodytimecen' wx:if='{{p_status==1}}'>
        剩余
      
        <span>{{obj.hou}}</span>:
        <span>{{obj.hou}}</span>:
        <span>{{obj.min}}</span>:
        <span>{{obj.sec}}</span>结束
      </view>
      
      <!-- 阶梯团 成功-->
      <view class='bodytimecen-success' wx:if='{{teamlist.kttype==3&&p_status==2 && is_pay_wk!=1}}'>
        剩余支付时间:
     
        <span>{{obj.hou}}</span>时
        <span>{{obj.min}}</span>分
        <span>{{obj.sec}}</span>秒
      </view>

      <view class='bodytimecen-success' wx:if='{{teamlist.kttype==3&&p_status==4 }}'>
         拼团已结束
      </view>

      <!-- </block> -->
      <!-- 阶梯团失败 -->
      <view class='bodytimecen' wx:if='{{p_status==3}}'>
        还差
        <text class="xc-wc">{{teamlist.ct_num-ordertx.length}}</text>人参团, 拼团失败。
      </view>
      <!-- 会员团 -->
      <view class='bodytimecen' wx:if='{{(teamlist.kttype==1 || teamlist.kttype==2) && p_status==2}}'>
        已经有
        <text class="xc-wc">{{ordertx.length>teamlist.ct_num?ordertx.length:teamlist.ct_num}}</text>人参团, 拼团成功。
      </view>

      <!----//旁边直线---->
      <view class='bodytimeright'>
        <view class='xian'></view>
      </view>
    </view>

    <!-- 阶梯团 -->
    <view class='fs30 xc-green' wx:if='{{teamlist.kttype==3&&p_status==2}}'>
      拼团成功, 规定时间内支付尾款即发货
    </view>
    <view class="xc-wc fs30 t-c xc-onclik" wx:if="{{p_status==1}}">
      点击下方按钮分享给小伙伴,可快速成团！
    </view>

    <!-- <block wx:if="{{pay_f!=1 && order.pt_status<2}}"> -->
      <!----/ // // // //按钮---->
      
      <view wx:if="{{teamlist.kttype==3}}" class='bodybutton'>
        <!-- 阶梯团 -->
				<button wx:if="{{p_status==1 && isLogin}}"  bindtap="clickShare"  style='background-color:#fab55a; color:#fff'>
        <!-- <button wx:if="{{p_status==1}}"  bindtap="clickShare" bindtap='cmeng'  style='background-color:#fab55a; color:#fff'> -->
          邀请好友参团
        </button>
        <button bindtap="go_pay_wk" style='background-color:#42c780;' wx:if="{{order.pt_status==2 && order.is_zsorder==4 }}">
          支付尾款
        </button>    
      </view>
      <!-- <view wx:elif="{{teamlist.ct_num-ordertx.length>0}}" class='' bindtap='cmeng'> -->
    
        <!--会员团 商家团-->
        <button class="bodybutton" style='background-color:#fab55a; color:#fff' bindtap='clickShare'
                wx:if="{{(teamlist.kttype==2||teamlist.kttype==1)&&p_status==1 && isLogin}}">邀请好友参团</button>
        
      <!-- </view> -->
    <!-- </block> -->
 <view class="xc-home-page-frame">
  <button class="xc-home-page" bindtap='gohome'> 返回首页</button>
  </view>
 
    <view class='zspan' hidden="{{hiddenName}}" bindtap='click'>查看拼团列表
      <view class='down-arrow1'></view>
    </view>
   
  </view>
  
  <!---/ // // // // //展开拼团列表---->
  <view class='bodyfoot'>
    <view class='bodyselect' wx:if="{{zk}}" bindtap='czk'>
      <span>查看拼团列表
        <view class='down-arrow'></view>
      </span>
    </view>

    <view class='zhangxi' hidden="{{hiddenName}}" wx:for="{{ordertx}}" wx:for-index="ky">
      <view class='img rel'>
        <view class="xc-list" wx:if="{{item.is_pt_tz}}">
          <span>团长</span>
        </view>
        <image src='{{item.head_pic}}'></image>{{item.nickname}}
      </view>
      <!-- <view class='zssj' wx:if="{{teamlist.kttype==1}}">{{item.add_time_date}}参团</view> -->
      <view class='zssj' wx:if="{{ky==0 &&teamlist.kttype!=1}}">{{item.add_time_date}}
        <text>开团</text>
      </view>
      <view class='zssj' wx:else>{{item.add_time_date}} 参团</view>
      <view class="clear"></view>
    </view>


    <view class='zhangxi' hidden="{{hiddenName}}" wx:for="{{head}}" >
      <view class='img rel'>
        <image  src='{{iurl}}/miniapp/images/anonymous/anonymous{{item}}.png'></image>匿名
      </view>
      <view class='zssj'>{{filters.format_time(teamgroup.buyenddate,1)}} 参团</view>
      <view class="clear"></view>
    </view>


    <view class='clear'></view>
  </view>
  <view class='clear'></view>

  <!----//大家都在团---->
  <view class='goodslist'>
    <view class='goodslisttop'>
      <!-- <view class='goodslistspan fs24'>大家都在团</view> -->
      <!-- 推荐商品 -->
      <view class="flex-center rel xc-linellae-frame">
        <view class="xc-linellae"></view>
        <view class="abs flex-center xc-recommend-frame ">
          <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png">
          </image>
          <view class="xc-recommend-word">大家都在团</view>
        </view>
      </view>
      <view class='goodslisttopright'></view>
    </view>
    <view class="changxin">
      <view class='onegoods' wx:for="{{pageteam}}" wx:key="{{index}}" bindtap="go_goodsinfo" data-gid="{{item.goods_id}}">
        <view class='onegoodsimg'>
          <image src="{{imageurl+item.share_imgurl}}"></image>
        </view>
        <view class="xc-buttmo-frame">
        <view class='onegoodsdesc '>

           <view class='price flex-vertical-between'>
          <view class='jgleft fs32 flex-center xc-wc'>
          <view class="xc-ping xc-wc fs26 t-c">拼</view>
          <text class="fs20"style='height:39rpx;margin-right:5rpx;margin-left:15rpx;' >¥</text>{{item.price}}
          </view>
          <view class='jgright'>{{item.ct_num}}
            <span>人参团</span>
          </view>
        </view>
        </view>
           <view class="xc-shuoming ellipsis-2 fs26">
          <text>{{item.goods_name}}</text>
        </view> 
   </view>
      </view>
    </view>
  </view>
</view>

<!----蒙板---->
<!-- <view class='mtop' wx:if="{{meng}}">
  <view wx:if="{{teamlist.kttype==3}}" class='mt1'>
    <block wx:if="{{max_num-ordertx.length>0}}">
      还差
      <span class='mts'>{{max_num-ordertx.length}}</span>人，邀请好友参团吧
      <span class='mcou' bindtap='cmc'>⊗</span>
    </block>
    <block wx:else>
      您已经可以享受最低价，邀请好友参团吧
      <span class='mcou' bindtap='cmc'>⊗</span>
    </block>
  </view>
  <view wx:else>
    还差
    <span class='mts'>{{teamlist.ct_num-ordertx.length}}</span>人，邀请好友参团吧
    <span class='mcou' bindtap='cmc'>⊗</span>
  </view>
  <view>点击分享，发送给
    <span class='mts'>朋友</span>和
    <span class='mts'>朋友圈</span>
  </view> -->
  <!--底部-->
  <!-- <view class='mfoot' bindtap='saveImageToPhotosAlbum'>
    <button class='mbtn'>查看分享二维码</button>
  </view>
</view> -->


<!--二维码显示页面-->
<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{canvasHidden}}'></canvas>
<!--拼团玩法弹出框-->
<!----弹起的---->
<block wx:if="{{pd_xx}}">
  <view class="bview"></view>
  <view class="juzhong">
    <view class="xq">
      <view class="title" bindtap="close_pt_xx">拼团玩法介绍
        <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>
      </view>
      <view>1.开团：
        <text class="hs1">选择心仪商品，点击“发起X人团”按钮，付款后即为开团成功；</text>
      </view>
      <view>2.参团：
        <text class="hs1">进入朋友分享的页面，点击“立即参团”按钮，付款后即为参团成功，若多人同时支付，支付成功时间较早的人获得参团资格；</text>
      </view>
      <view>3.成团：
        <text class="hs1">在开团或参团成功后，点击“邀请小伙伴参团”将页面分享给好友，在有效时间内凑齐人数即为成团，此时商家会开始发货；</text>
      </view>
      <view>4.组团失败：
        <text class="hs1">在有效时间内未凑齐人数，即为组团失败，此时付款项会原路退回到支付账户；</text>
      </view>
      <view>5.
        <text class="hs1">组团有效期间内，拼购商品订单不允许取消。 </text>
      </view>
    </view>
  </view>
</block>

<!-- 分享控件，底部弹出 -->
<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum"  wx:if="{{share_hidden}}"></share>


<view wx:if="{{showPoster}}">
  <view class="mask" catchtap="closePoster"></view>
  <view class="poster-container">
    <view class="poster-wrapper">
      <view class="poster">
        <!-- <view class="poster" bindtap="previewImage"> -->
        <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
        <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>
      </view>
       <view class="btn-container">
       <!--<button class="btn-share" open-type="share" bindtap="">微信好友分享</button>-->
       <button class="btn-share" bindtap="savePic">保存到相册</button>
       </view>
    </view>
  </view>
</view>



