123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- import httpRequestApi from '../../../utils/APIClient';
- Page({
- data: {
- fullScreenBtn: false,
- playBtn: false,
- gesture: true,
- user: [{
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- },
- {
- nickName: '萝莉小猫咪',
- image: '../../../static/image/timg.jpg',
- }
- ],
- inputValue: 'smdx',
- text: '总有一天我将实质性操作死去而你我的\xa0\xa0\xa0\xa0\xa0\xa0\xa0儿子自行车在啊实打实大苏打撒旦将加冕为王'
- },
- onLoad: function (option) {
- console.log(option)
- if (option.title) {
- wx.setNavigationBarTitle({
- title: option.title //页面标题为路由参数
- })
- this.setData({
- title: option.title,
- id: option.id
- })
- }
- let uid = 1;
- httpRequestApi.getWorksDetail(uid, option.id).success((res) => {
- console.log(res);
- this.getReply();
- });
- },
- goToReading: function () {
- let id = this.data.id;
- let title = this.data.title;
- wx.navigateTo({
- url: `../../main/reading/reading?id=${id}&title=${title}`
- })
- },
- onShareAppMessage: function (res) {
- if (res.from === 'button') {
- // 来自页面内转发按钮
- console.log(res.target)
- }
- return {
- title: '测试',
- path: '/pages/social/works/works'
- }
- },
- follow: function () {
- let uid = 1;
- let followUid = 2;
- httpRequestApi.followUser(uid, followUid).success((res) => {
- console.log(res)
- });
- },
- // 去其他用户的作品页
- goToOthers: function (e) {
- wx.navigateTo({
- url: `../../main/reading/reading?id=${id}&title=${title}`
- })
- },
- // 查询回复
- getReply: function () {
- let uid = 1;
- let columnId = 1001;
- let pageNo = 1;
- let pageSize = 10;
- httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
- console.log(res);
- });
- },
- // 打开回复详情页
- goToDetail: function (e) {
- let id = e.currentTarget.dataset.id;
- let num = e.currentTarget.dataset.num;
- console.log(e);
- wx.navigateTo({
- url: `../../social/replyDetail/replyDetail?id=${id}&num=${num}`
- })
- },
- // 绑定输入框内容
- inputValue: function (e) {
- this.setData({
- inputValue: e.detail.value
- });
- },
- // 发布回复
- sendHandler: function () {
- console.log(this.data.inputValue);
- if (this.data.inputValue !== '') {
- // let uid = 1;
- // let data = {
- // "postId": 1,
- // "content": this.data.inputValue
- // }
- // httpRequestApi.postReplyComment(uid, data).success(res => {
- // console.log(res);
- // });
- let uid = 1;
- let data = {
- "columnId": '1541403885738293',
- colunmNames: '金色巴掌',
- "detailDesc": this.data.inputValue
- }
- httpRequestApi.postReply(uid, data).success(res => {
- console.log(res);
- });
- }
- }
- })
|