indexmobile.php 1.59 KB
<?php if($this->view->isAjax):?>
    <div id="news_page" total="<?php echo $this->view->total;?>" page="<?php echo $this->view->page;?>">
        <?php $this->_widget('news_listmobile', array('list'=> $this->view->list));?>
    </div>
<?php else:?>
<?php $this->_extends('layout/default_layout_mobile');?>
<?php $this->_block('main');?>
<div class="news-select">
    <select>
    <?php 
    array_unshift($this->view->tags,  array('tag' => '',  'num'=> $this->view->total));
    foreach ($this->view->tags as $tag): if(empty($tag['num'])) continue;?>
        <option value ="<?php echo url('news/index',array('tag' => $tag['tag']))?>" 
          <?php echo ($this->view->current_tag == $tag['tag']) ?'selected':''?>>
            <?php echo sprintf("%s(%s)", $tag['tag'] == '' ? '全部资讯': $tag['tag'], $tag['num']); ?>
        </option>
    <?php endforeach;?>
    </select>
</div>
<div class="news-main content-main current">
    <div class="news-content">
        <div class="main-layout clearfix" total="<?php echo $this->view->pageTotal;?>" page="<?php echo $this->view->page;?>" 
            client="<?php echo $this->view->client;?>" total_times="3" current_tag="<?php echo $this->view->current_tag;?>" limit="<?php echo $this->view->limit;?>">  
           <?php $this->_widget('news_listmobile', array('list'=> $this->view->list));?>
        </div>
    </div>
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
seajs.use("mobile", function(mobile)
{
	mobile.news();
});
</script>
<?php $this->_endblock();?> 
<?php endif;?>