ltsecurityinc安防产品在线商城代码
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Elastic Search Base for Magento 2
|
||||
*/
|
||||
/** @var Template $block */
|
||||
/** @var Escaper $escaper */
|
||||
/** @var FurtherQueryViewModel $furtherQueryViewModel */
|
||||
|
||||
use Amasty\ElasticSearch\ViewModel\CatalogSearch\FurtherQueryViewModel;
|
||||
use Magento\Framework\Escaper;
|
||||
use Magento\Framework\View\Element\Template;
|
||||
|
||||
$furtherQueryViewModel = $block->getData('furtherQueryViewModel');
|
||||
$uniqueId = random_int(0, 10000000);
|
||||
?>
|
||||
|
||||
<section class="amelsearch-further-section"
|
||||
data-bind="
|
||||
scope: 'amelsearch_further_wrapper<?= (int) $uniqueId ?>',
|
||||
mageInit: {
|
||||
'Magento_Ui/js/core/app': {
|
||||
components: {
|
||||
'amelsearch_further_wrapper<?= (int) $uniqueId ?>': {
|
||||
component: 'Amasty_ElasticSearch/js/components/further-search',
|
||||
defaultValue: '<?= $escaper->escapeHtml($furtherQueryViewModel->getSubQueryText()) ?>',
|
||||
searchUrl: '<?= $escaper->escapeUrl($furtherQueryViewModel->getSearchUrl()) ?>'
|
||||
}
|
||||
}
|
||||
}
|
||||
}">
|
||||
<label class="amelsearch-label" for="amelsearch-further-input">
|
||||
<?= $escaper->escapeHtml(__('Search further')) ?>
|
||||
</label>
|
||||
<section class="amelsearch-form-section" data-bind="css: { '-focused': focused }">
|
||||
<input id="amelsearch-further-input"
|
||||
class="amelsearch-input"
|
||||
placeholder="<?= $escaper->escapeHtmlAttr(__('Search entire store here...')) ?>"
|
||||
type="text"
|
||||
data-bind="
|
||||
hasFocus: focused,
|
||||
value: value,
|
||||
event: {keypress: onEnter},
|
||||
valueUpdate: 'afterkeydown'"/>
|
||||
<!-- ko template: { name: templates.clear_button } --><!-- /ko-->
|
||||
<!-- ko template: { name: templates.loupe_button } --><!-- /ko-->
|
||||
<!-- ko template: { name: templates.submit_button } --><!-- /ko-->
|
||||
</section>
|
||||
</section>
|
||||
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Amasty Search Pro
|
||||
// ____________________________________________
|
||||
|
||||
@import 'module/_variables';
|
||||
|
||||
@import 'module/components/_further-block';
|
||||
@import 'module/components/_inputs';
|
||||
@import 'module/components/_buttons';
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Colors
|
||||
// ----------------------------------------------
|
||||
|
||||
@amelsearch-color__primary: #1979c2;
|
||||
|
||||
//
|
||||
// Icons
|
||||
// ----------------------------------------------
|
||||
|
||||
@amelsearch-icon__background__close: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMWwxMCAxMG0wLTEwTDEgMTEiIHN0cm9rZT0iI0IyQjJCMiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg==);
|
||||
@amelsearch-icon__background__loupe: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ni45NjYgNTYuOTY2Ij48cGF0aCBkPSJNNTUuMTQ2IDUxLjg4N0w0MS41ODggMzcuNzg2QTIyLjkyNiAyMi45MjYgMCAwIDAgNDYuOTg0IDIzYzAtMTIuNjgyLTEwLjMxOC0yMy0yMy0yM3MtMjMgMTAuMzE4LTIzIDIzIDEwLjMxOCAyMyAyMyAyM2M0Ljc2MSAwIDkuMjk4LTEuNDM2IDEzLjE3Ny00LjE2MmwxMy42NjEgMTQuMjA4Yy41NzEuNTkzIDEuMzM5LjkyIDIuMTYyLjkyLjc3OSAwIDEuNTE4LS4yOTcgMi4wNzktLjgzN2EzLjAwNCAzLjAwNCAwIDAgMCAuMDgzLTQuMjQyek0yMy45ODQgNmM5LjM3NCAwIDE3IDcuNjI2IDE3IDE3cy03LjYyNiAxNy0xNyAxNy0xNy03LjYyNi0xNy0xNyA3LjYyNi0xNyAxNy0xN3oiIGZpbGw9IiNhOWE5YTkiLz48L3N2Zz4=);
|
||||
|
||||
//
|
||||
// Indents
|
||||
// ----------------------------------------------
|
||||
|
||||
@amelsearch__indent: 10px;
|
||||
@amelsearch__indent__m: @amelsearch__indent * 2 - @amelsearch__indent / 2;
|
||||
@amelsearch__indent__l: @amelsearch__indent * 2;
|
||||
@amelsearch__indent__xl: @amelsearch__indent + @amelsearch__indent__m;
|
||||
Executable
+93
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// Buttons Component Styles
|
||||
// ______________________________________________
|
||||
|
||||
//
|
||||
// Colors
|
||||
// ----------------------------------------------
|
||||
|
||||
@amelsearch-button__color__primary: @amelsearch-color__primary;
|
||||
|
||||
//
|
||||
// Common
|
||||
// ----------------------------------------------
|
||||
|
||||
& when (@media-common = true) {
|
||||
.amelsearch-button {
|
||||
& {
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:not(.primary) {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&.-disabled {
|
||||
opacity: .7;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&.-icon {
|
||||
& {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 0;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.-close:after {
|
||||
background: @amelsearch-icon__background__close no-repeat center;
|
||||
}
|
||||
|
||||
&.-loupe:after {
|
||||
background: @amelsearch-icon__background__loupe no-repeat center;
|
||||
}
|
||||
|
||||
&.-primary {
|
||||
& {
|
||||
background-color: @amelsearch-button__color__primary;
|
||||
border-color: @amelsearch-button__color__primary;
|
||||
border-radius: 80px;
|
||||
color: #fff;
|
||||
font-size: 1.4rem;
|
||||
font-weight: 700;
|
||||
height: 32px;
|
||||
min-width: 78px;
|
||||
padding: 7px @amelsearch__indent;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: darken(@amelsearch-button__color__primary, 5%);
|
||||
border-color: darken(@amelsearch-button__color__primary, 5%);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: darken(@amelsearch-button__color__primary, 10%);
|
||||
border-color: darken(@amelsearch-button__color__primary, 10%);
|
||||
}
|
||||
|
||||
&.-disabled {
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+73
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// Further Component Styles
|
||||
// ______________________________________________
|
||||
|
||||
//
|
||||
// Common
|
||||
// ----------------------------------------------
|
||||
|
||||
& when (@media-common = true) {
|
||||
.amelsearch-further-section {
|
||||
& {
|
||||
display: none;
|
||||
margin: 0 0 40px;
|
||||
}
|
||||
|
||||
.amelsearch-label {
|
||||
display: block;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
margin: 0 0 @amelsearch__indent__l;
|
||||
}
|
||||
|
||||
.amelsearch-form-section {
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
display: inline-flex;
|
||||
max-width: 362px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.amelsearch-button.-loupe,
|
||||
.amelsearch-button.-close {
|
||||
height: 100%;
|
||||
margin: auto 0;
|
||||
position: absolute;
|
||||
right: 85px;
|
||||
}
|
||||
|
||||
.amelsearch-form-section.-focused {
|
||||
.amelsearch-input {
|
||||
padding-left: 33px;
|
||||
}
|
||||
|
||||
.amelsearch-button.-loupe {
|
||||
bottom: 0;
|
||||
left: 10px;
|
||||
right: auto;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.amelsearch-input {
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.amelsearch-button.-primary {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Mobile
|
||||
// ---------------------------------------------
|
||||
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
|
||||
.amelsearch-further-section {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Further Component Styles
|
||||
// ______________________________________________
|
||||
|
||||
//
|
||||
// Colors
|
||||
// ----------------------------------------------
|
||||
|
||||
@amelsearch-input__color__primary: @amelsearch-color__primary;
|
||||
|
||||
//
|
||||
// Common
|
||||
// ----------------------------------------------
|
||||
|
||||
& when (@media-common = true) {
|
||||
.amelsearch-input {
|
||||
& {
|
||||
border: 1px solid #ccc;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
padding: 10px 5px;
|
||||
transition: .3s;
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
&:hover:not([disabled]),
|
||||
&:focus:not([disabled]) {
|
||||
border-color: @amelsearch-input__color__primary;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Amasty Elastic Search Further Search UI Component
|
||||
* amelsearch_further_wrapper
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'ko',
|
||||
'uiComponent'
|
||||
], function ($, ko, Component) {
|
||||
'use strict';
|
||||
|
||||
return Component.extend({
|
||||
defaults: {
|
||||
templates: {
|
||||
clear_button: 'Amasty_ElasticSearch/further_search/clear_button.html',
|
||||
loupe_button: 'Amasty_ElasticSearch/further_search/loupe_button.html',
|
||||
submit_button: 'Amasty_ElasticSearch/further_search/submit_button.html'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
initObservable: function () {
|
||||
this._super()
|
||||
.observe({
|
||||
focused: false,
|
||||
value: this.defaultValue
|
||||
});
|
||||
|
||||
this.focused.extend({
|
||||
rateLimit: {
|
||||
method: 'notifyWhenChangesStop',
|
||||
timeout: 100
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Input event 'enter keydown' handle
|
||||
*
|
||||
* @public
|
||||
* @params {node} Object
|
||||
* @params {event} Object
|
||||
* @return {Boolean} for propagation
|
||||
*/
|
||||
onEnter: function (node, event) {
|
||||
if (event.keyCode === 13) {
|
||||
this.search();
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* On search process handle
|
||||
*
|
||||
* @public
|
||||
* @return {void}
|
||||
*/
|
||||
search: function () {
|
||||
window.location = this.searchUrl + (this.searchUrl.indexOf("?") > 0 ? "&" : "?")
|
||||
+ 'sub_query=' + this.value();
|
||||
}
|
||||
});
|
||||
});
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
<button class="amelsearch-button -close -icon"
|
||||
data-bind="
|
||||
attr: { title: $t('Clear Field') },
|
||||
event: {
|
||||
click: value.bind(this, '')
|
||||
},
|
||||
visible: value && value().length && focused">
|
||||
</button>
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
<button class="amelsearch-button -loupe -icon"
|
||||
data-bind="
|
||||
attr: { title: $t('Search') },
|
||||
event: {
|
||||
click: search
|
||||
}">
|
||||
</button>
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
<button class="amelsearch-button -primary"
|
||||
data-bind="
|
||||
attr: {
|
||||
title: $t('Search')
|
||||
},
|
||||
css: {
|
||||
'-disabled': !(value && value().length > 2)
|
||||
},
|
||||
event: {
|
||||
click: search
|
||||
},
|
||||
i18n: 'Search'">
|
||||
</button>
|
||||
Reference in New Issue
Block a user