1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import {
- getNewComment
- } from '~/api/message'
- import {
- ReplyComment
- } from '~/api/video'
- Page({
- data: {
- list: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.getNewComment()
- },
- async getNewComment() {
- let list = await getNewComment()
- this.setData({
- list
- })
- },
- setReply({
- currentTarget
- }) {
- wx.showModal({
- title: '回复评论',
- editable: true,
- confirmText: '发送',
- success: async (res) => {
- if (res.confirm) {
- if (!res.content) {
- return
- }
- let data = {
- postsId: currentTarget.dataset.id,
- content: res.content,
- }
- await ReplyComment(data)
- wx.showToast({
- title: '回复成功',
- })
- }
- }
- })
- },
- jumpUserInfo({
- currentTarget
- }) {
- wx.navigateTo({
- url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=user`,
- })
- },
- jumpWork({
- currentTarget
- }) {
- wx.navigateTo({
- url: `/pages/userWorks/index?id=${currentTarget.dataset.id}`,
- })
- },
- })
|