From f5e9b71775d1aacfd6657df9c48400a5c8cce1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=81=A5?= Date: Thu, 23 Sep 2021 17:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/main.wxss | 69 +- packagecard/cardList/cardList.js | 12 +- packagecard/cardList/cardList.wxml | 6 +- .../moments/momentsdetail/momentsdetail.js | 661 +++++++++--------- .../moments/momentsdetail/momentsdetail.wxml | 108 ++- .../moments/publish/momentpublishline.js | 7 + .../moments/publish/momentpublishline.wxml | 17 +- pages/index/index.js | 50 +- pages/index/index.wxml | 13 +- pages/mine/otherCard/othercarddetail.js | 4 + pages/mine/otherCard/othercarddetail.wxml | 44 +- utils/api.js | 1 + 12 files changed, 626 insertions(+), 366 deletions(-) diff --git a/class/main.wxss b/class/main.wxss index 6cbaa87..659ff87 100644 --- a/class/main.wxss +++ b/class/main.wxss @@ -4178,7 +4178,6 @@ l .text-depblack { .comment-line-input-box { - min-height: 200rpx; color: #000000; border-radius: 5rpx; width: 100%; @@ -4249,7 +4248,7 @@ l .text-depblack { justify-content: center; align-items: center; padding: 15rpx 0rpx; - flex-grow: 0.6; + flex: 6; } .click-white { @@ -4308,7 +4307,7 @@ l .text-depblack { .icon-comment { font-size: 50rpx; - flex-grow: 0.2; + flex: 2; text-align: center; } @@ -4323,7 +4322,6 @@ l .text-depblack { justify-content: flex-start; align-items: center; width: 100%; - margin-top: 15rpx; background-color: #ffffff; padding: 15rpx; min-height: 1000rpx; @@ -4349,6 +4347,10 @@ l .text-depblack { margin: 15rpx 0rpx; } +.comment-list-item-box:nth-child(1) { + margin: 25rpx 0rpx 15rpx 0rpx; +} + .comment-list-item-content { font-size: 28rpx; padding: 15rpx 0rpx 15rpx 0rpx; @@ -4363,6 +4365,55 @@ l .text-depblack { font-size: 24rpx; } +/* 评论的回复 */ +.restore-content-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 0rpx 15rpx 15rpx 15rpx; + border-bottom: 1rpx solid #f3f3f3; +} + +.line { + width: 100%; + height: 1rpx; + background-color: #f3f3f3; + padding: 0rpx 15rpx 0rpx 15rpx; +} + +.restore-content-title { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + width: 100%; +} + +.restore-content-title text { + margin: 0rpx 0rpx 0rpx 15rpx; + color: #000000; + font-size: 32rpx; +} + +.restore-content-title image { + width: 64rpx; + height: 64rpx; + border-radius: 50%; +} + +.dialog-content { + width: 100%; + height: 50%; +} + +.restore-content { + font-size: 28rpx; + padding: 15rpx 0rpx 15rpx 0rpx; + margin-left: 75rpx; + width: 90%; +} + .item-title-box { display: flex; flex-direction: row; @@ -4381,6 +4432,16 @@ l .text-depblack { padding: 15rpx 30rpx 15rpx 64rpx; } +.comment-input { + width: 80%; + background-color: #f3f3f3; + line-height: 70rpx; + height: 70rpx; + text-align: left; + padding: 0rpx 15rpx 0rpx 15rpx; + border-radius: 5rpx; +} + .comment-item-title { display: flex; flex-direction: row; diff --git a/packagecard/cardList/cardList.js b/packagecard/cardList/cardList.js index ff8b6b6..84157e9 100644 --- a/packagecard/cardList/cardList.js +++ b/packagecard/cardList/cardList.js @@ -18,6 +18,7 @@ Page({ isRefresh: false, isShowCodeInput: false, //测试true code: '', //邀请码 + contentHeight: app.globalData.windowHeight }, /** * 生命周期函数--监听页面加载 @@ -56,8 +57,7 @@ Page({ if (res.data.length > 0) { _self.setData({ optionsList: res.data, - curTypeId: res.data[0].dataId, - currentIndex: 0 + curTypeId: res.data[_self.data.currentIndex].dataId }) //根据第一条获取数据 _self.getList() @@ -80,7 +80,9 @@ Page({ token: app.globalData.token }, data: { - templateType: self.data.curTypeId + templateType: self.data.curTypeId, + page: '1', + rows: '2' } }).then(res => { wx.hideLoading({}) @@ -214,5 +216,9 @@ Page({ wx.navigateTo({ url: '/packagecard/paypage/paypage?price=' + _self.data.needPayPrice + '&teamprice=' + _self.data.needPayTeamPrice + '&displayTreaty=1&type=1', }) + }, + //加载更多 + loadMore() { + console.log('触底了') } }) \ No newline at end of file diff --git a/packagecard/cardList/cardList.wxml b/packagecard/cardList/cardList.wxml index 1724f33..986da7c 100644 --- a/packagecard/cardList/cardList.wxml +++ b/packagecard/cardList/cardList.wxml @@ -11,9 +11,9 @@ - + diff --git a/packagecard/moments/momentsdetail/momentsdetail.js b/packagecard/moments/momentsdetail/momentsdetail.js index 5b7dedf..c71e83f 100644 --- a/packagecard/moments/momentsdetail/momentsdetail.js +++ b/packagecard/moments/momentsdetail/momentsdetail.js @@ -2,7 +2,15 @@ const app = getApp() var innerAudioContext = wx.createInnerAudioContext() Page({ data: { + actions: [{ + className: 'dialog-content' + }], dataList: [], + isShowCommentInput: false, //是否显示评论等 + collectSwitch: '1', //收藏的开关默认关闭 + likeSwitch: '1', //点赞的开关 + commentSwitch: '1', //评论的开关 + shareSwitch: '1', //转发的开关 speedStep: 5, //快进快退秒数 waitFlag: false, avatarUrl: app.globalData.userInfo.avatarUrl, @@ -22,17 +30,42 @@ Page({ commentList: [], //评论列表 commentCount: 0, currentPage: 1, //当前评论页数 - curUserId: app.globalData.currentUserId + curUserId: app.globalData.currentUserId, + isShowRestore: false, + restoreList: [], + currentCommentItem: undefined, //当前评论条目 + currentType: 2, //当前评论类型 + restorePage: 1, //当前回复的页数 + restoreCount: 0, + likeStatus: false, //点赞 + collectStatus: false, //收藏, + restoreLikeStatus: false, //评论点赞 }, onLoad(options) { var _self = this this.setData({ uId: options.uId, columnId: options.cId, - dataId: options.uId + dataId: options.uId, + collectSwitch: options.collectSwitch, //收藏的开关 + likeSwitch: options.likeSwitch, //点赞的开关 + commentSwitch: options.commentSwitch, //评论的开关 + shareSwitch: options.shareSwitch, //转发的开关 }) + var isShow = options.collectSwitch == '3' || options.collectSwitch == '4' || options.likeSwitch == '3' && options.likeSwitch == '4' || options.shareSwitch == '3' || options.shareSwitch == '4' || options.commentSwitch == '3' || options.commentSwitch == '4' + console.log(isShow) + if (isShow) { + _self.setData({ + isShowCommentInput: true + }) + } else { + _self.setData({ + isShowCommentInput: false + }) + } _self.getMainMoment() _self.getCommentList() + _self.getColumnContentHandle(this.data.uId, 2) }, // 获取栏目内容 getMainMoment() { @@ -58,6 +91,66 @@ Page({ console.log(err) }) }, + //获取栏目内容点赞 收藏 评论 + getColumnContentHandle(ids, type) { + var _self = this + wx.showLoading({ + title: '加载中...', + }) + app.http.get(app.urls.getColumnContentHandle.format({ + projectId: 'column', + businessIds: ids + }), { + header: { + token: app.globalData.token + } + }) + .then(res => { + wx.hideLoading({}) + if (res.data.length > 0) { + if (type == 2) { + //栏目 + _self.setData({ + likeStatus: res.data[0].likeStatus, + collectStatus: res.data[0].collectStatus + }) + } else { + if (_self.data.currentType == 2) { + //评论 + _self.data.commentList.forEach(it => { + res.data.forEach(item => { + if (it.contentCommentId == item.businessId) { + it.likeStatus = item.likeStatus + it.contentCommentLike = item.likeCount + it.contentCommentSubCount = item.commentCount + } + }) + }) + _self.setData({ + commentList: _self.data.commentList + }) + } else { + //回复 + _self.data.restoreList.forEach(it => { + res.data.forEach(item => { + if (it.contentCommentId == item.businessId) { + it.likeStatus = item.likeStatus + it.contentCommentLike = item.likeCount + it.contentCommentSubCount = item.commentCount + } + }) + }) + _self.setData({ + restoreList: _self.data.restoreList + }) + } + } + } + }) + .catch(err => { + + }) + }, //构建展示数据 buildDetail(data) { var _self = this @@ -184,18 +277,60 @@ Page({ } }) .then(res => { + wx.hideLoading({}) + var ids = '' + res.data.rows.forEach(it => { + it.likeStatus = false + ids += it.contentCommentId + ',' + }) _self.data.commentList = _self.data.commentList.concat(res.data.rows) _self.setData({ commentList: _self.data.commentList, commentCount: res.data.total }) + if (ids.length > 0) { + _self.getColumnContentHandle(ids, 3) + } + }) + .catch(err => { + console.log(res) + }) + }, + //获取评论的回复 + getRestoreList() { + var _self = this + app.http.get(app.urls.getCommentList.format({ + projectId: 'column', + businessId: _self.data.dataId + }), { + header: { + token: app.globalData.token + }, + data: { + page: _self.data.restorePage + } + }) + .then(res => { + wx.hideLoading({}) + var ids = '' + res.data.rows.forEach(it => { + it.likeStatus = false + ids += it.contentCommentId + ',' + }) + _self.data.restoreList = _self.data.restoreList.concat(res.data.rows) + _self.setData({ + restoreList: _self.data.restoreList, + restoreCount: res.data.total, + isShowRestore: true + }) + if (ids.length > 0) { + _self.getColumnContentHandle(ids, 3) + } }) .catch(err => { console.log(res) }) }, - - //预览图片 viewImg(e) { wx.previewImage({ @@ -364,302 +499,6 @@ Page({ innerAudioContext.seek(e.detail.value) } }, - // 跳转模板列表 - goList: function () { - wx.navigateTo({ - url: 'packagecard/cardList/cardList', - }) - }, - // 获取个人简介 - getPersonIntro: function () { - var self = this - app.restAjax.get(app.restAjax.path('{personIntroUrl}app/userexpand/get/' + app.globalData.userInfo.userId, [app.personIntroUrl]), {}, { - headers: { - token: app.globalData.token - } - }, function (code, data) { - self.setData({ - personIntro: data - }) - }, function (code, data) { - app.dialog.msg(data.msg); - }); - }, - // 获取用户信息 - getUserInfo: function () { - var self = this - app.restAjax.get(app.restAjax.path('{loginUrl}app/user/get-app-user', [app.personIntroUrl]), {}, { - headers: { - token: app.globalData.token - } - }, function (code, data) { - app.globalData.userInfo = data - self.getList() - - }, function (code, data) { - app.dialog.msg(data.msg); - }); - }, - // 获取默认名片 - getDefault: function () { - var self = this - app.http.get(app.urls.getDefaultCard, { - header: { - token: app.globalData.token - }, - data: {} - }).then(res => { - var area = res.data.areaList - for (let i = 0; i < area.length; i++) { - if (area[i].templateAreaFontCenter == '1') { - area[i].templateAreaFontCenter = 'left' - } else if (area[i].templateAreaFontCenter == '2') { - area[i].templateAreaFontCenter = 'center' - } else { - area[i].templateAreaFontCenter = 'right' - } - if (area[i].templateAreaFontBold == '0') { - area[i].templateAreaFontBold = 'normal' - } else if (area[i].templateAreaFontBold == '1') { - area[i].templateAreaFontBold = 'bold' - } else { - area[i]['templateAreaFontStyle'] = 'italic' - } - if (area[i].templateAreaSource == 'phone') { - self.setData({ - phoneTxt: area[i].templateAreaFontValue - }) - } else if (area[i].templateAreaSource == 'wechat') { - self.setData({ - wechatTxt: area[i].templateAreaFontValue - }) - } else if (area[i].templateAreaSource == 'email') { - self.setData({ - emailTxt: area[i].templateAreaFontValue - }) - } else if (area[i].templateAreaSource == 'address') { - self.setData({ - addressTxt: area[i].templateAreaFontValue - }) - } else if (area[i].templateAreaSource == 'name') { - self.setData({ - nameTxt: area[i].templateAreaFontValue - }) - } - } - self.setData({ - cardInfo: res.data, - areaList: area, - dataList: [] - }) - - if (res.data) { - self.toSaveLocalImg(res.data.cardTemplateUseDispatchPhoto) - self.getBrowCardUserList(res.data.cardTemplateUseId) - self.getMainColumn(res.data.creator) - } - }).catch(res => { - - }) - }, - //获取浏览当前名片的用户头像列表 - getBrowCardUserList(id) { - var _self = this - app.http.get(app.urls.getCardBrowUserList, { - header: { - token: app.globalData.token - }, - data: { - page: '1', - rows: '7', - cardTemplateUseId: id - } - }) - .then(res => { - if (res.data) { - _self.setData({ - browUserList: res.data.rows - }) - } - }) - .catch(err => { - console.log(err) - }) - }, - // 存入通讯录 - addContact: function () { - var self = this - wx.addPhoneContact({ - firstName: self.data.nameTxt, - mobilePhoneNumber: self.data.phoneNum - }) - }, - // 加入卡包 - includedCard: function () { - var self = this - app.http.post(app.urls.includedCard, { - header: { - token: self.data.token - }, - data: { - cardTemplateUseBagId: "", - cardTemplateUseId: self.data.cardInfo.cardTemplateUseId, - cardTemplateUseStar: "", - cardTemplateUseTag: "", - cardTemplateUseTop: "" - } - }).then(res => { - console.log(res.data) - if (res.statusCode == '200') { - wx.showToast({ - title: '加入卡包成功!', - }) - } - }) - }, - // 拨打电话 - makeCall: function () { - var self = this - var phone = self.data.phoneTxt - if (phone) { - wx.makePhoneCall({ - phoneNumber: phone, - }) - } - }, - // 获取浏览数 - getViewCount: function () { - var self = this - app.restAjax.get(app.restAjax.path('{cardUrl}app/templateviewrecord/getByTemplateUseId/' + self.data.cardInfo.cardPersonId, [app.cardUrl]), {}, { - headers: { - token: app.globalData.token - } - }, function (code, data) { - self.setData({ - viewInfo: data - }) - }, function (code, data) { - if (data.msg) { - app.dialog.msg(data.msg); - } - }); - }, - // 获取转发数 - getForwardCount: function () { - var self = this - app.restAjax.get(app.restAjax.path('{cardUrl}app/templateforwardingrecord/count', [app.cardUrl]), { - templateUseId: self.data.cardInfo.cardPersonId - }, { - headers: { - token: app.globalData.token - } - }, function (code, data) { - self.setData({ - forwardCount: data.data - }) - }, function (code, data) { - app.dialog.msg(data.msg); - }); - }, - // 复制文本 - copyText: function (e) { - var self = this - var text = e.currentTarget.dataset.text - if (text) { - wx.setClipboardData({ - data: text, - success: function () {} - }) - } - }, - // 获取头像 - checkPermission() { - var _self = this - try { - var names = wx.getStorageSync('name') - var icon = wx.getStorageSync('userIcon') - - if (names) { - this.setData({ - name: names, - userIcon: icon - }) - } else { - wx.showModal({ - title: '提示', - content: '小程序需要您微信头像以及昵称用于展示,请授权.', - showCancel: false, - success(res) { - if (res.confirm) { - _self.getUserProfile(3) - } - } - }) - } - } catch (error) { - wx.showToast({ - title: '获取信息失败', - icon: 'error' - }) - } - }, - getUserProfile(e) { - let _self = this - wx.getUserProfile({ - desc: '获取微信头像以及昵称用于展示', - success: (res) => { - wx.setStorage({ - data: res.userInfo.nickName, - key: 'name', - }) - wx.setStorage({ - data: res.userInfo.avatarUrl, - key: 'userIcon', - }) - _self.setData({ - name: res.userInfo.nickName, - userIcon: res.userInfo.avatarUrl - }) - app.globalData.userIcon = res.userInfo.avatarUrl - app.globalData.userInfo = res.userInfo - _self.selectComponent('#head').refreshCart() - }, - fail(err) { - //判断是否绑定手机号 - wx.showToast({ - title: '获取个人信息失败', - icon: 'error', - }) - } - }) - }, - // 生成随机id - buildId: function () { - var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; - - var nums = ""; - - for (var i = 0; i < 36; i++) { - var id = parseInt(Math.random() * 61); - - nums += chars[id]; - } - return nums - }, - // 展示名片码 - showBarCode: function () { - this.setData({ - isShowBarCode: true - }) - wx.hideTabBar() - }, - // 隐藏名片码 - hideBarCode: function () { - this.setData({ - isShowBarCode: false - }) - wx.showTabBar() - }, // 转发记录 shareRecord: function (cardTemplateDispatchId) { var self = this @@ -728,24 +567,75 @@ Page({ delComment(e) { var _self = this var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.idx wx.showModal({ title: '提示', content: '确定要删除该评论吗?', success(res) { if (res.confirm) { //删除评论,刷新列表 + _self.doDelComment(id, index) } } }) }, - //点赞 - doLike(e) { + //删除评论或回复 + doDelComment(id, index) { + var _self = this + wx.showLoading({ + title: '删除中...', + }) + app.http.delete(app.urls.doDelComment.format({ + ids: id + }), { + header: { + token: app.globalData.token + } + }) + .then(res => { + wx.hideLoading({}) + wx.showToast({ + title: '删除成功', + }) + //删除成功 刷新列表 + if (_self.data.currentType == 2) { + //评论 + _self.data.commentList.splice(index, 1) + _self.setData({ + commentList: _self.data.commentList + }) + } else { + //回复 + _self.data.restoreList.splice(index, 1) + _self.data.commentList.forEach(it => { + if (it.contentCommentId == _self.data.dataId) { + it.contentCommentSubCount-- + } + }) + _self.setData({ + restoreList: _self.data.restoreList, + commentList: _self.data.commentList + }) + } + }) + .catch(err => { + }) }, //评论的评论 doCommentToComment(e) { + var _self = this var id = e.currentTarget.dataset.id - var count = e.currentTarget.dataset.count + var item = e.currentTarget.dataset.item + _self.setData({ + dataId: id, + currentPage: 1, + restoreList: [], + currentCommentItem: item, + currentType: 3 + }) + _self.getRestoreList() + }, //显示评论输入框 showComment() { @@ -759,6 +649,16 @@ Page({ isShowComment: false }) }, + onCloseRestore(e) { + var _self = this + _self.setData({ + isShowRestore: false, + currentType: 2, + dataId: _self.data.uId, + restoreList: [], + currentCommentItem: undefined + }) + }, //选择图片 chooseImg() { var _self = this @@ -902,15 +802,32 @@ Page({ wx.showToast({ title: '评论成功', }) - _self.setData({ - commentValue: '', - isShowComment: false, - currentPage: 1, //重置评论列表 - commentList: [], - commentCount: 0 - }) - //刷新列表 - _self.getCommentList() + if (_self.data.currentType == 2) { + _self.setData({ + commentValue: '', + isShowComment: false, + currentPage: 1, //重置评论列表 + commentList: [], + commentCount: 0 + }) + //刷新列表 + _self.getCommentList() + } else { + _self.data.commentList.forEach(it => { + if (it.contentCommentId == id) { + it.contentCommentSubCount++ + } + }) + _self.setData({ + commentValue: '', + isShowComment: false, + restorePage: 1, + restoreList: [], + restoreCount: 0, + commentList: _self.data.commentList + }) + _self.getRestoreList() + } }) .catch(err => { wx.hideLoading({}) @@ -919,5 +836,125 @@ Page({ }) }) }, + //点赞 + doLike(e) { + var _self = this + var type = e.currentTarget.dataset.type //用来判断是栏目内容或评论与回复 + var id = type == '2' ? _self.data.uId : e.currentTarget.dataset.id + var index = -1 + if (type == '4') { + _self.data.commentList.forEach((item, idx) => { + if (item.contentCommentId == id) { + index = idx + } + }) + } else { + index = e.currentTarget.dataset.idx //索引 + } + var favor = type == '2' ? _self.data.likeStatus : e.currentTarget.dataset.like //当前的状态 + var msg = '' + if (favor) { + msg = '取消中...' + } else { + msg = '保存中...' + } + wx.showLoading({ + title: msg, + }) + app.http.post(app.urls.doSaveLike, { + header: { + token: app.globalData.token + }, + data: { + businessId: id, + projectId: 'column' + } + }) + .then(res => { + wx.hideLoading({}) + if (type == '2') { + //栏目 + _self.setData({ + likeStatus: !favor + }) + } else { + //评论与回复 + if (_self.data.currentType == 2) { + //评论 + if (favor) { + _self.data.commentList[index].contentCommentLike-- + _self.data.commentList[index].likeStatus = false + } else { + _self.data.commentList[index].contentCommentLike++ + _self.data.commentList[index].likeStatus = true + } + _self.setData({ + commentList: _self.data.commentList + }) + } else { + if (type == '4') { + if (favor) { + _self.data.commentList[index].contentCommentLike-- + _self.data.commentList[index].likeStatus = false + _self.data.currentCommentItem.likeStatus = false + } else { + _self.data.commentList[index].contentCommentLike++ + _self.data.commentList[index].likeStatus = true + _self.data.currentCommentItem.likeStatus = true + } + _self.setData({ + commentList: _self.data.commentList, + currentCommentItem: _self.data.currentCommentItem + }) + } else { + //回复 + if (favor) { + _self.data.restoreList[index].contentCommentLike-- + _self.data.restoreList[index].likeStatus = false + } else { + _self.data.restoreList[index].contentCommentLike++ + _self.data.restoreList[index].likeStatus = true + } + _self.setData({ + restoreList: _self.data.restoreList + }) + } + + } + } + }) + .catch(err => {}) + }, + //收藏 + doCollect(e) { + var _self = this + var favor = _self.data.collectStatus + var msg = '' + if (favor) { + msg = '取消收藏...' + } else { + msg = '收藏中...' + } + wx.showLoading({ + title: msg, + }) + app.http.post(app.urls.doSaveCollect, { + header: { + token: app.globalData.token + }, + data: { + businessId: _self.data.uId, + projectId: 'column' + } + }) + .then(res => { + wx.hideLoading({}) + _self.data.collectStatus = !_self.data.collectStatus + _self.setData({ + collectStatus: _self.data.collectStatus + }) + }) + .catch(err => {}) + } }) \ No newline at end of file diff --git a/packagecard/moments/momentsdetail/momentsdetail.wxml b/packagecard/moments/momentsdetail/momentsdetail.wxml index d07b0c8..0e50d12 100644 --- a/packagecard/moments/momentsdetail/momentsdetail.wxml +++ b/packagecard/moments/momentsdetail/momentsdetail.wxml @@ -202,38 +202,68 @@ {{item.contentCommentUserName}} - + + {{item.contentCommentLike}} - + + {{item.contentCommentContent}} + + data-item="{{item}}"> {{item.contentCommentSubCount}} 回复 + data-idx="{{index}}" data-id="{{item.contentCommentId}}" + wx:if="{{curUserId== item.creator}}"> - - 暂无评论 + + - - + + - + 写评论... - - - + + + + + + + + 写评论... + + + @@ -243,16 +273,64 @@ - + - + 发布 + + + + + + + {{currentCommentItem.contentCommentUserName}} + + {{currentCommentItem.contentCommentContent}} + + + + + 全部回复 + + + + + + {{item.contentCommentUserName}} + + + {{item.contentCommentLike}} + + + + + {{item.contentCommentContent}} + + + + + + + + + + + + + + diff --git a/pages/index/index.js b/pages/index/index.js index 29b7fa7..710027c 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -249,11 +249,11 @@ Page({ }) .then(res => { if (res.data.length > 0) { - // collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关 - // commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关 - // shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关 - // likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关 var tempItem = { + collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关 + commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关 + shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关 + likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关 cId: datas[_self.data.curIndex].configColumnId, type: datas[_self.data.curIndex].configColumnType, name: datas[_self.data.curIndex].configColumnName, @@ -941,17 +941,13 @@ Page({ }, // 展示名片码 showBarCode: function () { - // TODO 测试 - wx.navigateTo({ - url: '/packagecard/moments/publish/momentpublish', + this.setData({ + isNeedRefresh: false + }) + var _self = this + wx.navigateTo({ + url: '/packagecard/sharePage/cardcode?cardImg=' + _self.data.cardInfo.cardTemplateUsePhotoUrl + '&id=' + _self.data.cardInfo.cardTemplateUseBarcode, }) - // this.setData({ - // isNeedRefresh: false - // }) - // var _self = this - // wx.navigateTo({ - // url: '/packagecard/sharePage/cardcode?cardImg=' + _self.data.cardInfo.cardTemplateUsePhotoUrl + '&id=' + _self.data.cardInfo.cardTemplateUseBarcode, - // }) }, // 隐藏名片码 hideBarCode: function () { @@ -993,7 +989,12 @@ Page({ var type = res.target.dataset.sharetype if (type && type == '2') { //转发个人动态 - + // data-item="{{it}}" data-idx="{{idx}}" + // data-index="{{index}}" + var item = res.target.dataset.item + var idx = res.target.dataset.idx + var index = res.target.dataset.index + console.log(item) } else { var postId = self.buildId() self.shareRecord(postId) @@ -1024,8 +1025,13 @@ Page({ //需要跳详情 var cId = e.currentTarget.dataset.cid var uId = e.currentTarget.dataset.id + var like = e.currentTarget.dataset.like + var collect = e.currentTarget.dataset.collect + var comment = e.currentTarget.dataset.comment + var share = e.currentTarget.dataset.share + var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share wx.navigateTo({ - url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId, + url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params, }) } }, @@ -1234,8 +1240,18 @@ Page({ //需要跳详情 var cId = e.currentTarget.dataset.cid var uId = e.currentTarget.dataset.uid + var like = e.currentTarget.dataset.like + var collect = e.currentTarget.dataset.collect + var comment = e.currentTarget.dataset.comment + var share = e.currentTarget.dataset.share + // collectSwitch: options.collectSwitch,//收藏的开关 + // likeSwitch:options.likeSwitch,//点赞的开关 + // commentSwitch:options.commentSwitch,//评论的开关 + // shareSwitch:options.shareSwitch,//转发的开关 + var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share + console.log(params) wx.navigateTo({ - url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId, + url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params, }) }, //点赞 diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0924d19..eac92de 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -119,7 +119,9 @@ style="width:100%;"> + data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}" + data-comment="{{item.commentSwitch}}" data-ctype="{{item.type}}" data-cid="{{item.cId}}" + data-id="{{it.uid}}"> @@ -152,6 +154,8 @@ @@ -327,7 +331,9 @@ + catchtap="showComment" data-uid="{{it.uid}}" data-cid="{{item.cId}}" data-like="{{item.likeSwitch}}" + data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}" + data-comment="{{item.commentSwitch}}"> {{it.commentCount>1000 ? '1000+':it.commentCount}} @@ -352,9 +358,6 @@ - - - diff --git a/pages/mine/otherCard/othercarddetail.js b/pages/mine/otherCard/othercarddetail.js index e21bb7b..c4df805 100644 --- a/pages/mine/otherCard/othercarddetail.js +++ b/pages/mine/otherCard/othercarddetail.js @@ -159,6 +159,10 @@ Page({ .then(res => { if (res.data.length > 0) { var tempItem = { + collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关 + commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关 + shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关 + likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关 cId: datas[_self.data.curIndex].configColumnId, type: datas[_self.data.curIndex].configColumnType, name: datas[_self.data.curIndex].configColumnName, diff --git a/pages/mine/otherCard/othercarddetail.wxml b/pages/mine/otherCard/othercarddetail.wxml index ee10e41..6061ef8 100644 --- a/pages/mine/otherCard/othercarddetail.wxml +++ b/pages/mine/otherCard/othercarddetail.wxml @@ -176,13 +176,13 @@ - + - @@ -192,7 +192,8 @@ - + @@ -302,6 +303,41 @@ + + + + + + + + + + + 收藏 + + + + + {{it.commentCount>1000 ? '1000+':it.commentCount}} + + + + + {{it.likeCount>1000? '1000+':it.likeCount}} + + + diff --git a/utils/api.js b/utils/api.js index 3f9377d..b8b1b15 100644 --- a/utils/api.js +++ b/utils/api.js @@ -129,6 +129,7 @@ var apis = { getColumnContentHandle: `app/contentcomment/countlist/{projectId}/{businessIds}`, //获取栏目内容评论 点赞 收藏数量 doSaveComment: `app/contentcomment/save`, //?businessId=xx&projectId=columnComment&contentCommentContent=xxx 保存评论 getCommentList: `app/contentcomment/listpagerelease/{projectId}/{businessId}`, // ?contentCommentParentId=xxx 获取评论列表 + doDelComment: `app/contentcomment/remove/{ids}`, //删除评论 //名片信息 getCardList: `app/cardtemplate/list`, //获取名片列表 getCardDetail: `app/cardtemplate/get/{cardTemplateId}`, //获取名片详情