|
@@ -16,6 +16,10 @@ define('MOBILE_SERVER',true);
|
|
|
|
|
|
class searchControl extends mobileHomeControl
|
|
|
{
|
|
|
+ const def_history_divider = '/mobile/defimg/history_divider.png';
|
|
|
+ const def_hot_divider = '/mobile/defimg/hot_divider.png';
|
|
|
+ const def_guess_divider = '/mobile/defimg/guess_like.png';
|
|
|
+
|
|
|
public function __construct()
|
|
|
{
|
|
|
parent::__construct();
|
|
@@ -176,17 +180,17 @@ class searchControl extends mobileHomeControl
|
|
|
$blocks = [];
|
|
|
if(!empty($history))
|
|
|
{
|
|
|
- $blocks[] = special_formater::format_keyword($history,'历史搜索');
|
|
|
if($_SESSION['is_lasted']) {
|
|
|
- $blocks[] = special_formater::def_divider();
|
|
|
+ $blocks[] = self::history_divider();
|
|
|
}
|
|
|
+ $blocks[] = special_formater::format_keyword($history,'历史搜索');
|
|
|
}
|
|
|
if(!empty($hot_search))
|
|
|
{
|
|
|
- $blocks[] = special_formater::format_keyword($hot_search,'热门搜索');
|
|
|
if($_SESSION['is_lasted']) {
|
|
|
- $blocks[] = special_formater::def_divider();
|
|
|
+ $blocks[] = self::hot_divider();
|
|
|
}
|
|
|
+ $blocks[] = special_formater::format_keyword($hot_search,'热门搜索');
|
|
|
}
|
|
|
|
|
|
$guslike = $this->guesslike();
|
|
@@ -198,7 +202,11 @@ class searchControl extends mobileHomeControl
|
|
|
else
|
|
|
{
|
|
|
$gus_blocks = $guslike['special_list'];
|
|
|
- if(!empty($gus_blocks)) {
|
|
|
+ if(!empty($gus_blocks))
|
|
|
+ {
|
|
|
+ if($_SESSION['is_lasted']) {
|
|
|
+ $blocks[] = self::guess_divider();
|
|
|
+ }
|
|
|
$blocks[] = $gus_blocks[0];
|
|
|
}
|
|
|
|
|
@@ -209,6 +217,52 @@ class searchControl extends mobileHomeControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static function history_divider()
|
|
|
+ {
|
|
|
+ static $block = [];
|
|
|
+ if(empty($block))
|
|
|
+ {
|
|
|
+ $block['item_type'] = 'divider';
|
|
|
+ $block['item_title'] = '';
|
|
|
+ $block['bg_type'] = 'image';
|
|
|
+ $image = RESOURCE_SITE_URL . self::def_history_divider;
|
|
|
+ $block['bg_data'] = $image;
|
|
|
+ $block['has_margin'] = false;
|
|
|
+ $block['scale'] = special_formater::scale($image);
|
|
|
+ }
|
|
|
+ return $block;
|
|
|
+ }
|
|
|
+ private static function hot_divider()
|
|
|
+ {
|
|
|
+ static $block = [];
|
|
|
+ if(empty($block))
|
|
|
+ {
|
|
|
+ $block['item_type'] = 'divider';
|
|
|
+ $block['item_title'] = '';
|
|
|
+ $block['bg_type'] = 'image';
|
|
|
+ $image = RESOURCE_SITE_URL . self::def_hot_divider;
|
|
|
+ $block['bg_data'] = $image;
|
|
|
+ $block['has_margin'] = false;
|
|
|
+ $block['scale'] = special_formater::scale($image);
|
|
|
+ }
|
|
|
+ return $block;
|
|
|
+ }
|
|
|
+ private static function guess_divider()
|
|
|
+ {
|
|
|
+ static $block = [];
|
|
|
+ if(empty($block))
|
|
|
+ {
|
|
|
+ $block['item_type'] = 'divider';
|
|
|
+ $block['item_title'] = '';
|
|
|
+ $block['bg_type'] = 'image';
|
|
|
+ $image = RESOURCE_SITE_URL . self::def_guess_divider;
|
|
|
+ $block['bg_data'] = $image;
|
|
|
+ $block['has_margin'] = false;
|
|
|
+ $block['scale'] = special_formater::scale($image);
|
|
|
+ }
|
|
|
+ return $block;
|
|
|
+ }
|
|
|
+
|
|
|
public function guesslike()
|
|
|
{
|
|
|
// $goodslist = Model('goods_browse')->getGuessLikeGoods($_SESSION['member_id'],10);
|