{extend name="$LAYOUT_MOBILE_BASE" /}
{block name="title"}积分商城 - {__block__}{/block}
{block name="meta"}
<meta name="description" content="{$seoIntegralDesc}">
<meta name="keywords" content="{$seoIntegralKeywords}">
{/block}
{block name="css"}
<link rel="stylesheet"  href="__ROOT__/addons/integral/view/mobile/index/css/list.css?v={$v}">
{/block}
{block name="header"}
	 <header class="ui-header ui-header-positive wst-se-header2" style="border-bottom: 1px solid #f6f6f8;">
        <a href="{:url('mobile/index/index')}"><i class="ui-icon-return"></i></a>
        <div class="wst-se-search">
            <i class="ui-icon-search" onclick="javascript:searchGoods();"></i>
            <form action＝"" class="input-form">
            <input type="search" value="{$keyword}" placeholder="按关键字搜索商品" onsearch="searchGoods()" autocomplete="off" id="wst-search">
            </form>
        </div>
        <span class="wst-se-icon" id="j-icon"  onclick="javascript:dataShow();"></span>
    </header>
{/block}
{block name="footer"}
	{include file="$LAYOUT_MOBILE_FOOTER" /}
{/block}
{block name="main"}
	 <input type="hidden" name="" value="{$keyword}" id="keyword" autocomplete="off">
	 <input type="hidden" name="" value="{$goodsCatId}" id="goodsCatId" autocomplete="off">
	 <input type="hidden" name="" value="" id="currPage" autocomplete="off">
     <input type="hidden" name="" value="" id="totalPage" autocomplete="off">
     <section class="ui-container">
        <div class="wst-swiper">
          
         </div>
        {if condition="session('WST_USER.userId') >0"}
         <div class="ui-row-flex wst-users_capital">
             <div class="ui-col ui-col wst-border">
                <a href="{:url('mobile/logmoneys/usermoneys')}">
                    <p class="ui-badge-wrap ui-nowrap"><span id="userMoney">¥ </span></p>
                    <span class="ui-flex ui-flex-align-end ui-flex-pack-center">余额</span>
                </a>
                </div>
                <div class="ui-col ui-col">
                <a href="{:url('mobile/userscores/index')}">
                    <p class="ui-badge-wrap ui-nowrap" id="userScore"></p>
                    <span class="ui-flex ui-flex-align-end ui-flex-pack-center">当前积分</span>
                </a>
             </div>
         </div>
         {/if}
		<ul class="ui-tab-content" id="integral-container" sc="{:date('Y-m-d H:i:s')}">
	        <li id="goods-list"></li>
	    </ul>
     </section>
<script id="list" type="text/html">
{{# if(d.Rows && d.Rows.length>0){ }}
{{# for(var i=0,goods=d.Rows; i<goods.length; i++){ }}
    <div class="ui-row-flex wst-shl-list goods_{{ d.CurrentPage }}" onclick="goGoods({{ goods[i].id }})" st="{{ goods[i].status }}">
        <div class="ui-col">
            <div class="img j-imgAdapt"><a href="javascript:void(0);" onclick="goGoods({{ goods[i].id }})">
            <img src="__RESOURCE_PATH__/{:WSTConf('CONF.goodsLogo')}" data-echo="__RESOURCE_PATH__/{{ goods[i].goodsImg }}" title="{{ goods[i].goodsName }}"></a>
            </div>
        </div>
        <div class="ui-col ui-col-2 info">
            <div class="title ui-nowrap">{{ goods[i].goodsName }}</div>
            <p class="price2">店铺价 ¥{{ goods[i].shopPrice }}</p>
            <p class="prices"><span class="price">¥{{ goods[i].goodsPrice }}</span> + <span>{{ goods[i].integralNum }}</span> 积分</p>
            <div >
            {{# if((goods[i].totalNum-goods[i].orderNum) > 0){ }}
                {{# var userScore = <?php echo (isSet($user) && $user['userScore'])?$user['userScore']:0; ?>; }}
                {{# if( userScore < goods[i].integralNum){ }}
                <span class="p-goods-over">积分不足</span>
                {{# }else{ }}
                <span class="p-add-cart" onclick="goGoods({{ goods[i].id }})">立即兑换</span>
                {{# } }}
            {{# }else{ }}
            <span class="p-goods-over" >已抢光</span>
            {{# } }}
        </div>
        </div>
    </div>
{{# } }}
{{# }else{ }}
    <div class="wst-prompt-icon"><img src="__MOBILE__/img/nothing-goods.png"></div>
    <div class="wst-prompt-info">
        <p>对不起，没有相关商品。</p>
    </div>
{{# } }}
</script>
{/block}
{block name="include"}
{/* 遮盖层  */}
<div class="wst-cover" id="cover"></div>
{/* 分类层  */}
<div class="wst-fr-box" id="frame">
    <div class="title"><span>商品分类</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
    <div class="content">
       <div class="ui-scrollerl" id="ui-scrollerl">
            <ul>
                {volist name="$data['goodscats']" key="k" id="go"}
                <li id="goodscate" class="wst-goodscate {if($k==1)}wst-goodscate_selected{/if}" onclick="javascript:showRight(this,{$k-1});">{php}echo str_replace('、', '<br/>', $go['catName']);{/php}</li>
                {/volist}
            </ul>
        </div>
        {volist name="$data['goodscats']" key="k" id="gc"}
        <div class="wst-scrollerr goodscate1" {if($k!=1)}style="display:none;"{/if}>
        {if(isset($gc['childList']))}
        <ul><li><div class="wst-goodscat">
                {volist name="gc['childList']" id="go1" key="k2"}
                <span {if($k2%1==0)}left{/if}>
                    <a href="javascript:void(0);" onclick="javascript:goodsCat({$go1['catId']});">
                        <img src="__RESOURCE_PATH__/{:WSTConf('CONF.goodsLogo')}" data-echo="__RESOURCE_PATH__/{$go1['catImg']}" class="goods-cat-img" title="{$go1.catName|WSTStripTags}"/>
                        <p class="ui-nowrap-flex">{$go1.catName}</p>
                    </a>
                </span>
                {/volist}
             </div><div class="wst-clear"></div></li><div class="wst-clear"></div></ul>
        {/if}
        </div>
        {/volist}
        <div class="wst-clear"></div>
    </div>
</div>
{/block}
{block name="js"}
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
<script type="text/javascript">
    
</script>
<script type='text/javascript' src='__ROOT__/addons/integral/view/mobile/index/js/list.js?v={$v}'></script>
{/block}