diff --git a/pages/question/comments.js b/pages/question/comments.js new file mode 100644 index 0000000000000000000000000000000000000000..363a125f65f1a1d5fab3a3a636dff35be3f7af47 --- /dev/null +++ b/pages/question/comments.js @@ -0,0 +1,47 @@ +// pages/question/comments.js +var app = getApp(); +Page({ + data:{ + commonts:{} + }, + onLoad:function(options){ + // 页面初始化 options为页面跳转所带来的参数 + var that = this; + //获取回答详情 + wx.request({ + url: 'https://api.cnblogs.com/api/questions/answers/'+options.id+'/comments', + method: 'GET', + data: { + }, + header: { + 'Authorization': 'Bearer '+ app.accessToken + }, + success: function (res) { + var data = {}; + data.status = true; + data.data = res.data; + if(res.data.length < 1){ + data.status = false; + } + that.setData({ + commonts: data + }); + }, + fail: function () { + console.log('获取用户信息失败!'); + } + }); + }, + onReady:function(){ + // 页面渲染完成 + }, + onShow:function(){ + // 页面显示 + }, + onHide:function(){ + // 页面隐藏 + }, + onUnload:function(){ + // 页面关闭 + } +}) \ No newline at end of file diff --git a/pages/question/comments.json b/pages/question/comments.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/pages/question/comments.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pages/question/comments.wxml b/pages/question/comments.wxml new file mode 100644 index 0000000000000000000000000000000000000000..6e5f5a4af224fa1fabfd3d8a418c31a7b830a502 --- /dev/null +++ b/pages/question/comments.wxml @@ -0,0 +1,37 @@ + + + + {{question.Title}} + {{question.Content}} + + + 评论 + + + + + {{commont.Content}} + + {{item.PostUserInfo.UserName}}| + 园豆:{{item.PostUserInfo.QScore}}| + {{item.DateAdded}}| + + + + + + + + + 文本域 + + + +