联系官方销售客服
1835022288
028-61286886
插件 | 建站系统 V3.16 |
应用作者 | 迅睿官方团队 |
发布时间 | 2022-03-01 15:30:06 |
更新时间 | 2024-11-11 14:53:11 |
搜索框搜索访问url地址出差
index.php?keyword=测试
index.php?s=shop&c=search&keyword=测试&catid=15
为什么使用搜索Router::search_url()函数 有时会出现第一种url地址无法访问,而出现第二种就能够访问
header部分搜索框
/template/pc/deale2/home/herder.html
搜索框
<!DOCTYPE html> <html dir="ltr" lang="en"> <head> <title>{$meta_title}</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="keywords" content="{$meta_keywords}" /> <meta name="description" content="{$meta_description}" /> <meta name="author" content="Mafea Deale" /> <meta name="360-site-verification" content="67bdabcecb47f3f4baaa1062e0c0c2c3" /> <meta name="baidu-site-verification" content="MOJIXsE601" /> <!-- favicon --> <link rel="icon" type="image/x-icon" href="{HOME_THEME_PATH}assets/images/favicon.png" /> <!-- Bootstrap css --> <link href="{HOME_THEME_PATH}assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <!-- Spacing css --> <link href="{HOME_THEME_PATH}assets/css/spacing.css" rel="stylesheet" type="text/css" /> <!-- Magnific Popup css --> <link href="{HOME_THEME_PATH}assets/css/magnific-popup.css" rel="stylesheet" type="text/css" /> <!-- Range Slider css --> <link rel="stylesheet" href="{HOME_THEME_PATH}assets/css/ui-range-slider.css" type="text/css" /> <!-- Slick css --> <link rel="stylesheet" href="{HOME_THEME_PATH}assets/css/slick.css" type="text/css" /> <link rel="stylesheet" href="{HOME_THEME_PATH}assets/css/flag-icons.min.css" type="text/css" /> <!-- Owl Carousel css --> <link href="{HOME_THEME_PATH}assets/js/owl-carousel/owl.carousel.min.css" rel="stylesheet" type="text/css" /> <!-- <link href="{HOME_THEME_PATH}assets/js/owl-carousel/owl.theme.default.min.css" rel="stylesheet" type="text/css"> --> <!-- Style css --> <link href="{HOME_THEME_PATH}assets/css/style.css" rel="stylesheet" type="text/css" /> <link href="{HOME_THEME_PATH}assets/css/style2.css" rel="stylesheet" type="text/css" /> <!-- 系统关键js(所有自建模板必须引用) --> <script type="text/javascript"> var assets_path = "{THEME_PATH}assets/"; var is_mobile_cms = "{IS_MOBILE}"; </script> <script src="{LANG_PATH}lang.js" type="text/javascript"></script> <script src="{THEME_PATH}assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="{THEME_PATH}assets/js/cms.js" type="text/javascript"></script> <!-- 系统关键js结束 --> </head> <body> <!--Start Header--> <header class="header-style2"> <div class="top-header bg-primary"> <div class="container"> <div class="row"> <div class="col-md-6 col-4"> <div class="top-contact-left"> <ul class="contact-info list-inline-block"> {content module=ymzd id=1 return=cc} <li> <a href="mailto:support@company.com" class="text-white"><i class="ti-email"></i> <span>{$cc.dhldbyx}</span></a> </li> <li> <a href="tel:+0123456789" class="text-white"><i class="icon-phone icons"></i> <span>{$cc.dhldbdh}</span></a> </li> {/content} </ul> </div> </div> <!--/.col-md-6--> <div class="col-md-6 col-8"> <div class="top-right-social"> <ul class="social-icons text-right icon-small-plane icon-color-white hover-color-white ignore"> <li><a id="translateLink" href="javascript:translatePage();">繁</a></li> <li> <a href="\"><span class="fi fi-cn language-active"></span></a> </li> <li> <a href="\"><span class="fi fi-us"></span></a> </li> <li> <a href="\"> <span class="fi fi-ru"></span></a> </li> </ul> </div> </div> <!--/.col-md-6--> </div> </div> </div> <!--/.top-header--> <div class="main-menu"> <nav class="navbar navbar-default background-white header-light navbar-top navbar-expand-lg nav-box-width"> <div class="container nav-header-container"> <div class="col-auto logo-col"> <a href="/" class="logo"> <img src="{SITE_LOGO}" alt="company" /> </a> </div> <div class="col-auto menu-wrap ms-auto"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-collapse-toggle" aria-expanded="false" aria-label="Toggle navigation" > <span class="navbar-toggler-icon"><i class="ti-align-justify"></i></span> </button> <div class="navbar-collapse collapse" id="navbar-collapse-toggle"> <ul class="nav navbar-nav navbar-left" data-in="fadeIn" data-out="fadeOut"> {content module=ymzd id=1 return=cc} <a href="/" style="padding: 30px 0px; font-weight: 600; color: black">{$cc.dhlsywz}</a> {/content} {category module=share pid=0} <li class="dropdown"> <a href="{$t.url}">{$t.name}</a> <i class="dropdown-toggle fa fa-angle-down" data-bs-toggle="dropdown"></i> {if $t.child} <ul class="dropdown-menu" role="menu"> {category module=share pid=$t.id return=t2} <li> <a href="{$t2.url}" target="_blank">{$t2.name}</a> </li> {/category} </ul> {/if} </li> {/category} </ul> </div> </div> <div class="col-auto right-menu-col"> <ul class="right-menu"> {if $top.id!=13} {if $top.id!=18} <li class="search-icon"> <i class="ti-search"></i> </li> {/if} {/if} </ul> </div> <div class="col-auto btn-col-header"> {content module=ymzd id=1 return=cc} <a href="{dr_share_cat_value(59,'url')}" class="btn btn-primary ml-30">{$cc.dhlanwz}</a> {/content} </div> <div class="search-form d-none"> <form> <input type="text" name="keyword" placeholder="请输入" class="form-control" value="{$keyword}" id="search_keyword" /> <button type="button" class="search-button" onclick="dr_module_searchss()"> <i class="ti-search"></i> </button> <script> function dr_module_searchss(name) { {if $indexc} var url = "{Router::search_url($params, 'keyword', 'xbmbdy','shop')}"; {else} var url = "{Router::search_url($params, 'keyword', 'xbmbdy')}"; {/if} var val = $("#search_keyword").val(); if (val) { url = url.replace("xbmbdy", val); } else { url = url.replace("xbmbdy", ""); } location.href = url{if $indexc}+"&catid=15" {/if}; return false; } </script> </form> <a href="#" class="search-close-btn"><i class="ti-close"></i></a> </div> </div> </nav> </div> </header> <!--End Header--> <!-- prettier-ignore -->