...
|
...
|
@@ -32,6 +32,11 @@ Page({ |
|
|
},
|
|
|
}), this.postList();
|
|
|
},
|
|
|
subArticle() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/interact/interactPost/interactPost',
|
|
|
})
|
|
|
},
|
|
|
zan(e){
|
|
|
let url = '/api/interact/setLike',params = {
|
|
|
object_id: e.currentTarget.id,
|
...
|
...
|
@@ -45,6 +50,32 @@ Page({ |
|
|
})
|
|
|
})
|
|
|
},
|
|
|
delArticle(e) {
|
|
|
console.log(e)
|
|
|
let t = this, id = e.currentTarget.id, url = '/api/interact/deletePosts', params = {
|
|
|
id: id
|
|
|
}, index = e.currentTarget.dataset.indx;
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确认删除这个帖子吗?',
|
|
|
success: (r) => {
|
|
|
if (r.confirm) {
|
|
|
A.post(url, params).then((rt) => {
|
|
|
wx.showToast({
|
|
|
title: '删除成功',
|
|
|
icon: 'none',
|
|
|
duration: 1300
|
|
|
})
|
|
|
t.data.postList.splice(index, 1);
|
|
|
t.setData({
|
|
|
postList: t.data.postList
|
|
|
})
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
navdetail(e) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/colleagues_2/colleagues_2?id='+e.currentTarget.id,
|
...
|
...
|
@@ -52,10 +83,13 @@ Page({ |
|
|
},
|
|
|
getzixun() {
|
|
|
let url = '/api/interact/getQuestionList', d = this, params = {
|
|
|
header: true,
|
|
|
page: d.data.page
|
|
|
};
|
|
|
A.post(url, params, false).then((r) => {
|
|
|
for(let b of r.data){
|
|
|
b.create_time = A.timeFormate(b.create_time, 'YYMMDDHHMM')
|
|
|
b.reply_time = A.timeFormate(b.reply_time,'YYMMDDHHMM')
|
|
|
}
|
|
|
let list = d.data.zixunList.concat(r.data);
|
|
|
d.setData({
|
|
|
zixunList: list
|
...
|
...
|
@@ -77,17 +111,33 @@ Page({ |
|
|
page: d.data.page
|
|
|
};
|
|
|
A.post(url, params, false).then((r) => {
|
|
|
for(let b of r.data){
|
|
|
b.images = b.images.split(',')
|
|
|
}
|
|
|
let list = d.data.postList.concat(r.data);
|
|
|
d.setData({
|
|
|
postList: list
|
|
|
postList: list,
|
|
|
comment: r.new_comment
|
|
|
})
|
|
|
list.length == 0 ? d.setData({
|
|
|
ifData: !0,
|
|
|
}) : (r.data.length < r.per_page ? d.setData({
|
|
|
noMore: !0
|
|
|
}) : "")
|
|
|
|
|
|
wx.stopPullDownRefresh()
|
|
|
})
|
|
|
},
|
|
|
getMore(){
|
|
|
console.log(1)
|
|
|
let t = this;
|
|
|
t.setData({
|
|
|
page: t.data.page++
|
|
|
})
|
|
|
!t.data.noMore ? (t.data.currentTab == '0' ? t.getzixun():t.postList()):wx.showToast({
|
|
|
title: '没有更多了',
|
|
|
icon:'none'
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
askQuestion() {
|
...
|
...
|
@@ -145,10 +195,13 @@ Page({ |
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
this.checkstatus()
|
|
|
this.setData({
|
|
|
zixunList: []
|
|
|
zixunList: [],
|
|
|
postList:[],
|
|
|
page: 1
|
|
|
})
|
|
|
this.checkstatus()
|
|
|
this.data.currentTab=='0'?this.getzixun():this.postList()
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -169,14 +222,19 @@ Page({ |
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
this.checkstatus()
|
|
|
this.setData({
|
|
|
zixunList: [],
|
|
|
postList: [],
|
|
|
page: 1
|
|
|
})
|
|
|
this.data.currentTab == '0' ? this.getzixun() : this.postList()
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|