|
@@ -46,6 +46,20 @@
|
|
|
<div class="search_wrap clearfix">
|
|
|
<div class="search_wrap-content">
|
|
|
<form class="fl" action="javascript:void(0)" method="get">
|
|
|
+ <el-select
|
|
|
+ v-model="searchType"
|
|
|
+ placeholder="Select"
|
|
|
+ popper-class="select-search-type"
|
|
|
+ style="width: 140px;
|
|
|
+ height: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in searchTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
<input
|
|
|
type="text"
|
|
|
v-model="keyword"
|
|
@@ -58,15 +72,15 @@
|
|
|
@input="inputChange"
|
|
|
@blur="inputBlur"
|
|
|
/>
|
|
|
- <input type="submit" :value="L['搜索']" class="button" @click="search" />
|
|
|
+ <input type="submit" :value="L['搜索']" class="button" @click="unifySearch" />
|
|
|
</form>
|
|
|
- <input
|
|
|
+ <!-- <input
|
|
|
type="submit"
|
|
|
:value="L['搜本店']"
|
|
|
class="button fl"
|
|
|
@click="searchStore('keyword')"
|
|
|
style="background: #333"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
|
|
|
|
|
@@ -202,6 +216,17 @@ const storeData = reactive({
|
|
|
cat: [ ],
|
|
|
info: {}
|
|
|
}); //店铺数据,cat:店铺分类,info:店铺基本信息
|
|
|
+const searchType = ref('store');
|
|
|
+const searchTypeOptions = [
|
|
|
+ {
|
|
|
+ value: 'store',
|
|
|
+ label: 'In This Store',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'site',
|
|
|
+ label: 'Full Site',
|
|
|
+ },
|
|
|
+]
|
|
|
const otherMenuData = reactive({data:[]})
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const keyword = ref(
|
|
@@ -302,6 +327,13 @@ watchEffect(() => {
|
|
|
|
|
|
});
|
|
|
|
|
|
+const unifySearch = () => {
|
|
|
+ if (searchType.value === 'store') {
|
|
|
+ searchStore('keyword')
|
|
|
+ } else {
|
|
|
+ search()
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
//搜索事件(搜全站)
|
|
|
const search = () => {
|
|
@@ -374,9 +406,33 @@ const inputBlur = () => {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.select-search-type {
|
|
|
+ .el-select-dropdown__item {
|
|
|
+ &.is-selected {
|
|
|
+ color: #036EB8;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="scss" scoped>
|
|
|
@import "@/assets/style/store/storeHeader.scss";
|
|
|
|
|
|
+:deep(.el-select) {
|
|
|
+ border-right: 1px solid $colorMain;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-select__wrapper) {
|
|
|
+ position: relative;
|
|
|
+ top: 2px;
|
|
|
+ box-shadow: none;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.kefu {
|
|
|
img {
|
|
|
width: 16px;
|