Authored by whb

资讯页

... ... @@ -157,11 +157,11 @@ define('mobile', function(require, exports) {
exports.news = function() {
$('select').on('click', function() {
var nowIndex = $('option').not(function() {
/*var nowIndex = $('option').not(function() {
return !this.selected
}).index();
$('.news-main').removeClass('current').eq(nowIndex).addClass('current');
// $('.news-main').removeClass('current').eq(nowIndex).addClass('current');*/
window.location.href = $(this).val();
})
};
});
\ No newline at end of file
... ...
<?php $this->_extends('layout/default_layout_mobile');?>
<?php $this->_block('main');?>
<div class="mobile-position">
<a class="mobile-back" href="<?php echo $this->view->callback;?>"></a>
<div class="mobile-news-navigator">
<span><?php echo ($this->view->current_tag =='') ? '全部资讯': $this->view->current_tag;?></span>
<ins></ins>
<select name="tag" id="tag">
<option value="<?php echo url('news/index');?>" <?php echo ($this->view->current_tag =='') ? 'selected':''; ?>>全部资讯</option>
<?php foreach ($this->view->tags as $tag):
if(empty($tag['num'])) continue;
?>
<option value="<?php echo url('news/index',array('tag' => $tag['tag'], 'current_tag'=> $this->view->current_tag))?>"
<?php echo ($this->view->current_tag == $tag['tag']) ? 'selected':''; ?>>
<?php echo sprintf("%s", $tag['tag']); ?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="news-select">
<select>
<?php
array_unshift($this->view->tags, array('tag' => '', 'num'=> $this->view->total));
foreach ($this->view->tags as $tag):?>
<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">
<?php $this->_widget('news_listmobile', array('list'=> $this->view->list));?>
</div>
<div class="mobile-container">
<?php
foreach($this->view->list as $news):
if($news['tag'] == '手机视频')
{
$news['tag'] = '视频';
}
if ($news['client_thumb'])
{
$thumb = Lib_Images::getImageUrl($news['client_thumb'], 'source','fragmentimg');
}
else if($news['thumb'])
{
$thumb = Lib_Images::getImageUrl($news['thumb'], 'source','fragmentimg');
}
else
{
$thumb = SITE_IMG.'/pic01.png';
}
?>
<div class="fluid-item">
<div class="image-box <?php echo trim($news['tag']) == '视频'? 'image-video':''; ?>">
<?php if(trim($news['tag']) == '视频'): ?>
<span class="icon-video"></span>
<?php endif;?>
<a href="<?php echo url('news/detail' ,array('id' => $news['id'], 'current_tag'=> $this->view->current_tag))?>">
<img width="100%" src="<?php echo $thumb;?>" alt=""/>
<a href="<?php echo url('news/index',array('tag' => $news['tag']))?>" class="fluid-tag"><?php echo $news['tag'];?></a>
</a>
</div>
<div class="content">
<h2 <?php echo $news['main_title_type'] == 1 ? 'class="volupia"':'';?>><a href="<?php echo url('news/detail' ,array('id' => $news['id'],'current_tag'=> $this->view->current_tag))?>"><?php echo $news['title'];?></a></h2>
<!-- <h3><a href="<?php echo url('news/detail' ,array('id' => $news['id']))?>"><?php echo Util_StringHelper::substr_cn($news['title'], 90);?></a></h3> -->
<p class="time"><?php echo date('Y.m.d', $news['create_time'])?></p>
<p><?php echo Lib_Utils_StringHelper::substr_cn(Lib_Utils_StringHelper::stripTags($news['content']), 68);?></p>
</div>
</div>
<?php endforeach;?>
<div class="detail-pagination">
<?php $this->_component('Common_Pagination',array(
'pagination' => $this->view->pagination,'next_label' => '下一页','prev_label' => '上一页',
'is_mobile' => true,'prev_class'=>'prev','next_class'=>'next',
'page_class'=>'pagination-inner', 'id'=>'img_page'
));?>
</div>
</div>
</div>
<div id="pageContent" style="text-align: center;" class="pagination">
<?php $this->_component('Common_Pagination',array(
'pagination' => $this->view->pagination,'next_label' => 'NEXT&nbsp;<span class="iconfont">&#xe610;</span>',
'prev_label' => '<span class="iconfont">&#xe60f;</span>&nbsp;PREV',
'is_mobile' => true,'prev_class'=>'iconfont','prev_class'=>'iconfont',
'page_class'=>'pagination-inner clearfix', 'id'=>'img_page'
));?>
</div>
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<?php $this->_js('index.js', array(
SITE_JS . '/lib/seajs.js',
));?>
<script type="text/javascript">
seajs.use("jquery", function($)
seajs.use("mobile", function(mobile)
{
$('#tag').bind("change",function()
{
window.location.href = $(this).val();
});
mobile.news();
});
</script>
<?php $this->_endblock();?>
\ No newline at end of file
<?php $this->_endblock();?>
\ No newline at end of file
... ...