Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
jd-vx-app
Commits
2cd16a63
Commit
2cd16a63
authored
Jun 08, 2022
by
lijiongliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索商品修改
parent
cbdff725
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
shop.vue
pages/shop.vue
+1
-1
search.vue
pagesC/pages/shop/search.vue
+17
-12
No files found.
pages/shop.vue
View file @
2cd16a63
...
...
@@ -4,7 +4,7 @@
<view>
<view
class=
"shop"
>
<div
class=
"my__search"
@
click=
'goSearch'
>
<u-search
placeholder=
"搜搜你最想知道的"
:showAction=
'false'
bgColor=
'#ffffff'
v-model=
"keyword"
></u-search>
<u-search
placeholder=
"搜搜你最想知道的"
:showAction=
'false'
bgColor=
'#ffffff'
></u-search>
</div>
<div
class=
"shop__swiper"
>
<view
class=
"u-demo-block"
>
...
...
pagesC/pages/shop/search.vue
View file @
2cd16a63
...
...
@@ -6,7 +6,7 @@
<view
class=
"appCotent"
>
<div
class=
"myMoveCar"
>
<div
class=
"my__search"
>
<u-search
placeholder=
"请输入商品"
:showAction=
'false'
bgColor=
'#ffffff'
v-model=
"keyword"
@
search
=
"searchCommodity"
></u-search>
<u-search
placeholder=
"请输入商品"
:showAction=
'false'
bgColor=
'#ffffff'
v-model=
"keyword"
@
change
=
"searchCommodity"
></u-search>
</div>
<div
class=
"list"
>
<div
class=
"list__item"
v-for=
"(vo,inx) in items"
:key=
"inx"
@
click=
"goDetail(vo.id,vo.link)"
>
...
...
@@ -38,6 +38,7 @@ export default {
return
{
keyword
:
''
,
items
:
[],
timer
:
null
};
},
methods
:
{
...
...
@@ -47,17 +48,21 @@ export default {
})
},
searchCommodity
(){
let
searchCondition
=
{
searchVal
:
this
.
keyword
}
console
.
log
(
searchCondition
,
222222222
)
let
opts
=
{
url
:
'/app/index/mall/list'
,
method
:
'get'
};
this
.
http
.
httpRequest
(
opts
,
searchCondition
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
this
.
items
=
res
.
data
.
data
.
rows
}
})
if
(
this
.
timer
)
{
clearTimeout
(
this
.
timer
);
}
this
.
timer
=
setTimeout
(()
=>
{
let
searchCondition
=
{
searchVal
:
this
.
keyword
}
console
.
log
(
searchCondition
,
222222222
)
let
opts
=
{
url
:
'/app/index/mall/list'
,
method
:
'get'
};
this
.
http
.
httpRequest
(
opts
,
searchCondition
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
this
.
items
=
res
.
data
.
data
.
rows
}
})
},
300
)
},
goDetail
(
id
,
link
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
...
...
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