17 changed files with 393 additions and 76 deletions
@ -1,19 +1,94 @@ |
|||
import {HTTP, Method} from '../utils/http.js' |
|||
|
|||
const TopicBaseUrl = { |
|||
topic_list_url:'/api/group/page', |
|||
topic_goldenList_url:'/api/comment/goldenList', |
|||
topic_detail_url:'/api/group/queryById/', |
|||
topic_detailComment_url:'/api/comment/page', |
|||
topic_collect:'/api/group/collectGroup/', |
|||
topic_commentPraise_url: '/api/comment/addSupport/', |
|||
// topic_commentUnPraise_url: '/api/comment/deleteComment/{id}',
|
|||
} |
|||
|
|||
class TopicModel extends HTTP { |
|||
constructor () { |
|||
super() |
|||
} |
|||
// 首页列表
|
|||
getTopicList = (success) => { |
|||
// 议题列表
|
|||
getTopicList(page, success) { |
|||
let params = { |
|||
url: TopicBaseUrl.topic_list_url, |
|||
method: Method.POST, |
|||
data: { |
|||
page: page, |
|||
pageSize: 10, |
|||
}, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
} |
|||
|
|||
getTopicDetail(id, success){ |
|||
let params = { |
|||
url: TopicBaseUrl.topic_detail_url+`${id}`, |
|||
method: Method.POST, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
} |
|||
|
|||
getTopicDetailComment(id, page,success) { |
|||
let params = { |
|||
url: TopicBaseUrl.topic_detailComment_url, |
|||
method: Method.POST, |
|||
data:{ |
|||
groupId:id, |
|||
page: page, |
|||
pageSize: 10, |
|||
}, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
} |
|||
|
|||
topicCollect(id,success){ |
|||
let params = { |
|||
url: '/fqsb/group/list', |
|||
sucess: success, |
|||
method: Method.GET |
|||
url: TopicBaseUrl.topic_collect + `${id}`, |
|||
method: Method.POST, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
} |
|||
|
|||
topicCommentPraise(id,success){ |
|||
let params = { |
|||
url: TopicBaseUrl.topic_commentPraise_url + `${id}`, |
|||
method: Method.POST, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
|
|||
} |
|||
|
|||
goldenList(page, success) { |
|||
let params = { |
|||
url: TopicBaseUrl.topic_goldenList_url, |
|||
method: Method.POST, |
|||
data: { |
|||
type:1, |
|||
page: page, |
|||
pageSize: 10, |
|||
}, |
|||
success: success |
|||
} |
|||
this.request(params) |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
export {TopicModel} |
|||
|
|||
|
@ -1,7 +1,7 @@ |
|||
<!--pages/topics/index.wxml--> |
|||
<view class="content-wrapper"> |
|||
<e-segment bind:tapSegment="tapSegment" headerTitles="{{headerTitles}}" defaultSelectIndex="{{selectedTitle}}"/> |
|||
<interactive wx:if="{{selectedTitle==0}}" /> |
|||
<goodIdea wx:if="{{selectedTitle==1}}" /> |
|||
<message wx:if="{{selectedTitle==2}}" /> |
|||
<interactive wx:if="{{segmentIndex==0}}" list="{{topicList}}" /> |
|||
<goodIdea wx:if="{{segmentIndex==1}}" list="{{goodIdeaList}}" /> |
|||
<message wx:if="{{segmentIndex==2}}" /> |
|||
</view> |
|||
|
@ -1,3 +1,6 @@ |
|||
{ |
|||
"enablePullDownRefresh": false, |
|||
|
|||
"navigationBarTitleText":"议题", |
|||
"usingComponents": {} |
|||
} |
Loading…
Reference in new issue