作者 景龙
1 个管道 的构建 通过 耗费 1 秒

修复音频,增加搜索

@@ -15,6 +15,7 @@ use app\portal\model\MobileCodeModel; @@ -15,6 +15,7 @@ use app\portal\model\MobileCodeModel;
15 use think\Db; 15 use think\Db;
16 class CommonController extends HomeBaseController 16 class CommonController extends HomeBaseController
17 { 17 {
  18 + //助通科技网址:http://mix2.zthysms.com/login
18 private $url = 'http://api.mix2.zthysms.com/v2/sendSmsTp';//短信请求地址 19 private $url = 'http://api.mix2.zthysms.com/v2/sendSmsTp';//短信请求地址
19 private $username = 'dujiaoxinghy';//用户名 20 private $username = 'dujiaoxinghy';//用户名
20 private $password = 'eU3OeYmx';//密码 21 private $password = 'eU3OeYmx';//密码
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 */ 6 */
7 namespace app\portal\controller; 7 namespace app\portal\controller;
8 8
  9 +use app\portal\model\CityCategoryModel;
9 use app\portal\model\UserModel; 10 use app\portal\model\UserModel;
10 use app\portal\validate\UsersValidate; 11 use app\portal\validate\UsersValidate;
11 use cmf\controller\HomeBaseController; 12 use cmf\controller\HomeBaseController;
@@ -17,7 +18,7 @@ use think\Config; @@ -17,7 +18,7 @@ use think\Config;
17 18
18 class LoginController extends HomeBaseController 19 class LoginController extends HomeBaseController
19 { 20 {
20 - 21 + private $limit = 8;//收藏,搜索分页
21 //登录页面 22 //登录页面
22 public function login(){ 23 public function login(){
23 return $this->fetch(); 24 return $this->fetch();
@@ -174,7 +175,7 @@ class LoginController extends HomeBaseController @@ -174,7 +175,7 @@ class LoginController extends HomeBaseController
174 175
175 //我的收藏列表 176 //我的收藏列表
176 public function myCollection(){ 177 public function myCollection(){
177 - $limit = 8; 178 + $limit = $this->limit;
178 $uid = cmf_get_current_user_id(); 179 $uid = cmf_get_current_user_id();
179 $collectionModel = new CollectionModel(); 180 $collectionModel = new CollectionModel();
180 $res = $collectionModel 181 $res = $collectionModel
@@ -206,6 +207,127 @@ class LoginController extends HomeBaseController @@ -206,6 +207,127 @@ class LoginController extends HomeBaseController
206 return $this->fetch(); 207 return $this->fetch();
207 } 208 }
208 209
  210 + //搜索列表
  211 + public function searchList(){
  212 + $keyword = $this->request->param('keyword');
  213 + if(isset($keyword) && !empty($keyword)){
  214 + $limit = $this->limit;
  215 + $res = Db::name('portal_post')
  216 + ->alias('p')
  217 + ->join('city_category c','p.city_id = c.id','LEFT')
  218 + ->join('portal_category_post c_p','p.id = c_p.post_id','LEFT')
  219 + ->where('p.post_title','like','%'.$keyword.'%')
  220 + ->where('c_p.category_id','<>',CityCategoryModel::xqyy)
  221 + ->where('c_p.category_id','<>',CityCategoryModel::xyhl)
  222 + ->where('p.delete_time', 0)
  223 + ->field('p.id,p.post_title,p.post_excerpt,p.post_favorites,c.name city_name')
  224 + ->order('p.weigh desc')
  225 + ->paginate($limit,false,['query'=>request()->param()]);
  226 + $data = $res->toArray();
  227 + $page = $res->render();
  228 +
  229 + $post_ids = array_column($data['data'],'id');
  230 + //查找分类名称
  231 + $category = Db::name('portal_category_post')
  232 + ->alias('c_p')
  233 + ->join('portal_category c','c_p.category_id = c.id','LEFT')
  234 + ->whereIn('c_p.post_id',$post_ids)
  235 + ->field('c.id,c_p.post_id,c.name')
  236 + ->select()
  237 + ->toArray();
  238 + foreach($data['data'] as &$value){
  239 + $value['post_title'] = str_replace($keyword,'<span style="color:rgba(9, 255, 142, 1);">'.$keyword.'</span>',$value['post_title']);
  240 + foreach($category as $item){
  241 + if($value['id'] == $item['post_id']){
  242 + $value['category_name'] = $item['name'];
  243 + $value['post_url'] = $this->getDetailUrl($item['id']);
  244 + }
  245 + }
  246 + }
  247 +
  248 + //查询总数
  249 + $count = Db::name('portal_post')
  250 + ->alias('p')
  251 + ->join('portal_category_post c_p','p.id = c_p.post_id','LEFT')
  252 + ->where('p.post_title','like','%'.$keyword.'%')
  253 + ->where('c_p.category_id','<>',CityCategoryModel::xqyy)
  254 + ->where('c_p.category_id','<>',CityCategoryModel::xyhl)
  255 + ->where('p.delete_time', 0)
  256 + ->count();
  257 + }else{
  258 + $count = 0;
  259 + $data['data'] = [];
  260 + $page = '';
  261 + }
  262 + $this->assign('count',$count);
  263 + $this->assign('res',$data['data']);
  264 + $this->assign('page',$page);
  265 + return $this->fetch();
  266 + }
  267 +
  268 + //获取各个板块详情页位置
  269 + public function getDetailUrl($c_id){
  270 + $url = '';
  271 + switch ($c_id) {
  272 + case CityCategoryModel::xqgs:
  273 + $url = '/portal/star/getStoryDetail';
  274 + break;
  275 + case CityCategoryModel::whmj:
  276 + $url = '/portal/star/getSceneryDetail';
  277 + break;
  278 + case CityCategoryModel::yyzx:
  279 + $url = '/portal/star/getFoodDetail';
  280 + break;
  281 + case CityCategoryModel::lsmq:
  282 + $url = '/portal/star/getHotelDetail';
  283 + break;
  284 + case CityCategoryModel::hlst:
  285 + $url = '/portal/star/getEcologyDetail';
  286 + break;
  287 + case CityCategoryModel::blcx:
  288 + $url = '/portal/star/getTravelDetail';
  289 + break;
  290 + case CityCategoryModel::mxft:
  291 + $url = '/portal/region/getStarDetail';
  292 + break;
  293 + case CityCategoryModel::djkb:
  294 + $url = '/portal/region/getNewsDetail';
  295 + break;
  296 + case CityCategoryModel::djrz:
  297 + $url = '/portal/region/getNoteDetail';
  298 + break;
  299 + case CityCategoryModel::tqwl:
  300 + $url = '/portal/region/getFutureDetail';
  301 + break;
  302 + case CityCategoryModel::qlxc:
  303 + $url = '/portal/enjoy/getEnjoyDetail';
  304 + break;
  305 + case CityCategoryModel::sjmy:
  306 + $url = '/portal/enjoy/getEnjoyDetail';
  307 + break;
  308 + case CityCategoryModel::stsy:
  309 + $url = '/portal/enjoy/getEnjoyDetail';
  310 + break;
  311 + case CityCategoryModel::hwtt:
  312 + $url = '/portal/enjoy/getEnjoyDetail';
  313 + break;
  314 + case CityCategoryModel::lylx:
  315 + $url = '/portal/scout/getTravelDetail';
  316 + break;
  317 + case CityCategoryModel::ddfw:
  318 + $url = '/portal/scout/getSceneryDetail';
  319 + break;
  320 + case CityCategoryModel::cysj:
  321 + $url = '/portal/scout/getSceneryDetail';
  322 + break;
  323 + case CityCategoryModel::yjyr:
  324 + $url = '/portal/scout/getSceneryDetail';
  325 + break;
  326 + default:
  327 + }
  328 + return $url;
  329 + }
  330 +
209 //第三方微信登录 331 //第三方微信登录
210 public function wx_login(){ 332 public function wx_login(){
211 $config = Config::get('wx_login'); 333 $config = Config::get('wx_login');
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <title>星球故事更多</title> 8 <title>星球故事更多</title>
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap4.0.css"> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap4.0.css">
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css"> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css">
  11 + <link rel="stylesheet" href="__TMPL__/public/assets/css/audio.css">
11 </head> 12 </head>
12 13
13 <body> 14 <body>
@@ -36,7 +37,11 @@ @@ -36,7 +37,11 @@
36 </div> 37 </div>
37 <!-- 进度条 --> 38 <!-- 进度条 -->
38 <div class="show_index_progress"> 39 <div class="show_index_progress">
39 - <img src="__TMPL__/public/assets/starImg/aicon_15.png" alt=""> 40 + <notempty name="vo.audio">
  41 + <audio src="{:cmf_get_file_download_url($vo.audio)}"></audio>
  42 + <else/>
  43 + <audio src="http://link.hhtjim.com/163/442869240.mp3"></audio>
  44 + </notempty>
40 </div> 45 </div>
41 </div> 46 </div>
42 </volist> 47 </volist>
@@ -51,6 +56,26 @@ @@ -51,6 +56,26 @@
51 <include file="public@footer"/> 56 <include file="public@footer"/>
52 <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> 57 <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
53 <script src="__TMPL__/public/assets/js/public.js"></script> 58 <script src="__TMPL__/public/assets/js/public.js"></script>
  59 + <script src="__TMPL__/public/assets/js/k-audio.js"></script>
  60 + <script>
  61 + $('audio').each(function() {
  62 + var a = new kac(this, 800, 40, "https://raw.githubusercontent.com/KIPI-C/k-audio.js/master/22.lrc", true);
  63 + a.style("#E1E1E6");
  64 + });
  65 + // 获取所有audios
  66 + var audios = document.getElementsByTagName("audio");
  67 + // 暂停函数
  68 + function pauseAll() {
  69 + var self = this;
  70 + [].forEach.call(audios, function(i) {
  71 +// 将audios中其他的audio全部暂停
  72 + i !== self && i.pause();
  73 + })
  74 + }
  75 + // 给play事件绑定暂停函数
  76 + [].forEach.call(audios, function(i) {
  77 + i.addEventListener("play", pauseAll.bind(i));
  78 + });
  79 + </script>
54 </body> 80 </body>
55 -  
56 </html> 81 </html>
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <title>星域秀场</title> 8 <title>星域秀场</title>
9 <link rel="stylesheet" href="__TMPL__/public/assets/js/swiper4/swiper.min.css"> 9 <link rel="stylesheet" href="__TMPL__/public/assets/js/swiper4/swiper.min.css">
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css"> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css">
  11 + <link rel="stylesheet" href="__TMPL__/public/assets/css/audio.css">
11 <style> 12 <style>
12 .slide-image{ 13 .slide-image{
13 width:260px; 14 width:260px;
@@ -19,55 +20,30 @@ @@ -19,55 +20,30 @@
19 .swiper-button-prev2,.swiper-button-next2{ 20 .swiper-button-prev2,.swiper-button-next2{
20 outline:none; 21 outline:none;
21 } 22 }
22 - .kc-body {  
23 - margin: 0 !important;  
24 - }  
25 - .kc-lrctable {  
26 - width: 0 !important;  
27 - }  
28 - .kc-playlog,  
29 - .kc-pauselog {  
30 - width: 30px !important;  
31 - height: 30px !important;  
32 - margin-top: 10px !important;  
33 - }  
34 - .kc-rangeloadli {  
35 - border-radius: 2px;  
36 - background-color: #5B5B6B !important;  
37 - }  
38 - .kc-rangeli {  
39 - border-radius: 2px;  
40 - background-color: #CCCCD1 !important;  
41 - }  
42 - .kc-infbody {  
43 - display: none;  
44 - }  
45 - .kc-soundbody {  
46 - display: none;  
47 - }  
48 - .kc-rangep {  
49 - position: absolute !important;  
50 - top: -6px !important;  
51 - z-index: 11;  
52 - width: 14px !important;  
53 - height: 14px !important;  
54 - background: white;  
55 - border: 1px solid rgba(207, 207, 207, 1);  
56 - border-radius: 50% !important; 23 +
  24 + .hl_index{
  25 + overflow: hidden;
  26 + float: left;
  27 + margin-top: 11px;
57 } 28 }
58 - .kc-rangebody {  
59 - top: -45% !important; 29 + .hl_index span {
  30 + width: 8px;
  31 + height: 8px;
  32 + float: left;
  33 + background: rgba(255, 255, 255, 1);
  34 + opacity: 0.6;
  35 + display: inline-block;
  36 + border-radius: 50%;
  37 + margin-right: 6px;
60 } 38 }
61 - .kc-playlog,  
62 - .kc-pauselog {  
63 - margin-left: 45px !important;  
64 - z-index: 99; 39 + .swiper-button-prev2{
  40 + margin-right: 6px;
65 } 41 }
66 - .kc-rangebody {  
67 - left: 100px !important; 42 + .hl_index .first {
  43 + background: #09FF8E;
68 } 44 }
69 - .k-body {  
70 - border-radius: 0 !important; 45 + .swiper-button-disabled2 {
  46 + background-color: white !important;
71 } 47 }
72 </style> 48 </style>
73 </head> 49 </head>
@@ -146,7 +122,11 @@ @@ -146,7 +122,11 @@
146 </div> 122 </div>
147 <!-- 进度条 --> 123 <!-- 进度条 -->
148 <div class="show_index_progress"> 124 <div class="show_index_progress">
149 - <audio src="{:cmf_get_file_download_url($vo.audio)}"></audio> 125 + <notempty name="vo.audio">
  126 + <audio src="{:cmf_get_file_download_url($vo.audio)}"></audio>
  127 + <else/>
  128 + <audio src="http://link.hhtjim.com/163/442869240.mp3"></audio>
  129 + </notempty>
150 <!--<img src="__TMPL__/public/assets/starImg/aicon_15.png" alt="">--> 130 <!--<img src="__TMPL__/public/assets/starImg/aicon_15.png" alt="">-->
151 </div> 131 </div>
152 </div> 132 </div>
@@ -156,7 +136,10 @@ @@ -156,7 +136,10 @@
156 <div class="show_swiper2_btn clearfix"> 136 <div class="show_swiper2_btn clearfix">
157 <div class="show_swiper2_btn22"> 137 <div class="show_swiper2_btn22">
158 <div class="swiper-button-prev2"></div> 138 <div class="swiper-button-prev2"></div>
159 - <div class="swiper-pagination"> 139 + <div class="hl_index">
  140 + <volist name="res_xqgs" id="vo">
  141 + <span></span>
  142 + </volist>
160 </div> 143 </div>
161 <div class="swiper-button-next2"></div> 144 <div class="swiper-button-next2"></div>
162 145
@@ -302,13 +285,59 @@ @@ -302,13 +285,59 @@
302 <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> 285 <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script>
303 <script src="__TMPL__/public/assets/js/public.js"></script> 286 <script src="__TMPL__/public/assets/js/public.js"></script>
304 <script src="__TMPL__/public/assets/js/k-audio.js"></script> 287 <script src="__TMPL__/public/assets/js/k-audio.js"></script>
305 - <script src="__TMPL__/public/assets/js/k-color.js"></script>  
306 <script> 288 <script>
  289 + var index = 0;
  290 + $(window).ready(function() {
  291 + if (index == 0) {
  292 + $('.swiper-button-prev2').addClass('swiper-button-disabled2');
  293 + }
  294 + });
  295 + // 轮播图
  296 + $('.hl_index span:first-child').addClass('first');
  297 + $('.swiper-button-next2').click(function() {
  298 + index++;
  299 + if (index == $('.swiper-container2 .swiper-wrapper .swiper-slide').length) {
  300 + index = $('.swiper-container2 .swiper-wrapper .swiper-slide').length - 1
  301 + }
  302 + $(".swiper-container2 .swiper-wrapper").animate({
  303 + "left": -1200 * index
  304 + }, 300);
  305 + $(".hl_index span").eq(index).css("background-color", "#09FF8E")
  306 + .siblings().css("background-color", "#FFFFFF");
  307 + if (index == $('.swiper-container2 .swiper-wrapper .swiper-slide').length - 1) {
  308 + $('.swiper-button-next2').addClass('swiper-button-disabled2');
  309 + $('.swiper-button-prev2').removeClass('swiper-button-disabled2');
  310 + } else if (index <= $('.swiper-container2 .swiper-wrapper .swiper-slide').length - 1) {
  311 + $('.swiper-button-next2').removeClass('swiper-button-disabled2');
  312 + $('.swiper-button-prev2').removeClass('swiper-button-disabled2');
  313 + } else {
  314 + $('.swiper-button-next2').removeClass('swiper-button-disabled2');
  315 + }
  316 + });
  317 + $(".swiper-button-prev2").click(function() {
  318 + if (index == 0) {
  319 + index = 0;
  320 + } else {
  321 + index--;
  322 + }
  323 + $(".swiper-container2 .swiper-wrapper").animate({
  324 + "left": -1200 * index
  325 + }, 300);
  326 + $(".hl_index span").eq(index).css("background-color", "#09FF8E")
  327 + .siblings().css("background-color", "#FFFFFF");
  328 + if (index == 0) {
  329 + $('.swiper-button-prev2').addClass('swiper-button-disabled2');
  330 + $('.swiper-button-next2').removeClass('swiper-button-disabled2');
  331 + } else if (index <= $('.swiper-container2 .swiper-wrapper .swiper-slide').length - 1) {
  332 + $('.swiper-button-next2').removeClass('swiper-button-disabled2');
  333 + $('.swiper-button-prev2').removeClass('swiper-button-disabled2');
  334 + } else {
  335 + $('.swiper-button-prev2').removeClass('swiper-button-disabled2');
  336 + }
  337 + });
307 $('audio').each(function() { 338 $('audio').each(function() {
308 var a = new kac(this, 800, 40, "https://raw.githubusercontent.com/KIPI-C/k-audio.js/master/22.lrc", true); 339 var a = new kac(this, 800, 40, "https://raw.githubusercontent.com/KIPI-C/k-audio.js/master/22.lrc", true);
309 a.style("#E1E1E6"); 340 a.style("#E1E1E6");
310 - // var b = new kac(this, 800, 40, "https://raw.githubusercontent.com/KIPI-C/k-audio.js/master/2U.lrc");  
311 - // b.style("#E1E1E6");  
312 }); 341 });
313 // 获取所有audios 342 // 获取所有audios
314 var audios = document.getElementsByTagName("audio"); 343 var audios = document.getElementsByTagName("audio");
@@ -335,19 +364,19 @@ @@ -335,19 +364,19 @@
335 }, 364 },
336 }); 365 });
337 // 星球故事swiper 366 // 星球故事swiper
338 - var swiper = new Swiper('.swiper-container2', {  
339 - slidesPerView: 1,  
340 - spaceBetween: 30,  
341 - // loop: true,  
342 - pagination: {  
343 - el: '.swiper-pagination',  
344 - clickable: true,  
345 - },  
346 - navigation: {  
347 - nextEl: '.swiper-button-next2',  
348 - prevEl: '.swiper-button-prev2',  
349 - },  
350 - }); 367 +// var swiper = new Swiper('.swiper-container2', {
  368 +// slidesPerView: 1,
  369 +// spaceBetween: 30,
  370 +// // loop: true,
  371 +// pagination: {
  372 +// el: '.swiper-pagination',
  373 +// clickable: true,
  374 +// },
  375 +// navigation: {
  376 +// nextEl: '.swiper-button-next2',
  377 +// prevEl: '.swiper-button-prev2',
  378 +// },
  379 +// });
351 380
352 // banner视频 381 // banner视频
353 // var video = document.getElementById("video"); 382 // var video = document.getElementById("video");
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <title>星球奇境</title> 8 <title>星球奇境</title>
9 <link rel="stylesheet" href="__TMPL__/public/assets/js/swiper4/swiper.min.css" /> 9 <link rel="stylesheet" href="__TMPL__/public/assets/js/swiper4/swiper.min.css" />
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/happy_index.css" /> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/happy_index.css" />
  11 + <link rel="stylesheet" href="__TMPL__/public/assets/css/audio.css">
11 </head> 12 </head>
12 13
13 <body> 14 <body>
@@ -61,7 +62,12 @@ @@ -61,7 +62,12 @@
61 </div> 62 </div>
62 <!-- 进度条 --> 63 <!-- 进度条 -->
63 <div class="show_index_progress"> 64 <div class="show_index_progress">
64 - <img src="__TMPL__/public/assets/starImg/aicon_15.png" alt=""> 65 + <notempty name="res_xqgs.audio">
  66 + <audio src="{:cmf_get_file_download_url($res_xqgs.audio)}"></audio>
  67 + <else/>
  68 + <audio src="http://link.hhtjim.com/163/442869240.mp3"></audio>
  69 + </notempty>
  70 +
65 </div> 71 </div>
66 </div> 72 </div>
67 </div> 73 </div>
@@ -260,7 +266,26 @@ @@ -260,7 +266,26 @@
260 <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script> 266 <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
261 <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script> 267 <script src="__TMPL__/public/assets/js/swiper4/swiper.min.js"></script>
262 <script src="__TMPL__/public/assets/js/public.js"></script> 268 <script src="__TMPL__/public/assets/js/public.js"></script>
  269 + <script src="__TMPL__/public/assets/js/k-audio.js"></script>
263 <script> 270 <script>
  271 + $('audio').each(function() {
  272 + var a = new kac(this, 800, 40, "https://raw.githubusercontent.com/KIPI-C/k-audio.js/master/22.lrc", true);
  273 + a.style("#E1E1E6");
  274 + });
  275 + // 获取所有audios
  276 + var audios = document.getElementsByTagName("audio");
  277 + // 暂停函数
  278 + function pauseAll() {
  279 + var self = this;
  280 + [].forEach.call(audios, function(i) {
  281 +// 将audios中其他的audio全部暂停
  282 + i !== self && i.pause();
  283 + })
  284 + }
  285 + // 给play事件绑定暂停函数
  286 + [].forEach.call(audios, function(i) {
  287 + i.addEventListener("play", pauseAll.bind(i));
  288 + });
264 // swiper 289 // swiper
265 var swiper = new Swiper(".swiper-container", { 290 var swiper = new Swiper(".swiper-container", {
266 slidesPerView: 4, 291 slidesPerView: 4,
  1 +.kc-body {
  2 + margin: 0 !important;
  3 +}
  4 +.kc-lrctable {
  5 + width: 0 !important;
  6 +}
  7 +.kc-playlog,
  8 +.kc-pauselog {
  9 + width: 30px !important;
  10 + height: 30px !important;
  11 + margin-top: 10px !important;
  12 +}
  13 +.kc-rangeloadli {
  14 + border-radius: 2px;
  15 + background-color: #5B5B6B !important;
  16 +}
  17 +.kc-rangeli {
  18 + border-radius: 2px;
  19 + background-color: #CCCCD1 !important;
  20 +}
  21 +.kc-infbody {
  22 + display: none;
  23 +}
  24 +.kc-soundbody {
  25 + display: none;
  26 +}
  27 +.kc-rangep {
  28 + position: absolute !important;
  29 + top: -6px !important;
  30 + z-index: 11;
  31 + width: 14px !important;
  32 + height: 14px !important;
  33 + background: white;
  34 + border: 1px solid rgba(207, 207, 207, 1);
  35 + border-radius: 50% !important;
  36 +}
  37 +.kc-rangebody {
  38 + top: -45% !important;
  39 +}
  40 +.kc-playlog,
  41 +.kc-pauselog {
  42 + margin-left: 45px !important;
  43 + z-index: 99;
  44 +}
  45 +.kc-rangebody {
  46 + left: 100px !important;
  47 +}
  48 +.k-body {
  49 + border-radius: 0 !important;
  50 +}
  51 +.kc-lrctable{
  52 + display: none;
  53 +}
@@ -132,6 +132,12 @@ $(function(){ @@ -132,6 +132,12 @@ $(function(){
132 $('#about_us').click(function(){ 132 $('#about_us').click(function(){
133 window.location.href = '/portal/index/aboutUs'; 133 window.location.href = '/portal/index/aboutUs';
134 }); 134 });
  135 + //搜索
  136 + $("#keywords").keypress(function (e) {
  137 + if (e.which == 13) {
  138 + $("#searchForm").submit();//处理事件
  139 + }
  140 + });
135 }); 141 });
136 142
137 //点赞收藏 143 //点赞收藏
@@ -37,10 +37,12 @@ @@ -37,10 +37,12 @@
37 </ul> 37 </ul>
38 </section> 38 </section>
39 <!-- 搜索框 --> 39 <!-- 搜索框 -->
40 - <section class="home_search">  
41 - <i class="search_icon"></i>  
42 - <input type="text" placeholder="">  
43 - </section> 40 + <form method="GET" action="/portal/login/searchList" id="searchForm">
  41 + <section class="home_search">
  42 + <i class="search_icon"></i>
  43 + <input type="text" placeholder="" name="keyword" value="{$keyword}" id="keywords">
  44 + </section>
  45 + </form>
44 <notempty name="user"> 46 <notempty name="user">
45 <section class="home_login login_person"> 47 <section class="home_login login_person">
46 <notempty name="user.avatar"> 48 <notempty name="user.avatar">
@@ -34,6 +34,8 @@ class HomeBaseController extends BaseController @@ -34,6 +34,8 @@ class HomeBaseController extends BaseController
34 $this->getComment(); 34 $this->getComment();
35 $this->is_collection(); 35 $this->is_collection();
36 $this->is_like(); 36 $this->is_like();
  37 + $keyword = $this->request->param('keyword');
  38 + $this->assign('keyword',$keyword);
37 } 39 }
38 40
39 protected function _initializeView() 41 protected function _initializeView()