diff --git a/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.js b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.js new file mode 100644 index 0000000..a5aa860 --- /dev/null +++ b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.js @@ -0,0 +1,101 @@ +import UserApi from "../../assets/js/http/userApi" + +// pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + // 起草组id + id: '', + // 起草组详情信息 + draftingDetailIngfo: {}, + }, + // 报名 + signUp() { + const that = this + wx.navigateTo({ + url: `../signUpDraftTeamPage/signUpDraftTeamPage?id=${this.data.id}`, + }) + }, + // 获取信息 + loadData() { + UserApi.getDraftGroupInfoById({ id: this.data.id }).then(res => { + if (res.success) { + this.setData({ + draftingDetailIngfo: res.result || {} + }) + } + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none' + }) + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let url = decodeURIComponent(options.q) + let id = url.split('=')[1] + // 用于测试代码 + id = '1746776208124739585' + this.setData({ id }) + this.loadData() + }, + goBack(){ + wx.navigateBack() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.json b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.json new file mode 100644 index 0000000..9915bf2 --- /dev/null +++ b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "起草组报名入口", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxml b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxml new file mode 100644 index 0000000..f153551 --- /dev/null +++ b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxml @@ -0,0 +1,43 @@ + + + + + 起草组项目名称 + {{draftingDetailIngfo.draftingGroupProject || ''}} + + + 关联工作组 + {{draftingDetailIngfo.workingGroupName || ''}} + + + 负责人A + {{draftingDetailIngfo.principalNameA || ''}} + + + 负责人B + {{draftingDetailIngfo.principalNameB || ''}} + + + 每年召开次数 + {{draftingDetailIngfo.convokeNum || ''}} + + + 运行周期 + {{draftingDetailIngfo.operationCycle || ''}} + + + + + + + + + + + diff --git a/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxss b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxss new file mode 100644 index 0000000..878f47b --- /dev/null +++ b/pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxss @@ -0,0 +1,104 @@ +/* pages/signUpDraftTeamEntrance/signUpDraftTeamEntrance.wxss */ +page{ + box-sizing: border-box; + background-color: #F5F5F5; +} +.basic-info .title{ + height: 40px; +} +.basic-info .title text{ + display: block; + border-left: 3px solid #069F99; + height: 14px; + padding-left: 10px; + border-radius: 2px; + display: flex; + justify-content: center; + align-items: center; + color: #333; + font-size: 15px; + font-weight: 500; +} +.basic-info view{ + background-color: #FFF; + padding: 15px; + min-height: 40px; + display: flex; + justify-content: space-between; + align-items: center; + color: #333; + font-size: 14px; + border-bottom: 0.5px solid #f5f5f5; + position: relative; +} +.basic-info view.wrap-text-view .basic-label{ + flex-basis: 120rpx; +} +.basic-info view.wrap-text-view > text:nth-of-type(2){ + flex: 1; + width: 0; + margin-left: 10rpx; + text-align: right; +} +.basic-info view:last-child{ + border-bottom: 0; +} +.meeting-name{ + margin-bottom: 10px; +} +.warning-text{ + position: absolute !important; + top: 5px; + left: 75px; + color: #FF5E60 !important; + font-size: 10px !important; + padding: 0 !important; +} +.warning-text image{ + width: 10px; + height: 10px; +} +.sign-up-empty{ + height: 60px; + width: 100%; + display: block; + margin-top: 10px; +} +.sign-up{ + width: 100%; + padding: 10px 15px; + box-sizing: border-box; + background-color: #fff; + position: fixed; + bottom: 0; +} +.sign-up text{ + background-color: #069F99; + height: 40px; + border-radius: 10px; + color: #fff; + font-size: 16px; + font-weight: 600; + display: block; + text-align: center; + line-height: 40px; +} +.sign-up-btn { + background-color: #069F99; + font-weight: 500; + color:#fff +} + +.basic-info view.sign-in { + display: flex!important; + flex-direction: column!important; + align-items: start; + justify-content: start; + height: auto!important; +} +.sign-in-text { +margin-top: 15px; +} +.block-text { + display: block; +} diff --git a/pages/signUpDraftTeamPage/signUpDraftTeamPage.js b/pages/signUpDraftTeamPage/signUpDraftTeamPage.js new file mode 100644 index 0000000..5a9e42a --- /dev/null +++ b/pages/signUpDraftTeamPage/signUpDraftTeamPage.js @@ -0,0 +1,237 @@ +import UserApi from "../../assets/js/http/userApi"; + +// pages/signUpDraftTeamPage/signUpDraftTeamPage.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + pageTitle: '起草组报名', + // page-container 相关的配置 + statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], + // 当前起草组项目id + id: '', + // 是否需要权限 + nolimitBool: false, + // 选择的用户 + selectedPerson: {}, + // 选择用户下标 + selectedPersonIndex: null, + // 当前选择的企业 + selectedCompany: {}, + // 企业联系人 + personList: [{}, {}, {}], + }, + + // 选择参会单位 + selectCompany() { + wx.navigateTo({ + url: `../companyList/companyList?nolimit=true`, + }) + }, + setIdentityDisabled () {}, + // 选择联系人 + selectPerson(e) { + const that = this + // 设置操作的下标,onLoad事件将数据放入数组 + console.log('操作企业联系人下标', e.currentTarget.dataset.index); + this.setData({ + selectedPersonIndex: e.currentTarget.dataset.index + }) + if (!!this.data.selectedCompany.id) { + wx.navigateTo({ + url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}&nolimit=${that.data.nolimitBool}`, + }) + } else { + wx.showToast({ + title: '请先选择参会单位', + icon: "none", + duration: 800, + }); + } + }, + // 添加企业联系人 + handleAddContacts () { + if (this.data.personList.length >= 10) { + wx.showToast({ + title: '最多添加十个企业联系人', + icon: "none", + duration: 800, + }); + return + } + this.data.personList.push({}) + this.setData({ + personList: this.data.personList + }) + }, + // 删除企业联系人 + handleDelContacts (e) { + const index = e.currentTarget.dataset.index + if (this.data.personList.length === 1) { + wx.showToast({ + title: '最少需要一个企业联系人', + icon: "none", + duration: 800, + }); + } else { + this.setData({ + personList: this.data.personList.filter((_, i) => index !== i) + }) + } + }, + // 企业联系人备注 + inputContactsRemarks (e) { + const index = e.currentTarget.dataset.index + this.data.personList[index].remarks = e.detail.value || '' + this.setData({ + personList: this.data.personList + }) + }, + // 提交 + formSubmit(e) { + // 参会单位必填 + if (!this.data.selectedCompany.id) { + wx.showToast({ + title: '请先选择参会单位', + icon: "none", + duration: 800, + }); + return + } + // 企业联系人1必填 + if (!this.data.personList[0].contactsId) { + wx.showToast({ + title: '请选择企业联系人1', + icon: 'none', + duration: 2000 + }) + return + } + // 企业联系人不能重复 + const personIds = this.data.personList.filter(item => item.contactsId).map(item => item.contactsId) + if (Array.from(new Set(personIds)).length !== personIds.length) { + wx.showToast({ + title: '请选择不同的联系人', + icon: 'none', + duration: 2000 + }) + return + } + const params = {} + // 报名起草组id + params.draftingGroupId = this.data.id + // 审核状态 1未审核 2已审核 3已驳回 + params.checkResult = 1 + // 选择的企业 + params.chargeCompanyId = this.data.selectedCompany.id + params.chargeCompanyTemporaryName = this.data.selectedCompany.companyName + // 总备注 + params.remarks = e.detail.value.remarks || '' + // 联络人列表 + params.payDraftingGroupSubItemContactsList = this.data.personList.filter(item => item.contactsId) + console.log(params); + wx.showLoading({ + title: '加载中', + mask: true + }) + UserApi.draftingGroupRegistration(params).then(res => { + if (res.success) { + wx.showToast({ + title: res.message, + icon: 'loading', + duration: 1500, + success: () => { + this.goBack() + } + }) + } else { + wx.showToast({ + title: res.message, + icon: 'none', + duration: 2000 + }) + } + }).catch(e => { + wx.showToast({ + title: '操作失败', + icon: 'error', + duration: 2000 + }) + }) + }, + goBack(){ + wx.navigateBack() + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + id: options.id + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + console.log('选择的用户', this.data.selectedPersonIndex, this.data.selectedPerson); + if (this.data.selectedPersonIndex !== null && this.data.selectedPersonIndex !== undefined) { + const { id, name } = this.data.selectedPerson || {} + this.data.personList[this.data.selectedPersonIndex] = { + contactsId: id, + contactsTemporaryName: name, + remarks: '' + } + this.setData({ + selectedPerson: {}, + selectedPersonIndex: null, + personList: this.data.personList + }) + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/signUpDraftTeamPage/signUpDraftTeamPage.json b/pages/signUpDraftTeamPage/signUpDraftTeamPage.json new file mode 100644 index 0000000..24090ca --- /dev/null +++ b/pages/signUpDraftTeamPage/signUpDraftTeamPage.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "起草组报名", + "navigationStyle": "custom", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/signUpDraftTeamPage/signUpDraftTeamPage.wxml b/pages/signUpDraftTeamPage/signUpDraftTeamPage.wxml new file mode 100644 index 0000000..b5c2d8e --- /dev/null +++ b/pages/signUpDraftTeamPage/signUpDraftTeamPage.wxml @@ -0,0 +1,60 @@ + + + + + {{pageTitle}} + + + + +
+ + + + 企业名称: + + + + + + 企业联系人{{index + 1}} + + + + + + + + 姓名: + + + + + + 备注: + + + + + + + 添加企业联系人 + + + + + + + 备注 +