<wxs module="filters" src="../../utils/filter.wxs"></wxs>

<!-- 如果是自定义模板的时候 -->
<block wx:if="{{object}}">
	<view class="store_sele1 flex ai_c" bindtap="sele_top_store" style="background-color:{{object.bgcolor}};color: {{object.word_color}};">
		   <image class="logo_box circle" src="{{url+store_config.store_logo}}"></image>
           <block wx:if="{{no_select}}">{{top_store?top_store.pickup_name:'请选择门店'}}</block>
           <block wx:else>{{top_store?top_store.pickup_name+'[切换]':'请选择门店'}}</block>
	</view>
</block>
<block wx:else>
	<view class="store_sele flex ai_c" bindtap="sele_top_store">
		  <image class="logo_box circle" src="{{url+store_config.store_logo}}"></image>
          <block wx:if="{{no_select}}">{{top_store?top_store.pickup_name:'请选择门店'}}</block>
          <block wx:else>{{top_store?top_store.pickup_name+'[切换]':'请选择门店'}}</block>
	</view>
	<view class="pd-view"></view>
</block>

<!-- 选择门店的弹框，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}}">
              <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}}</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}}</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}}</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 jc-center ai_center">
                <view class="determine red-b fs28 white t-c" bindtap="sure_pick">确定</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>  