|
@@ -1,18 +1,65 @@
|
|
|
// pages/myComment/myComment.js
|
|
|
+
|
|
|
+import {
|
|
|
+ getComments
|
|
|
+} from '../api/user-api'
|
|
|
+
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ tab: 0,
|
|
|
+ item: 0,
|
|
|
+ commentList: []
|
|
|
+ },
|
|
|
|
|
|
+ changeItem: function (e) {
|
|
|
+ this.setData({
|
|
|
+ item: e.currentTarget.dataset.item
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ changeTab: function (e) {
|
|
|
+ this.setData({
|
|
|
+ tab: e.detail.current
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
+ const params = {
|
|
|
+ 'userId': 'test',
|
|
|
+ 'type': 1
|
|
|
+ }
|
|
|
+ // getComments(params).then(res => {
|
|
|
+ // this.setData({
|
|
|
+ // 'commentList': res.data.dataList
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ const data = [{
|
|
|
+ "replyId": 3172674,
|
|
|
+ "userId": 18001640,
|
|
|
+ "userName": "Mr.Caras",
|
|
|
+ "headerImg": "https://imagecdn.cqliving.com/images/app_4/cms/202105/2f6942bd99b36639a2a9f567b0e303ab14f10e63.jpg",
|
|
|
+ "content": "作者用心了,a了a了!",
|
|
|
+ "commentTime": "1分钟前",
|
|
|
+ "sourceTitle": "长江上游最大中心岛的生态蝶变"
|
|
|
+ },{
|
|
|
+ "replyId": 3172672,
|
|
|
+ "userId": 18001130,
|
|
|
+ "userName": "Mr.王",
|
|
|
+ "headerImg": "https://imagecdn.cqliving.com/images/app_4/cms/202105/2f6942bd99b36639a2a9f567b0e303ab14f10e63.jpg",
|
|
|
+ "content": "来人,把我30米大刀拿来给秀儿梳头发!",
|
|
|
+ "commentTime": "2022-1-1",
|
|
|
+ "sourceTitle": "且看汉武帝如何指江山,定乾坤"
|
|
|
+ }]
|
|
|
+ this.setData({
|
|
|
+ 'commentList': data
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|