消息报名的调整

This commit is contained in:
fengachen
2021-10-19 18:23:38 +08:00
parent 15a27091a8
commit 620213509c
5 changed files with 144 additions and 81 deletions
+5 -1
View File
@@ -45,6 +45,10 @@ Page({
},
// 加载企业列表
loadData() {
wx.showToast({
title: '加载中...',
icon: 'loading'
})
signUpApi.companyList(this.data.searchParams).then(res => {
if (res.success) {
// 搜索时,把原数据清空,重新筛选
@@ -162,4 +166,4 @@ Page({
onShareAppMessage: function () {
}
})
})
+4 -1
View File
@@ -103,9 +103,12 @@ Page({
})
})
}
const meetingId = JSON.parse(e.currentTarget.dataset.message.busId).id
if(templateCode == 'QY_1_HYTZ_WORK_GROUP_CREATE'){ // 去报名页
// 需要调用会议详情的接口 判断该会议是否还在报名时间内 并跳转不同的页面或者操作
wx.navigateTo({
url: 'url',
// 这里传入的是会议id
url: `../signUpPage/signUpPage?meetingId=${meetingId}&type=indexMsg`,
})
}
},
+16 -18
View File
@@ -17,7 +17,7 @@ Page({
dataSource: [],
// 选择参会人 还是 选择邮寄联系人 1 是参会人 2 是邮寄联系人
selectType:"",
// 是否是从国际研讨会跳过来的
// 是否是从国际研讨会跳过来的
page:''
},
// 输入查询条件
@@ -47,7 +47,8 @@ Page({
},
// 选中联系人
selectedItem(e) {
console.log(this.data.selectType,'this.data.selectType');
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2];
const that = this
// 带过去的信息
let selectedPerson = e.currentTarget.dataset.person
@@ -59,20 +60,12 @@ Page({
//这里是点击了确定以后
// 将选中的参会人存入缓存中
if(that.data.selectType === '1'){
wx.setStorage({
key:'selectedPerson',
data:selectedPerson,
success() {
if(that.data.page === 'guoji'){
wx.navigateTo({
url: `../signUpPageGuoji/signUpPageGuoji`,
})
}else{
wx.navigateTo({
url: `../signUpPage/signUpPage`,
})
}
}
prevPage.setData({
'selectedPerson.name':selectedPerson.name,
'selectedPerson.id':selectedPerson.id
})
wx.navigateBack({
delta: 1,
})
}else if(that.data.selectType === '2' ){
// 选中的邮寄联系人 存入缓存中
@@ -85,8 +78,8 @@ Page({
url: `../signUpPageGuoji/signUpPageGuoji`,
})
}else{
wx.navigateTo({
url: `../signUpPage/signUpPage`,
wx.navigateBack({
delta: 1,
})
}
}
@@ -103,6 +96,11 @@ Page({
},
// 加载联系人列表
loadData() {
wx.showToast({
title: '加载中...',
icon: 'loading',
duration: 1000
})
signUpApi.personListNolimit(this.data.queryParam).then(res => {
if (res.success) {
// 搜索时,把原数据清空,重新筛选
+117 -59
View File
@@ -1,5 +1,6 @@
// pages/signUpPage/signUpPage.js
import signUpApi from '../../assets/js/http/signUp'
import MeetingApi from '../../assets/js/http/meetingApi'
import {
phoneReg,
postcode
@@ -76,7 +77,9 @@ Page({
// 选中的会议
selectedMeeting: {},
// 是否正确填写信息
flag: false
flag: false,
// 首页消息
indexMsg: ''
},
// 是否需要发票的选择
needInvoiceChange(e) {
@@ -100,7 +103,17 @@ Page({
formSubmit(e) {
console.log(e);
const formData = Object.assign({}, e.detail.value)
// 会议id
formData.meetingId = this.data.selectedMeeting.id
// 参会人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: '信息输入有误',
@@ -173,30 +186,12 @@ Page({
return
}
// 会议id
formData.meetingId = this.data.selectedMeeting.id
// 参会人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);
signUpApi.signUpMeeting(formData).then(res => {
if (res.success) {
// 成功 清除缓存 跳转报名成功页面
wx.removeStorage({
key: 'selectedCompany',
})
wx.removeStorage({
key: 'selectedPerson',
})
wx.removeStorage({
key: 'selectedPostPerson',
})
wx.removeStorage({
key: 'currentMeetingInfo',
success() {
@@ -230,55 +225,57 @@ Page({
});
}
},
// 根据会议id查询会议信息
queryMeetingInfo(id){
MeetingApi.meetingDetail({id:id}).then(res => {
console.log(res);
if(res.success){
this.setData({
selectedMeeting:res.result
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
this.setData({
indexMsg: options.type,
})
// this.setData({
// selectedCompany:JSON.parse(options.company)
// })
// 从缓存中拿选中的企业
const that = this
wx.getStorage({
key: 'selectedCompany',
success(res) {
that.setData({
selectedCompany: JSON.parse(res.data)
})
}
})
// 从缓存中拿选中的联系人
wx.getStorage({
key: 'selectedPerson',
success(res) {
that.setData({
selectedPerson: res.data
})
}
})
// 是否是从首页消息进来的报名
if (options.type === 'indexMsg') {
// 查询会议信息
this.queryMeetingInfo(options.meetingId)
// 默认填写个人信息
// 从缓存中拿个人信息
wx.getStorage({
key: 'userInfo',
success(res) {
console.log(res);
that.setData({
'selectedCompany.companyName': res.data.companyName,
'selectedPerson.name': res.data.name,
'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,
})
}
})
}
// 从缓存中拿选中的邮寄联系人
wx.getStorage({
key: 'selectedPostPerson',
success(res) {
that.setData({
selectedPostPerson: res.data
})
}
})
// 从缓存中拿选中的会议的信息
wx.getStorage({
key: 'currentMeetingInfo',
success(res) {
console.log(res, 'meetingInfo');
that.setData({
selectedMeeting: res.data
})
}
})
},
// 手机号验证
validatePhone(e) {
@@ -361,6 +358,67 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
const that = this
console.log(this.data.type ,'this.data.type ');
// 是否是从首页消息进来的报名
if (this.data.type === 'indexMsg') {
// 默认填写个人信息
// 从缓存中拿个人信息
wx.getStorage({
key: 'userInfo',
success(res) {
console.log(res);
that.setData({
'selectedCompany.companyName': res.data.companyName,
'selectedPerson.name': res.data.name,
'selectedCompany.id': res.data.companyId,
phone: res.data.phone,
})
}
})
}
// 从缓存中拿选中的企业
wx.getStorage({
key: 'selectedCompany',
success(res) {
that.setData({
selectedCompany: JSON.parse(res.data)
})
}
})
// 从缓存中拿选中的联系人
wx.getStorage({
key: 'selectedPerson',
success(res) {
that.setData({
selectedPerson: res.data
})
}
})
// 从缓存中拿选中的邮寄联系人
wx.getStorage({
key: 'selectedPostPerson',
success(res) {
that.setData({
selectedPostPerson: res.data
})
}
})
// 从缓存中拿选中的会议的信息
wx.getStorage({
key: 'currentMeetingInfo',
success(res) {
console.log(res, 'meetingInfo');
that.setData({
selectedMeeting: res.data
})
}
})
},
+2 -2
View File
@@ -61,12 +61,12 @@
<view class="form-item">
<text class="item-label flex-1 validate">邮寄地址:</text>
<input placeholder-class="text-right" name="postContactAddress" maxlength="50" bindinput="bindInputPhone" placeholder="请输入邮寄地址" />
<input placeholder-class="text-right" name="postContactAddress" maxlength="50" bindinput="bindInputPhone" value="{{selectedPostPerson.contactAddress}}" placeholder="请输入邮寄地址" />
</view>
<view class="form-item">
<text class="item-label flex-1 validate">邮编:</text>
<input placeholder-class="text-right" name="postCode" bindblur="validatePostCode" data-message='请输入邮编' data-errmsg='请输入正确的邮编' type="number" maxlength="6" placeholder="请输入邮编" />
<input placeholder-class="text-right" name="postCode" bindblur="validatePostCode" value="{{selectedPostPerson.postalCode}}" data-message='请输入邮编' data-errmsg='请输入正确的邮编' type="number" maxlength="6" placeholder="请输入邮编" />
</view>
<view class="form-item-radio">