123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import {
- getNewComment
- } from '~/api/message'
- import {
- ReplyComment
- } from '~/api/video'
- Page({
- data: {
- list: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.getNewComment()
- },
- async getNewComment() {
- let list = await getNewComment()
- console.log(list);
- this.setData({
- list
- })
- },
- setReply({
- currentTarget
- }) {
- console.log(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`,
- })
- },
- })
|