diff --git a/pages/companyList/companyList.js b/pages/companyList/companyList.js index c63e4ab..6711fe8 100644 --- a/pages/companyList/companyList.js +++ b/pages/companyList/companyList.js @@ -20,7 +20,9 @@ Page({ // 数据 dataSource: [], // 是否国际研讨会过来的 - page: "" + page: "", + // 是否需要调用无限制接口 + nolimitBool:false }, // 输入查询条件 bindInputCompanyName(e) { @@ -48,31 +50,57 @@ Page({ }, // 加载企业列表 loadData() { + console.log('1552203698874545454545454545454545'); + console.log(this.data.nolimitBool,'this.data.nolimitBool'); wx.showToast({ title: '加载中...', icon: 'loading' }) - signUpApi.companyList(this.data.searchParams).then(res => { - if (res.success) { - // 搜索时,把原数据清空,重新筛选 - if (this.data.searchParams.pageNo === 1) { - this.setData({ - dataSource: [] - }) + if(this.data.nolimitBool){ + signUpApi.companyListNoLimit(this.data.searchParams).then(res => { + if (res.success) { + // 搜索时,把原数据清空,重新筛选 + if (this.data.searchParams.pageNo === 1) { + this.setData({ + dataSource: [] + }) + } + if (res.result.records && res.result.records.length) { + this.setData({ + dataSource: [...this.data.dataSource,...res.result.records] + }) + } } - if (res.result.records && res.result.records.length) { - this.setData({ - dataSource: [...this.data.dataSource,...res.result.records] - }) - } - } - }).catch(err => { - wx.showToast({ - title: '加载失败', - icon: 'none', - duration: 1000 + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 1000 + }) }) - }) + }else{ + signUpApi.companyList(this.data.searchParams).then(res => { + if (res.success) { + // 搜索时,把原数据清空,重新筛选 + if (this.data.searchParams.pageNo === 1) { + this.setData({ + dataSource: [] + }) + } + if (res.result.records && res.result.records.length) { + this.setData({ + dataSource: [...this.data.dataSource,...res.result.records] + }) + } + } + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 1000 + }) + }) + } }, // 选中的企业 selectedItem(e) { @@ -110,12 +138,16 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - console.log(options); if (options.page) { this.setData({ page: options.page }) } + if(options.nolimit){ + this.setData({ + nolimitBool: true + }) + } this.loadData() }, @@ -130,7 +162,15 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + const that = this + wx.getStorage({ + key:'nolimit', + success(res){ + that.setData({ + nolimitBool:res.data + }) + } + }) }, /** diff --git a/pages/personList/personList.js b/pages/personList/personList.js index f227918..815ff66 100644 --- a/pages/personList/personList.js +++ b/pages/personList/personList.js @@ -20,7 +20,9 @@ Page({ // 选择参会人 还是 选择邮寄联系人 1 是参会人 2 是邮寄联系人 selectType:"", // 是否是从国际研讨会跳过来的 - page:'' + page:'', + // 是否调用无权限接口 + nolimitBool:false }, // 输入查询条件 bindInputName(e) { @@ -90,32 +92,57 @@ Page({ }, // 加载联系人列表 loadData() { + console.log('联系人列表',this.data.nolimitBool); wx.showToast({ title: '加载中...', icon: 'loading', duration: 1000 }) - signUpApi.personListNolimit(this.data.queryParam).then(res => { - if (res.success) { - // 搜索时,把原数据清空,重新筛选 - if(this.data.queryParam.pageNo === 1) { - this.setData({ - dataSource: [] - }) - } - if(res.result && res.result.length){ - this.setData({ - dataSource: [...this.data.dataSource, ...res.result] - }) - } - } - }).catch(err => { - wx.showToast({ - title: '加载失败', - icon: 'none', - duration: 1000 + if(this.data.nolimitBool){ + signUpApi.personListNolimit(this.data.queryParam).then(res => { + if (res.success) { + // 搜索时,把原数据清空,重新筛选 + if(this.data.queryParam.pageNo === 1) { + this.setData({ + dataSource: [] + }) + } + if(res.result && res.result.length){ + this.setData({ + dataSource: [...this.data.dataSource, ...res.result] + }) + } + } + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 1000 + }) }) - }) + }else{ + signUpApi.personList(this.data.queryParam).then(res => { + if (res.success) { + // 搜索时,把原数据清空,重新筛选 + if(this.data.queryParam.pageNo === 1) { + this.setData({ + dataSource: [] + }) + } + if(res.result && res.result.length){ + this.setData({ + dataSource: [...this.data.dataSource, ...res.result] + }) + } + } + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 1000 + }) + }) + } }, /** @@ -123,6 +150,11 @@ Page({ */ onLoad: function (options) { console.log(options); + if(options.nolimit){ + this.setData({ + nolimitBool:true + }) + } this.setData({ 'queryParam.companyId':options.companyId, selectType:options.selectType, @@ -142,6 +174,15 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + const that = this + wx.getStorage({ + key:'nolimit', + success(res){ + that.setData({ + nolimitBool:res.data + }) + } + }) }, diff --git a/pages/signUpEntrance/signUpEntrance.js b/pages/signUpEntrance/signUpEntrance.js index 6dc7316..3fdaf51 100644 --- a/pages/signUpEntrance/signUpEntrance.js +++ b/pages/signUpEntrance/signUpEntrance.js @@ -59,16 +59,25 @@ Page({ }, // 报名 signUp() { + const that = this + // 企业列表与参会人列表调用的是无权限接口 + wx.setStorage({ + key:'nolimit', + data:true + }) // 不同的会议通跳转不同的会议页面 let meetingType = this.data.meetingDetailIngfo.meetingType - + wx.setStorage({ + key:'currentMeetingInfo', + data:that.data.meetingDetailIngfo + }) if (meetingType !== '3') { wx.navigateTo({ - url: '../signUpPage/signUpPage', + url: `../signUpPage/signUpPage?meetingId=${this.data.meetingDetailIngfo.id}&nolimit=nolimit`, }) } else { wx.navigateTo({ - url: '../signUpPageGuoji/signUpPageGuoji', + url: `../signUpPageGuoji/signUpPageGuoji?meetingId=${this.data.meetingDetailIngfo.id}&nolimit=nolimit`, }) } }, diff --git a/pages/signUpPage/signUpPage.js b/pages/signUpPage/signUpPage.js index 2205e46..d8e5789 100644 --- a/pages/signUpPage/signUpPage.js +++ b/pages/signUpPage/signUpPage.js @@ -86,7 +86,8 @@ Page({ indexMsgBool:false, // 首页消息 indexMsg: '', - + // 扫码报名的 需要调用无限制接口 + nolimitBool:false }, // 是否需要发票的选择 needInvoiceChange(e) { @@ -169,7 +170,7 @@ Page({ return } // 邮寄联系人 - if (formData.postContactId === undefined) { + if (this.data.selectedPostPerson.id && formData.postContactId === undefined) { wx.showToast({ title: '请选择邮寄联系人', icon: 'none', @@ -237,16 +238,23 @@ Page({ }, // 选择参会单位 selectCompany() { - wx.navigateTo({ - url: '../companyList/companyList', - }) + console.log('选择参会单位',this.data.nolimitBool); + if(this.data.nolimitBool){ + wx.navigateTo({ + url: `../companyList/companyList?nolimit=nolimt`, + }) + }else{ + wx.navigateTo({ + url: `../companyList/companyList`, + }) + } }, // 选择参会人 selectPerson(e) { - console.log(this.data.selectedCompany); + const that = this if (!!this.data.selectedCompany.id) { wx.navigateTo({ - url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}`, + url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}&nolimit=${that.data.nolimitBool}`, }) } else { wx.showToast({ @@ -265,27 +273,40 @@ Page({ selectedMeeting:res.result }) } + }).catch( () => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 1000 + }) }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + if(options.type){ + this.setData({ + indexMsg: options.type, + }) + } + if(options.nolimit){ + this.setData({ + nolimitBool:true + }) + } - this.setData({ - indexMsg: options.type, - }) - // this.setData({ - // selectedCompany:JSON.parse(options.company) - // }) + if(options.meetingId){ + + this.queryMeetingInfo(options.meetingId) + } const that = this // 是否是从首页消息进来的报名 if (options.type === 'indexMsg') { this.setData({ indexMsgBool:true }) - // 查询会议信息 - this.queryMeetingInfo(options.meetingId) + // 默认填写个人信息 // 从缓存中拿个人信息 wx.getStorage({ diff --git a/pages/signUpPage/signUpPage.wxml b/pages/signUpPage/signUpPage.wxml index 2882d43..06bf56c 100644 --- a/pages/signUpPage/signUpPage.wxml +++ b/pages/signUpPage/signUpPage.wxml @@ -5,12 +5,12 @@ 参会单位: - + 参会人: - + @@ -56,7 +56,7 @@ 邮寄联系人: - + diff --git a/pages/signUpPageGuoji/signUpPageGuoji.js b/pages/signUpPageGuoji/signUpPageGuoji.js index e1a0475..1107ef1 100644 --- a/pages/signUpPageGuoji/signUpPageGuoji.js +++ b/pages/signUpPageGuoji/signUpPageGuoji.js @@ -108,7 +108,9 @@ Page({ name: '否' }, ], - flag:false + flag:false, + // 是否调用无限制接口 + nolimitBool:false }, // 抵达时间选择 bindDateChangeArriveTime(e) { @@ -143,14 +145,24 @@ Page({ // 选择参会单位 selectCompany(e) { wx.navigateTo({ - url: `../companyList/companyList?page=${e.currentTarget.dataset.page}`, + }) + if(this.data.nolimitBool){ + wx.navigateTo({ + url: `../companyList/companyList?page=${e.currentTarget.dataset.page}&nolimit=nolimit`, + }) + }else{ + wx.navigateTo({ + url: `../companyList/companyList?page=${e.currentTarget.dataset.page}`, + }) + } }, // 选择参会人 selectPerson(e) { + const that = this if (!!this.data.selectedCompany.id) { wx.navigateTo({ - url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}&page=${e.currentTarget.dataset.page}`, + url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}&page=${e.currentTarget.dataset.page}&nolimit=${that.data.nolimitBool}`, }) } else { wx.showToast({ @@ -485,7 +497,7 @@ Page({ return } // 会议id - formData.meetingId = '1449638073563172866' + formData.meetingId = this.meetingDetailInfo.id // 参会人id formData.companyContactId = this.data.selectedPerson.id // 邮寄联系人id @@ -530,12 +542,18 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - - + // 这个id 可能是是会议活动进来的 或者消息 或者扫码的 + if(options.meetingId){ + this.queryMeetingDetail(options.meetingId) + } + if(options.nolimit){ + this.setData({ + nolimitBool:true + }) + } // 从缓存中拿选中的企业 const that = this - // 这个id 可能是是会议活动进来的 或者消息 或者扫码的 - this.queryMeetingDetail('1449638073563172866') + wx.getStorage({ key: 'selectedCompany', success(res) { diff --git a/pages/signUpPageGuoji/signUpPageGuoji.wxml b/pages/signUpPageGuoji/signUpPageGuoji.wxml index ce4c287..8db1e4e 100644 --- a/pages/signUpPageGuoji/signUpPageGuoji.wxml +++ b/pages/signUpPageGuoji/signUpPageGuoji.wxml @@ -5,15 +5,14 @@ 参会单位: - 参会人: - + @@ -74,7 +73,7 @@ 邮寄联系人: -