<!-- 判断隐私是不是显示 -->
<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>

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

	<!--图片区域-->
	<view class='center'  bindtap="go_to" data-url="/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id={{goods_id}}&prom_type=6&prom_id={{teamlist.id}}">
		<view class='cenleft'>
			<image src='{{image}}' binderror='bind_bnerr' data-errorimg='image'></image>
		</view>
		<view class='cenright'>
			<view class='cenrt'>

				<view class='xc-goods-details ellipsis-2 fs28'>
					<text>{{goods.serviceName}}</text>
				</view>
			</view>
			<view class='cenrcen flex-vertical-between'>
				<view>
					<view class="fs40 xc-wc" style='font-size:40rpx'>
						<text class="fs28" style="font-weight:500;">￥</text>{{teamlist.price}}</view>
					<view class="fs22 word-line xc-wc">
						零售价￥{{goods.show_price}}
					</view>
				</view>
				<view class="xc-wc fs24">
					<view>
						<view class="">已拼{{teamlist.buy_num}}件</view>
						<view class="flex xc-valframe t-c">
							<view class="xc-frame-img">
								<image class="picture" src="{{imageurl}}/miniapp/images/bai-ren.png"></image>
							</view>
							<view style='margin-left:9rpx;'>
								{{teamlist.ct_num}}人拼
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>

	<view class='body oh'>
		<!-- 等待团员 -->
		<!-- <view class='bodytop' wx:if="{{teamlist.kt_type==3}}"> -->
		<!-- 拼团成功 -->
		<view class="xc-ptcomplete flex-level fs28" wx:if="{{val==2}}">

			<view class="xc-wc">拼团成功</view>,为您节省<text class="xc-wc">25</text>元
			<view class="xc-img-frame oh" wx:if="{{val==2}}">
				<image class="img" src="{{imageurl}}/miniapp/images/xc_qtcg.png"></image>
			</view>
		</view>
		<!-- 拼团失败 -->
		<view class="xc-ptcomplete flex-level fs28" wx:if="{{val==3}}">
			<view class="xc-wc xc-end">拼团失败</view>
			<view class="xc-img-frames oh iw" wx:if="{{val==3}}">
				<image class="img " src="{{imageurl}}/miniapp/images/xc-qtshibai.png"></image>
			</view>
		</view>
		<!--头像-->
		<view class="flex_tou">
			<view class='bodyimg flex-level' wx:for="{{ordertx2}}" wx:key>
				<view class='d'>
					<image src='{{item.head_pic}}'></image>
					<text wx:if="{{item.is_pt_tz==1}}">团长</text>
				</view>
			</view>
			<view class='d' wx:for="{{sf_arr}}">
				<image src='{{iurl}}/miniapp/images/shafa.png' style='width:100%; height:100%'></image>
			</view>
			<view class='xc-ellipsis-img' wx:if="{{ordertx.length>5}}">
				<image style='width:56rpx;height:56rpx;margin-left:10rpx;' src="{{imageurl}}/miniapp/images/xc_ellipsis.png"></image>
			</view>


		</view>

		<view class='bodytime'>
			<!--/ //旁边直线-->
			<view class='bodytimeleft'>
				<view class='xian'></view>
			</view>
			<!--/ // //时间-->
			<!--许程 <view class='bodytimecen' wx:if='{{obj}}'> -->
			<view class='bodytimecen'>
				剩余
				<text wx:if="{{obj.day!=0}}"> {{obj.day}} </text>:
				<text> {{obj.hou}} </text>:
				<text> {{obj.min}} </text>:
				<text> {{obj.sec}} </text>结束
			</view>


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

		<view style='height:50rpx;width:100%' wx:if="{{val==1}}"></view>
		<!--如果团还没有满-->
		<block wx:if="{{tg_arr==null}}">
			<!--按钮-->
			<view wx:if="{{is_group_end==0}}" class='bodybutton white fs32'>
				<view class="xc-good-friend" bindtap='cyijian' data-isct="0">去参团</view>
				<view class="xc-home-page" bindtap='gohome'>返回首页</view>
			</view>
			<view wx:elif="{{teamlist.kttype>1}}" class='bodybutton' bindtap='cyijian' data-isct="1">
				<view class="xc-good-friend">一键参团</view>
				<view class="xc-home-page" bindtap='gohome'>返回首页</view>
			</view>
			<view wx:else class='bodybutton' bindtap='cyijian' data-isct="1">
				<view class="xc-good-friend">一键参团</view>
				<view class="xc-home-page" bindtap='gohome'>返回首页</view>
			</view>
		</block>
		<block wx:else>
			<view class="show_zf_dd">
				<view>会员'{{tg_arr.user_name}}'待付款，若{{r_obj.min}}分{{r_obj.sec}}秒后该会员未支付您可以继续参团哦！</view>
			</view>

			<view class='bodybutton white fs32'>
				<view class="xc-good-friend co-w" data-isct="0">去参团</view>
				<view class="xc-home-page" bindtap='gohome'>返回首页</view>
			</view>

		</block>

	</view>
	<!--展开拼团列表-->
	<view class='mck'>
		<view class='bodyfoot'>
			<view class='bodyselect' wx:if="{{zk}}" bindtap='czk'>
				<text>展开拼团列表
					<view class='down-arrow'></view>
				</text>
			</view>
			<!----收起拼团列表---->
			<view class='zhangxi' wx:if="{{hiddenName}}">

				<view class='ztext' bindtap='click'>收起拼团列表
					<view class='down-arrow1'></view>
				</view>

				<view class="ia" wx:for="{{ordertx}}" wx:for-index="ky">
					<view class='img'>
						<image src='{{item.head_pic}}'></image>
						<text>{{item.nickname}}</text>
					</view>
					<view class='zssj' wx:if="{{ky==0}}">{{item.add_time_date}} 开团</view>
					<view class='zssj' wx:else>{{item.add_time_date}} 参团</view>
				</view>
			</view>
		</view>
	</view>

	<!--大家都在团-->
	<view class='goodslist'>
		<view class='goodslisttop'>
			<text class='goodslisttext'>大家都在团</text>
			<view class='goodslisttopright'></view>
		</view>
		<view class="changxin">
			<view class='onegoods' wx:for='{{pageteam}}' wx:key="{{index}}" bindtap="go_goodsinfo" data-index="{{index}}">
				<view class='onegoodsimg'>
					<image src="{{imageurl+item.share_imgurl}}"></image>
				</view>
				<view class='onegoodsdesc'>
					<text>{{item.goods_name}}</text>
				</view>
				<view class='price'>
					<view class='jgleft'>¥{{item.price}}</view>
					<view class='jgright'>{{item.ct_num}}人
						<text>参团</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</view>

<!--弹出购物模块-->
<view class="pop_up" wx:if="{{yijian}}">
	<view>

		<view bindtap="closeSpecModal" class="cover-layer"></view>
		<view class="spec-model">
			<view class="pding">
				<icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
				<!-- 商品名称 -->
				<view class="spec-goods">
					<image class="wh100 spec-img xc-distance-bottom" src="{{image}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
					<view class="spec-goods-info">
						<view class="spec-goods-name ellipsis-1">{{goods.serviceName}}</view>
						<view class="flex ai_end xc-val-money">						
							<view class="spec-goods-price">
								<text class='t1'>¥</text><text class='t2'>{{teamlist.kttype==3?teamlist.yf_price:teamlist.price}}</text>	
							</view>
						</view>								
						<view class="flex">
							  <view class="spec-goods-stock">已售：{{teamlist.buy_num}}</view>
							  <view class="spec-goods-stock">可售：{{teamlist.goods_num-teamlist.buy_num}}</view>
						</view>							
					</view>
				</view>

				<view style="clear: both"></view>
				<view style="margin-top: 20rpx">
					<view class="flex-space-between address ai_end xc-width ">
						
						<view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
							<text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
						
							<view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}">
								距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
							</view>
						</view>
						
										
						<view class="flex" bindtap="choice_store" wx:else>
								<image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
								<view class="fs28 xc-ash-9f">选择门店</view>
					    </view>
						
						<view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view>

						
					</view>
					<view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>
					<view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}">(该店不可售)</view>
					<view class="fs24 xc-ash-9f xc-distance-top " wx:elif="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
					
				</view>

				<view>
					<view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
						<view>购买数量</view>
						<view class="count">
							<view bindtap="{{num <= 1 ? '':'bindMinus'}}" class="sub {{num <= 1 ? 'active':''}}">-</view>
							<!-- <view class='{{minusStatus}}' bindtap="bindMinus" class="sub">-</view> -->
							<input bindblur="bindManual" class="xc-val-fream" type="number" value="{{num}}">1</input>
							<view bindtap="bindPlus" class="add">+</view>
						</view>
					</view>


				</view>
			</view>

			<view class="pt_qd">
				<view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn spec-buy w100" data-action="buy" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
				<view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}" class="spec-cart-btn spec-buy w100" data-action="buy" style="background-color: #dcdcdc;color: #999;">该店不可售</view>
				<view wx:else bindtap="go_pay" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
			</view>

		</view>

	</view>
</view>

<!-- 选择门店的弹框，1.1版最新的 -->
<block wx:if="{{store==1}}">
  <view class="mongolia-layer" bindtap="close_popup"></view>
  <view class="popup-frame">
  <block  wx:if="{{sort_store==0}}">
     <!-- 头部 标题 -->
     <view class="popup-top flex-space-between">
       <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
        <view>
           <view>
              <icon bindtap="close_popup" class="modal-closes" color="black" size="22"       type="cancel"></icon>
           </view>
           <view class="felx choose_more" bindtap="more_store"  wx:if="{{is_show_sto_cat>0}}">
              <text class="fs26 red-co">{{choice_sort_store==0?'更多门店':'返回'}}</text>
              <view class="bg_rights"></view>
           </view>
          </view>
       </view>
          <!-- 门店列表，最外层的门店列表，一开始 -->
          <view class="store-list">
              <!--如果还没有点击更多门店的时候  -->
              <block wx:if="{{choice_sort_store==0}}">
                  <!-- 需要for循环 -->
                  <block wx:if="{{is_show_sto_cat==1}}">
                      <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
                  <view class="store flex-vertical">
                <!-- 需要点击事件 -->
                <block wx:if="{{index==fir_pick_index}}">
               <view class="circle white xc-hook fs20 red-b">Г</view>
             </block>
                <block wx:else>
               <view class="circle  xc-hooks"></view>
             </block>
                <view class="address-frame xc-ash">
              <view class="flex-vertical-between butttem5">
                  <view class="flex xc-ash">
                       <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
						   <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
						   <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
					   </view>
                   </view>
                  <view>
                    <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
                    距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view>
                  </view>
              </view>
              <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
            </view>
            </view>
                 </view>
                  </block>
                  <block wx:else>
                           <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
               <view class="store flex-vertical">
                 <!-- 需要点击事件 -->
                 <block wx:if="{{index==fir_pick_index}}" >
                   <view  class="circle white xc-hook fs20 red-b">Г</view>
                 </block>
                 <block wx:else>
                   <view  class="circle  xc-hooks"></view>
                 </block>

                 <view class="address-frame xc-ash">
                   <view class="flex-vertical-between ">
                     <view class="flex xc-ash">
                       <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
						   <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
						   <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
					   </view>
                     </view>
                     <view>
                       <view class="distance fs24 address-val"
                       wx:if="{{item.distance!=null}}">距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
                     </view>
                     </view>
                   </view>
                   <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                 </view>
               </view>
             </view>
                   </block>
              </block>
              <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店  -->
                   <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}"  bindtap="choose_for_store">
                  <view class="store flex-vertical">
                    <!-- 需要点击事件 -->
                    <block wx:if="{{index==sec_pick_index}}">
                      <view  class="circle white xc-hook fs20 red-b">Г</view>
                    </block>
                    <block wx:else>
                      <view class="circle  xc-hooks"></view>
                    </block>

                    <view class="address-frame xc-ash">
                      <view class="flex-vertical-between ">
                        <view class="flex xc-ash">
                          <view class="fs28 xc-black3 address_name">{{item.pickup_name}}
							  <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
							  <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
						  </view>
                        </view>
                        <view>
                          <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
							  距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view>
                        </view>
                      </view>
                      <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                    </view>
                  </view>
                </view>
              </block>

           </view>

           <!-- 门店列表底部 -->
           <view class="store-bottom-frame">
              <view class="store-bottom flex-vertical-between">
                <view class="determine red-b fs28 white t-c" bindtap="sure_pick" 
                data-openindstore="{{open_ind_store}}">确定</view>
                <view class="default  t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">设为默认</view>
             </view>
          </view>
       
     </block>


       <block wx:else>
         <view class="popup-top flex-space-between">
           <text class="fs32 nearby_store">门店分类选择</text>
           <view>
              <view><icon bindtap="close_popup" class="modal-closes" color="black" size="22"  type="cancel"></icon></view>
              <view class="felx choose_mores" bindtap="returns"><text class="fs26 red-co">返回</text></view>
           </view>
         </view>
         <view class="sort_store_list"> 
            <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
              <view class="sort-store flex-vertical-between" >
                  <view class="fs30" di>{{item.name}}</view>
                  <view class="black_rights-frame">
                      <view class="black_rights"></view>
                </view>
             </view>
          </view>

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

<!--mask吐司内容-->
<view class="toast_mask" wx:if="{{isShowToast}}"></view>

<!--以下为toast显示的内容-->
<view class="toast_content_box" wx:if="{{isShowToast}}">
	<view class="toast_content">
		<view class="toast_content_text">
			{{toastText}}
		</view>
	</view>
</view>

<!--拼团玩法弹出框-->
<!----弹起的---->
<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>

<warn id="warn"></warn>
