Browse Source

版本 1.6.29 解码锦水模块内容增加可评论;

release
ZhaoTongYao 5 years ago
parent
commit
087a5a70a3
  1. 3
      app.json
  2. 2
      pages/toRegister/toRegister.js
  3. 9
      subpages/associationNew/pages/addTopic/addTopic.js
  4. 2
      subpages/discussion/pages/addIssue/addIssue.js
  5. 2
      subpages/discussion/pages/remarkOrReply/remarkOrReply.js
  6. BIN
      subpages/oneKeyService/images/ic_baidataidubianji@2x.png
  7. BIN
      subpages/oneKeyService/images/ic_dangbiaoqian.png
  8. BIN
      subpages/oneKeyService/images/ic_fandu@2x.png
  9. BIN
      subpages/oneKeyService/images/ic_fanduihuise@2x.png
  10. BIN
      subpages/oneKeyService/images/ic_huifu@2x.png
  11. BIN
      subpages/oneKeyService/images/ic_qiehuan@2x.png
  12. BIN
      subpages/oneKeyService/images/ic_zhici@2x.png
  13. BIN
      subpages/oneKeyService/images/ic_zhicihuise@2x.png
  14. 4
      subpages/oneKeyService/pages/index/index.js
  15. 1
      subpages/oneKeyService/pages/index/index.wxml
  16. 6
      subpages/oneKeyService/pages/moduleList/moduleList.js
  17. 46
      subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.js
  18. 3
      subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.json
  19. 57
      subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.wxml
  20. 168
      subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.wxss
  21. 222
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.js
  22. 6
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.json
  23. 35
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml
  24. 60
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxss
  25. 108
      subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.js
  26. 3
      subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.json
  27. 20
      subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.wxml
  28. 76
      subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.wxss
  29. 10
      subpages/oneKeyService/utils/common.js
  30. 30
      utils/understandJs.js

3
app.json

@ -146,7 +146,8 @@
"pages/reportIssueDetail/reportIssueDetail",
"pages/suggestDict/suggestDict",
"pages/suggestDictList/suggestDictList",
"pages/suggestDetail/suggestDetail"
"pages/suggestDetail/suggestDetail",
"pages/remarkOrReply/remarkOrReply"
]
}
],

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
const versionNum = "1.6.28"
const versionNum = "1.6.29"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag

9
subpages/associationNew/pages/addTopic/addTopic.js

@ -47,7 +47,7 @@ Page({
// 话题内容框 值双向绑定
bindTopicValue (e) {
this.setData({
topicValue: e.detail.value
topicValue: e.detail.value.trim(' ')
})
console.log(this.data.topicValue)
},
@ -275,6 +275,13 @@ Page({
this.data.imageList.forEach(item => {
imagesList.push(item.ossUrl)
})
} else {
wx.showToast({
title: '请上传图片',
icon: 'none',
duration: 2000
})
return false
}
const para = {
topicType:this.data.topicType,//话题类型:0:事好儿鼓个掌 1:话对捧个场

2
subpages/discussion/pages/addIssue/addIssue.js

@ -34,7 +34,7 @@ Page({
// 双向绑定 内容输入框
bindTextareaInput (e) {
this.setData({
issueContent: e.detail.value
issueContent: e.detail.value.trim(' ')
})
},
// 双向绑定 地址输入框

2
subpages/discussion/pages/remarkOrReply/remarkOrReply.js

@ -35,7 +35,7 @@ Page({
// textarea 双向绑定
bindTextareaValue (e) {
this.setData({
textareaValue: e.detail.value
textareaValue: e.detail.value.trim(' ')
})
},
remarkOrReply () {

BIN
subpages/oneKeyService/images/ic_baidataidubianji@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
subpages/oneKeyService/images/ic_dangbiaoqian.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
subpages/oneKeyService/images/ic_fandu@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
subpages/oneKeyService/images/ic_fanduihuise@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
subpages/oneKeyService/images/ic_huifu@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
subpages/oneKeyService/images/ic_qiehuan@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
subpages/oneKeyService/images/ic_zhici@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
subpages/oneKeyService/images/ic_zhicihuise@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

4
subpages/oneKeyService/pages/index/index.js

@ -88,7 +88,7 @@ Page({
goDetails(e) {//模块编码(政策,通知,档案,警事,一键直通)
if (e.currentTarget.dataset.modulestyle == '4') {
wx.navigateTo({
url: `../noticeDetail/noticeDetail?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}`
url: `../noticeDetail/noticeDetail?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}&commentFlag=${e.currentTarget.dataset.commentflag}`
})
} else {
if (e.currentTarget.dataset.categorycode == 'module_hardcore') {
@ -101,7 +101,7 @@ Page({
})
} else {
wx.navigateTo({
url: `../moduleList/moduleList?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}`
url: `../moduleList/moduleList?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}&commentFlag=${e.currentTarget.dataset.commentflag}`
})
}
}

1
subpages/oneKeyService/pages/index/index.wxml

@ -6,6 +6,7 @@
wx:for-index="index"
wx:for="{{modulelist}}"
data-pid="{{item.id}}"
data-commentFlag="{{item.commentFlag}}"
data-bannerFlag="{{item.bannerFlag}}"
data-categoryCode="{{item.categoryCode}}"
data-moduleStyle="{{item.moduleStyle}}"

6
subpages/oneKeyService/pages/moduleList/moduleList.js

@ -299,12 +299,12 @@ Page({
const info = e.currentTarget.dataset.info
if (info.moduleStyle == '4') {
wx.navigateTo({
url: `../noticeDetail/noticeDetail?pid=${info.pid}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}`
url: `../noticeDetail/noticeDetail?pid=${info.pid}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}`
})
}
else {
wx.navigateTo({
url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}`
url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}`
})
}
},
@ -313,7 +313,7 @@ Page({
toDetail(e){
const info = e.currentTarget.dataset
wx.navigateTo({
url: `../noticeDetail/noticeDetail?id=${info.id}&title=${this.data.moduleInfo.categoryname}`
url: `../noticeDetail/noticeDetail?id=${info.id}&title=${this.data.moduleInfo.categoryname}&commentFlag=${this.data.moduleInfo.commentFlag}`
})
},

46
subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.js

@ -0,0 +1,46 @@
Component({
data: {
support: "../../../../images/ic_zhicihuise@2x.png",
supported: "../../../../images/ic_zhici@2x.png",
dispport: "../../../../images/ic_fanduihuise@2x.png",
dispported: "../../../../images/ic_fandu@2x.png"
},
properties: {
remarkObj: {
type: Object,
value: {}
},
remarkType: {
type: String,
value: "new"
}
},
lifetimes: {
},
pageLifetimes: {
},
methods: {
// 对评论进行回复
replyRemark (e) {
this.triggerEvent("replyRemark", { commentId: e.currentTarget.dataset.commentid })
},
// 支持评论
supportRemark (e) {
this.triggerEvent("supportRemark", { commentId: e.currentTarget.dataset.commentid })
},
// 反对 评论
dispportRemark (e) {
this.triggerEvent("dispportRemark", { commentId: e.currentTarget.dataset.commentid })
},
// 最新最热 切换
changeRemarkType () {
if (this.data.remarkType === "new") {
this.triggerEvent("changeRemarkType", { type: "hot"})
} else {
this.triggerEvent("changeRemarkType", { type: "new"})
}
}
}
})

3
subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.json

@ -0,0 +1,3 @@
{
"component": true
}

57
subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.wxml

@ -0,0 +1,57 @@
<view class="detail-remark">
<view class="title">
<view class="left">
<view class="remark-title">评论</view>
<view class="remark-altitude">表达态度{{remarkObj.statementNum}}次</view>
</view>
<view class="right">
<view class="flip {{remarkType === 'hot' ? 'reverse' : ''}}" bindtap="changeRemarkType">
<view class="front">
<view class="latest">最新</view>
<image class="latest-image" src="../../../../images/ic_qiehuan@2x.png" />
</view>
<view class="back">
<image class="latest-image" src="../../../../images/ic_qiehuan@2x.png" />
<view class="latest">最热</view>
</view>
</view>
</view>
</view>
<view class="remark-list">
<view
class="remark-list-item"
wx:for="{{remarkObj.commentsList}}"
wx:key="{{index}}"
wx:for-index="index"
wx:for-item="item">
<view class="user-info">
<image class="avatar" src="{{item.user.userFace}}" />
<view class="right">
<view class="identify">
<view class="nickname">{{item.user.userName}}</view>
<image class="party-flag" wx:if="{{item.user.partyFlag == '1'}}" src="../../../../images/ic_dangbiaoqian.png" />
</view>
<view class="time">{{item.commentTime}}</view>
</view>
</view>
<view class="remark-content">{{item.content}}</view>
<view class="remarked-content" wx:if="{{item.replyComment.userName}}">{{item.replyComment.userName}}:{{item.replyComment.content}}</view>
<view class="operation">
<view class="support type" bindtap="supportRemark" data-commentid="{{item.commentId}}">
<image src="{{item.userLike ? supported : support}}" />
<view style="color: {{item.userLike ? '#FFB100' : '#a7a7a7'}}">支持 {{item.approveNum}}</view>
</view>
<view class="dispport type" bindtap="dispportRemark" data-commentid="{{item.commentId}}">
<image src="{{item.userDislike ? dispported : dispport}}" />
<view style="color: {{item.userDislike ? '#FFB100' : '#a7a7a7'}}">不支持 {{item.opposeNum}}</view>
</view>
<view class="reply type" bindtap="replyRemark" data-commentid="{{item.commentId}}">
<image src="../../../../images/ic_huifu@2x.png" />
<view>回复</view>
</view>
</view>
</view>
</view>
</view>

168
subpages/oneKeyService/pages/noticeDetail/components/detailRemark/detailRemark.wxss

@ -0,0 +1,168 @@
.detail-remark {
width: 100%;
}
.title {
width: 100%;
height: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: 25rpx;
}
.title .left {
display: flex;
align-items: flex-end;
}
.title .left .remark-title {
font-size: 32rpx;
color: #333;
font-weight: bolder;
margin-right: 11rpx;
}
.title .left .remark-altitude {
font-size: 24rpx;
color: #999;
}
.title .right {
height: 80rpx;
width: 110rpx;
perspective: 1000;
transform-style: preserve-3d;
}
.title .right .flip {
position: relative;
transition: 0.6s;
transform-style: preserve-3d;
width: 100%;
height: 100%;
}
.title .right .flip.reverse {
transform: rotateY(180deg);
}
.title .right .flip .front, .title .right .flip .back {
display: flex;
align-items: center;
justify-content: flex-end;
position:absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
}
.title .right .flip .front {
z-index: 2;
background: #f7f7f7;
}
.title .right .flip .back {
transform: rotateY(-180deg);
background: #f7f7f7;
}
.title .right .latest {
font-size: 28rpx;
color: #333;
height: 80rpx;
line-height: 80rpx;
}
.title .right .latest-image {
width: 28rpx;
height: 23rpx;
object-fit: cover;
margin: 0 10rpx 0 10rpx;
}
.remark-list {
width: 100%;
}
.remark-list .remark-list-item {
width: 100%;
box-sizing: border-box;
border-radius: 16rpx;
background: #fff;
padding: 37rpx 25rpx 0;
overflow: hidden;
}
.remark-list .remark-list-item + .remark-list-item {
margin-top: 20rpx;
}
.remark-list-item .user-info {
width: 100%;
height: 64rpx;
display: flex;
align-items: center;
}
.remark-list-item .user-info .avatar {
width: 64rpx;
height: 64rpx;
border-radius: 8rpx;
margin-right: 13rpx;
}
.remark-list-item .user-info .right {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.remark-list-item .user-info .right .identify {
display: flex;
align-items: center;
}
.remark-list-item .user-info .right .nickname {
font-size: 28rpx;
color: #333;
}
.remark-list-item .user-info .right .party-flag {
width: 27rpx;
height: 27rpx;
object-fit: cover;
margin-left: 6rpx;
}
.remark-list-item .user-info .right .time {
font-size: 20rpx;
color: #999;
}
.remark-list-item .remark-content {
margin-top: 28rpx;
margin-bottom: 24rpx;
font-size: 36rpx;
color: #333;
}
.remark-list-item .remarked-content {
width: 100%;
height: 88rpx;
border-radius: 16rpx;
background: #f2f2f2;
box-sizing: border-box;
padding: 0 20rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 30rpx;
color: #999;
line-height: 88rpx;
margin-bottom: 25rpx;
}
.remark-list-item .operation {
width: 100%;
height: 85rpx;
display: flex;
align-items: center;
justify-content: space-around;
border-top: 1rpx solid #eaeaea;
}
.remark-list-item .operation .type {
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.remark-list-item .operation .type image {
width: 28rpx;
height: 28rpx;
object-fit: cover;
}
.remark-list-item .operation .type view {
font-size: 24rpx;
color: #A7A7A7;
margin-left: 15rpx;
}

222
subpages/oneKeyService/pages/noticeDetail/noticeDetail.js

@ -1,5 +1,7 @@
const api = require('../../../../utils/understandJs')
const app = getApp()
import util from '../../../../utils/util'
import { formatTimestamp } from "../../utils/common"
Page({
/**
@ -8,8 +10,6 @@ Page({
data: {
noticeObj: {},
noticeObjContent: "",
pageIndex:1,
pageSize:10,
categoryName:'',
preloadVisible: true,
isNeedBanner: false,
@ -21,19 +21,46 @@ Page({
duration: 500, //幻灯片切换时长(ms)
currentSwiper: 0,
nodata: false,
showTitle: true
showTitle: true,
noticeId: '',
infoCompleted: 0, // 当前用户是否完善信息
completeInfoDialogVisible: false, // 完善信息弹窗
commentFlag: '0', //是否显示评论列表
remarkType: "new", // 评论 最新最热类型
pageIndex:1,
pageSize:10,
remarkObj: { // 评论列表
statementNum: 0,
commentsList: []
},
supportTimer: "", // 点赞 支持的计时器
dispportTimer: "", // 点踩 反对的计时器
dialogVisible: false, // 提示信息探矿所需入参
dialogTitle: "",
dialogContent: "",
dialogConformText: "",
dialogCancelText: "",
loadMoreVisible: false, // loadMoreVisible 和 loadMoreType 控制 超出一屏时的 加载和没有更多的显示与隐藏
loadMoreType: "none",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
infoCompleted: app.globalData.infoCompleted,
commentFlag: options.commentFlag
})
if (options.id) {
wx.setNavigationBarTitle({
title: options.title
})
this.setData({
noticeId: options.id
})
this.noticeDetail(options.id)
this.getRemarkList()
} else {
this.setData({
categoryName:options.categorycode
@ -99,8 +126,8 @@ Page({
noticelist () {
let that = this;
let params = {
pageIndex: that.data.pageIndex,
pageSize: that.data.pageSize,
pageIndex: 1,
pageSize: 10,
noticeCategory: that.data.categoryName
}
api.noticelist(params).then(function (res) {
@ -110,9 +137,11 @@ Page({
})
} else {
that.setData({
nodata: false
nodata: false,
noticeId: res.data[0].id
})
that.noticeDetail(res.data[0].id)
that.getRemarkList()
}
}).catch(err => {
console.log(err)
@ -130,6 +159,171 @@ Page({
console.log(err)
})
},
// 最新最热 评论列表切换
changeRemarkType (e) {
this.setData({
remarkType: e.detail.type,
loadMoreVisible: false
})
this.getRemarkList()
},
// 获取评论列表 下拉刷新
getRemarkList () {
if (this.data.commentFlag != '1') {
return false
}
this.setData({
pageIndex: 1,
pageSize: 10
})
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
timestamp: formatTimestamp(),
orderType: this.data.remarkType === "new" ? 0 : 1,
noticeId: this.data.noticeId,
}
api.getCommentList(para).then(res => {
console.log("评论列表", res)
this.setData({
remarkObj: {
statementNum: res.data.statementNum,
commentsList: [...res.data.commentsList]
},
loadMoreType: res.data.commentsList.length === 10 ? "loading" : "none"
})
}).catch(err => {
console.log(err)
})
},
// 获取评论列表 上拉加载
loadMoreGetRemarkList () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
timestamp: formatTimestamp(),
orderType: this.data.remarkType === "new" ? 0 : 1,
noticeId: this.data.noticeId,
}
api.getCommentList(para).then(res => {
console.log("评论列表", res)
this.setData({
remarkObj: {
statementNum: res.data.statementNum,
commentsList: [...this.data.remarkObj.commentsList, ...res.data.commentsList]
},
loadMoreType: res.data.commentsList.length === 10 ? "loading" : "none"
})
}).catch(err => {
console.log(err)
})
},
debounceSupportRemark (e) {
clearTimeout(this.data.supportTimer)
this.data.supportTimer = setTimeout(() => {
this.supportRemark(e)
}, 300)
},
// 评论 支持 点赞
supportRemark (e) {
if (this.verifyCompleteInfo()) {
return false
}
const hasAttitude = this.data.remarkObj.commentsList.some(item => item.commentId === e.detail.commentId && (item.userLike || item.userDislike))
if (hasAttitude) {
this.setData({
dialogConformText: "知道了",
dialogContent: ["已表达过态度,不可以更改哦!"],
dialogTitle: "已表态",
dialogVisible: !this.data.dialogVisible
})
return false
}
const index = this.data.remarkObj.commentsList.findIndex(item => item.commentId === e.detail.commentId)
this.setData({
[`remarkObj.commentsList[${index}].userLike`]: true,
[`remarkObj.commentsList[${index}].approveNum`]: parseInt(this.data.remarkObj.commentsList[index].approveNum) + 1,
["remarkObj.statementNum"]: parseInt(this.data.remarkObj.statementNum) + 1
})
const para = {
attitude: "0",
commentId: e.detail.commentId,
noticeId: this.data.noticeId
}
api.commentSupport(para).then(res => {
console.log('评论支持', res)
}).catch(err => {
console.log(err)
})
},
debounceDispportRemark (e) {
clearTimeout(this.data.dispportTimer)
this.data.dispportTimer = setTimeout(() => {
this.dispportRemark(e)
}, 300)
},
// 评论 不支持 点踩
dispportRemark (e) {
if (this.verifyCompleteInfo()) {
return false
}
const hasAttitude = this.data.remarkObj.commentsList.some(item => item.commentId === e.detail.commentId && (item.userLike || item.userDislike))
if (hasAttitude) {
this.setData({
dialogConformText: "知道了",
dialogContent: ["已表达过态度,不可以更改哦!"],
dialogTitle: "已表态",
dialogVisible: !this.data.dialogVisible
})
return false
}
const index = this.data.remarkObj.commentsList.findIndex(item => item.commentId === e.detail.commentId)
this.setData({
[`remarkObj.commentsList[${index}].userDislike`]: true,
[`remarkObj.commentsList[${index}].opposeNum`]: parseInt(this.data.remarkObj.commentsList[index].opposeNum) + 1,
["remarkObj.statementNum"]: parseInt(this.data.remarkObj.statementNum) + 1
})
const para = {
attitude: "1",
commentId: e.detail.commentId,
noticeId: this.data.noticeId
}
api.commentOpposition(para).then(res => {
console.log('评论不支持', res)
}).catch(err => {
console.log(err)
})
},
// 进行评论
navigateToReply () {
if (this.verifyCompleteInfo()) {
return false
}
wx.navigateTo({
url: `../remarkOrReply/remarkOrReply?noticeId=${this.data.noticeId}&faCommentId=`
})
},
// 评论 回复 回调
replyRemark (e) {
if (this.verifyCompleteInfo()) {
return false
}
wx.navigateTo({
url: `../remarkOrReply/remarkOrReply?noticeId=${this.data.noticeId}&faCommentId=${e.detail.commentId}`
})
},
// 检查 是否完善信息
verifyCompleteInfo () {
if (this.data.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return true
} else {
return false
}
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -170,13 +364,21 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.loadMoreGetRemarkList()
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
// onShareAppMessage: function () {
}
// }
})

6
subpages/oneKeyService/pages/noticeDetail/noticeDetail.json

@ -1,7 +1,11 @@
{
"usingComponents": {
"no-data": "../../../../components/nodata/nodata",
"parser": "../../../../components/parser/parser"
"parser": "../../../../components/parser/parser",
"completeInfo-dialog": "../../../../components/completeInfoDialog/completeInfoDialog",
"detail-remark": "./components/detailRemark/detailRemark",
"load-more": "../../../../components/loadMore/loadMore",
"tip-dialog": "../../compontents/notice/notice"
},
"navigationBarTitleText": ""
}

35
subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml

@ -51,6 +51,41 @@
<view class="preload-title"></view>
<view class="preload-content"></view>
</view>
<block wx:if="{{commentFlag == '1'}}">
<detail-remark
remarkObj="{{remarkObj}}"
remarkType="{{remarkType}}"
bind:replyRemark="replyRemark"
bind:supportRemark="debounceSupportRemark"
bind:dispportRemark="debounceDispportRemark"
bind:changeRemarkType="changeRemarkType">
</detail-remark>
<load-more
loadMoreVisible="{{loadMoreVisible}}"
loadMoreType="{{loadMoreType}}"
>
</load-more>
<view class="bottom">
<view class="reply" style="width: {{detailObj.showSatisfactionEvaluation ? '490rpx': '100%'}}">
<image src="../../images/ic_baidataidubianji@2x.png" />
<input disabled bindtap="navigateToReply" placeholder="placeholder-input" type="text" placeholder="快来表达您的态度吧"/>
</view>
<button wx:if="{{detailObj.showSatisfactionEvaluation && detailType == 'project'}}" hover-class="hover-button" bindtap="publishEvaluation">满意度评价</button>
</view>
</block>
</view>
<no-data isShow="{{nodata}}"></no-data>
<tip-dialog
dialogVisible="{{dialogVisible}}"
title="{{dialogTitle}}"
content="{{dialogContent}}"
confirmText="{{dialogConformText}}"
cancelText="{{dialogCancelText}}">
</tip-dialog>
<completeInfo-dialog
completeInfoDialogVisible="{{completeInfoDialogVisible}}">
</completeInfo-dialog>

60
subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxss

@ -3,10 +3,10 @@ page{
}
.notice-detail {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 20rpx;
background: #f7f7f7;
margin-bottom: 80rpx;
}
.richContent img{
width: 100%!important;
@ -19,6 +19,7 @@ page{
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 25rpx 38rpx;
margin-bottom: 40rpx;
}
.detail-title {
font-family: PingFang-SC-Bold;
@ -264,4 +265,59 @@ swiper {
position: absolute;
top: 0;
}
/* 轮播图end */
/* 轮播图end */
/* 评论 start */
.bottom {
width: 100%;
height: 90rpx;
background: #fff;
padding: 15rpx;
box-sizing: border-box;
display: flex;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
}
.reply {
width: 490rpx;
height: 70rpx;
border-radius: 8rpx;
background: #F2F2F2;
display: flex;
align-items: center;
}
.reply image {
width: 30rpx;
height: 30rpx;
margin: 0 10rpx 0 25rpx;
}
.reply input {
height: 100%;
width: calc(100% - 65rpx);
font-size: 26rpx;
}
.reply .placeholder-input {
font-size: 26rpx;
color: #a8a8a8;
}
button {
width: 200rpx;
height: 70rpx;
border-radius: 35rpx;
background: linear-gradient(to right, #FFAC00, #FFBF00);
color: #fff;
font-size: 30rpx;
line-height: 70rpx;
text-align:center;
padding: 0;
outline: 0;
}
button::after {
border:0;
}
.hover-button {
background: orange;
}
/* 评论 end */

108
subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.js

@ -0,0 +1,108 @@
const api = require('../../../../utils/understandJs')
Page({
data: {
textareaValue: "",
faCommentId: "",
noticeId: "",
violationsCount: 0, //违规次数
isConReview: false,
lock: false, //锁定提交状态,防止双击
},
onLoad (options) {
this.setData({
noticeId: options.noticeId,
faCommentId: options.faCommentId
})
},
// textarea 双向绑定
bindTextareaValue (e) {
this.setData({
textareaValue: e.detail.value.trim(' ')
})
},
remarkOrReply () {
if (!this.data.textareaValue) {
wx.showToast({
title: "请输入评论内容",
icon: "none"
})
return false
}
if (this.data.lock) {
return false
}
this.setData({
lock: true
})
const para = {
noticeId: this.data.noticeId,
faCommentId: this.data.faCommentId,
content: this.data.textareaValue,
// isConReview: this.data.isConReview
}
wx.showLoading({
title: "提交中..."
})
let that = this
if (this.data.faCommentId) { //评论 回复 回调
api.commentReplySubmit(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
wx.showToast({
title: "评论成功",
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
page.getRemarkList()
}
setTimeout(() => {
wx.navigateBack()
}, 500)
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
} else { //对 内容 进行评论
api.commentSubmit(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
wx.showToast({
title: "评论成功",
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
page.getRemarkList()
}
setTimeout(() => {
wx.navigateBack()
}, 500)
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
}
}
})

3
subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.json

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "评论"
}

20
subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.wxml

@ -0,0 +1,20 @@
<view class="remark-or-reply">
<view class="remark-content">
<textarea
maxlength="200"
value="{{textareaValue}}"
bindinput="bindTextareaValue"
placeholder="请您表达观点态度吧"
placeholder-class="textarea-placeholder">
</textarea>
<view class="content-num">
{{textareaValue.length}}/200
</view>
</view>
<view class="reply-btn">
<button hover-class="hover-button" bindtap="remarkOrReply" disabled="{{lock}}">
<image src="../../images/submitbk.png" />
<text >发布</text>
</button>
</view>
</view>

76
subpages/oneKeyService/pages/remarkOrReply/remarkOrReply.wxss

@ -0,0 +1,76 @@
page {
width:100%;
height:100vh;
}
.remark-or-reply {
width: 100%;
height: 100%;
background: #f7f7f7;
box-sizing: border-box;
padding: 20rpx;
}
.remark-or-reply .remark-content {
width: 100%;
border-radius: 16rpx;
background: #fff;
height: 930rpx;
box-sizing: border-box;
padding: 25rpx;
}
.remark-or-reply .remark-content textarea {
width: 100%;
height: calc(100% - 50rpx);
overflow-y: auto;
font-size: 32rpx;
color: #333;
line-height: 50rpx;
}
.remark-or-reply .remark-content .content-num {
width:100%;
height: 50rpx;
line-height: 50rpx;
font-size: 28rpx;
color: #999;
text-align: right;
}
.remark-or-reply .remark-content .textarea-placeholder {
font-size: 32rpx;
color: #999;
}
.reply-btn {
width: 100%;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 70rpx;
}
.reply-btn button {
width: 560rpx;
height: 100rpx;
line-height: 84rpx;
text-align: center;
color: #fff;
font-size: 36rpx;
padding: 0;
outline: 0;
border-radius: 16rpx;
/* background: linear-gradient(to right, #f40f0f, #ff4c4c); */
background-color: transparent;
}
.reply-btn .hover-button {
/* background:red; */
}
button image {
width: 100%;
height: 100%;
}
button text {
position: absolute;
width: 100%;
height: 100%;
left: 0;
}
button::after {
border: none;
}

10
subpages/oneKeyService/utils/common.js

@ -0,0 +1,10 @@
export function formatTimestamp () {
const date = new Date()
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, "0")
const day = (date.getDate()).toString().padStart(2, "0")
const hour = (date.getHours()).toString().padStart(2, "0")
const minute = (date.getMinutes()).toString().padStart(2, "0")
const second = (date.getSeconds()).toString().padStart(2, "0")
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
}

30
utils/understandJs.js

@ -10,7 +10,12 @@ module.exports = {
bannerList:bannerList,
videoBannerList:videoBannerList,
getFullDictInfo:getFullDictInfo,
moduleCategory:moduleCategory
moduleCategory:moduleCategory,
getCommentList: getCommentList,
commentSupport: commentSupport,
commentOpposition: commentOpposition,
commentSubmit: commentSubmit,
commentReplySubmit: commentReplySubmit
}
// 了解锦水-模块管理接口
function modulelist(moduleCategory='') {
@ -63,4 +68,27 @@ function getFullDictInfo (dictType) {
// 一键服务/解码锦水 改版模块类别接口
function moduleCategory(params) {
return fly.get('news/module/moduleCategory', params)
}
//内容评论列表【最新/最热列表】
function getCommentList(params) {
return fly.get('news/notice/comment/list', params)
}
//表态内容评论(赞)
function commentSupport (data) {
return fly.post("news/notice/comment/statement/support", data)
}
//表态内容评论(踩)
function commentOpposition (data) {
return fly.post("news/notice/comment/statement/opposition", data)
}
//内容评论提交
function commentSubmit (data) {
return fly.post("news/notice/comment/submit", data)
}
//内容评论的回复提交
function commentReplySubmit (data) {
return fly.post("news/notice/comment/reply/submit", data)
}
Loading…
Cancel
Save