Skip to content

Commit a9250c8

Browse files
committed
修改今日话题bug
1 parent a346018 commit a9250c8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pages/topic_detail/topic_detail.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const app = getApp();
2+
const util = require("../../utils/util.js");
23

34
Page({
45

@@ -23,13 +24,20 @@ Page({
2324
pageNumber: 1,
2425
initPageNumber: 1,
2526
showGeMoreLoadin:false,
26-
showFooter:false
27+
showFooter:false,
28+
currentTime:''
2729
},
2830

2931
/**
3032
* 生命周期函数--监听页面加载
3133
*/
3234
onLoad: function (options) {
35+
36+
//设置当前时间
37+
this.setData({
38+
currentTime: util.formatTime(new Date())
39+
});
40+
3341
let id = options.id;
3442

3543
this.setData({
@@ -129,7 +137,7 @@ Page({
129137

130138
app.http(
131139
'get',
132-
'/topic/' + id + `/new_comments?`,
140+
'/topic/' + id + `/new_comments?time=` + this.data.currentTime,
133141
{}, function (res) {
134142

135143
console.log(res.data.data);

0 commit comments

Comments
 (0)