12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import {
- getNewComment
- } from '~/api/message'
- import {
- ReplyComment
- } from '~/api/video'
- import reachBottom from '~/mixins/reachBottom'
- Page({
- behaviors: [reachBottom],
- data: {},
- onShow(options) {
- this.resetData()
- },
- loadMore() {
- this.getData(getNewComment, {
- pageSize: 20
- })
- },
- 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
- }) {
- let {
- id,
- commentlog
- } = currentTarget.dataset
- wx.navigateTo({
- url: `/pages/userWorks/index?id=${id}&onceId=${commentlog}&type=comment`,
- })
- },
- })
|