关键字

feat/task1-c-wallet
gongfuxiang 2018-10-21 00:03:32 +08:00
parent 2779ba0ee0
commit e2a4891d64
19 changed files with 223 additions and 33 deletions

View File

@ -52,6 +52,9 @@ class ConfigController extends CommonController
// 是否
$this->assign('common_is_text_list', L('common_is_text_list'));
// 热门搜索关键字
$this->assign('common_search_keywords_type_list', L('common_search_keywords_type_list'));
// 配置信息
$data = M('Config')->getField('only_tag,name,describe,value,error_tips');
$this->assign('data', $data);

View File

@ -49,6 +49,18 @@
<label>{{$data.common_user_center_notice.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_user_center_notice.describe}}</span></label>
<textarea rows="3" name="{{$data.common_user_center_notice.only_tag}}" class="am-radius" placeholder="{{$data.common_user_center_notice.name}}" data-validation-message="{{$data.common_user_center_notice.error_tips}}"><present name="data">{{$data.common_user_center_notice.value}}</present></textarea>
</div>
<div class="am-form-group">
<label>{{$data.home_search_keywords_type.name}}</label>
<select name="{{$data.home_search_keywords_type.only_tag}}" class="am-radius chosen-select c-p" data-validation-message="{{$data.home_search_keywords_type.error_tips}}">
<foreach name="common_search_keywords_type_list" item="v">
<option value="{{$v.value}}" <if condition="isset($data['home_search_keywords_type']['value']) and $data['home_search_keywords_type']['value'] eq $v['value']">selected</if>>{{$v.name}}</option>
</foreach>
</select>
</div>
<div class="am-form-group">
<label>{{$data.home_search_keywords.name}}<span class="fs-12 fw-100 cr-999">{{$data.home_search_keywords.describe}}</span></label>
<input type="text" name="{{$data.home_search_keywords.only_tag}}" placeholder="{{$data.home_search_keywords.describe}}" data-validation-message="{{$data.home_search_keywords.error_tips}}" class="am-radius" data-am-tagsinput <present name="data"> value="{{$data.home_search_keywords.value}}"</present> />
</div>
<div class="am-form-group">
<label>{{$data.common_baidu_map_ak.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_baidu_map_ak.describe}}</span></label>
<input type="text" name="{{$data.common_baidu_map_ak.only_tag}}" placeholder="{{$data.common_baidu_map_ak.describe}}" data-validation-message="{{$data.common_baidu_map_ak.error_tips}}" class="am-radius" <present name="data"> value="{{$data.common_baidu_map_ak.value}}"</present> />

View File

@ -24,6 +24,7 @@
<js href="__PUBLIC__/Common/Lib/amazeui-switch/amazeui.switch.min.js" />
<js href="__PUBLIC__/Common/Lib/amazeui-chosen/amazeui.chosen.min.js" />
<js href="__PUBLIC__/Common/Lib/amazeui-dialog/amazeui.dialog.min.js" />
<js href="__PUBLIC__/Common/Lib/amazeui-tagsinput/amazeui.tagsinput.min.js" />
<!-- 日期组件 -->
<js href="__PUBLIC__/Common/Lib/My97DatePicker/WdatePicker.js" />

View File

@ -8,6 +8,7 @@
<css href="__PUBLIC__/Common/Lib/assets/css/amazeui.css" />
<css href="__PUBLIC__/Common/Lib/amazeui-switch/amazeui.switch.css" />
<css href="__PUBLIC__/Common/Lib/amazeui-chosen/amazeui.chosen.css" />
<css href="__PUBLIC__/Common/Lib/amazeui-tagsinput/amazeui.tagsinput.css" />
<css href="__PUBLIC__/Common/Css/Common.css" />
<css href="__PUBLIC__/Admin/{{$default_theme}}/Css/Common.css" />
<if condition="!empty($module_css)">

View File

@ -513,6 +513,13 @@ return array(
1 => array('value' => 1, 'name' => '已评价'),
),
// 搜索框下热门关键字类型
'common_search_keywords_type_list' => array(
0 => array('value' => 0, 'name' => '关闭'),
1 => array('value' => 1, 'name' => '自动'),
2 => array('value' => 2, 'name' => '自定义'),
),
// 色彩值

View File

@ -7,6 +7,7 @@ use Service\GoodsService;
use Service\NavigationService;
use Service\BuyService;
use Service\MessageService;
use Service\ResourcesService;
/**
* 前台
@ -170,6 +171,19 @@ class CommonController extends Controller
$common_message_total = MessageService::UserMessageTotal($params);
$this->assign('common_message_total', ($common_message_total > 99) ? '99+' : $common_message_total);
// 搜索框下热门关键字
$home_search_keywords = [];
switch(intval(MyC('home_search_keywords_type', 0)))
{
case 1 :
$home_search_keywords = ResourcesService::SearchKeywordsList();
break;
case 2 :
$home_search_keywords = explode(',', MyC('home_search_keywords'));
break;
}
$this->assign('home_search_keywords', $home_search_keywords);
// 当前控制器名称
$this->assign('controller_name', CONTROLLER_NAME);
}

View File

@ -31,7 +31,7 @@
<notempty name="goods.video">
<i class="am-icon-play-circle-o goods-video-submit-start"></i>
<i class="goods-video-submit-close none">&times;</i>
<video class="goods-video-container none" src="{{$goods.video}}" poster="{{$goods['photo'][0]}}" controls="controls" preload="auto">
<video class="goods-video-container none" src="{{$goods.video}}" controls="controls" preload="auto">
your browser does not support the video tag
</video>
</notempty>
@ -65,7 +65,7 @@
<notempty name="goods.video">
<i class="am-icon-play-circle-o goods-video-submit-start"></i>
<i class="goods-video-submit-close none">&times;</i>
<video class="goods-video-container none" src="{{$goods.video}}" poster="{{$goods['photo'][0]}}" controls="controls" preload="auto">
<video class="goods-video-container none" src="{{$goods.video}}" controls="controls" preload="auto">
your browser does not support the video tag
</video>
</notempty>

View File

@ -11,10 +11,17 @@
</a>
</div>
<div class="search-bar pr">
<div class="search-bar">
<form action="{{:U('Home/Search/Index')}}" method="POST">
<input id="search-input" name="keywords" type="text" placeholder="{{:L('common_so_tips')}}" value="<if condition="!empty($params['keywords'])">{{$params.keywords}}</if>" autocomplete="off" />
<input id="ai-topsearch" class="submit am-btn" placeholder="{{:L('common_so_tips')}}" index="1" type="submit" value="{{:L('common_so_text')}}" />
<notempty name="home_search_keywords">
<ul class="search-hot-keywords am-hide-sm-only">
<foreach name="home_search_keywords" item="v">
<li><a href="{{:U('Home/Search/Index', ['keywords'=>$v])}}" target="_blank">{{$v}}</a></li>
</foreach>
</ul>
</notempty>
</form>
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -172,5 +172,18 @@ class ResourcesService
return M('Region')->where($where)->field($field)->order('id asc, sort asc')->select();
}
/**
* [SearchKeywordsList 获取热门关键字列表]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-10-20T23:55:06+0800
* @param [array] $params [输入参数]
*/
public function SearchKeywordsList($params = [])
{
return ['自动的', '自动2'];
}
}
?>

View File

@ -28,13 +28,18 @@
.chosen-container { width: 100% !important; }
.chosen-choices, .chosen-single { border-radius: 2px; }
.chosen-choices li.search-field input[type="text"] { height: 28px !important; }
.chosen-choices li.search-field input[type="text"]:hover { box-shadow: 0 0 0 #fff !important; }
.chosen-choices li.search-field input[type="text"]:focus { border-color: #fff; -webkit-box-shadow: inset 0 0 0 0 !important; box-shadow: inset 0 0 0 0 !important; }
.chosen-choices li.search-field input[type="text"]:hover,
.am-tagsinput input[type="text"]:hover { box-shadow: 0 0 0 #fff !important; border: 0 !important; }
.chosen-choices li.search-field input[type="text"]:focus,
.am-tagsinput input[type="text"]:focus { border-color: #fff; -webkit-box-shadow: inset 0 0 0 0 !important; box-shadow: inset 0 0 0 0 !important; }
.chosen-choices { padding: 0px 3px !important; min-height: 32px; }
.chosen-container-single .chosen-single { height: 32px; line-height: 32px; }
.chosen-container-multi .chosen-choices li.search-field { padding-left: 3px; }
.chosen-container-single .chosen-single { color: #444 !important; }
.chosen-container-single .chosen-default { color: #999 !important; }
.am-tagsinput { display: block; }
.am-tagsinput { padding: 0 5px 5px 5px; }
.am-tagsinput .tag { margin-top: 5px; }
/**
*

View File

@ -0,0 +1,11 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

View File

@ -0,0 +1,103 @@
{
"env": {
"browser": true,
"node": true
},
"rules": {
// Strict Mode
// @see http://eslint.org/docs/rules/strict
"strict": [
2,
"safe"
],
// Variables
// @see http://eslint.org/docs/rules/#variables
"no-undef": 2,
"no-unused-vars": 2,
// Possible Errors
// @see http://eslint.org/docs/rules/#possible-errors
"comma-dangle": [2, "never"],
"no-empty": [2, {"allowEmptyCatch": true}],
// Best Practices
// @see http://eslint.org/docs/rules/#best-practices
"curly": 2,
"dot-notation": 2,
"no-caller": 2,
"no-multi-str": 2,
"no-unused-expressions": [2, {
"allowShortCircuit": true,
"allowTernary": true
}],
"no-with": 2,
"wrap-iife": [
2,
"any"
],
// Stylistic Issues
// @see http://eslint.org/docs/rules/#stylistic-issues
"array-bracket-spacing": [2, "never"],
"camelcase": [2, {
"properties": "always"
}],
"comma-style": [2, "last"],
"eol-last": 2,
"keyword-spacing": [
2,
{
"before": true,
"after": true,
"overrides": {}}
],
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"linebreak-style": [2, "unix"],
"max-len": [
2,
80,
2,
{
"ignoreUrls": true
}
],
"new-cap": [2, {
"capIsNewExceptions": [
"$.Event"
]
}],
"no-bitwise": 2,
"no-mixed-spaces-and-tabs": 2,
"no-trailing-spaces": [2, {"skipBlankLines": true }],
"one-var": [2, "never"],
"quotes": [
2,
"single",
{"avoidEscape": true, "allowTemplateLiterals": true}
],
"quote-props": [2, "as-needed"],
"semi": ["error", "always"],
"spaced-comment": ["error", "always"],
"space-before-function-paren": [2, {
"anonymous": "never",
"named": "never"
}],
"space-in-parens": [2, "never"],
"space-infix-ops": [2, {"int32Hint": true}],
"space-unary-ops": [
2, {
// `words` applies to unary word operators,
// such as: new, delete, typeof, void, yield
"words": true,
// nonwords - applies to unary operators such as: -, +, --, ++, !, !!
"nonwords": false
}]
}
}

View File

@ -0,0 +1,2 @@
node_modules
dist

View File

@ -0,0 +1,12 @@
.DS_Store
node_modules
.idea
dist
docs
gulpfile.js
.editorconfig
.gitignore
.jshintrc
.npmignore
bower.json
.*

View File

@ -0,0 +1 @@
.am-tagsinput{display:inline-block;margin-bottom:1rem;padding:.5em .625em;font-size:1.6rem;line-height:1.2;color:#555;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0;-webkit-appearance:none;max-width:100%;cursor:text}.am-tagsinput .tag{margin-right:2px;font-size:13px;line-height:20px;padding:0 .5em;color:#fff}.am-tagsinput .tag [data-role="remove"]{margin-left:5px;cursor:pointer}.am-tagsinput .tag [data-role="remove"]:after{content:"x";padding:0 3px}.am-tagsinput .tag [data-role="remove"]:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.am-tagsinput .tag [data-role="remove"]:hover:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.am-tagsinput input,.am-form .am-tagsinput input{display:inline-block;border:none;-webkit-box-shadow:none;box-shadow:none;outline:none;background-color:transparent;padding:0;margin:0;width:auto!important;max-width:inherit;height:20px;line-height:20px}.am-tagsinput input:focus,.am-form .am-tagsinput input:focus{border:none;-webkit-box-shadow:none;box-shadow:none}.am-form-group .am-tagsinput{margin-bottom:auto}

File diff suppressed because one or more lines are too long

View File

@ -83,9 +83,13 @@ color: #555555;background:none;border-color:transparent;cursor: default;}
/*搜索框*/
.search-bar{height:36px; width: calc(100% - 103px); display: -webkit-inline-box;}
.search-bar form{border:2px solid #d2364c; width:100%;}
.search-bar input{padding-left:5px;height:32px;width:78%;outline:none; font-size:12px; border:none}
.search-bar input{height:32px;width:78%;outline:none; font-size:12px; border:none}
#search-input { padding-left: 8px; }
#ai-topsearch { width:20%;height:32px;border:none;float:right;background: #d2364c none repeat scroll 0% 0%;
color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px; }
.search-hot-keywords { margin-top: 5px; height: 16px; overflow: hidden; }
.search-hot-keywords li { float: left; }
.search-hot-keywords li:not(:last-child) { margin-right: 10px; }
/* 导航 */
.shop-nav .am-container { position: relative; }
@ -114,11 +118,6 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
.mobile-navigation li.active a{color:#d2364c ;}
.hot-icon { position: absolute; top: 1%; left: 53%; z-index: 2; border: 1px solid #fff; }
@media only screen and (max-width: 640px) {
}
@media only screen and (min-width: 640px) {
.am-container {padding-left:0px;padding-right:0px ;}
.shop-nav {position: relative;}
@ -138,7 +137,7 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
.classified{display:none;}
.mobile-navigation{display:none;}
.nav-search{ position:relative;top:0px;z-index:0;margin-bottom: 5px;margin-top: 5px;}
#ai-topsearch{ font-size:14px;height: 36px;line-height: 26px;}
#ai-topsearch{ font-size:14px;height: 36px;line-height: 22px; font-weight: 500; }
/*底部*/
.am-footer {text-align:center; display:block;position: relative;margin: 0px auto; padding: 7px 0px 9px; margin-top:20px;}
.am-footer .footer-bd p, .footer .footer-hd p {margin-bottom: 8px;line-height: 27px;border-bottom: 1px solid #DDD; text-align:left;}

File diff suppressed because one or more lines are too long