|
@@ -16,18 +16,20 @@ Page({
|
|
replyList: [],
|
|
replyList: [],
|
|
howMuch: '2000',
|
|
howMuch: '2000',
|
|
moneySelect: 'moneySelect',
|
|
moneySelect: 'moneySelect',
|
|
- moneyNormal: 'moneyNormal'
|
|
|
|
|
|
+ moneyNormal: 'moneyNormal',
|
|
|
|
+ ifReward: false
|
|
},
|
|
},
|
|
onLoad: function (option) {
|
|
onLoad: function (option) {
|
|
- if (option.title) {
|
|
|
|
- wx.setNavigationBarTitle({
|
|
|
|
- title: option.title //页面标题为路由参数
|
|
|
|
- })
|
|
|
|
- this.setData({
|
|
|
|
- title: option.title,
|
|
|
|
- id: option.id
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ console.log(option)
|
|
|
|
+
|
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
|
+ title: option.title //页面标题为路由参数
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.setData({
|
|
|
|
+ title: option.title,
|
|
|
|
+ id: option.id
|
|
|
|
+ })
|
|
let uid = wx.getStorageSync('uid');
|
|
let uid = wx.getStorageSync('uid');
|
|
this.getWorks(uid, option.id);
|
|
this.getWorks(uid, option.id);
|
|
},
|
|
},
|
|
@@ -93,6 +95,20 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 点赞评论
|
|
|
|
+ likeCommend: function (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ let uid = wx.getStorageSync('uid');
|
|
|
|
+ let followUid = e.currentTarget.dataset.id;
|
|
|
|
+ let index = e.currentTarget.dataset.index;
|
|
|
|
+ httpRequestApi.likeCommend(uid, followUid).success(res => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ const str = `replyList[${index}].likes`;
|
|
|
|
+ this.setData({
|
|
|
|
+ [str]: res.data.data.favors
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 去其他用户的作品页
|
|
// 去其他用户的作品页
|
|
goToOthers: function (e) {
|
|
goToOthers: function (e) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
@@ -103,6 +119,7 @@ Page({
|
|
getReply: function () {
|
|
getReply: function () {
|
|
let uid = wx.getStorageSync('uid');
|
|
let uid = wx.getStorageSync('uid');
|
|
let columnId = this.data.id;
|
|
let columnId = this.data.id;
|
|
|
|
+ console.log(columnId)
|
|
let pageNo = 1;
|
|
let pageNo = 1;
|
|
let pageSize = 10;
|
|
let pageSize = 10;
|
|
httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
|
|
httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
|
|
@@ -117,6 +134,7 @@ Page({
|
|
temp.id = item.id;
|
|
temp.id = item.id;
|
|
temp.replyCount = item.replyCount;
|
|
temp.replyCount = item.replyCount;
|
|
temp.time = formatDate(item.gmtCreated, 3);
|
|
temp.time = formatDate(item.gmtCreated, 3);
|
|
|
|
+ temp.likes = item.postsAttributeInfo.favors || 0;
|
|
console.log(temp.time)
|
|
console.log(temp.time)
|
|
replyTemp.push(temp);
|
|
replyTemp.push(temp);
|
|
});
|
|
});
|
|
@@ -157,17 +175,22 @@ Page({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 选择金额
|
|
// 选择金额
|
|
- setMoney: function(e){
|
|
|
|
|
|
+ setMoney: function (e) {
|
|
this.setData({
|
|
this.setData({
|
|
howMuch: e.currentTarget.dataset.money
|
|
howMuch: e.currentTarget.dataset.money
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ reward: function () {
|
|
|
|
+ this.setData({
|
|
|
|
+ ifReward: true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 奖励
|
|
// 奖励
|
|
rewardMoney: function () {
|
|
rewardMoney: function () {
|
|
console.log(this.data.authorUid);
|
|
console.log(this.data.authorUid);
|
|
const data = {
|
|
const data = {
|
|
targetUid: this.data.authorUid,
|
|
targetUid: this.data.authorUid,
|
|
- amount: "50"
|
|
|
|
|
|
+ amount: this.data.howMuch
|
|
}
|
|
}
|
|
let uid = wx.getStorageSync('uid');
|
|
let uid = wx.getStorageSync('uid');
|
|
httpRequestApi.rewardMoney(uid, data).success(res => {
|
|
httpRequestApi.rewardMoney(uid, data).success(res => {
|
|
@@ -192,15 +215,22 @@ Page({
|
|
content: '支付成功',
|
|
content: '支付成功',
|
|
success(res) {
|
|
success(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- console.log('点击确定')
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ ifReward: false
|
|
|
|
+ })
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
- console.log('取消')
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ ifReward: false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
'fail': function (res) {
|
|
'fail': function (res) {
|
|
|
|
+ this.setData({
|
|
|
|
+ ifReward: false
|
|
|
|
+ })
|
|
console.log('支付失败', res)
|
|
console.log('支付失败', res)
|
|
}
|
|
}
|
|
})
|
|
})
|