Authored by whb

添加客户端配置

... ... @@ -265,6 +265,7 @@ define('mobile', function(require, exports) {
window.location.href = $(this).val();
});
var current_tag = $(".main-layout").attr("current_tag");
var client = $(".main-layout").attr("client");
var url = current_tag == "" ? "/news/index" : "/news/index/tag/" + current_tag;
var prevPage = '<a href="{url}"><span class="iconfont">&#xe60f;</span>&nbsp;PREV</a>';
var lastPage = '<a href="{url}" class="next">NEXT&nbsp;<span class="iconfont">&#xe610;</span></a>';
... ... @@ -275,11 +276,11 @@ define('mobile', function(require, exports) {
return ""
}
if (page - 1 >= 1) {
prevPage = prevPage.replace("{url}", url + "/page/" + ((page - 1) * 4 - 3));
prevPage = prevPage.replace("{url}", url + "/page/" + ((page - 1) * 4 - 3) + "/client/" + client);
pageHtml = pageHtml.replace("{prevPage}", prevPage);
}
if (page < totalPage) {
lastPage = lastPage.replace("{url}", url + "/page/" + (page * 4 + 1));
lastPage = lastPage.replace("{url}", url + "/page/" + (page * 4 + 1) + "/client/" + client);
pageHtml = pageHtml.replace("{lastPage}", lastPage);
}
if (page < 1) {
... ...
... ... @@ -498,5 +498,6 @@ function C($name=null, $value=null)
*/
function url($udi, $params = null, $route = null, array $opts = null)
{
if(isset($_REQUEST['client'])) {$params = array_merge($params, array('client' => $_REQUEST['client']));}
return Framework_YHttpRequest::instance()->url($udi, $params, $route, $opts);
}
\ No newline at end of file
... ...
... ... @@ -55,7 +55,7 @@
<ul>
<?php foreach($this->view->news as $news):?>
<li>
<a class="clearfix" href="/news/detail/id/<?php echo $news['id'];?>">
<a class="clearfix" href="<?php echo url('news/detail' ,array('id' => $news['id']))?>">
<div class="image-box">
<img src="<?php echo Lib_Images::getImageUrl($news['thumb'], 'source','fragmentimg');?>" alt="">
</div>
... ...
... ... @@ -20,7 +20,7 @@
<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;?>"
total_times="3" current_tag="<?php echo $this->view->current_tag;?>" limit="<?php echo $this->view->limit;?>">
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>
... ...