Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wxapp
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
wxapp
Commits
45c2d2cc
Commit
45c2d2cc
authored
Sep 27, 2018
by
ArronYR
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 123.56.28.111:qz-tour/wxapp
parents
8863f108
bf7ad3e3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
18 deletions
+55
-18
components/search-filter/index.js
+8
-1
components/search-filter/index.wxss
+1
-1
images/icon_vip_price.png
+0
-0
pages/search/index.js
+44
-16
pages/search/index.wxss
+2
-0
No files found.
components/search-filter/index.js
View file @
45c2d2cc
...
...
@@ -20,6 +20,7 @@ Component({
filter_idx
:
0
,
selected
:
{
type
:
'0'
,
city
:
'0'
,
catalog
:
'0'
,
region
:
'0'
,
tags
:
[]
...
...
@@ -74,7 +75,13 @@ Component({
_selected
.
catalog
=
idx
_selected_titles
.
catalog
=
name
}
else
if
(
this
.
data
.
filter_idx
==
3
)
{
_selected
.
region
=
idx
if
(
name
==
'国内'
||
name
==
'国外'
)
{
// 国内国外筛选
_selected
.
region
=
idx
}
else
{
// 城市筛选
_selected
.
city
=
idx
}
_selected_titles
.
region
=
name
}
this
.
setData
({
...
...
components/search-filter/index.wxss
View file @
45c2d2cc
...
...
@@ -39,7 +39,7 @@
.filter-content-wrapper {
position: fixed;
width: 100%;
top:
96
px;
top:
110
px;
left: 0;
bottom: 0;
right: 0;
...
...
images/icon_vip_price.png
0 → 100755
View file @
45c2d2cc
604 Bytes
pages/search/index.js
View file @
45c2d2cc
...
...
@@ -17,23 +17,47 @@ Page({
currentPage
:
1
,
loading
:
true
,
hasMore
:
true
,
filters
:
{
type
:
'0'
,
catalog
:
'0'
,
city
:
'0'
,
region
:
'0'
,
tags
:
[]
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
getListData
()
},
/**
* 加载
*/
getListData
:
function
(
callback
)
{
getListData
:
function
(
callback
)
{
const
p
=
this
.
data
.
currentPage
api
.
search
.
index
({
p
}).
then
(
res
=>
{
let
params
=
{
p
:
p
}
if
(
this
.
data
.
filters
.
tags
.
length
>
0
)
{
params
[
'tags'
]
=
JSON
.
stringify
(
this
.
data
.
filters
.
tags
)
}
if
(
parseInt
(
this
.
data
.
filters
.
city
)
>
0
)
{
params
[
'city'
]
=
this
.
data
.
filters
.
city
}
if
(
parseInt
(
this
.
data
.
filters
.
region
)
>
0
)
{
params
[
'region_type'
]
=
this
.
data
.
filters
.
region
}
if
(
parseInt
(
this
.
data
.
filters
.
type
)
>
0
)
{
params
[
'type'
]
=
this
.
data
.
filters
.
type
}
if
(
parseInt
(
this
.
data
.
filters
.
catalog
)
>
0
)
{
params
[
'catalog_id'
]
=
this
.
data
.
filters
.
catalog
}
// 请求数据接口
api
.
search
.
index
(
params
).
then
(
res
=>
{
if
(
res
.
code
)
{
this
.
setData
({
hasMore
:
false
,
...
...
@@ -55,38 +79,37 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
onPullDownRefresh
:
function
()
{
this
.
setData
({
projects
:
[],
loading
:
true
,
hasMore
:
true
,
currentPage
:
1
...
...
@@ -105,7 +128,7 @@ Page({
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
onReachBottom
:
function
()
{
let
that
=
this
if
(
that
.
data
.
loading
||
!
that
.
data
.
hasMore
)
{
return
;
...
...
@@ -123,14 +146,18 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
onShareAppMessage
:
function
()
{
},
/**
* 用户进行了筛选操作
*/
filterChange
:
function
(
event
){
console
.
log
(
event
)
filterChange
:
function
(
event
)
{
let
_filters
=
event
.
detail
.
filters
this
.
setData
({
filters
:
_filters
})
wx
.
startPullDownRefresh
()
}
})
\ No newline at end of file
pages/search/index.wxss
View file @
45c2d2cc
/* pages/search/index.wxss */
.page-wrapper{
}
.search-header{
background: white;
padding-top: 14px;
}
.search-wrapper{
display: flex;
...
...
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