Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
songxia-wxherr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
songxia-wxherr
Commits
320ebb78
Commit
320ebb78
authored
Jun 16, 2017
by
夏彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
0df3ddeb
d3475fe8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
62 deletions
+73
-62
dev.js
config/dev.js
+1
-0
prod.js
config/prod.js
+1
-1
test.js
config/test.js
+2
-1
tool_search.css
src/css/tool_search.css
+0
-1
home.vue
src/pages/home.vue
+69
-59
No files found.
config/dev.js
View file @
320ebb78
...
...
@@ -17,6 +17,7 @@ module.exports = {
noInfo
:
true
,
quiet
:
false
},
devtool
:
'#cheap-module-source-map'
,
stats
:
{
modules
:
false
}
...
...
config/prod.js
View file @
320ebb78
...
...
@@ -8,7 +8,7 @@ module.exports = {
plugins
:
[
new
webpack
.
DefinePlugin
({
__BASE_URL__
:
JSON
.
stringify
(
'http://code.ibanshou.cn/songxia/'
),
__SERVER_URL__
:
JSON
.
stringify
(
'http://code.ibanshou.cn/'
),
__SERVER_URL__
:
JSON
.
stringify
(
'http
s
://code.ibanshou.cn/'
),
__QINIU_URL__
:
JSON
.
stringify
(
'http://img.2g.vgot.net/'
),
__NODE_ENV__
:
'"production"'
}),
...
...
config/test.js
View file @
320ebb78
...
...
@@ -20,6 +20,7 @@ module.exports = {
new
webpack
.
LoaderOptionsPlugin
({
minimize
:
true
})
]
],
devtool
:
'#source-map'
};
src/css/tool_search.css
View file @
320ebb78
...
...
@@ -173,7 +173,6 @@ body{
}
.error-code-fixed
{
display
:
none
;
position
:
fixed
;
left
:
0
;
top
:
0
;
...
...
src/pages/home.vue
View file @
320ebb78
<
template
>
<
form
method=
"post"
action=
"/"
class=
"full-box"
>
<
div
class=
"full-box"
>
<div
class=
"vertical-obj"
>
<div
class=
"vertical-obj-cont"
>
...
...
@@ -22,12 +22,12 @@
</div>
<div
class=
"type-code"
>
<a
href=
"javascript:;"
@
click=
"
openErrorTypeBox()
"
:class=
"
{'has-code':code}">
{{
code
?
code
:
'请输入故障码,示例:E6'
}}
</a>
<a
href=
"javascript:;"
@
click=
"
blurSearch=true
"
:class=
"
{'has-code':code}">
{{
code
?
code
:
'请输入故障码,示例:E6'
}}
</a>
</div>
<div
class=
"error-code-fixed"
>
<input
type=
"
text"
name=
"code"
v-model
.
trim=
"code"
placeholder=
"请输入故障码,示例:E6"
id=
"codeSearchInput"
onfocus=
"
"
>
<a
href=
"javascript:;"
@
click=
"
closeErrorFixed()
"
>
取消
</a>
<div
class=
"error-code-fixed"
v-show=
"blurSearch"
>
<input
type=
"
search"
name=
"code"
v-model
.
trim=
"code"
@
keyup
.
enter=
"searchCode"
placeholder=
"请输入故障码,示例:E6"
id=
"codeSearchInput
"
>
<a
href=
"javascript:;"
@
click=
"
blurSearch=false
"
>
取消
</a>
</div>
<div
class=
"error-code"
v-if=
"isUseCaptcha"
>
...
...
@@ -35,7 +35,7 @@
</div>
<div
class=
"foot-btn"
>
<button
class=
"search-btn"
type=
"
submit"
:disabled=
"!searchabl
e"
>
查一下
</button>
<button
class=
"search-btn"
type=
"
button"
:disabled=
"!searchable"
@
click=
"searchCod
e"
>
查一下
</button>
</div>
</div>
...
...
@@ -111,15 +111,16 @@
<a
href=
"javascript:;"
@
click=
"showMedal = false"
><i
class=
"iconfont icon-close"
></i></a>
</div>
</
form
>
</
div
>
</template>
<
script
>
require
(
"script-loader!../libs/slidernav.js"
);
import
autoComplete
from
"../libs/autocomplete/jquery.autocomplete"
;
import
weixinShare
from
'../utils/weixin-share'
;
import
gt
from
'../utils/gt'
;
import
api
from
"../utils/api"
;
require
(
"script-loader!../libs/slidernav.js"
);
export
default
{
data
()
{
return
{
...
...
@@ -138,6 +139,7 @@ export default {
//bsTimer: null,
input
:
null
,
acBind
:
false
,
blurSearch
:
false
,
isCheckCaptcha
:
false
,
showBanshouQrcode
:
false
,
isUseCaptcha
:
false
...
...
@@ -160,6 +162,16 @@ export default {
categoryId
()
{
this
.
autocomplete
();
},
blurSearch
(
val
)
{
//如果是显示,则聚集到输入框
if
(
val
)
{
let
self
=
this
;
this
.
$nextTick
(()
=>
{
self
.
input
.
focus
();
});
}
}
},
computed
:
{
selectedText
()
{
...
...
@@ -231,7 +243,10 @@ export default {
this
.
input
=
$
(
"#codeSearchInput"
);
//提交搜索
$
(
this
.
$el
).
submit
(
self
.
searchCode
);
$
(
this
.
$el
).
submit
(()
=>
{
self
.
searchCode
();
return
false
;
});
var
title
=
'扳手快查'
;
var
imgUrl
=
common
.
getUrl
(
'img/share_logo.jpg'
);
...
...
@@ -299,64 +314,59 @@ export default {
return
common
.
getUrl
(
url
);
},
openErrorTypeBox
(){
$
(
'.error-code-fixed'
).
show
();
this
.
input
.
focus
();
},
searchCode
()
{
var
self
=
this
;
if
(
!
self
.
searchable
)
{
self
.
blurSearch
=
false
;
return
false
;
}
if
(
sessionStorage
)
{
sessionStorage
.
homeState
=
JSON
.
stringify
({
brandId
:
self
.
brandId
,
categoryId
:
self
.
categoryId
,
code
:
self
.
code
});
}
searchCode
(){
let
self
=
this
;
if
(
self
.
searchable
)
{
if
(
sessionStorage
)
{
sessionStorage
.
homeState
=
JSON
.
stringify
({
brandId
:
self
.
brandId
,
categoryId
:
self
.
categoryId
,
code
:
self
.
code
//移除中文
var
code
=
self
.
code
.
replace
(
/
[\u
4E00-
\u
9FA5
]
/g
,
''
);
api
.
post
(
"code/hit"
,
{
brand_id
:
self
.
brandId
,
category_id
:
self
.
categoryId
,
code
:
code
}).
done
(
res
=>
{
if
(
!
res
.
status
)
{
layer
.
alert
(
res
.
message
,
{
closeBtn
:
false
,
title
:
false
,
icon
:
7
,
shade
:
0.3
});
return
;
}
var
reg
=
/
[\u
4E00-
\u
9FA5
]
/g
;
var
code
=
self
.
code
.
replace
(
reg
,
''
);
api
.
post
(
"code/hit"
,
{
brand_id
:
self
.
brandId
,
category_id
:
self
.
categoryId
,
code
:
code
}).
done
(
res
=>
{
if
(
!
res
.
status
)
{
layer
.
alert
(
res
.
message
,
{
closeBtn
:
false
,
title
:
false
,
icon
:
7
,
shade
:
0.3
});
return
;
}
var
url
=
common
.
getUrl
(
'#/code/'
+
self
.
brandId
+
'/'
+
self
.
categoryId
)
+
"?code="
+
encodeURIComponent
(
code
)
+
"&t="
+
res
.
data
.
tk
;
var
invite
=
common
.
getParameterByName
(
'invite'
);
var
url
=
common
.
getUrl
(
'#/code/'
+
self
.
brandId
+
'/'
+
self
.
categoryId
)
+
"?code="
+
encodeURIComponent
(
code
)
+
"&t="
+
res
.
data
.
tk
;
var
invite
=
common
.
getParameterByName
(
'invite'
);
if
(
invite
)
{
url
=
url
+
'&invite='
+
invite
}
if
(
invite
)
{
url
=
url
+
'&invite='
+
invite
}
if
(
!
self
.
isLogin
)
{
common
.
requestLogin
(
url
);
return
false
;
}
if
(
!
self
.
isLogin
)
{
common
.
requestLogin
(
url
);
return
false
;
}
self
.
$router
.
push
(
self
.
targetUrl
);
});
}
self
.
$router
.
push
(
self
.
targetUrl
);
});
return
false
;
},
closeErrorFixed
(){
$
(
'.error-code-fixed'
).
hide
();
},
getIcon
(
className
){
var
iconFont
=
{
'电视机'
:
'dianshi'
,
...
...
@@ -415,13 +425,13 @@ export default {
return
{
suggestions
:
[]};
}
},
triggerSelectOnValidInput
:
false
,
onSelect
:
function
(
item
)
{
if
(
self
.
code
!=
item
.
data
)
{
self
.
code
=
item
.
code
;
self
.
code
=
item
.
data
;
if
(
!
self
.
searchable
)
{
self
.
closeErrorFixed
()
;
self
.
blurSearch
=
false
;
}
else
{
self
.
searchCode
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment