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
May 12, 2020
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({
* 页面的初始数据
*/
data
:
{
page
:
0
,
pageCount
:
0
,
keyword
:
''
,
faqList
:
[]
},
...
...
@@ -14,7 +16,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
setData
({
keyword
:
options
.
key
});
//检索
},
/**
...
...
@@ -26,7 +32,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
get
FaqList
();
this
.
search
FaqList
();
},
/**
...
...
@@ -35,7 +41,7 @@ Page({
onShareAppMessage
:
function
()
{},
//获取在线答疑列表
get
FaqList
()
{
search
FaqList
()
{
var
that
=
this
;
var
config
=
wx
.
getStorageSync
(
'config'
);
//获取用户消息列表
...
...
@@ -46,6 +52,8 @@ Page({
},
data
:
{
unionId
:
config
.
unionId
,
keyword
:
that
.
data
.
keyword
,
page
:
that
.
data
.
page
,
},
method
:
'GET'
,
dataType
:
'json'
,
...
...
@@ -53,7 +61,8 @@ Page({
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
==
200
)
{
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({
})
},
/**
* 页面上拉触底事件的处理函数
*/
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
()
{
if
(
this
.
data
.
keyword
==
null
||
this
.
data
.
keyword
==
''
)
{
wx
.
showToast
({
...
...
@@ -77,6 +107,8 @@ Page({
});
return
;
}
this
.
searchFaqList
();
},
//咨询详细页面
...
...
src/wx/pages/faqSearch/faqSearch.wxml
View file @
e1bb7d08
...
...
@@ -3,26 +3,14 @@
<image class='background-image' src='/img/faqTop.png' mode="widthFix"></image>
</view>
<view class="title" bindtap='back'>
<image src="/img/left1.png" style="width:40px;height:40px;margin-right:5px"></image>在线答疑
</view>
<view class="titleArea">
<text>亲爱的志愿者\n欢迎来到志愿者服务大厅</text>
<image src="/img/left1.png" style="width:40px;height:40px;margin-right:5px"></image>在线答疑检索
</view>
<view class="searchArea">
<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>
<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="hotFaqs">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
...
...
src/wx/project.config.json
View file @
e1bb7d08
...
...
@@ -96,7 +96,7 @@
"scene"
:
null
},
{
"id"
:
-1
,
"id"
:
7
,
"name"
:
"在线答疑"
,
"pathName"
:
"pages/faq/faq"
,
"query"
:
""
,
...
...
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