From d37c31fd302a39f7a12f0dd3f15656e93254bdd5 Mon Sep 17 00:00:00 2001
From: wjb <544913422@qq.com>
Date: Mon, 28 May 2018 17:53:09 +0800
Subject: [PATCH 1/4] wjb
---
.idea/.name | 1 +
.idea/encodings.xml | 4 +
.idea/mip-extensions.iml | 8 +
.idea/modules.xml | 8 +
.idea/scopes/scope_settings.xml | 5 +
.idea/vcs.xml | 6 +
.idea/workspace.xml | 358 ++++++++++++++++++
src/mip-searchAssociation/README.md | 25 ++
.../mip-searchAssociation.js | 33 ++
src/mip-searchAssociation/package.json | 13 +
10 files changed, 461 insertions(+)
create mode 100644 .idea/.name
create mode 100644 .idea/encodings.xml
create mode 100644 .idea/mip-extensions.iml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/scopes/scope_settings.xml
create mode 100644 .idea/vcs.xml
create mode 100644 .idea/workspace.xml
create mode 100644 src/mip-searchAssociation/README.md
create mode 100644 src/mip-searchAssociation/mip-searchAssociation.js
create mode 100644 src/mip-searchAssociation/package.json
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 000000000..0cb737cec
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+mip-extensions
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 000000000..d82104827
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/mip-extensions.iml b/.idea/mip-extensions.iml
new file mode 100644
index 000000000..c956989b2
--- /dev/null
+++ b/.idea/mip-extensions.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 000000000..f7323a9be
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
new file mode 100644
index 000000000..922003b84
--- /dev/null
+++ b/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 000000000..94a25f7f4
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 000000000..74edca219
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,358 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1527498012551
+
+ 1527498012551
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/mip-searchAssociation/README.md b/src/mip-searchAssociation/README.md
new file mode 100644
index 000000000..edaee2d85
--- /dev/null
+++ b/src/mip-searchAssociation/README.md
@@ -0,0 +1,25 @@
+# mip-searchAssociation
+
+`` 实现搜索联想
+
+标题|内容
+----|----
+类型|通用
+支持布局|N/S
+所需脚本|https://c.mipcdn.com/static/v1/mip-searchAssociation/mip-searchAssociation.js
+
+## 示例
+
+### 基本用法
+
+```html
+
+
+\```
+
+##属性
+{data-src}
+说明:{后台地址}
+必选项:{是}
+类型:{字符串}
diff --git a/src/mip-searchAssociation/mip-searchAssociation.js b/src/mip-searchAssociation/mip-searchAssociation.js
new file mode 100644
index 000000000..a2a3b614d
--- /dev/null
+++ b/src/mip-searchAssociation/mip-searchAssociation.js
@@ -0,0 +1,33 @@
+/**
+ * Created by Administrator on 2018/5/28.
+ */
+define(function(require) {
+ var customElem = require('customElement').create();
+ var fetchJsonp = require('fetch-jsonp');
+ customElem.prototype.firstInviewCallback = function () {
+ var element = this.element;
+ var input = document.querySelectorAll('.mip-list-more')[0];
+ var resultList = element.querySelector('.result-list')[0];
+ var src = element.getAttribute('data-src');
+ var inputVal = input.value;
+ input.onkeyup=function(){
+ fetchJsonp(src, {
+ jsonpCallback: inputVal
+ }).then(function (res) {
+ var searchData = JSON.parse(res);
+ var html = '';
+ for(var value of searchData){
+ html+=`
+
+ ${value.name}
+
+ `
+ }
+ resultList.innerHTML = html;
+ }).catch(function (data) {
+ console.log(data);
+ });
+ }
+ };
+ return customElem;
+});
\ No newline at end of file
diff --git a/src/mip-searchAssociation/package.json b/src/mip-searchAssociation/package.json
new file mode 100644
index 000000000..7291a3aea
--- /dev/null
+++ b/src/mip-searchAssociation/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "mip-searchAssociation",
+ "version": "1.0.0",
+
+ "author": {
+ "name": "wjb",
+ "email": "544913422@qq.com"
+ },
+
+ "engines": {
+ "mip": ">=1.1.0"
+ }
+}
\ No newline at end of file
From ef0e0a5cd3c0e5283c46b41121f78fddedd2a376 Mon Sep 17 00:00:00 2001
From: wjb <544913422@qq.com>
Date: Mon, 28 May 2018 17:57:54 +0800
Subject: [PATCH 2/4] mip
---
.idea/workspace.xml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 74edca219..61c171abd 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,11 +1,7 @@
-
-
-
-
-
+
From 2bc3750d5f9d390ec937136bab1602940154d03e Mon Sep 17 00:00:00 2001
From: wjb <544913422@qq.com>
Date: Wed, 30 May 2018 15:53:28 +0800
Subject: [PATCH 3/4] wjb
---
.idea/misc.xml | 4 +
.idea/workspace.xml | 129 +++++++++++++-----
src/mip-searchAssociation/README.md | 8 ++
.../mip-searchAssociation.js | 4 +-
4 files changed, 106 insertions(+), 39 deletions(-)
create mode 100644 .idea/misc.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 000000000..8662aa97f
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 61c171abd..c4df18b98 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,11 @@
-
+
+
+
+
+
@@ -38,7 +42,7 @@
-
+
@@ -48,8 +52,8 @@
-
-
+
+
@@ -58,18 +62,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -214,7 +208,7 @@
-
+
@@ -247,6 +241,12 @@
+
+
+
+
+ true
+
@@ -268,25 +268,25 @@
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
-
+
-
-
+
+
+
@@ -312,23 +312,39 @@
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -336,7 +352,7 @@
-
+
@@ -344,8 +360,47 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/mip-searchAssociation/README.md b/src/mip-searchAssociation/README.md
index edaee2d85..3e6e63dea 100644
--- a/src/mip-searchAssociation/README.md
+++ b/src/mip-searchAssociation/README.md
@@ -14,6 +14,14 @@
```html
+
\```
diff --git a/src/mip-searchAssociation/mip-searchAssociation.js b/src/mip-searchAssociation/mip-searchAssociation.js
index a2a3b614d..54305bf0e 100644
--- a/src/mip-searchAssociation/mip-searchAssociation.js
+++ b/src/mip-searchAssociation/mip-searchAssociation.js
@@ -6,8 +6,8 @@ define(function(require) {
var fetchJsonp = require('fetch-jsonp');
customElem.prototype.firstInviewCallback = function () {
var element = this.element;
- var input = document.querySelectorAll('.mip-list-more')[0];
- var resultList = element.querySelector('.result-list')[0];
+ var input = element.querySelectorAll('.mip-list-more')[0];
+ var resultList = element.querySelectorAll('.result-list')[0];
var src = element.getAttribute('data-src');
var inputVal = input.value;
input.onkeyup=function(){
From 8b20fc2a8562b27f458be87ac91591d3b340bd7a Mon Sep 17 00:00:00 2001
From: wjb <544913422@qq.com>
Date: Tue, 5 Jun 2018 10:55:33 +0800
Subject: [PATCH 4/4] wjb
---
.idea/workspace.xml | 155 ++++++++++++++++--
.../mip-searchAssociation.js | 7 +-
2 files changed, 146 insertions(+), 16 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index c4df18b98..003f4f2e0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,7 +2,6 @@
-
@@ -32,7 +31,7 @@
-
+
@@ -52,7 +51,7 @@
-
+
@@ -62,8 +61,8 @@
-
-
+
+
@@ -208,7 +207,7 @@
-
+
@@ -265,7 +264,7 @@
-
+
@@ -280,13 +279,13 @@
-
+
-
-
+
+
@@ -310,6 +309,134 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -383,7 +510,7 @@
-
+
@@ -391,7 +518,7 @@
-
+
@@ -399,8 +526,8 @@
-
-
+
+
diff --git a/src/mip-searchAssociation/mip-searchAssociation.js b/src/mip-searchAssociation/mip-searchAssociation.js
index 54305bf0e..2f27e6299 100644
--- a/src/mip-searchAssociation/mip-searchAssociation.js
+++ b/src/mip-searchAssociation/mip-searchAssociation.js
@@ -10,7 +10,10 @@ define(function(require) {
var resultList = element.querySelectorAll('.result-list')[0];
var src = element.getAttribute('data-src');
var inputVal = input.value;
- input.onkeyup=function(){
+ input.onkeyup=function(e){
+ if(e.keyCode == 13){
+ window.location.href='/search-kecheng?kw='+inputVal
+ }
fetchJsonp(src, {
jsonpCallback: inputVal
}).then(function (res) {
@@ -19,7 +22,7 @@ define(function(require) {
for(var value of searchData){
html+=`
- ${value.name}
+ ${value.kwd}
`
}