【bug】消息报名的参会单位不可更改

This commit is contained in:
fengachen
2021-11-04 11:56:01 +08:00
parent 33bb8f954f
commit 3306eadb0d
6 changed files with 219 additions and 145 deletions
+63 -41
View File
@@ -9,13 +9,26 @@ Page({
*/
data: {
date: '',
list: [], // 消息列表
selectArr: [
{ path: '../../assets/images/laikuan.png', text: '项目' },
{ path: '../../assets/images/gongzuozu.png', text: '工作组' },
{ path: '../../assets/images/fenbiaowei.png', text: '分标委' },
{ path: '../../assets/images/huiyi.png', text: '会议活动' },
{ path: '../../assets/images/ziliao.png', text: '资料网员' },
selectArr: [{
path: '../../assets/images/laikuan.png',
text: '项目'
},
{
path: '../../assets/images/gongzuozu.png',
text: '工作组'
},
{
path: '../../assets/images/fenbiaowei.png',
text: '分标委'
},
{
path: '../../assets/images/huiyi.png',
text: '会议活动'
},
{
path: '../../assets/images/ziliao.png',
text: '资料网员'
},
],
titleList: [
'会议通知',
@@ -33,25 +46,25 @@ Page({
endTime: '' // 结束日期
}
},
loadData(){
loadData() {
wx.showToast({
title: '加载中...',
icon: 'loading'
})
UserApi.messageList(this.data.searchParams).then(res=>{
if(res.success){
UserApi.messageList(this.data.searchParams).then(res => {
if (res.success) {
// 搜索时,把原数据清空,重新筛选
if(this.data.searchParams.pageNo === 1) {
if (this.data.searchParams.pageNo === 1) {
this.setData({
list: []
})
}
const reg = new RegExp("<p>","g")
const reg1 = new RegExp("</p>","g")
const reg2 = new RegExp("<span>","g")
const reg3 = new RegExp("</span>","g")
if(res.result.records && res.result.records.length){
res.result.records.forEach(item=>{
const reg = new RegExp("<p>", "g")
const reg1 = new RegExp("</p>", "g")
const reg2 = new RegExp("<span>", "g")
const reg3 = new RegExp("</span>", "g")
if (res.result.records && res.result.records.length) {
res.result.records.forEach(item => {
item.msgContent = item.msgContent.replace(reg, "")
item.msgContent = item.msgContent.replace(reg1, "")
item.msgContent = item.msgContent.replace(reg2, "")
@@ -71,19 +84,19 @@ Page({
})
},
// 点击首页的五个选项跳转页面
clickSelect(e){
clickSelect(e) {
let index = e.currentTarget.dataset.index
let url = ''
if(index === 0) { // 来款项目
if (index === 0) { // 来款项目
url = '../project/project?type=project'
} else if(index === 1) { // 工作组
} else if (index === 1) { // 工作组
// url = '../work/work'
url = '../project/project?type=work'
} else if(index === 2) { // 分标委
} else if (index === 2) { // 分标委
url = '../committee/committee'
} else if(index === 3) { // 会议活动
} else if (index === 3) { // 会议活动
url = '../meeting/meeting'
} else{ // 资料网员
} else { // 资料网员
// url = '../data/data'
url = '../project/project?type=ziliao'
}
@@ -92,11 +105,13 @@ Page({
})
},
// 会议去报名,切换已读状态
messageDetail(e){
messageDetail(e) {
const readFlag = e.currentTarget.dataset.message.readFlag
const templateCode = e.currentTarget.dataset.message.templateCode
if(readFlag == 0) { // 标记已读
UserApi.messageStatus({anntId: e.currentTarget.dataset.message.anntId}).then(res=>{
if (readFlag == 0) { // 标记已读
UserApi.messageStatus({
anntId: e.currentTarget.dataset.message.anntId
}).then(res => {
this.loadData()
wx.showToast({
title: '已读成功',
@@ -105,18 +120,25 @@ Page({
})
}
const meetingId = JSON.parse(e.currentTarget.dataset.message.busId).id
if(templateCode == 'QY_1_HYTZ_WORK_GROUP_CREATE'){ // 去报名页
if (templateCode == 'QY_1_HYTZ_WORK_GROUP_CREATE') { // 去报名页
// 需要调用会议详情的接口 判断该会议是否还在报名时间内 并跳转不同的页面或者操作
MeetingApi.meetingDetail({id:meetingId}).then(res => {
if(res.success){
MeetingApi.meetingDetail({
id: meetingId
}).then(res => {
if (res.success) {
let flag = this.judgeCurrentTime(res.result.registerDeadline)
if(flag){
if (flag) {
// 超过报名时间了
wx.navigateTo({
// 这里传入的是会议id
url: `../cannotSignUp/cannotSignUp`,
})
}else{
} else {
// 从消息报名的参会单位不可更改
wx.setStorage({
key: 'companyDisabled',
data: true
})
wx.navigateTo({
// 这里传入的是会议id
url: `../signUpPage/signUpPage?meetingId=${meetingId}&type=indexMsg`,
@@ -124,35 +146,35 @@ Page({
}
}
})
}
},
// 判断当前时间与会议报名截止时间
judgeCurrentTime(time){
judgeCurrentTime(time) {
let date = new Date();
let compareTime = new Date(time)
if(date.getTime() > compareTime.getTime()){
if (date.getTime() > compareTime.getTime()) {
return true
}else{
} else {
return false
}
},
// 类型选中
bindTitleChange(e){
bindTitleChange(e) {
this.data.searchParams.pageNo = 1
if(e.detail.value == 0){
if (e.detail.value == 0) {
this.setData({
"searchParams.titile": 3,
})
}else if(e.detail.value == 1){
} else if (e.detail.value == 1) {
this.setData({
"searchParams.titile": 6,
})
}else if(e.detail.value == 2){
} else if (e.detail.value == 2) {
this.setData({
"searchParams.titile": 7,
})
}else {
} else {
this.setData({
"searchParams.titile": 8,
})
@@ -173,7 +195,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
let searchParams = {
pageNo: 1,
pageSize: 10,
+5
View File
@@ -128,6 +128,11 @@ Page({
// 如果是去报名页面需要在缓存中存储会议信息 当报名结束后 需要清除缓存中的当前会议信息 meetingSignUpType 1 可报名 2报名
if (meetingItem.meetingSignUpType === 1) {
// 从消息报名的参会单位不可更改
wx.setStorage({
key:'companyDisabled',
data:true
})
wx.setStorage({
key: "currentMeetingInfo",
data: e.currentTarget.dataset.meetinginfo,
@@ -37,6 +37,16 @@
<text>会议费用(VIP</text>
<text>{{meetingInfo.meetingCostsVip}}</text>
</view>
<!-- 分标委会议 -->
<view wx:if="{{meetingInfo.meetType === '5' }}">
<text>所属分标委</text>
<text>{{meetingInfo.caseCommitteeName}}</text>
</view>
<!-- 工作组会议 -->
<view wx:if="{{meetingInfo.meetType === '1' }}">
<text>所属工作组</text>
<text>{{meetingInfo.workingGroupName}}</text>
</view>
<view class="sign-in">
<text>会议内容</text>
<text class="sign-in-text">{{meetingInfo.meetingContent}}</text>
+4
View File
@@ -140,6 +140,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setStorage({
key: 'companyDisabled',
data: false
})
let url = decodeURIComponent(options.q)
console.log(options,'options');
console.log(url,'url');
+124 -104
View File
@@ -65,10 +65,10 @@ Page({
},
],
// 选中的参会身份 默认参会人
selectedIdentity:'2',
selectedIdentity: '2',
// 是否选择发票的选中的索引 默认需要
index: -1,
paymentMethod:'1',
paymentMethod: '1',
// 抵达时间
arrivalTime: '请选择抵达时间',
// 离开时间
@@ -82,17 +82,17 @@ Page({
// 选中的会议
selectedMeeting: {},
// 会议id
meetingId:'',
meetingId: '',
// 是否正确填写信息
flag: false,
// 是否是首页消息进来的
indexMsgBool:false,
indexMsgBool: false,
// 首页消息
indexMsg: '',
// 扫码报名的 需要调用无限制接口
nolimitBool:false,
nolimitBool: false,
// 会议费用
meetingCost:''
meetingCost: ''
},
// 是否需要发票的选择
needInvoiceChange(e) {
@@ -113,68 +113,70 @@ Page({
})
},
// 选择参会身份
changeIdentity(e){
changeIdentity(e) {
const that = this
this.setData({
selectedIdentity:e.detail.value
})
console.log(e.detail.value);
// 参会身份选择嘉宾和内部企业 会议费用为 0
if(e.detail.value === '2'){
// 标协会议需要判断选中的企业是否是标协成员
if(this.data.selectedMeeting.meetingType === '2'){
signUpApi.validateStandard({companyName:that.data.selectedCompany.companyName}).then(result => {
if(result.result){
that.setData({
meetingCost:that.data.selectedMeeting.meetingCostsVip
})
}else{
that.setData({
meetingCost:that.data.selectedMeeting.meetingCosts
})
}
})
}else{
this.setData({
meetingCost:that.data.selectedMeeting.meetingCosts
})
}
}else{
this.setData({
meetingCost:'0.00'
selectedIdentity: e.detail.value
})
}
console.log(e.detail.value);
// 参会身份选择嘉宾和内部企业 会议费用为 0
if (e.detail.value === '2') {
// 标协会议需要判断选中的企业是否是标协成员
if (this.data.selectedMeeting.meetingType === '2') {
signUpApi.validateStandard({
companyName: that.data.selectedCompany.companyName
}).then(result => {
if (result.result) {
that.setData({
meetingCost: that.data.selectedMeeting.meetingCostsVip
})
} else {
that.setData({
meetingCost: that.data.selectedMeeting.meetingCosts
})
}
})
} else {
this.setData({
meetingCost: that.data.selectedMeeting.meetingCosts
})
}
} else {
this.setData({
meetingCost: '0.00'
})
}
},
// 缴费方式的选择
paymentMethodRadioChange(e){
paymentMethodRadioChange(e) {
this.setData({
paymentMethod:e.detail.value
paymentMethod: e.detail.value
})
},
// 确定
formSubmit(e) {
const formData = Object.assign({}, e.detail.value)
// 会议id
if( this.data.selectedMeeting.id){
formData.meetingId = this.data.selectedMeeting.id
}else{
wx.getStorage({
key:"meetingId",
success(res){
formData.meetingId = res.data
}
})
}
// 参会人id
formData.companyContactId = this.data.selectedPerson.id
// 邮寄联系人id
formData.postContactId = this.data.selectedPostPerson.id
// 参会企业id
formData.companyId = this.data.selectedCompany.id
// 会议类型
formData.meetingType = this.data.selectedMeeting.meetingType
console.log(formData);
// 会议id
if (this.data.selectedMeeting.id) {
formData.meetingId = this.data.selectedMeeting.id
} else {
wx.getStorage({
key: "meetingId",
success(res) {
formData.meetingId = res.data
}
})
}
// 参会人id
formData.companyContactId = this.data.selectedPerson.id
// 邮寄联系人id
formData.postContactId = this.data.selectedPostPerson.id
// 参会企业id
formData.companyId = this.data.selectedCompany.id
// 会议类型
formData.meetingType = this.data.selectedMeeting.meetingType
console.log(formData);
if (this.data.flag) {
wx.showToast({
title: '信息输入有误',
@@ -193,7 +195,7 @@ Page({
return
}
// 手机号验证
if(formData.phone === '' || formData.phone === undefined ){
if (formData.phone === '' || formData.phone === undefined) {
wx.showToast({
title: '请输入手机号',
icon: 'none',
@@ -247,32 +249,32 @@ Page({
return
}
// 校验时间
if(formData.arrivalTime && formData.departureTime){
let flag = compareDate(formData.arrivalTime,formData.departureTime)
if(flag){
if (formData.arrivalTime && formData.departureTime) {
let flag = compareDate(formData.arrivalTime, formData.departureTime)
if (flag) {
// 抵达时间大于离开时间
wx.showToast({
title: '抵达时间不能大于离开时间',
icon:'none',
duration:2000
icon: 'none',
duration: 2000
})
return
}
}
wx.showLoading({
title: '加载中',
mask:true
mask: true
})
signUpApi.signUpMeeting(formData).then(res => {
if (res.success) {
wx.hideLoading({
})
wx.showToast({
title: '报名成功',
icon:'loading',
duration:1500
icon: 'loading',
duration: 1500
})
// 成功 清除缓存 跳转报名成功页面
wx.removeStorage({
@@ -285,19 +287,19 @@ Page({
key: 'currentMeetingInfo',
success() {
// 跳转报名成功页面
if(formData.payMode){
if (formData.payMode) {
wx.navigateTo({
url: `../signUpSuccess/signUpSuccess?payMode=${formData.payMode}`,
})
}else{
} else {
wx.navigateTo({
url: `../signUpSuccess/signUpSuccess`,
})
}
}
})
}else{
} else {
wx.showToast({
title: res.message,
icon: 'none',
@@ -314,12 +316,26 @@ Page({
},
// 选择参会单位
selectCompany() {
console.log('选择参会单位',this.data.nolimitBool);
if(this.data.nolimitBool){
let flag
wx.getStorage({
key: 'companyDisabled',
success(res) {
if (res.data) {
flag = res.data
}
}
})
if (flag) {
return
}
console.log('选择参会单位', this.data.nolimitBool);
if (this.data.nolimitBool) {
wx.navigateTo({
url: `../companyList/companyList?nolimit=nolimt`,
})
}else{
} else {
wx.navigateTo({
url: `../companyList/companyList`,
})
@@ -341,21 +357,23 @@ Page({
}
},
// 根据会议id查询会议信息
queryMeetingInfo(id){
MeetingApi.meetingDetail({id:id}).then(res => {
queryMeetingInfo(id) {
MeetingApi.meetingDetail({
id: id
}).then(res => {
console.log(res);
if(res.success){
if (res.success) {
this.setData({
selectedMeeting:res.result,
meetingCost:res.result.meetingCosts
selectedMeeting: res.result,
meetingCost: res.result.meetingCosts
})
// 存储会议信息
wx.setStorage({
key:'currentMeetingInfo',
data:res.result
key: 'currentMeetingInfo',
data: res.result
})
}
}).catch( () => {
}).catch(() => {
wx.showToast({
title: '加载失败',
icon: 'none',
@@ -367,33 +385,33 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type){
if (options.type) {
this.setData({
indexMsg: options.type,
})
}
if(options.nolimit){
if (options.nolimit) {
this.setData({
nolimitBool:true
nolimitBool: true
})
}
// this.queryMeetingInfo('1455359606691979265')
if(options.meetingId){
console.log(options.meetingId,'options.meetingId');
if (options.meetingId) {
console.log(options.meetingId, 'options.meetingId');
this.queryMeetingInfo(options.meetingId)
this.setData({
meetingId:options.meetingId
meetingId: options.meetingId
})
wx.setStorage({
key:'meetingId',
data:options.meetingId
key: 'meetingId',
data: options.meetingId
})
}
const that = this
// 是否是从首页消息进来的报名
if (options.type === 'indexMsg') {
this.setData({
indexMsgBool:true
indexMsgBool: true
})
// 默认填写个人信息
@@ -408,10 +426,10 @@ Page({
'selectedPerson.id': res.data.id,
'selectedCompany.id': res.data.companyId,
phone: res.data.phone,
'selectedPostPerson.id':res.data.id,
'selectedPostPerson.name':res.data.name,
'selectedPostPerson.contactAddress':res.data.contactAddress,
'selectedPostPerson.postalCode':res.data.postalCode,
'selectedPostPerson.id': res.data.id,
'selectedPostPerson.name': res.data.name,
'selectedPostPerson.contactAddress': res.data.contactAddress,
'selectedPostPerson.postalCode': res.data.postalCode,
})
}
})
@@ -499,7 +517,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
console.log(this.data.selectedMeeting,'this.selectedMeeting');
console.log(this.data.selectedMeeting, 'this.selectedMeeting');
const that = this
// 是否是从首页消息进来的报名
if (this.data.type === 'indexMsg') {
@@ -558,15 +576,17 @@ Page({
selectedMeeting: res.data
})
// 标协会议需要判断单位是否是会员单位
if(that.data.selectedCompany.companyName && res.data.meetingType+'' === '2' ){
signUpApi.validateStandard({companyName:that.data.selectedCompany.companyName}).then(result => {
if(result.result){
if (that.data.selectedCompany.companyName && res.data.meetingType + '' === '2') {
signUpApi.validateStandard({
companyName: that.data.selectedCompany.companyName
}).then(result => {
if (result.result) {
that.setData({
meetingCost:res.data.meetingCostsVip
meetingCost: res.data.meetingCostsVip
})
}else{
} else {
that.setData({
meetingCost:res.data.meetingCosts
meetingCost: res.data.meetingCosts
})
}
})
@@ -610,4 +630,4 @@ Page({
onShareAppMessage: function () {
}
})
})
+13
View File
@@ -230,6 +230,19 @@ Page({
},
// 选择参会单位
selectCompany(e) {
let flag
wx.getStorage({
key: 'companyDisabled',
success(res) {
if (res.data) {
flag = res.data
}
}
})
if (flag) {
return
}
if (this.data.nolimitBool) {
wx.navigateTo({
url: `../companyList/companyList?page=${e.currentTarget.dataset.page}&nolimit=nolimit`,