Browse Source

所有提交增加防止连击;我要举报和申请发单增加内容审核;修复扫码老兵在线无法跳转BUG;

feature/optimise
ZhaoTongYao 5 years ago
parent
commit
fa3831d2c0
  1. 2
      components/activity/activity.wxss
  2. 38
      pages/complete/components/personalInfo/personalInfo.js
  3. 4
      pages/complete/components/personalInfo/personalInfo.wxml
  4. 3
      pages/indexNew/indexNew.js
  5. 2
      pages/mine/components/topicItemNew/topicItemNew.wxss
  6. 22
      subpages/associationNew/pages/addTopic/addTopic.js
  7. 6
      subpages/associationNew/pages/addTopic/addTopic.wxml
  8. 10
      subpages/associationNew/pages/eventlist/eventlist.js
  9. 2
      subpages/associationNew/pages/eventlist/eventlist.wxml
  10. 12
      subpages/discussion/pages/addIssue/addIssue.js
  11. 2
      subpages/discussion/pages/addIssue/addIssue.wxml
  12. 42
      subpages/discussion/pages/remarkOrReply/remarkOrReply.js
  13. 2
      subpages/discussion/pages/remarkOrReply/remarkOrReply.wxml
  14. 11
      subpages/heart/pages/clockIn/clockIn.js
  15. 2
      subpages/heart/pages/clockIn/clockIn.wxml
  16. 59
      subpages/heart/pages/myApply/myApply.js
  17. 12
      subpages/heart/pages/volunteer/volunteer.js
  18. 4
      subpages/heart/pages/volunteer/volunteer.wxml
  19. 58
      subpages/oneKeyService/pages/reportIssue/reportIssue.js
  20. 6
      utils/config.js

2
components/activity/activity.wxss

@ -95,7 +95,7 @@
}
.infos .infos_times {
font-size: 24rpx;
height: 98rpx;
/* height: 98rpx; */
overflow: hidden;
color: #a8a8a8;
}

38
pages/complete/components/personalInfo/personalInfo.js

@ -10,7 +10,8 @@ Component({
road: "", // 什么路
villageName: "", // 小区
dwellingPlace: "", // 楼栋号-单元室
partyFlag: "0"
partyFlag: "0",
lock: false, //锁定提交状态,防止连击
},
gridInfo: {
gridName: "", // 网格名称
@ -291,6 +292,9 @@ Component({
this.showToast("小区或所在道路不能超过100个字")
return false
}
this.setData({
lock: true
})
const para = {
partyFlag: this.data.type === "partyMember" ? "1" : "0",
identityNo: this.data.personalInfo.identityNo,
@ -320,6 +324,9 @@ Component({
})
api.completeResidentInfoV2(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",
@ -345,8 +352,16 @@ Component({
}
})
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
} else if (e.cancel) {
this.setData({
lock: false
})
return false
}
},
@ -358,6 +373,9 @@ Component({
if (this.data.type === "partyMember") {
api.completePartyInfoV2(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",
@ -387,6 +405,9 @@ Component({
} else if (this.data.type === "resident") {
api.completeResidentInfoV2(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",
@ -444,6 +465,9 @@ Component({
this.showToast("请填写所在街道")
return false
}
this.setData({
lock: true
})
const para = {
partyFlag: this.data.type === "partyMember" ? "1" : "0",
identityNo: this.data.personalInfo.identityNo,
@ -473,6 +497,9 @@ Component({
})
api.completeResidentInfo(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",
@ -500,6 +527,9 @@ Component({
}
})
} else if (e.cancel) {
this.setData({
lock: false
})
return false
}
},
@ -511,6 +541,9 @@ Component({
if (this.data.type === "partyMember") {
api.completePartyInfo(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",
@ -540,6 +573,9 @@ Component({
} else if (this.data.type === "resident") {
api.completeResidentInfo(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.data.resultCode == 1) {
wx.showModal({
title: "认证信息提交成功",

4
pages/complete/components/personalInfo/personalInfo.wxml

@ -89,10 +89,10 @@
<view class="note">*请填写您的真实信息,我们会严格保密,请您放心</view>
<view class="submit-button" wx:if="{{unionIdStatus === '1'}}">
<button bindtap="submitPersonalInfo" hover-class="hover-submit">提交</button>
<button bindtap="submitPersonalInfo" hover-class="hover-submit" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">提交</button>
</view>
<view class="submit-button" wx:if="{{unionIdStatus === '0'}}">
<button hover-class="hover-submit" open-type="getUserInfo" bindgetuserinfo="getUserInfo">提交</button>
<button hover-class="hover-submit" open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">提交</button>
</view>
</view>

3
pages/indexNew/indexNew.js

@ -106,6 +106,7 @@ Page({
},
onLoad: function (options) {
this.getResidentConfig()
this.getModuleList()
if (options.shareType) {
const para = {
shareType: options.shareType,
@ -451,7 +452,7 @@ Page({
that.getNewsList()
that.getIssueList()
that.getProjectList()
that.getModuleList()
// that.getModuleList()
}
}
})

2
pages/mine/components/topicItemNew/topicItemNew.wxss

@ -51,7 +51,7 @@
/* width: calc(100% - 58rpx); */
margin-top: 30rpx;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(216rpx, 1fr));
grid-template-columns: repeat(auto-fit, minmax(208rpx, 1fr));
grid-gap: 7rpx;
}

22
subpages/associationNew/pages/addTopic/addTopic.js

@ -18,7 +18,8 @@ Page({
topicType:"",//0:事好儿鼓个掌 1:话对捧个场
addTopicPrevious: 0,
violationsCount: 0,
isConReview: false
isConReview: false,
lock: false, //锁定发布按钮状态,防止连击
},
onShow () {
@ -245,6 +246,13 @@ Page({
duration: 2000
})
return false
} else if (this.data.topicValue.length > 1000) {
wx.showToast({
title: "超出1000字数限制",
icon: "none",
duration: 2000
})
return false
} else if (this.data.addressValue === "") {
wx.showToast({
title: "请输入-地址",
@ -278,13 +286,19 @@ Page({
images: imagesList,
isConReview: this.data.isConReview
}
this.setData({
lock: true
})
wx.showLoading({
title: "加载中",
})
let that = this
addTopic(para).then(res => {
wx.hideLoading()
console.log(res)
this.setData({
lock: false
})
// console.log(res)
if (res.code == 0) {
wx.showToast({
title: "发布成功",
@ -331,6 +345,10 @@ Page({
}
}).catch(err => {
console.log('err',err)
wx.hideLoading()
this.setData({
lock: false
})
})
},
// 删除图片

6
subpages/associationNew/pages/addTopic/addTopic.wxml

@ -1,8 +1,8 @@
<view class="add-topic">
<view class="topic">
<textarea value="{{topicValue}}" bindinput="bindTopicValue" maxlength="500">
<textarea value="{{topicValue}}" bindinput="bindTopicValue" maxlength="1001">
<view wx:if="{{topicValue.length == 0}}" class="placeholder-textarea">
<view>请将事描述清晰</view>
<view>请将事描述清晰(1000字以内)</view>
</view>
</textarea>
<view wx:if="{{topicType == '0'}}" class="picture">
@ -24,7 +24,7 @@
</view>
</view>
<view class="topic-button">
<button bindtap="addTopic" type="default" size="defaultSize" hover-class="hover-button">发起话题</button>
<button bindtap="addTopic" type="default" size="defaultSize" hover-class="hover-button" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">发起话题</button>
</view>
</view>

10
subpages/associationNew/pages/eventlist/eventlist.js

@ -36,6 +36,7 @@ Page({
showModal: false, //是否显示屏蔽原因模态框
shieldId: '', //被屏蔽话题的ID
shieldReason: '', //屏蔽的原因
lock: false, //锁定发布状态,防止连击
},
/**
* 生命周期函数--监听页面加载
@ -267,6 +268,9 @@ Page({
})
return
}
this.setData({
lock: true
})
let that = this;
const para = {
topicId: that.data.topicId,//被评论的话题ID
@ -276,6 +280,9 @@ Page({
}
commentSubmit(para).then(res => {
// 评论成功以后,调用接口比对出当前评论列表的数据,对已有列表数据进行替换
this.setData({
lock: false
})
if (res.code == 0) {
this.setData({
violationsCount: 0,
@ -318,6 +325,9 @@ Page({
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
},

2
subpages/associationNew/pages/eventlist/eventlist.wxml

@ -74,7 +74,7 @@
<textarea placeholder-class="input_null" fixed="true" maxlength="-1" show-confirm-bar="false"
cursor-spacing="15" auto-height="true" placeholder="请输入回复" value="{{commentContent}}" focus='{{focus}}'
bindblur="bindAddressInput" bindinput="bindIdentity"></textarea>
<button bindtap="commentSubmit" form-type="submit" class="submit">发送</button>
<button bindtap="commentSubmit" form-type="submit" class="submit" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">发送</button>
</view>
</view>
<!--加载更多提示-->

12
subpages/discussion/pages/addIssue/addIssue.js

@ -19,7 +19,8 @@ Page({
violationsCount: 0,
isConReview: false,
tagIds: [],
checkboxs: []
checkboxs: [],
lock: false, //锁定发布状态,防止连击
},
onLoad () {
this.getEventTagList()
@ -253,12 +254,18 @@ Page({
isConReview: this.data.isConReview,
tagIds: this.data.tagIds
}
this.setData({
lock: true
})
wx.showLoading({
title: "加载中..."
})
let that = this
addIssue(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("发布议题", res)
if (res.code == 0) {
this.setData({
@ -295,6 +302,9 @@ Page({
}
}
}).catch(err => {
this.setData({
lock: false
})
wx.showToast({
title: err,
icon: "none",

2
subpages/discussion/pages/addIssue/addIssue.wxml

@ -47,7 +47,7 @@
</view>
<view class="publish-issue">
<button hover-class="hover-publish" bindtap="throttlePublisgIssue">发布</button>
<button hover-class="hover-publish" bindtap="throttlePublisgIssue" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">发布</button>
</view>
</view>

42
subpages/discussion/pages/remarkOrReply/remarkOrReply.js

@ -11,7 +11,8 @@ Page({
issueId: "",
projectId: "",
violationsCount: 0, //违规次数
isConReview: false
isConReview: false,
lock: false, //锁定提交状态,防止双击
},
onLoad (options) {
if (options.detailType === "issue") {
@ -52,6 +53,9 @@ Page({
itemId: this.data.detailType === "project" ? this.data.projectId : "",
isConReview: this.data.isConReview
}
this.setData({
lock: true
})
wx.showLoading({
title: "加载中..."
})
@ -60,6 +64,9 @@ Page({
if (this.data.detailType === "issue") { //议题
issueComReply(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
if (res.code == 0) {
wx.showToast({
@ -67,6 +74,9 @@ Page({
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
@ -107,10 +117,16 @@ Page({
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
} else { //项目
itemComReply(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
if (res.code == 0) {
wx.showToast({
@ -118,6 +134,9 @@ Page({
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
@ -158,12 +177,18 @@ Page({
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
}
} else { //对 议题/项目 进行评论
if (this.data.detailType === "issue") { //议题
issueCom(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
if (res.code == 0) {
wx.showToast({
@ -171,6 +196,9 @@ Page({
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
@ -211,10 +239,16 @@ Page({
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
} else { //项目
itemCom(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
console.log("评论或回复", res)
if (res.code == 0) {
wx.showToast({
@ -222,6 +256,9 @@ Page({
icon: "none",
duration: 1000
})
this.setData({
textareaValue: ''
})
const pages = getCurrentPages()
const page = pages[pages.length - 2]
if (page.getRemarkList) {
@ -262,6 +299,9 @@ Page({
}
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
}
}

2
subpages/discussion/pages/remarkOrReply/remarkOrReply.wxml

@ -12,6 +12,6 @@
</view>
</view>
<view class="reply-btn">
<button hover-class="hover-button" bindtap="remarkOrReply">发布</button>
<button hover-class="hover-button" bindtap="remarkOrReply" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">发布</button>
</view>
</view>

11
subpages/heart/pages/clockIn/clockIn.js

@ -219,6 +219,14 @@ Page({
* 数据提交方法
*/
submission () {
if (this.data.submissionDisabled) {
wx.showToast({
title: "正在提交打卡,请耐心等待...",
icon: "none",
duration: 3000
})
return false
}
if (this.data.operationDesc === "") {
wx.showToast({
title: "请先输入打卡描述",
@ -306,6 +314,9 @@ Page({
submissionDisabled: false
})
if (res.code == 0) {
that.setData({
operationDesc: ''
})
wx.showToast({
title: "打卡成功",
icon: "none",

2
subpages/heart/pages/clockIn/clockIn.wxml

@ -41,5 +41,5 @@
<view class="clear"></view>
</view>
<view class="button" bindtap="submission" disabled="{{submissionDisabled}}">提交打卡</view>
<view class="button" bindtap="submission" style="{{submissionDisabled?'background:grey;':''}}" disabled="{{submissionDisabled}}">提交打卡</view>
</view>

59
subpages/heart/pages/myApply/myApply.js

@ -20,7 +20,10 @@ Page({
actTel: '',
dialogVisible: false, //提示框
},
curCode: '', //区分是start还是end
curCode: '', //区分是start还是end,
violationsCount: 0, //内容审核计数
isConReview: false, //内容审核标志
lock: false, //锁定发布按钮状态,防止连击
},
/**
@ -149,6 +152,9 @@ Page({
//提交申请
submitApply () {
if (this.data.lock) {
return false
}
if (!this.data.dataForm.actTitle) {
this.showToast("请填写活动标题")
return false
@ -193,17 +199,64 @@ Page({
this.showToast("请填写联系人电话")
return false
}
wx.showLoading({
title: "加载中",
})
this.setData({
lock: true,
'dataForm.actPeopleNum': parseInt(this.data.dataForm.actPeopleNum)
})
const para = { ...this.data.dataForm }
para.isConReview = this.data.isConReview
console.log('submit apply', para)
let that = this
api.applyAct(para).then(res => {
if(res.code == '' && res.msg == 'success') {
wx.hideLoading()
this.setData({
lock: false
})
if(res.code == 0) {
this.setData({
dialogVisible: !this.data.dialogVisible
dialogVisible: !this.data.dialogVisible,
'dataForm.Title': '',
violationsCount: 0,
isConReview: false
})
} else if (res.code == 533) {
this.data.violationsCount++
console.log(this.data.violationsCount)
if (this.data.violationsCount == 1){
wx.showToast({
title: res.msg,
icon: "none",
duration: 2000
})
} else if (this.data.violationsCount == 2) {
wx.showModal({
title: '提示',
content: '您提交的内容再次被判定为违规,您确定是否要提交?',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
that.data.isConReview = true
that.addTopic()
} else if (res.cancel) {
console.log('用户点击取消')
that.setData({
violationsCount: 0,
isConReview: false
})
}
}
})
}
}
}).catch(err => {
console.log('err',err)
wx.hideLoading()
this.setData({
lock: false
})
})
},

12
subpages/heart/pages/volunteer/volunteer.js

@ -37,7 +37,8 @@ Page({
getMobileType: "wx",
smsCodeText: "获取验证码",
uploadImageList: [],
disabled:false
disabled:false,
lock: false, //锁定提交状态,防止连击
},
onLoad: function () {
this.setData({
@ -293,6 +294,9 @@ Page({
encryptedData: this.data.unionIdStatus === "1" ? "" : this.data.encryptedData,
iv: this.data.unionIdStatus === "1" ? "" : this.data.iv
}
this.setData({
lock: true
})
wx.showLoading({
title: "正在提交",
})
@ -305,12 +309,18 @@ Page({
wx.setStorageSync("token", res.data.token)
this.setData({
lock: false,
dialogVisible: !this.data.dialogVisible,
dialogTitle: "志愿者认证",
dialogContent: ["您已认证成功,快去报名吧"],
dialogConfirmText: "确定",
// dialogCancelText: '否'
})
}).catch(err => {
console.log(err)
this.setData({
lock: false
})
})
},
confirmDialog () {

4
subpages/heart/pages/volunteer/volunteer.wxml

@ -156,11 +156,11 @@
</view> -->
<view class="submit-btn" wx:if="{{unionIdStatus === '1'}}">
<button hover-class="hover-button" bindtap="submission">提交认证</button>
<button hover-class="hover-button" bindtap="submission" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">提交认证</button>
</view>
<view class="submit-btn" wx:elif="{{unionIdStatus === '0'}}">
<button hover-class="hover-button" open-type="getUserInfo" bindgetuserinfo="getUserInfo">提交认证</button>
<button hover-class="hover-button" open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="{{lock?'background:grey;':''}}" disabled="{{lock}}">提交认证</button>
</view>
</view>

58
subpages/oneKeyService/pages/reportIssue/reportIssue.js

@ -18,6 +18,9 @@ Page({
dialogVisible: false, //提示框
dialogTitle: '提交成功', //提交提示,成功还是失败
errMsg: [], //提交失败msg
lock: false, //锁定提交状态,防止连击,
violationsCount: 0, //内容审核计数
isConReview: false, //内容审核标志
},
/**
@ -101,6 +104,10 @@ Page({
//提交申请
submitIssue () {
if (this.data.lock) {
this.showToast("正在提交,请耐心等待...")
return false
}
if (!this.data.dataForm.content) {
this.showToast("请填写举报的问题")
return false
@ -123,18 +130,59 @@ Page({
return false
}
}
wx.showLoading({
title: "加载中",
})
this.setData({
lock: true
})
const para = { ...this.data.dataForm }
para.isConReview = this.data.isConReview
console.log('submit issue', para)
api.reportIssue(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
if (res.code == 0 && res.msg == 'success') {
this.data.errMsg = []
this.setData({
'dataForm.content': '',
dialogTitle: '提交成功',
errMsg: this.data.errMsg,
dialogVisible: !this.data.dialogVisible
dialogVisible: !this.data.dialogVisible,
violationsCount: 0,
isConReview: false
})
// wx.navigateBack()
} else if (res.code == 533) {
this.data.violationsCount++
console.log(this.data.violationsCount)
if (this.data.violationsCount == 1){
wx.showToast({
title: res.msg,
icon: "none",
duration: 2000
})
} else if (this.data.violationsCount == 2) {
wx.showModal({
title: '提示',
content: '您提交的内容再次被判定为违规,您确定是否要提交?',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
that.data.isConReview = true
that.addTopic()
} else if (res.cancel) {
console.log('用户点击取消')
that.setData({
violationsCount: 0,
isConReview: false
})
}
}
})
}
} else {
this.data.errMsg[0] = res.msg
this.setData({
@ -143,6 +191,12 @@ Page({
dialogVisible: !this.data.dialogVisible
})
}
}).catch(err => {
console.log(err)
wx.hideLoading()
this.setData({
lock: false
})
})
},

6
utils/config.js

@ -6,9 +6,9 @@ module.exports = {
};
function BASEURL() {
// return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://192.168.43.19:9094/epdc-api/api/'
return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境
// return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://10.211.55.2:9094/epdc-api/api/'
}
function WEBROOT() {

Loading…
Cancel
Save