<import src='/components/common/index'></import>
<import src='/components/diy/diy.wxml'></import>
<view class='page {{__page_classes}}'>
  <include src='/components/common/common'></include>
  <include src='/components/header/header'></include>
  <view class='body after-navber'>
    <template is='buy-data' data='{{buy:buy}}'></template>
    <block wx:if='{{template}}'>
      <view class='diy'>
        <block wx:for='{{template}}' wx:for-item='item' wx:for-index='index' wx:key='{{item.id}}'>
          <block>
            <block wx:if='{{item.type == "integralbase"}}'>
              <view class='head'>
                <image class='head-img' src='{{__wxapp_img.integral.head.url}}'></image>
                <view class='w-100' style='position:relative;margin-bottom:36rpx;'>
                  <view class='flex-row flex-x-center integral'>
                    <view class='flex-grow-0'>我的积分</view>
                    <view class='flex-grow-0'>
                      <image bindtap='shuoming' src='{{__wxapp_img.store.shuoming.url}}' style='width:30rpx;height:30rpx;margin-left:20rpx;'></image>
                    </view>
                  </view>
                  <view class='flex-row flex-x-center my-integral'>{{(item.param.user_integral?item.param.user_integral:0)}}</view>
                </view>
                <view class='flex-row my-exchange'>
                  <view bindtap='exchange' class='flex-grow-1 flex-x-center'>
                    <view class='flex-row'>
                      <view class='flex-grow-0'>
                        <image src='{{__wxapp_img.store.my_exchange.url}}'></image>
                      </view>
                      <view class='flex-grow-1'>我的兑换</view>
                    </view>
                  </view>
                  <view bindtap='detail' class='flex-grow-1 flex-x-center'>
                    <view class='flex-row'>
                      <view class='flex-grow-0'>
                        <image src='{{__wxapp_img.integral.detail.url}}'></image>
                      </view>
                      <view class='flex-grow-1'>积分明细</view>
                    </view>
                  </view>
                </view>
                
                <view class='flex-row flex-x-center' style='position:relative'>
                  <block wx:if='{{register_day == 1}}'>
                    <image bindtap='register' src='{{__wxapp_img.register.is_register.url}}' style='width:376rpx;height:96rpx;margin-bottom:-48rpx;'></image>
                  </block>
                  <block wx:else>
                    <image bindtap='register' src='{{__wxapp_img.register.register.url}}' style='width:376rpx;height:96rpx;margin-bottom:-48rpx;'></image>
                  </block>
                </view>
              </view>
            </block>
          </block>

          <block wx:if='{{item.type == "goods"}}'>
            <view class='user-block flex-row' style='flex-wrap:wrap;'>
              <block wx:if='{{item.param.is_cat == 1}}'>
                <template is='diy-cat' data='{{param:item.param,template_index:index}}'></template>
              </block>
              <template is='cat-position-{{(item.param.is_cat == 0?0:item.param.cat_position)}}' data='{{param:item.param,template_index:index,WindowHeight:WindowHeight,type:item.type}}'></template>
            </view>
          </block>
          <block wx:elif='{{item.type == "modal"}}'></block>
          <block wx:elif='{{item.type == "topic"}}'>
            <block wx:if='{{item.param.style != 0}}'>
              <template is='topic-{{item.param.style}}' data='{{param:item.param,__wxapp_img:__wxapp_img,show_notice:show_notice,play:play,time_all:time_all,template_index:index}}'></template>
            </block>
            <block wx:else>
              <template is='topic' data='{{param:item.param,__wxapp_img:__wxapp_img,show_notice:show_notice,play:play,time_all:time_all,template_index:index}}'></template>
            </block>
          </block>
          <block wx:elif='{{item.type == "integral"}}'>
            <block wx:if='{{item.param.is_coupon == 1}}'>
              <template is='coupon' data='{{param:item.param,__wxapp_img:__wxapp_img,show_notice:show_notice,play:play,time_all:time_all,template_index:index,coupon_index:"true",type:item.type}}'></template>
            </block>
            <block wx:if='{{item.param.is_goods == 1}}'>
              <template is='cat-position-0' data='{{param:item.param,template_index:index,WindowHeight:WindowHeight,type:item.type,time_all:time_all}}'></template>
            </block>
          </block>
          <block wx:elif='{{item.type == "mch"}}'>
            <block wx:if='{{item.param.is_goods == 0}}'>
              <template is='mch' data='{{mch_list:item.param.list,mch_index:"true"}}'></template>
            </block>
            <block wx:else>
              <template is='mch-1' data='{{param:item.param,mch_list:item.param.list,template_index:index,__wxapp_img:__wxapp_img}}'></template>
            </block>
          </block>
          <block wx:elif='{{ ( ( ( (item.type == "miaosha" || item.type == "pintuan")  || item.type == "bargain")  || item.type == "book")  || item.type == "lottery") }}'>
            <template is='cat-position-0' data='{{param:item.param,template_index:index,WindowHeight:WindowHeight,type:item.type,time_all:time_all,__wxapp_img:__wxapp_img}}'></template>
          </block>
          <block wx:elif='{{ (item.type == "nav" || item.type == "video") }}'>
            <template is='diy-{{item.type}}' data='{{param:item.param,__wxapp_img:__wxapp_img,show_notice:show_notice,play:play,time_all:time_all,template_index:index}}'></template>
          </block>
          <block wx:elif='{{item.type == "float"}}'>
<!--            <block wx:if='{{item.param.style == 0}}'>
              <app-navigation __alipay_mp_config='{{__alipay_mp_config}}' __device='{{__device}}' __platform='{{__platform}}' __user_info='{{__user_info}}' home_icon='{{home_icon}}' options='{{options}}' setnavi='{{setnavi}}' store='{{store}}'></app-navigation>
            </block>
            <block wx:else>
              <app-navigation __alipay_mp_config='{{__alipay_mp_config}}' __device='{{__device}}' __platform='{{__platform}}' __user_info='{{__user_info}}' click_pic='{{item.param.click_pic}}' home_icon='true' options='{{options}}' setnavi='{{item.param.setnavi}}'
                store='{{item.param.store}}'></app-navigation>
            </block> -->
          </block>
          <block wx:else>
            <template is='{{item.type}}' data='{{param:item.param,__wxapp_img:__wxapp_img,show_notice:show_notice,play:play,time_all:time_all,template_index:index,coupon_index:"true",type:item.type}}'></template>
          </block>
        </block>
        <template is='goods-modal' data='{{__wxapp_img:__wxapp_img,show_attr_picker:show_attr_picker,goods:goods,attr_group_list:attr_group_list,form:form}}'></template>
      </view>
    </block>
    <block wx:else>
      <block wx:for='{{module_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{item.id}}'>
        <block wx:if='{{item.name == "notice"}}'>
          <template is='notice' data='{{notice:notice,param:update_list.notice,__wxapp_img:__wxapp_img,show_notice:show_notice,template_index:1}}'></template>
        </block>
        <block wx:elif='{{item.name == "banner"}}'>
          <template is='banner' data='{{param:update_list.banner}}'></template>
        </block>
        <block wx:elif='{{item.name == "search"}}'>
          <template is='search' data='{{__wxapp_img:__wxapp_img}}'></template>
        </block>
        <block wx:elif='{{item.name == "nav"}}'>
          <template is='nav' data='{{nav_icon_list:nav_icon_list,nav_count:nav_count}}'></template>
        </block>
        <block wx:elif='{{item.name == "topic"}}'>
          <template is='topic' data='{{param:update_list.topic,topic_list:topic_list,item:item}}'></template>
        </block>
        <block wx:elif='{{item.name == "coupon"}}'>
          <template is='coupon' data='{{__wxapp_img:__wxapp_img,param:update_list.coupon,item:item}}'></template>
        </block>
        <block wx:elif='{{ (item.name == "cat" || item.name == "single_cat") }}'>
          <template is='cat' data='{{cat_list:cat_list,__wxapp_img:__wxapp_img,cat_goods_cols:cat_goods_cols,__is_sales:__is_sales,cat_item:item}}'></template>
        </block>
        <block wx:elif='{{item.name == "miaosha"}}'>
          <template is='miaosha' data='{{__wxapp_img:__wxapp_img,miaosha:miaosha,item:item}}'></template>
        </block>
        <block wx:elif='{{item.name == "pintuan"}}'>
          <template is='pintuan' data='{{__wxapp_img:__wxapp_img,pintuan:pintuan,item:item}}'></template>
        </block>
        <block wx:elif='{{item.name == "yuyue"}}'>
          <template is='yuyue' data='{{__wxapp_img:__wxapp_img,yuyue:yuyue,item:item}}'></template>
        </block>
        <block wx:elif='{{item.name == "video"}}'>
          <template is='video' data='{{__wxapp_img:__wxapp_img,update_list:update_list,video_item:item,play:play}}'></template>
        </block>
        <block wx:elif='{{ ( (item.name == "mch" && mch_list)  && mch_list.length > 0) }}'>
          <template is='mch' data='{{__wxapp_img:__wxapp_img,mch_list:mch_list,item:item}}'></template>
        </block>
        <block wx:else>
          <block wx:for='{{block_list}}' wx:for-item='block' wx:for-index='index' wx:key='block.id'>
            <block wx:if='{{item.block_id == block.id}}'>
              <template is='{{"block-" + block.data.pic_list.length + "-" + block.style}}' data='{{__wxapp_img:__wxapp_img,block:block,item:item,store:store}}'></template>
            </block>
          </block>
        </block>
      </block>
      <app-navigation __alipay_mp_config='{{__alipay_mp_config}}' __device='{{__device}}' __platform='{{__platform}}' __user_info='{{__user_info}}' home_icon='{{home_icon}}' options='{{options}}' setnavi='{{setnavi}}' store='{{store}}'></app-navigation>
    </block>
    <block wx:if='{{ (act_modal_list && act_modal_list.length > 0) }}'>
      <template is='act-modal' data='{{__wxapp_img:__wxapp_img,act_modal_list:act_modal_list}}'></template>
    </block>
  </view>
  <!-- <include src='/components/footer/footer'></include> -->
</view>