正在显示
7 个修改的文件
包含
222 行增加
和
8 行删除
@@ -115,15 +115,15 @@ class RegionController extends HomeBaseController | @@ -115,15 +115,15 @@ class RegionController extends HomeBaseController | ||
115 | ->toArray(); | 115 | ->toArray(); |
116 | $post_id = array_column($post_id,'post_id'); | 116 | $post_id = array_column($post_id,'post_id'); |
117 | //查询文章 | 117 | //查询文章 |
118 | - $res = Db::table($pre.'portal_post') | 118 | + $res = Db::name('portal_post') |
119 | ->whereIn('id',$post_id) | 119 | ->whereIn('id',$post_id) |
120 | ->where('delete_time', 0) | 120 | ->where('delete_time', 0) |
121 | ->field($field) | 121 | ->field($field) |
122 | - ->page($page,$limit) | ||
123 | ->order('weigh desc') | 122 | ->order('weigh desc') |
124 | - ->select() | ||
125 | - ->toArray(); | ||
126 | - return $res; | 123 | + ->paginate(1); |
124 | + $arr['data'] = $res; | ||
125 | + $arr['page'] = $res->render(); | ||
126 | + return $arr; | ||
127 | } | 127 | } |
128 | 128 | ||
129 | //获取城市分类 | 129 | //获取城市分类 |
@@ -158,7 +158,9 @@ class RegionController extends HomeBaseController | @@ -158,7 +158,9 @@ class RegionController extends HomeBaseController | ||
158 | $position['category_id'] = CityCategoryModel::mxft; | 158 | $position['category_id'] = CityCategoryModel::mxft; |
159 | $field = 'id,thumbnail avatar,full_name,position,trade,post_excerpt'; | 159 | $field = 'id,thumbnail avatar,full_name,position,trade,post_excerpt'; |
160 | $res = $this->getChildArticlePage($position,$field,$page,5); | 160 | $res = $this->getChildArticlePage($position,$field,$page,5); |
161 | - $this->assign('res',$res); | 161 | + $this->assign('res',$res['data']); |
162 | + $this->assign('page',$res['page']); | ||
163 | + return $this->fetch(); | ||
162 | } | 164 | } |
163 | 165 | ||
164 | //明星访谈详情 | 166 | //明星访谈详情 |
@@ -693,6 +693,7 @@ | @@ -693,6 +693,7 @@ | ||
693 | <include file="public@footer"/> | 693 | <include file="public@footer"/> |
694 | <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> | 694 | <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> |
695 | <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> | 695 | <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> |
696 | + <script src="__TMPL__/public/assets/js/public.js"></script> | ||
696 | <script> | 697 | <script> |
697 | // 星球奇景 | 698 | // 星球奇景 |
698 | $('.africa p,.asia p,.north p,.south p,.antarctica p,.europe p,.oceania p').click(function() { | 699 | $('.africa p,.asia p,.north p,.south p,.antarctica p,.europe p,.oceania p').click(function() { |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
8 | + <title>明星访谈更多</title> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/layui.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/header.css"> | ||
11 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css"> | ||
12 | +</head> | ||
13 | + | ||
14 | +<body> | ||
15 | + <!--头部--> | ||
16 | + <include file="public@header"> | ||
17 | + <!-- main 背景 --> | ||
18 | + <div class="show_InMain show_3_Box"> | ||
19 | + <!-- 明星访谈盒子 --> | ||
20 | + <div class="show_InMain_box"> | ||
21 | + <!-- 顶部标题 --> | ||
22 | + <div class="show_INMain_tit clearfix"> | ||
23 | + <div class="show_IN1 clearfix"> | ||
24 | + <img src="__TMPL__/public/assets/starImg/aicon_48.png" alt=""> | ||
25 | + <p>明星<span>访谈</span></p> | ||
26 | + <h2>Star Interview</h2> | ||
27 | + </div> | ||
28 | + <!-- 更多 --> | ||
29 | + <!--<div class="show_IN2">--> | ||
30 | + <!--<a href=""> MORE+ </a>--> | ||
31 | + <!--</div>--> | ||
32 | + </div> | ||
33 | + <!-- 内容--1 --> | ||
34 | + <div class="show_INMain_con clearfix"> | ||
35 | + <img class="show_INMain_con1" src="__TMPL__/public/assets/starImg/aicon_31.png" alt=""> | ||
36 | + <div class="show_INMain_con2 clearfix"> | ||
37 | + <img class="show_INMain_con3" src="__TMPL__/public/assets/starImg/aicon_32.png" alt=""> | ||
38 | + <h2>胡歌</h2> | ||
39 | + <h3>著名国际巨星 慈善家</h3> | ||
40 | + <p>那年孩子们都上大学了,我孑然一身,几个老弟兄说出国走走看看,一个老嫂子会点外语,于是我们就自由行到了欧洲,法国,德国,意大利,几个国家转了一圈,外国的天气,气候真是清新,不去的时候不想,但是身临其境的时候就会感受到巨大的差异。巴黎车水马龙,意大利热情奔放,</p> | ||
41 | + </div> | ||
42 | + </div> | ||
43 | + <!-- 内容--2 --> | ||
44 | + <div class="show_3_list"> | ||
45 | + <ul class="clearfix"> | ||
46 | + <li> | ||
47 | + <img src="__TMPL__/public/assets/starImg/bicon_24.png" alt=""> | ||
48 | + <div class="show_3_list_txt"> | ||
49 | + <h1>斯嘉丽·约翰逊</h1> | ||
50 | + <h2>著名国际巨星 慈善家</h2> | ||
51 | + <p> | ||
52 | + | ||
53 | + 这两位的婚礼这几天在微博上是大有刷屏之势,新娘新郎就算了,连参加婚礼的宾客们都轮番换着上热搜,那叫一个热闹。其实除了刘诗诗吴奇隆,之前杨幂和刘恺威的婚礼也是选在了巴厘岛。地处印度尼西亚的巴厘岛是著名的旅游海岛,岛上热带风情浓郁,风景绮丽无比,这里的细阔沙滩. 魂牵梦绕。 | ||
54 | + | ||
55 | + </p> | ||
56 | + </div> | ||
57 | + </li> | ||
58 | + <li> | ||
59 | + <img src="__TMPL__/public/assets/starImg/bicon_24.png" alt=""> | ||
60 | + <div class="show_3_list_txt"> | ||
61 | + <h1>斯嘉丽·约翰逊</h1> | ||
62 | + <h2>著名国际巨星 慈善家</h2> | ||
63 | + <p> | ||
64 | + | ||
65 | + 这两位的婚礼这几天在微博上是大有刷屏之势,新娘新郎就算了,连参加婚礼的宾客们都轮番换着上热搜,那叫一个热闹。其实除了刘诗诗吴奇隆,之前杨幂和刘恺威的婚礼也是选在了巴厘岛。地处印度尼西亚的巴厘岛是著名的旅游海岛,岛上热带风情浓郁,风景绮丽无比,这里的细阔沙滩. 魂牵梦绕。 | ||
66 | + | ||
67 | + </p> | ||
68 | + </div> | ||
69 | + </li> | ||
70 | + <li> | ||
71 | + <img src="__TMPL__/public/assets/starImg/bicon_24.png" alt=""> | ||
72 | + <div class="show_3_list_txt"> | ||
73 | + <h1>斯嘉丽·约翰逊</h1> | ||
74 | + <h2>著名国际巨星 慈善家</h2> | ||
75 | + <p> | ||
76 | + | ||
77 | + 这两位的婚礼这几天在微博上是大有刷屏之势,新娘新郎就算了,连参加婚礼的宾客们都轮番换着上热搜,那叫一个热闹。其实除了刘诗诗吴奇隆,之前杨幂和刘恺威的婚礼也是选在了巴厘岛。地处印度尼西亚的巴厘岛是著名的旅游海岛,岛上热带风情浓郁,风景绮丽无比,这里的细阔沙滩. 魂牵梦绕。 | ||
78 | + | ||
79 | + </p> | ||
80 | + </div> | ||
81 | + </li> | ||
82 | + </ul> | ||
83 | + </div> | ||
84 | + <!-- 内容--3 --> | ||
85 | + <div class="show_INMain_con show_3_con3 clearfix"> | ||
86 | + <img class="show_INMain_con1" src="__TMPL__/public/assets/starImg/aicon_31.png" alt=""> | ||
87 | + <div class="show_INMain_con2 clearfix"> | ||
88 | + <img class="show_INMain_con3" src="__TMPL__/public/assets/starImg/aicon_32.png" alt=""> | ||
89 | + <h2>林允儿</h2> | ||
90 | + <h3>著名国际巨星 慈善家</h3> | ||
91 | + <p>那年孩子们都上大学了,我孑然一身,几个老弟兄说出国走走看看,一个老嫂子会点外语,于是我们就自由行到了欧洲,法国,德国,意大利,几个国家转了一圈,外国的天气,气候真是清新,不去的时候不想,但是身临其境的时候就会感受到巨大的差异。巴黎车水马龙,意大利热情奔放,</p> | ||
92 | + </div> | ||
93 | + </div> | ||
94 | + | ||
95 | + <!-- 底部翻页 --> | ||
96 | + <!-- <div class="show_3_nextPage clearfix"> | ||
97 | + <span> < </span> | ||
98 | + <p>1</p> | ||
99 | + <p>2</p> | ||
100 | + <p>3</p> | ||
101 | + <span> > </span> | ||
102 | + </div> --> | ||
103 | + </div> | ||
104 | + <div class="pagination"> | ||
105 | + {$page|default=''} | ||
106 | + </div> | ||
107 | + <!--<div id="page">--> | ||
108 | + | ||
109 | + <!--</div>--> | ||
110 | + </div> | ||
111 | + <!-- 底部 --> | ||
112 | + <footer></footer> | ||
113 | + <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> | ||
114 | + <script src="__TMPL__/public/assets/js/layui.js"></script> | ||
115 | + <script src="__TMPL__/public/assets/js/public.js"></script> | ||
116 | + <script> | ||
117 | + // page 分页 | ||
118 | + $(function() { | ||
119 | + var dataObj = { | ||
120 | + dataList: [{ | ||
121 | + img: "__TMPL__/public/assets/starImg/bicon_24.png", | ||
122 | + name: "121212", | ||
123 | + name_tit: "按时大苏打啊实打", | ||
124 | + content: "偶是女的芬兰首都基辅九分零四" | ||
125 | + }, { | ||
126 | + img: "__TMPL__/public/assets/starImg/bicon_24.png", | ||
127 | + name: "121212", | ||
128 | + name_tit: "按时大苏打啊实打", | ||
129 | + content: "偶是女的芬兰首都基辅九分零四" | ||
130 | + }, { | ||
131 | + img: "__TMPL__/public/assets/starImg/bicon_24.png", | ||
132 | + name: "121212", | ||
133 | + name_tit: "按时大苏打啊实打", | ||
134 | + content: "偶是女的芬兰首都基辅九分零四" | ||
135 | + }, { | ||
136 | + img: "__TMPL__/public/assets/starImg/bicon_24.png", | ||
137 | + name: "121212", | ||
138 | + name_tit: "按时大苏打啊实打", | ||
139 | + content: "偶是女的芬兰首都基辅九分零四" | ||
140 | + }, { | ||
141 | + img: "__TMPL__/public/assets/starImg/bicon_24.png", | ||
142 | + name: "121212", | ||
143 | + name_tit: "按时大苏打啊实打", | ||
144 | + content: "偶是女的芬兰首都基辅九分零四" | ||
145 | + }] | ||
146 | + } | ||
147 | + var currPage = 1; // 当前页 | ||
148 | + | ||
149 | + var limit = 1; // 每页显示的条数 | ||
150 | + | ||
151 | + var count = dataObj.dataList.length; | ||
152 | + console.log(count); | ||
153 | + | ||
154 | + layui.use('laypage', function() { | ||
155 | + var laypage = layui.laypage //分页 | ||
156 | + //执行一个laypage实例 | ||
157 | + laypage.render({ //layui分页 | ||
158 | + elem: 'page', | ||
159 | + //分页容器id | ||
160 | + count: count, //总条数 | ||
161 | + curr: currPage, //当前页 | ||
162 | + limit: limit, //每页的条数 | ||
163 | + // limits: 1, //可选择每页数目 | ||
164 | + prev: "<", //上一页图标 | ||
165 | + next: ">", //下一页图标 | ||
166 | + theme: 'xxx', //分页主色 | ||
167 | + // layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], //设置分页组件显示 | ||
168 | + jump: function(obj, first) { | ||
169 | + if (!first) { //设置首次渲染分页无需走业务逻辑处理函数,不然会陷入死循环 | ||
170 | + console.log(obj); | ||
171 | + currPage = obj.curr; | ||
172 | + console.log(currPage) | ||
173 | + limit = obj.limit; | ||
174 | + } | ||
175 | + } | ||
176 | + }) | ||
177 | + }) | ||
178 | + }); | ||
179 | + </script> | ||
180 | +</body> | ||
181 | + | ||
182 | +</html> |
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | </div> | 45 | </div> |
46 | <!-- 更多 --> | 46 | <!-- 更多 --> |
47 | <div class="show_IN2"> | 47 | <div class="show_IN2"> |
48 | - <a href="show_3.html"> MORE+ </a> | 48 | + <a href="/portal/region/getMoreStar"> MORE+ </a> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
51 | <!-- 内容 --> | 51 | <!-- 内容 --> |
@@ -116,6 +116,10 @@ | @@ -116,6 +116,10 @@ | ||
116 | <p>星球<span>画廊</span></p> | 116 | <p>星球<span>画廊</span></p> |
117 | <h2>Star Gallery</h2> | 117 | <h2>Star Gallery</h2> |
118 | </div> | 118 | </div> |
119 | + <!-- 更多 --> | ||
120 | + <div class="show_IN2"> | ||
121 | + <a href=""> MORE+ </a> | ||
122 | + </div> | ||
119 | </div> | 123 | </div> |
120 | <!-- 内容 --> | 124 | <!-- 内容 --> |
121 | <div class="show_INMain_con3_3 swiper-container"> | 125 | <div class="show_INMain_con3_3 swiper-container"> |
@@ -237,6 +241,7 @@ | @@ -237,6 +241,7 @@ | ||
237 | <include file="public@footer"/> | 241 | <include file="public@footer"/> |
238 | <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> | 242 | <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> |
239 | <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> | 243 | <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> |
244 | + <script src="__TMPL__/public/assets/js/public.js"></script> | ||
240 | <script> | 245 | <script> |
241 | // 星球画廊swiper | 246 | // 星球画廊swiper |
242 | var swiper = new Swiper('.swiper-container', { | 247 | var swiper = new Swiper('.swiper-container', { |
1 | +/** layui-v2.4.5 MIT License By https://www.layui.com */ | ||
2 | + ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.5"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;o<e.length&&!t.call(e[o],o,e[o]);o++);return n},n.prototype.sort=function(e,t,o){var n=JSON.parse(JSON.stringify(e||[]));return t?(n.sort(function(e,o){var n=/^-?\d+$/,r=e[t],i=o[t];return n.test(r)&&(r=parseFloat(r)),n.test(i)&&(i=parseFloat(i)),r&&!i?1:!r&&i?-1:r>i?1:r<i?-1:0}),o&&n.reverse(),n):n},n.prototype.stope=function(t){t=t||e.event;try{t.stopPropagation()}catch(o){t.cancelBubble=!0}},n.prototype.onevent=function(e,t,o){return"string"!=typeof e||"function"!=typeof o?this:n.event(e,t,null,o)},n.prototype.event=n.event=function(e,t,n,r){var i=this,a=null,u=t.match(/\((.*)\)$/)||[],l=(e+"."+t).replace(u[0],""),s=u[1]||"",c=function(e,t){var o=t&&t.call(i,n);o===!1&&null===a&&(a=!1)};return r?(o.event[l]=o.event[l]||{},o.event[l][s]=[r],this):(layui.each(o.event[l],function(e,t){return"{*}"===s?void layui.each(t,c):(""===e&&layui.each(t,c),void(s&&e===s&&layui.each(t,c)))}),a)},e.layui=new n}(window); |
@@ -32,4 +32,26 @@ $(function(){ | @@ -32,4 +32,26 @@ $(function(){ | ||
32 | $(this).text('查看更多评论'); | 32 | $(this).text('查看更多评论'); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | + | ||
36 | + //头部导航栏切换颜色 | ||
37 | + var str_url = window.location.pathname; | ||
38 | + $('.home_nav_act,.slide_vo').children('a').removeClass('home_nav_act'); | ||
39 | + var star = 'star';//星球奇境 | ||
40 | + var region = 'region';//星域秀场 | ||
41 | + var enjoy = 'enjoy';//星享体验 | ||
42 | + var scout = 'scout';//星探推荐 | ||
43 | + var active = 'active';//星际活动 | ||
44 | + if(str_url.indexOf(star) != -1){ | ||
45 | + $('.slide_vo').eq(0).children('a').addClass('home_nav_act'); | ||
46 | + }else if(str_url.indexOf(region) != -1){ | ||
47 | + $('.slide_vo').eq(1).children('a').addClass('home_nav_act'); | ||
48 | + }else if(str_url.indexOf(enjoy) != -1){ | ||
49 | + $('.slide_vo').eq(2).children('a').addClass('home_nav_act'); | ||
50 | + }else if(str_url.indexOf(scout) != -1){ | ||
51 | + $('.slide_vo').eq(3).children('a').addClass('home_nav_act'); | ||
52 | + }else if(str_url.indexOf(active) != -1){ | ||
53 | + $('.slide_vo').eq(4).children('a').addClass('home_nav_act'); | ||
54 | + }else{ | ||
55 | + $('.home_nav_act').children('a').addClass('home_nav_act'); | ||
56 | + } | ||
35 | }); | 57 | }); |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <a class="home_nav_act" href="/">首页</a> | 11 | <a class="home_nav_act" href="/">首页</a> |
12 | </li> | 12 | </li> |
13 | <volist name="slide" id="vo"> | 13 | <volist name="slide" id="vo"> |
14 | - <li> | 14 | + <li class="slide_vo"> |
15 | <a class="home_nav_act_A" href="{$vo.url}">{$vo.name}</a> | 15 | <a class="home_nav_act_A" href="{$vo.url}">{$vo.name}</a> |
16 | <div class="home_nav_down"> | 16 | <div class="home_nav_down"> |
17 | <div class="home_nav_down2"> | 17 | <div class="home_nav_down2"> |
-
请 注册 或 登录 后发表评论