Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
e1bb7d08
Commit
e1bb7d08
authored
4 years ago
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111111
parent
3146b935
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
19 deletions
+39
-19
faqSearch.js
src/wx/pages/faqSearch/faqSearch.js
+35
-3
faqSearch.wxml
src/wx/pages/faqSearch/faqSearch.wxml
+3
-15
project.config.json
src/wx/project.config.json
+1
-1
No files found.
src/wx/pages/faqSearch/faqSearch.js
View file @
e1bb7d08
...
@@ -6,6 +6,8 @@ Page({
...
@@ -6,6 +6,8 @@ Page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
page
:
0
,
pageCount
:
0
,
keyword
:
''
,
keyword
:
''
,
faqList
:
[]
faqList
:
[]
},
},
...
@@ -14,7 +16,11 @@ Page({
...
@@ -14,7 +16,11 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
setData
({
keyword
:
options
.
key
});
//检索
},
},
/**
/**
...
@@ -26,7 +32,7 @@ Page({
...
@@ -26,7 +32,7 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
this
.
get
FaqList
();
this
.
search
FaqList
();
},
},
/**
/**
...
@@ -35,7 +41,7 @@ Page({
...
@@ -35,7 +41,7 @@ Page({
onShareAppMessage
:
function
()
{},
onShareAppMessage
:
function
()
{},
//获取在线答疑列表
//获取在线答疑列表
get
FaqList
()
{
search
FaqList
()
{
var
that
=
this
;
var
that
=
this
;
var
config
=
wx
.
getStorageSync
(
'config'
);
var
config
=
wx
.
getStorageSync
(
'config'
);
//获取用户消息列表
//获取用户消息列表
...
@@ -46,6 +52,8 @@ Page({
...
@@ -46,6 +52,8 @@ Page({
},
},
data
:
{
data
:
{
unionId
:
config
.
unionId
,
unionId
:
config
.
unionId
,
keyword
:
that
.
data
.
keyword
,
page
:
that
.
data
.
page
,
},
},
method
:
'GET'
,
method
:
'GET'
,
dataType
:
'json'
,
dataType
:
'json'
,
...
@@ -53,7 +61,8 @@ Page({
...
@@ -53,7 +61,8 @@ Page({
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
==
200
)
{
if
(
res
.
statusCode
==
200
)
{
that
.
setData
({
that
.
setData
({
faqList
:
res
.
data
.
result
.
faqList
pageCount
:
res
.
data
.
result
.
pageCount
,
faqList
:
that
.
data
.
faqList
.
concat
(
res
.
data
.
result
.
faqList
)
})
})
}
}
},
},
...
@@ -68,6 +77,27 @@ Page({
...
@@ -68,6 +77,27 @@ Page({
})
})
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
//触底以后加载更多
if
((
this
.
data
.
page
+
1
)
<
this
.
data
.
pageCount
)
{
var
pageIndex
=
this
.
data
.
page
+
1
this
.
setData
({
page
:
pageIndex
})
this
.
searchFaqList
();
}
else
{
wx
.
showToast
({
title
:
'没有更多咨询啦。'
,
icon
:
'success'
,
duration
:
2000
});
}
},
//点击检索
searchFaq
()
{
searchFaq
()
{
if
(
this
.
data
.
keyword
==
null
||
this
.
data
.
keyword
==
''
)
{
if
(
this
.
data
.
keyword
==
null
||
this
.
data
.
keyword
==
''
)
{
wx
.
showToast
({
wx
.
showToast
({
...
@@ -77,6 +107,8 @@ Page({
...
@@ -77,6 +107,8 @@ Page({
});
});
return
;
return
;
}
}
this
.
searchFaqList
();
},
},
//咨询详细页面
//咨询详细页面
...
...
This diff is collapsed.
Click to expand it.
src/wx/pages/faqSearch/faqSearch.wxml
View file @
e1bb7d08
...
@@ -3,26 +3,14 @@
...
@@ -3,26 +3,14 @@
<image class='background-image' src='/img/faqTop.png' mode="widthFix"></image>
<image class='background-image' src='/img/faqTop.png' mode="widthFix"></image>
</view>
</view>
<view class="title" bindtap='back'>
<view class="title" bindtap='back'>
<image src="/img/left1.png" style="width:40px;height:40px;margin-right:5px"></image>在线答疑
<image src="/img/left1.png" style="width:40px;height:40px;margin-right:5px"></image>在线答疑检索
</view>
<view class="titleArea">
<text>亲爱的志愿者\n欢迎来到志愿者服务大厅</text>
</view>
</view>
<view class="searchArea">
<view class="searchArea">
<text>关键词索引</text>
<text>关键词索引</text>
<input class="input" name="keyword" placeholder="搜索从这里开始" bindinput="keywordInput" placeholder-class="input_center" />
<input class="input" name="keyword" placeholder="搜索从这里开始" bindinput="keywordInput" placeholder-class="input_center"
value='{{keyword}}'
/>
<view bindtap="searchFaq">搜索</view>
<view bindtap="searchFaq">搜索</view>
</view>
</view>
<view class='topTitle'>
<view class='leftTitle'>
<view class='leftLine'></view>
<text class="hot_title">热门资讯</text>
</view>
<view class='rightTitle' bindtap='myFaq'>
<text>我的咨询</text>
<view></view>
</view>
</view>
<view class="content">
<view class="content">
<view class="hotFaqs">
<view class="hotFaqs">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
...
...
This diff is collapsed.
Click to expand it.
src/wx/project.config.json
View file @
e1bb7d08
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
"scene"
:
null
"scene"
:
null
},
},
{
{
"id"
:
-1
,
"id"
:
7
,
"name"
:
"在线答疑"
,
"name"
:
"在线答疑"
,
"pathName"
:
"pages/faq/faq"
,
"pathName"
:
"pages/faq/faq"
,
"query"
:
""
,
"query"
:
""
,
...
...
This diff is collapsed.
Click to expand it.
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