diff --git a/app.json b/app.json index ebf59dd..b608c3c 100644 --- a/app.json +++ b/app.json @@ -35,7 +35,8 @@ "pages/standardBasicInfo/standardBasicInfo", "pages/council/council", "pages/councilDetail/councilDetail", - "pages/guestEditSignUpinfo/guestEditSignUpInfo" + "pages/guestEditSignUpinfo/guestEditSignUpInfo", + "pages/invoice/invoice" ], "window":{ "backgroundTextStyle": "dark", diff --git a/assets/images/icon_delete.png b/assets/images/icon_delete.png new file mode 100644 index 0000000..568e51b Binary files /dev/null and b/assets/images/icon_delete.png differ diff --git a/assets/images/icon_edit.png b/assets/images/icon_edit.png new file mode 100644 index 0000000..683ac40 Binary files /dev/null and b/assets/images/icon_edit.png differ diff --git a/assets/images/invoice.png b/assets/images/invoice.png new file mode 100644 index 0000000..2896457 Binary files /dev/null and b/assets/images/invoice.png differ diff --git a/assets/js/Enums/common.js b/assets/js/Enums/common.js new file mode 100644 index 0000000..3a95136 --- /dev/null +++ b/assets/js/Enums/common.js @@ -0,0 +1,19 @@ +export const InvoiceTypeEnums = { + noNeed: { name: '不需要', index: 0 }, + plain: { name: '增值税普通发票', index: 1 }, + special: { name: '增值税专用发票', index: 2 } +} +// 参会人员身份类型 +export const MeetIdentifyTypeEnums = { + guest: { name: '嘉宾', index: 1 }, + attendee: { name: '参会人', index: 2 }, + internal: { name: '内部企业', index: 3 } +} +// 嘉宾类型 +export const GuestTypeEnums = { + VIP: { name: 'VIP', index: 1 }, + speaker: { name: '演讲嘉宾', index: 2 }, + guestInvitation: { name: '特邀嘉宾', index: 3 }, + cooperative: { name: '合作伙伴', index: 4 }, + exhibitor: { name: '参展商', index: 5 }, +} diff --git a/assets/js/http/meetingApi.js b/assets/js/http/meetingApi.js index 3fd0330..683ce9d 100644 --- a/assets/js/http/meetingApi.js +++ b/assets/js/http/meetingApi.js @@ -10,7 +10,11 @@ const MeetingApi = { // 参会人信息 queryPersongInfoById:(params) => http.get(`${URL_CONFIG}meeting/payMeetingSituation/queryById`, params), // 国际研讨会编辑嘉宾信息 - editSignUpInfo:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/editGuestInfo`, params) + editSignUpInfo:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/editGuestInfo`, params), + // 删除会议报名信息 + deleteSignUpInfo:(params) => http.get(`${URL_CONFIG}meeting/payMeetingSituation/contactsDelete`, params), + // 编辑会议报名信息 + editContactsInfo:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/contactsEdit`, params) } export default MeetingApi diff --git a/assets/js/http/userApi.js b/assets/js/http/userApi.js index ff7ef01..4ffa26d 100644 --- a/assets/js/http/userApi.js +++ b/assets/js/http/userApi.js @@ -82,7 +82,9 @@ const UserApi = { // 手机号唯一校验 checkPhoneOnly: (params) => http.get(`${URL_CONFIG}/sys/duplicate/check`, params), // 企业端的会议文件的下载 - downFileDownWeb: (fileId,meetingId, params) => http.get(`${URL_CONFIG}meeting/payMeeting/userDownload/${fileId}/${meetingId}`,params) + downFileDownWeb: (fileId,meetingId, params) => http.get(`${URL_CONFIG}meeting/payMeeting/userDownload/${fileId}/${meetingId}`,params), + // 企业人员查询参与项目的邮寄信息 + getVoiceMailList: (fileId,meetingId, params) => http.get(`${URL_CONFIG}mail/payMailBill/contactsSearch`,params) } export default UserApi diff --git a/behavior/confirmInvoiceModal.js b/behavior/confirmInvoiceModal.js index 09f763b..424e871 100644 --- a/behavior/confirmInvoiceModal.js +++ b/behavior/confirmInvoiceModal.js @@ -22,6 +22,7 @@ module.exports = Behavior({ data: { // page-container 相关的配置 statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], + pageTitle: '会议报名', invoiceConfirmModalVisible: false, duration: 300, position: 'bottom', @@ -118,6 +119,10 @@ module.exports = Behavior({ }); } }) - } + }, + // 自定义头部的参数 + goBack(){ + wx.navigateBack() + }, } }) diff --git a/components/imageUpload/imageUpload.js b/components/imageUpload/imageUpload.js index b71eb25..1c1dd72 100644 --- a/components/imageUpload/imageUpload.js +++ b/components/imageUpload/imageUpload.js @@ -1,6 +1,9 @@ // components/imageUpload/imageUpload.js -import {baseUrl, URL_CONFIG} from '../../assets/js/project.config' +import { + baseUrl, + URL_CONFIG +} from '../../assets/js/project.config' Component({ /** * 组件的属性列表 @@ -17,11 +20,27 @@ Component({ value: 1 }, // 图片的回显 - initImgsList:{ - type:String + initImgsList: { + type: String + } + }, + observers: { + 'initImgsList': function (initImgsList) { + let initImgArr + if (!!this.data.initImgsList) { + initImgArr = this.data.initImgsList.split(',') + } + const arr = [] + if (initImgArr && initImgArr.length > 0) { + for (let index = 0; index < initImgArr.length; index++) { + arr.push(baseUrl + URL_CONFIG + 'sys/common/download/' + initImgArr[index]) + } + } + this.setData({ + tempFilePaths: arr + }) } }, - /** * 组件的初始数据 */ @@ -30,20 +49,19 @@ Component({ tempFilePaths: [] }, lifetimes: { - attached: function() { - console.log(' this.data.initImgsList', this.data.initImgsList); + attached: function () { let initImgArr - if(!!this.data.initImgsList){ + if (!!this.data.initImgsList) { initImgArr = this.data.initImgsList.split(',') } const arr = [] - if(initImgArr && initImgArr.length > 0){ + if (initImgArr && initImgArr.length > 0) { for (let index = 0; index < initImgArr.length; index++) { - arr.push( baseUrl + URL_CONFIG + 'sys/common/download/' + initImgArr[index]) - } + arr.push(baseUrl + URL_CONFIG + 'sys/common/download/' + initImgArr[index]) + } } this.setData({ - tempFilePaths:arr + tempFilePaths: arr }) console.log(this.data.tempFilePaths); }, @@ -129,7 +147,7 @@ Component({ //如果是最后一张,则隐藏等待中 if (count == tempFilePaths.length) { wx.hideToast(); - that.triggerEvent("getIds",imgids) + that.triggerEvent("getIds", imgids) } }, diff --git a/pages/home/home.js b/pages/home/home.js index c32a256..426c5ca 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -206,6 +206,8 @@ Page({ url = '../standardRouter/standardRouter' } else if (this.data.selectArr[index].val === '5') { // 合同 url = '../mineContract/mineContract' + } else if (this.data.selectArr[index].val === '7') { // 发票 + url = '../invoice/invoice' } isLogin( () => { wx.navigateTo({ @@ -394,6 +396,11 @@ Page({ text: '合同', val: '5', }, + { + path: '../../assets/images/invoice.png', + text: '发票', + val: '7', + } ] let menuArr = [{ @@ -427,6 +434,11 @@ Page({ text: '合同', val: '5', }, + { + path: '../../assets/images/invoice.png', + text: '发票', + val: '7', + } ] let searchParams = { pageNo: 1, diff --git a/pages/invoice/invoice.js b/pages/invoice/invoice.js new file mode 100644 index 0000000..4e3adc7 --- /dev/null +++ b/pages/invoice/invoice.js @@ -0,0 +1,125 @@ +import UserApi from '../../assets/js/http/userApi' +import { appName } from '../../assets/js/project.config' +Page({ + + /** + * 页面的初始数据 + */ + data: { + statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], + index: 0, + list: [], // 项目列表 + searchParams: { + pageNo: 1, + pageSize: 10, + needInvoice: '', // 是否需要发票 0 4 + pack: '', // 是否打包 0 1 + year: '', // 运行年份 + particularYear:'',// 资料网元的运行年份, + // 创建时间倒叙排序 + column:'createTime', + order:'desc' + }, + pageTitle:'发票' + }, + goBack(){ + wx.navigateBack() + }, + // 发票改变 + bindNeedInvoiceChange(e){ + this.data.searchParams.pageNo = 1 + if(e.detail.value == 0) { + this.setData({ + "searchParams.needInvoice": 1, + }) + }else{ + this.setData({ + "searchParams.needInvoice": 0, + }) + } + this.loadData() + }, + // 打包改变 + bindPackChange(e){ + this.data.searchParams.pageNo = 1 + if(e.detail.value == 0) { + this.setData({ + "searchParams.pack": 1, + }) + }else{ + this.setData({ + "searchParams.pack": 0, + }) + } + this.loadData() + }, + bindDateChange(e){ + this.data.searchParams.pageNo = 1 + // 资料网员的年份查询字段与其他的不一样 + if(this.data.type === 'ziliao'){ + this.setData({ + "searchParams.particularYear": e.detail.value + }) + }else{ + this.setData({ + "searchParams.year": e.detail.value + }) + } + this.loadData() + }, + // 项目详情 + projectDetail(e){ + let project = e.currentTarget.dataset.project + let num = project.postNo + // num = 'SF1632615984954' + wx.navigateTo({ + url: `plugin://kdPlugin/index?num=${num}&appName=${appName}`, + }) + // wx.navigateTo({ + // url: `../projectDetail/projectDetail?id=${e.currentTarget.dataset.project.id}&type=${this.data.type}&workingGroupId=${e.currentTarget.dataset.project.workingGroupId}`, + // }) + }, + loadData(){ + const that = this + wx.showToast({ + title: '加载中...', + icon: 'loading' + }) + + UserApi.getVoiceMailList(this.data.searchParams).then(res=>{ + if(res.success){ + // 搜索时,把原数据清空,重新筛选 + if(that.data.searchParams.pageNo === 1) { + that.setData({ + list: [] + }) + } + if(res.result.records && res.result.records.length){ + that.setData({ + list: [...that.data.list, ...res.result.records] + }) + } + } + }).catch(err=>{ + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 2000 + }) + }) + + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.loadData() + }, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.data.searchParams.pageNo++ + this.loadData() + }, +}) diff --git a/pages/invoice/invoice.json b/pages/invoice/invoice.json new file mode 100644 index 0000000..ced5b27 --- /dev/null +++ b/pages/invoice/invoice.json @@ -0,0 +1,4 @@ +{ + "navigationStyle": "custom", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/invoice/invoice.wxml b/pages/invoice/invoice.wxml new file mode 100644 index 0000000..ca4b19a --- /dev/null +++ b/pages/invoice/invoice.wxml @@ -0,0 +1,57 @@ + + + + {{pageTitle}} + + + + + + + + + + + + + + + + + + + + + 项目名称:{{item.projectName }} + + 开票金额:{{item.invoiceAmount }} 元 + 项目负责人:{{item.principalName}} + 邮寄联系人:{{item.contactName}} + 状态:{{item.postStatus_dictText}} + + + + + + 暂无数据 + + + diff --git a/pages/invoice/invoice.wxss b/pages/invoice/invoice.wxss new file mode 100644 index 0000000..62e3d25 --- /dev/null +++ b/pages/invoice/invoice.wxss @@ -0,0 +1,103 @@ +/* pages/meeting/meeting.wxss */ +page { + background-color: #F5F5F5; +} +/* 头部筛选 start */ +.select-list { + border-top: 0.5px solid #F5F5F5; + height: 40px; + font-size: 14px; + display: flex; + align-items: center; + background-color: #fff; +} + +.select-item { + flex: 1; + display: flex; + align-items: center; + justify-content: center; +} + +.select-item image { + width: 11px; + height: 6px; + margin-left: 9px; +} +/* 头部筛选end */ +/* 列表start */ +.list{ + padding: 15px; +} +.list-item{ + height: auto; + background-color: #fff; + border-radius: 5px; + padding: 10px 15px; + display: flex; + justify-content: space-around; + align-items: center; + flex-direction: column; +} +.list-item:not(:first-child) { + margin-top: 10px; +} +.list-item .title{ + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; +} +.list-item .title text:nth-child(1){ + font-size: 14px; + color: #333; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.list-item .title text:nth-child(2){ + font-size: 12px; + color: #999; + width: 70px; + text-align: right; + flex-shrink: 0; +} +.item-content { + width: 100%; + padding: 10rpx 0; + box-sizing: border-box; + font-size: 14px; + height: auto; + display: flex; +} +.item-content text{ + flex-shrink: 0; +} +.content-text{ + width: 100%; + color: #999; + font-size: 12px; + display: flex; + justify-content: space-between; + align-items: center; +} + +/* 字体颜色 */ +.color-gray { + color:#999 +} + +.color-green { + color:#069F99 +} + +.color-orange { + color: orange; +} +.half{ + color: burlywood; +} +.all{ + color: #069F99; +} diff --git a/pages/meeting/meeting.js b/pages/meeting/meeting.js index 9e2a0a2..41b33f3 100644 --- a/pages/meeting/meeting.js +++ b/pages/meeting/meeting.js @@ -36,7 +36,7 @@ Page({ {name:'培训会',value:'8'}, {name:'宣贯会',value:'9'} ], - + // 会议列表数据 meetingList: [], // 下拉框送搜索数据 @@ -155,9 +155,8 @@ Page({ // 会议类型筛选 bindTypeChange(e) { let index = this.data.meetingTypeList[e.detail.value].value - console.log(index); this.data.searchParams.pageNo = 1 - // 宣贯会 培训会 信息交流会 需要单独写查询条件 + // 宣贯会 培训会 信息交流会 需要单独写查询条件 if(index === '7'){ // 信息交流会 this.setData({ @@ -182,7 +181,7 @@ Page({ 'searchParams.meetingType': index }) } - + this.queryMeetingList() }, bindDateChange(e) { @@ -190,7 +189,7 @@ Page({ // ' ' + '00:00:00' + ' ' + '23:59:59' this.setData({ 'searchParams.meetingStartTime': e.detail.value , - 'searchParams.meetingEndTime': e.detail.value + 'searchParams.meetingEndTime': e.detail.value }) this.queryMeetingList() }, @@ -200,13 +199,12 @@ Page({ wx.navigateTo({ url: `../meetingDetailSigned/meetingDetailSigned?meetingInfo=${meetingInfo}`, // (已报名) }) - - // let meetingItem = e.currentTarget.dataset.meetinginfo + // let meetingItem = e.currentTarget.dataset.meetinginfo // 如果是去报名页面需要在缓存中存储会议信息 当报名结束后 需要清除缓存中的当前会议信息 meetingSignUpType 1 可报名 2报名 // if (meetingItem.meetingSignUpType === 1) { - // // 从消息报名的参会单位不可更改 + // // 从消息报名的参会单位不可更改 // wx.setStorage({ // key:'companyDisabled', // data:true @@ -227,7 +225,7 @@ Page({ // } // } // }) - // } + // } }, // 获取会议列表数据 @@ -246,7 +244,7 @@ Page({ }) } if (res.result.records && res.result.records.length) { - + if(this.data.meetingList.length > 0){ this.data.meetingList.forEach(tt => { tt.meetingTypeText = this.initMeetingType(tt) @@ -254,7 +252,6 @@ Page({ } res.result.records.forEach(tt => { tt.meetingTypeText = this.initMeetingType(tt) - console.log(tt); }) this.setData({ meetingList: [...this.data.meetingList, ...res.result.records] @@ -269,12 +266,60 @@ Page({ }) }) }, + // 删除会议报名的信息 + deleteMeetingInfo(e) { + let meetingInfo = e.currentTarget.dataset.meetinginfo + const params = {id: meetingInfo.situationId} + let that = this + wx.showModal({ + title: '提示', + content: '确定删除此报名信息吗?', + success: function (res) { + if (res.confirm) { + MeetingApi.deleteSignUpInfo(params).then(res => { + wx.showToast({ + title: res.message, + icon: "none", + duration: 800, + }); + if (res.success) { + that.data.searchParams.pageNo = 1 + that.queryMeetingList() + } + }) + } else if (res.cancel) { + return false; + } + } + }) + }, + // 编辑会议报名的信息 + editMeetingInfo(e) { + let meetingInfo = e.currentTarget.dataset.meetinginfo + const params = { + id: meetingInfo.situationId, // 报名信息的id + meetingId: meetingInfo.id, + meetingType: meetingInfo.meetingType, + } + console.log("---------params------", params) + // 国际研讨会去国际研讨会的报名 + if(params.meetingType !== 3){ + wx.navigateTo({ + url: `../signUpPage/signUpPage?meetingId=${params.meetingId}&id=${params.id}&ope=edit&page=meeting&options=${JSON.stringify(this.options)}`, + }) + }else{ + wx.navigateTo({ + url: `../signUpPageGuoji/signUpPageGuoji?meetingId=${params.meetingId}&id=${params.id}&ope=edit&page=meeting&options=${JSON.stringify(this.options)}`, + }) + } + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { console.log(options); + this.options = options if (!!options.workingGroupId) { // 工作组的更多跳转 this.setData({ diff --git a/pages/meeting/meeting.wxml b/pages/meeting/meeting.wxml index ef29770..21e7cbf 100644 --- a/pages/meeting/meeting.wxml +++ b/pages/meeting/meeting.wxml @@ -8,27 +8,27 @@ - - - 状态 - - - - - - - - 会议类型 - - - - - - - 时间 - - - + + + 状态 + + + + + + + + 会议类型 + + + + + + + 时间 + + + @@ -38,7 +38,7 @@ - {{ item.meetingTypeText }} + {{ item.meetingTypeText }} @@ -48,12 +48,23 @@ 报名状态:{{ item.signUpStatus_dictText || '无'}} + + + + 编辑 + + + + 删除 + + + - 暂无数据 - + 暂无数据 + - + \ No newline at end of file diff --git a/pages/meeting/meeting.wxss b/pages/meeting/meeting.wxss index fb5b993..313d8b3 100644 --- a/pages/meeting/meeting.wxss +++ b/pages/meeting/meeting.wxss @@ -2,6 +2,7 @@ page { background-color: #F5F5F5; } + /* 头部筛选 start */ .select-list { border-top: 0.5px solid #F5F5F5; @@ -24,13 +25,15 @@ page { height: 6px; margin-left: 9px; } + /* 头部筛选end */ /* 列表start */ -.list{ +.list { padding: 15px; } -.list-item{ - height: 90px; + +.list-item { + min-height: 90px; background-color: #fff; border-radius: 5px; padding: 10px 15px; @@ -39,16 +42,20 @@ page { align-items: center; flex-direction: column; } + .list-item:not(:first-child) { margin-top: 10px; } -.list-item .title{ + +.list-item .title { width: 100%; display: flex; justify-content: space-between; align-items: center; + min-height: 50rpx; } -.list-item .title text:nth-child(1){ + +.list-item .title text:nth-child(1) { font-size: 14px; color: #333; flex: 1; @@ -56,20 +63,55 @@ page { text-overflow: ellipsis; white-space: nowrap; } -.list-item .title text:nth-child(2){ + +.list-item .title text:nth-child(2) { font-size: 12px; color: #999; width: 120px; text-align: right; flex-shrink: 0; } -.content-text{ + +.content-text { + min-height: 36rpx; width: 100%; color: #999; font-size: 12px; } -.content-text image{ + +.content-text image { width: 11px; height: 11px; margin-right: 10px; +} + +/* 列表页的操作按钮 */ +.content-btn { + margin-top: 10rpx; + padding-top: 10px; + border-top: 2rpx solid #f5f5f5; + border-top: 2rpx solid #f5f5f5; + display: flex; + align-items: center; + justify-content: flex-end; + flex-direction: row; + width: 100%; +} + +.content-btn .inner-btn-box { + display: flex; + align-items: center; + margin-left: 50rpx; +} + +.content-btn .inner-btn-box image { + width: 23rpx; + height: 24rpx; + margin-right: 8rpx; +} + +.content-btn .inner-btn-box text { + font-size: 24rpx; + font-weight: 300; + color: #069F99; } \ No newline at end of file diff --git a/pages/signUpEntrance/signUpEntrance.js b/pages/signUpEntrance/signUpEntrance.js index 9f6b469..eebd04d 100644 --- a/pages/signUpEntrance/signUpEntrance.js +++ b/pages/signUpEntrance/signUpEntrance.js @@ -165,7 +165,9 @@ Page({ }) let url = decodeURIComponent(options.q) let meetingId = url.split('=')[1] - // meetingId = '1571763536197734402' + // todo 开发直接测试 + // meetingId = '1681696011549757442' // 其他会议 + meetingId = '1681693843581128706' // 国际研讨会 this.queryMeetingDetail(meetingId) // this.queryMeetingDetail("1479397531946348545") diff --git a/pages/signUpPage/signUpPage.js b/pages/signUpPage/signUpPage.js index 7083e79..25c97d6 100644 --- a/pages/signUpPage/signUpPage.js +++ b/pages/signUpPage/signUpPage.js @@ -9,12 +9,9 @@ import { compareDate, dutyCode } from '../../utils/validate' - -const InvoiceTypeEnums = { - noNeed: { name: '不需要', index: 0 }, - plain: { name: '增值税普通发票', index: 1 }, - special: { name: '增值税专用发票', index: 2 } -} +import { + InvoiceTypeEnums +} from '../../assets/js/Enums/common.js' Page({ behaviors: [confirmInvoiceModalBehavior], @@ -118,7 +115,9 @@ Page({ // 扫码报名的 需要调用无限制接口 nolimitBool: false, // 会议费用 - meetingCost: '' + meetingCost: '', + // 备注信息 + remark: '', }, // 是否需要发票的选择 needInvoiceChange(e) { @@ -193,7 +192,6 @@ Page({ this.setData({ selectedIdentity: e.detail.value }) - console.log(e.detail.value); // 参会身份选择嘉宾和内部企业 会议费用为 0 if (e.detail.value === '2') { // 标协会议需要判断选中的企业是否是标协成员 @@ -375,7 +373,7 @@ Page({ return } } - if (!formData.invoiceProject || formData.invoiceProject === -1) { + if (formData.invoiceProject === undefined || formData.invoiceProject === -1) { wx.showToast({ title: '请选择发票项目', icon: 'none', @@ -431,11 +429,22 @@ Page({ title: '加载中', mask: true }) - signUpApi.signUpMeeting(formData).then(res => { + let func + let lastPage // 上一个调换的页面,用于记录编辑成功后返回哪个页面 + const isEdit = this.isEdit + if(isEdit) { + func = MeetingApi.editContactsInfo + formData.id = this.model.id // 编辑参会人的信息 + lastPage = this.lastPage + } else { + func = signUpApi.signUpMeeting + } + func(formData).then(res => { if (res.success) { wx.hideLoading({}) + let message = isEdit ? '编辑成功' : '报名成功' wx.showToast({ - title: '报名成功', + title: message, icon: 'loading', duration: 1500 }) @@ -449,15 +458,22 @@ Page({ wx.removeStorage({ key: 'currentMeetingInfo', success() { - // 跳转报名成功页面 - - if (!res.result) { - wx.navigateTo({ - url: `../signUpSuccess/signUpSuccess?audit=${res.result}`, - }) + // 非编辑页面跳转到下一页 + if(!isEdit) { + // 跳转报名成功页面 + if (!res.result) { + wx.navigateTo({ + url: `../signUpSuccess/signUpSuccess?audit=${res.result}`, + }) + } else { + wx.navigateTo({ + url: `../signUpSuccess/signUpSuccess`, + }) + } } else { + // 编辑页面跳转到会议列表页 wx.navigateTo({ - url: `../signUpSuccess/signUpSuccess`, + url: lastPage, }) } } @@ -504,7 +520,6 @@ Page({ if (flag) { return } - console.log('选择参会单位', this.data.nolimitBool); if (this.data.nolimitBool) { wx.navigateTo({ url: `../companyList/companyList?nolimit=nolimt`, @@ -532,7 +547,6 @@ Page({ }, // 信用代码验证 validateDutyCode(e) { - console.log(e, 1111) let value = e.detail.value let { message, @@ -565,7 +579,6 @@ Page({ }, // 发票项目变化的时候触发的方法 invoiceProjectChange(e) { - console.log("------e--------", e) this.setData({ invoiceProjectIndex: e.detail.value }) @@ -575,12 +588,15 @@ Page({ MeetingApi.meetingDetail({ id: id }).then(res => { - console.log(res); if (res.success) { this.setData({ selectedMeeting: res.result, meetingCost: res.result.meetingCosts }) + // 编辑的时候判断是否是标协会员,费用是否需要修改 + if(this.isEdit) { + this.judgeMemberCompany(this, res.result) + } // 存储会议信息 wx.setStorage({ key: 'currentMeetingInfo', @@ -595,10 +611,80 @@ Page({ }) }) }, + /* + * 编辑 + * */ + edit(record){ + this.model = Object.assign({}, record) + // 选中的身份 + const selectedIdentity = this.model.identity + '' + // 参会身份选中状态的处理 + this.data.identifyList.map(tt => { + if (tt.value === selectedIdentity) { + tt.checked = true + } + }) + // 是否选择发票的选中的索引 默认需要 + const index = this.data.needInvoiceList.findIndex(e => e.value === (this.model.needInvoice + '')) + '' + // 缴费方式 + const paymentMethod = this.model.payMode + // 缴费方式选中状态的处理 + this.data.paymentMethodList.map(tt => { + if (tt.value === paymentMethod + '') { + tt.checked = true + } + }) + // 选中的参会单位 + const selectedCompany = { + id:this.model.companyId, + companyName:this.model.companyName, + // 写入发票的信息,因为需要回显 + dutyCode:this.model.dutyCode, // 信用代码 + companyAddress:this.model.companyAddress, // 公司地址 + companyPhone:this.model.companyPhone, // 公司电话 + openingBank:this.model.openingBank, // 开户行 + bankAccount:this.model.bankAccount, // 银行账号 + linkBankNumber:this.model.linkBankNumber // 联行号 + } + const selectedPerson = { + id:this.model.companyContactTemporaryId, + name:this.model.companyContactName + } + // 发票项目选择的索引 + const invoiceProjectIndex = this.data.invoiceProjectList.findIndex(e => e.value === (this.model.invoiceProject + '')) + // 回显邮寄联系人 + const selectedPostPerson = { + id: this.model.postContactId, + name: this.model.postContactName, + contactAddress: this.model.postContactAddress, // 邮寄地址 + postalCode: this.model.postCode, // 邮编 + } + + this.setData({ + selectedCompany, + selectedPerson, + phone: this.model.phone, + selectedIdentity, // 参会身份 + identifyList: this.data.identifyList, // 参会身份选中 + paymentMethod, // 缴费方式 + paymentMethodList: this.data.paymentMethodList, // 缴费方式信息选中 + index, // 是否需要发票 + invoiceProjectIndex, // 发票项目 + selectedPostPerson, // 邮寄联系人信息 + remark: this.model.remark // 备注 + }) + }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad: async function (options) { + // options = { + // id: "1682018325751480322", + // meetingId: "1680850121742204930", + // meetingType: 1, + // page: 'meeting', + // ope: 'edit' + // } if (options.type) { this.setData({ indexMsg: options.type, @@ -609,10 +695,33 @@ Page({ nolimitBool: true }) } + this.setData({ + pageTitle: options.id ? '编辑报名信息' : '会议报名' + }) + if(options.id){ + this.isEdit = options.ope === 'edit' + this.lastPage = `../${options.page}/${options.page}` + // 对上一个页面的参数进行处理 + this.lastOptions = options.options && JSON.parse(options.options) || {} + let str = '' + Object.keys(this.lastOptions).forEach((tt, i) => { + if( i > 0) { + str += `&${tt}=${this.lastOptions[tt]}` + } else { + str += `?${tt}=${this.lastOptions[tt]}` + } + }) + this.lastPage += str + // 通过id获取参会人信息 + MeetingApi.queryPersongInfoById({id: options.id}).then(res => { + if(res.success){ + this.edit(res.result) + } + }) + } // this.queryMeetingInfo('1455359606691979265') if (options.meetingId) { - console.log(options.meetingId, 'options.meetingId'); - this.queryMeetingInfo(options.meetingId) + await this.queryMeetingInfo(options.meetingId) this.setData({ meetingId: options.meetingId }) @@ -634,7 +743,6 @@ Page({ wx.getStorage({ key: 'userInfo', success(res) { - console.log(res); that.setData({ 'selectedCompany.companyName': res.data.companyName, 'selectedPerson.name': res.data.name, @@ -653,7 +761,6 @@ Page({ }, // 手机号验证 validatePhone(e) { - console.log(e); let value = e.detail.value let { message, @@ -720,7 +827,37 @@ Page({ } }, - + /** + * 判断是否是标协会员的单位 进行费用的重置 + * @param that--原方法里面就是this实例 + * @param meetingObj -- 原方法是获取的currentMeetingInfo信息 + */ + judgeMemberCompany(that, meetingObj) { + // 标协会议需要判断单位是否是会员单位 + if (that.data.selectedCompany.companyName && meetingObj.meetingType + '' === '2') { + signUpApi.validateStandard({ + companyName: that.data.selectedCompany.companyName + }).then(result => { + if (result.result) { + that.setData({ + meetingCost: meetingObj.meetingCostsVip + }) + } else { + that.setData({ + meetingCost: meetingObj.meetingCosts + }) + } + }).finally(() => { + if (that.data.selectedIdentity) { + that.changeIdentity({ + detail: { + value: that.data.selectedIdentity + } + }) + } + }) + } + }, /** * 生命周期函数--监听页面初次渲染完成 @@ -742,7 +879,6 @@ Page({ wx.getStorage({ key: 'userInfo', success(res) { - console.log(res); that.setData({ 'selectedCompany.companyName': res.data.companyName, 'selectedPerson.name': res.data.name, @@ -791,30 +927,7 @@ Page({ that.setData({ selectedMeeting: res.data }) - // 标协会议需要判断单位是否是会员单位 - 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 - }) - } else { - that.setData({ - meetingCost: res.data.meetingCosts - }) - } - }).finally(() => { - if (that.data.selectedIdentity) { - that.changeIdentity({ - detail: { - value: that.data.selectedIdentity - } - }) - } - }) - } + that.judgeMemberCompany(that, res.data) } }) diff --git a/pages/signUpPage/signUpPage.json b/pages/signUpPage/signUpPage.json index 7b5888c..2afe5c6 100644 --- a/pages/signUpPage/signUpPage.json +++ b/pages/signUpPage/signUpPage.json @@ -1,4 +1,5 @@ { "navigationBarTitleText": "会议报名", + "navigationStyle": "custom", "usingComponents": {} -} \ No newline at end of file +} diff --git a/pages/signUpPage/signUpPage.wxml b/pages/signUpPage/signUpPage.wxml index 5198a00..8042096 100644 --- a/pages/signUpPage/signUpPage.wxml +++ b/pages/signUpPage/signUpPage.wxml @@ -1,4 +1,12 @@ + + + + {{pageTitle}} + + + +
@@ -25,7 +33,7 @@ @@ -39,7 +47,7 @@ @@ -112,42 +120,42 @@ 邮编: - - + + - + - + 备注: -