index.ttml 5.76 KB
<template name='tipTitle'>
  <view class='titleContainer'
        style="border-bottom:{{no_line?'0.5rpx solid #ffffff':'0.5rpx solid #e0e0e0'}}">
    <view class='titleLine'></view>
    <view class='titleDesc'>{{desc}}</view>
    <view class='titleMore' tt:if='{{more_url?true:false}}' data-jump_rule="{{more_url}}" bindtap="jumpByRule">
      <image class="titleMoreIm" src="../../images/more_ic@2x.png" ></image> 
    </view> 
  </view>
</template>



<view class="container">

  <view  class='newtop'>
    <view class='newsearch' bindtap="searchTapped">
      <image class="serachIcon" src="../../images/home_search@2x.png"></image>
      <view class="serach_view_show">潮流单品搜一下</view>
    </view>
    <view class='scanCodeIconView'>
      <image class="scanCodeIcon" catchtap="scanCodeTapped" src="../../images/home_qr_new@3x.png"></image> 
    </view>
     <image bindtap='selectChannel' class="channelIcon" src='../../images/ceb-ic@2x.png'></image>
  </view>
  <image class='newTopImg' src='../../images/home-top-bg2@2x.png'></image> 
  <image tt:if='{{channelSelect}}' class='channelBg' src='../../images/channel-bg@2x.png'></image>
  <form bindsubmit='formSubmitFromSwitchGender' report-submit='true'>

  <view class='channelContainer' tt:if='{{channelSelect}}'>

    <view class='channelItem' data-type="boy" bindtap="channelSelected">
      <view class='indicator' style="background-color:{{selectedChannel=='boy' ? 'white':'transparent'}}"></view>
      <view class='channelText' data-type="boy">男生
      </view>
      <button class='channelButton' style='top: 0rpx;'
      form-type='submit'  data-type="boy"></button>
    </view>
    <view class='channelItem' style='border-top: 1rpx solid #ececec;'  bindtap="channelSelected" data-type="girl">
      <view class='indicator' style="background-color:{{selectedChannel=='girl' ? 'white':'transparent'}}" ></view>
      <view class='channelText' data-type="girl">女生
      </view>
      <button class='channelButton' style='top: 100rpx'
      form-type='submit' data-type="girl"></button>
    </view>

     <view class='channelItem' style='border-top: 1rpx solid #ececec;' bindtap="jumpToYohood">
      <view class='channelText'>YOHOOD</view>
      <button class='channelButton' style='top: 200rpx;' form-type='submit'  data-type="yohood"></button>
    </view>
  </view>
  
<scroll-view scroll-y="true" class="mainContainer" style="height:{{windowHeight}};">

  <block tt:for='{{homelist}}' tt:key='{{index}}'>

    <block tt:if="{{item.template_name=='focus' || item.template_name=='newFocus'}}">
      <home-banner data="{{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name}}}" bindjumpByRule="jumpByRuleEvent"></home-banner>
    </block>

    <block tt:elif="{{item.template_name=='image_list' && item.data.list.length == 4}}">
      <home-four-images data="{{{data:item.data.list,f_id:item.template_id,f_index:index,f_name:item.template_name}}}" bindjumpByRule="jumpByRuleEvent"></home-four-images>
    </block>
        
    <block tt:elif="{{item.template_name == 'twoPicture'}}">
      <block tt:if="{{item.title}}">
        <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:false}}"/>
      </block>
      <home-two-images data="{{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name,ratio:item.ratio,title:item.title}}}" bindjumpByRule="jumpByRuleEvent"></home-two-images>
    </block>

    <block tt:elif="{{item.template_name=='newSingleImage'}}">
      <block tt:if="{{item.title}}">
        <template is='tipTitle' data="{{desc:item.title}}"/>
      </block> 
      <home-single-image item="{{{data:item,f_id:item.template_id,f_index:index,f_name:item.template_name}}}" bindjumpByRule="jumpByRuleEvent"></home-single-image>
	  </block>
    
     <!-- <block tt:elif="{{item.template_name=='sv_new_user_floor'}}">
		  <template is='newCustomerBanner' data="{{newCustomer: newCustomer, data:item.data.banner_image}}" />
	  </block> -->
    
    <block tt:elif="{{item.template_name=='new_recommend_content_five'}}">
      <block tt:if="{{item.title}}">
        <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:true}}"/>
      </block>
      <home-hot-category data="{{{data:item.list,f_id:item.template_id,f_index:index,f_name:item.template_name}}}" bindjumpByRule="jumpByRuleEvent"></home-hot-category>
    </block>
      

    <block tt:elif="{{item.template_name=='3:4ImageListFloor'}}">
      <block tt:if="{{item.title}}">
        <template is='tipTitle' data="{{desc:item.title}}"/>
      </block>
      <home-brand data="{{{data:item.list,title:item.title,f_id:item.template_id,f_index:index,f_name:item.template_name}}}" bindjumpByRule="jumpByRuleEvent"></home-brand>
      <view tt:if="{{!item.title}}" style='width:100%;height:16rpx;background-color:white'/><!--兼容空白 后期需优化调整-->
    </block>

    <!--拼团购商品列表-->
    <block tt:elif="{{item.template_name=='collageBuyPrdList'}}">
      <home-group-booking data="{{item.prdList}}" bindjumpByRule="jumpByRuleEvent"></home-group-booking>
    </block>

    <block tt:elif="{{item.template_name=='newProductListFloor'}}">
      <home-hor-product-list data="{{item.data}}"></home-hor-product-list>
    </block>
    
    <block tt:elif="{{item.template_name=='popularListFloor'}}">
      <home-hor-product-list data="{{item.data}}"></home-hor-product-list>
    </block>
  
  </block>

  <!-- 商品推荐 -->
  <block tt:if="{{newChannels[selectedChannel]['recommend']['data'].length > 0}}">
    <template is='tipTitle' data="{{desc:'猜你喜欢'}}"/>
    <view class="product-list">
      <block tt:for="{{newChannels[selectedChannel]['recommend']['data']}}" tt:for-item="product" tt:key="{{index}}">
        <productCell id="productCell" item="{{product}}"/>
      </block>
    </view>
  </block>

</scroll-view>