diff --git a/assets/images/fapiao.png b/assets/images/fapiao.png new file mode 100644 index 0000000..f48454d Binary files /dev/null and b/assets/images/fapiao.png differ diff --git a/assets/images/hy.png b/assets/images/hy.png new file mode 100644 index 0000000..627fa3f Binary files /dev/null and b/assets/images/hy.png differ diff --git a/assets/images/wenjian.png b/assets/images/wenjian.png new file mode 100644 index 0000000..0955576 Binary files /dev/null and b/assets/images/wenjian.png differ diff --git a/assets/js/http/userApi.js b/assets/js/http/userApi.js index 5bac7a7..9dcb08e 100644 --- a/assets/js/http/userApi.js +++ b/assets/js/http/userApi.js @@ -45,6 +45,12 @@ const UserApi = { projectList: (params) => http.get(`${URL_CONFIG}project/payCommonProject/queryCompanyPageList`, params), // 来款项目详情 projectDetail: (params) => http.get(`${URL_CONFIG}project/payCommonProject/queryCompanyById`, params), + // 消息提醒列表 + messageList: (params) => http.get(`${URL_CONFIG}sys/sysAnnouncementSend/getCompanyMyAnnouncementSend`, params), + // 消息提醒已读状态 + messageStatus: (params) => http.post(`${URL_CONFIG}sys/sysAnnouncementSend/editCompanyByAnntIdAndUserId`, params), + // 工作组分页 + workList: (params) => http.get(`${URL_CONFIG}project/payWorkingGroupSubitem/queryCompanyPageList`, params), } export default UserApi diff --git a/components/dateMonth/dateMonth.js b/components/dateMonth/dateMonth.js index 6895949..3d398cd 100644 --- a/components/dateMonth/dateMonth.js +++ b/components/dateMonth/dateMonth.js @@ -49,13 +49,13 @@ Component({ methods: { closePopup() { this.triggerEvent("close", { - visible: this.data.visible + visibleDate: this.data.visibleDate }) }, outClick(){ if (this.data.outClickCanClose){ this.triggerEvent("close", { - visible: this.data.visible + visibleDate: this.data.visibleDate }) } }, diff --git a/components/dateMonth/dateMonth.wxml b/components/dateMonth/dateMonth.wxml index b5c9d4f..7af849a 100644 --- a/components/dateMonth/dateMonth.wxml +++ b/components/dateMonth/dateMonth.wxml @@ -4,10 +4,10 @@ - {{item}}年 + {{item}}年 - {{item}}月 + {{item}}月 diff --git a/pages/home/home.js b/pages/home/home.js index 589bde9..16d410a 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -1,3 +1,5 @@ +import UserApi from '../../assets/js/http/userApi' + // pages/home/home.js Page({ @@ -5,23 +7,66 @@ 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: '资料网员' }, - ] + ], + titleList: [ + '会议提醒', + '文件提醒', + '邮寄提醒', + '催款提醒', + ], + index: 0, + list: [], // 消息列表 + searchParams: { + pageNo: 1, + pageSize: 10, + titile: '', // 提醒类型 3:会议 6:文件 7:邮寄 8:催款 + startTime: '', // 开始日期 + endTime: '' // 结束日期 + } + }, + loadData(){ + UserApi.messageList(this.data.searchParams).then(res=>{ + if(res.success){ + // 搜索时,把原数据清空,重新筛选 + if(this.data.searchParams.pageNo === 1) { + this.setData({ + list: [] + }) + } + const reg = new RegExp("

","g") + const reg1 = new RegExp("

","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,"") + const startIndex = item.msgContent.indexOf("<") + const endIndex = item.msgContent.lastIndexOf(">") + item.msgContent = item.msgContent.substring(0, startIndex) + item.msgContent.slice(endIndex+1) + '点击报名' + }) + this.setData({ + list: [...this.data.list, ...res.result.records] + }) + } + } + }) }, // 点击首页的五个选项跳转页面 - clickSelect(e){ + clickSelect(e){ let index = e.currentTarget.dataset.index let url = '' if(index === 0) { // 来款项目 - url = '../project/project' + url = '../project/project?type=project' } else if(index === 1) { // 工作组 // url = '../work/work' - url = '../project/project' + url = '../project/project?type=work' } else if(index === 2) { // 分标委 url = '../committee/committee' } else if(index === 3) { // 会议活动 @@ -34,59 +79,77 @@ Page({ url, }) }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - + // 会议去报名,切换已读状态 + 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=>{ + wx.showToast({ + title: '已读成功', + icon: 'none' + }) + }) + } + if(templateCode == 'QY_1_HYTZ_WORK_GROUP_CREATE'){ // 去报名页 + wx.navigateTo({ + url: 'url', + }) + } }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - + // 类型选中 + bindTitleChange(e){ + this.data.searchParams.pageNo = 1 + if(e.detail.value == 0){ + this.setData({ + "searchParams.titile": 3, + }) + }else if(e.detail.value == 1){ + this.setData({ + "searchParams.titile": 6, + }) + }else if(e.detail.value == 2){ + this.setData({ + "searchParams.titile": 7, + }) + }else { + this.setData({ + "searchParams.titile": 8, + }) + } + this.loadData() + }, + // 日期选中 + bindDateChange: function (e) { + this.data.searchParams.pageNo = 1 + this.setData({ + "searchParams.startTime": e.detail.value, + "searchParams.endTime": e.detail.value + }) + this.loadData() }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - + let searchParams = { + pageNo: 1, + pageSize: 10, + titile: '', // 提醒类型 3:会议 6:文件 7:邮寄 8:催款 + startTime: '', // 开始日期 + endTime: '' // 结束日期 + } + this.setData({ + searchParams + }) + this.loadData() }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + this.data.searchParams.pageNo++ + this.loadData() } }) \ No newline at end of file diff --git a/pages/home/home.json b/pages/home/home.json index 965b8e8..a2ebd45 100644 --- a/pages/home/home.json +++ b/pages/home/home.json @@ -1,4 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "popup": "../../components/popup/popup", + "dateMonth": "../../components/dateMonth/dateMonth" + }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/home/home.wxml b/pages/home/home.wxml index c7771eb..b623cf2 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -1,11 +1,12 @@ - + - + @@ -13,5 +14,49 @@ + + + + + + + + 类型 + 会议提醒 + 文件提醒 + 邮寄提醒 + 催款提醒 + + + + + + + 时间 + {{searchParams.startTime}} + + + + + + + + + + + {{item.titile_dictText}} + + {{item.sendTime}} + + {{item.msgContent}} + + + + + + 暂无数据 + - \ No newline at end of file + + + diff --git a/pages/home/home.wxss b/pages/home/home.wxss index 2a513b4..a3e8fed 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -33,3 +33,76 @@ page{ .image-box image{ max-height: 100%; } +.list-box{ + margin: 0 15pt; + margin-top: -30pt; + padding: 15px 0; + background: #fff; + border-radius: 10px; +} + +.sign-list .select-list { + height: 40px; + font-size: 14px; + display: flex; + align-items: center; + background-color: #fff; +} +.sign-list .select-item { + flex: 1; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} +.sign-list .select-item image { + width: 11px; + height: 6px; + margin-left: 9px; +} +.list-content{ + max-height: 500px; + overflow-y: auto; + padding: 15px 15pt; + border-radius: 10px; +} +.list-content .list-content-item{ + height: 60px; + border-bottom: 0.5px solid #f5f5f5; + display: flex; + flex-direction: column; + justify-content: space-around; + position: relative; +} +.list-content-item:last-child{ + border: 0; +} +.content-top{ + display: flex; + justify-content: space-between; + align-items: center; + font-size: 11px; + color: #999; +} +.content-top image{ + width: 10px; + height: 10px; + margin-right: 10px; +} +.content-bottom{ + color: #555; + font-size: 13px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.status{ + position: absolute; + top: 0px; + right: -5px; + display: block; + width: 5px; + height: 5px; + background-color: #FF5E60; + border-radius: 50%; +} \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index 9fc4e34..963d0e8 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -26,6 +26,11 @@ Page({ // 获取成功,倒计时 start if (res.success) { this.countDown() + wx.showToast({ + title: res.message, + icon: 'none', + duration: 2000 + }) } else { wx.showToast({ title: res.message, diff --git a/pages/project/project.js b/pages/project/project.js index ec6987d..8ad94c6 100644 --- a/pages/project/project.js +++ b/pages/project/project.js @@ -5,9 +5,8 @@ Page({ * 页面的初始数据 */ data: { - visible: false, - visibleDate: false, index: 0, + type: '', // project 是来款项目 work 是工作组 list: [], // 项目列表 searchParams: { pageNo: 1, @@ -15,141 +14,110 @@ Page({ needInvoice: '', // 是否需要发票 0 4 pack: '', // 是否打包 0 1 year: '', // 运行年份 - }, - selects: [ // 自定义选择框参数 - { - select: '发票', - active: false, - tabIndex: 1 - }, - { - select: '打包', - active: false, - tabIndex: 2 - }, - { - select: '时间', - active: false, - tabIndex: 3 - } - ], - data: [ - { - label: '需要', - value: 4 - },{ - label: '不需要', - value: 0 - } - ] + } }, - // 搜索筛选 - changeTab(e){ - this.data.index = e.currentTarget.dataset.index - if(this.data.index === 0){ + // 发票改变 + bindNeedInvoiceChange(e){ + console.log(e.detail.value) + this.data.searchParams.pageNo = 1 + if(e.detail.value == 0) { this.setData({ - visible: true - }) - this.setData({ - data: [ - { - label: '需要', - value: 4 - },{ - label: '不需要', - value: 0 - } - ] - }) - }else if(this.data.index === 1){ - this.setData({ - visible: true - }) - this.setData({ - data: [ - { - label: '是', - value: 1 - },{ - label: '否', - value: 0 - } - ] + "searchParams.needInvoice": 1, }) }else{ this.setData({ - visibleDate: true + "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, }) } - }, - // 关闭发票和打包的弹出层 - close() { - this.setData({ - visible: false - }) - }, - // 日期选中 - dateOk(value){ - this.data.pageNo = 1 - this.setData({ - "searchParams.year": value.detail, - visibleDate: false - }) this.loadData() }, - ok(e){ - this.data.pageNo = 1 - if(this.data.index === 0){ - this.setData({ - 'searchParams.needInvoice': e.detail - }) - }else if(this.data.index === 1){ - this.setData({ - 'searchParams.pack': e.detail - }) - } + bindDateChange(e){ + this.data.searchParams.pageNo = 1 + this.setData({ + "searchParams.year": e.detail.value + }) this.loadData() }, // 项目详情 - projectDetail(){ + projectDetail(e){ + console.log(e) wx.navigateTo({ - url: '../projectDetail/projectDetail', + url: `../projectDetail/projectDetail?id=${e.currentTarget.dataset.project.id}`, }) }, loadData(){ - UserApi.projectList(this.data.searchParams).then(res=>{ - if(res.success){ - // 搜索时,把原数据清空,重新筛选 - if(this.data.pageNo === 1) { - this.setData({ - list: [] - }) + if(this.data.type == 'project'){ + UserApi.projectList(this.data.searchParams).then(res=>{ + if(res.success){ + // 搜索时,把原数据清空,重新筛选 + if(this.data.searchParams.pageNo === 1) { + this.setData({ + list: [] + }) + } + if(res.result.records && res.result.records.length){ + this.setData({ + list: [...this.data.list, ...res.result.records] + }) + } } - if(res.result.records && res.result.records.length){ - this.setData({ - list: [...this.data.list, ...res.result.records] - }) - } - } - }).catch(err=>{ - wx.showToast({ - title: '加载失败', - icon: 'fail', - duration: 2000 + }).catch(err=>{ + wx.showToast({ + title: '加载失败', + icon: 'fail', + duration: 2000 + }) }) - }) + }else if(this.data.type == 'work'){ + UserApi.workList(this.data.searchParams).then(res=>{ + if(res.success){ + // 搜索时,把原数据清空,重新筛选 + if(this.data.searchParams.pageNo === 1) { + this.setData({ + list: [] + }) + } + if(res.result.records && res.result.records.length){ + this.setData({ + list: [...this.data.list, ...res.result.records] + }) + } + } + }).catch(err=>{ + wx.showToast({ + title: '加载失败', + icon: 'fail', + duration: 2000 + }) + }) + } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.data.type = options.type this.loadData() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - this.data.pageNo++ + this.data.searchParams.pageNo++ this.loadData() }, }) diff --git a/pages/project/project.wxml b/pages/project/project.wxml index 4f55e6e..c727c85 100644 --- a/pages/project/project.wxml +++ b/pages/project/project.wxml @@ -1,19 +1,44 @@ - + + + + + + 发票{{searchParams.needInvoice == '' ? '' : searchParams.needInvoice == 1 ? ' :是' : ' :否'}} + + + + + + + + 打包{{searchParams.pack == '' ? '' : searchParams.pack == 1 ? ' :是' : ' :否'}} + + + + + + + + 时间 + 时间:{{searchParams.year}}年 + + - + - {{item.chargeUse_dictText}} + {{item.chargeProject}} {{item.year}}年 - {{item.needInvoice === 0 ? '不需要发票' : '需要发票'}} + {{item.needInvoice === 0 ? '不需要发票' : '需要发票'}} 到账 开票 邮寄 @@ -24,4 +49,4 @@ 暂无数据 - + \ No newline at end of file diff --git a/pages/projectDetail/projectDetail.js b/pages/projectDetail/projectDetail.js index 3349a12..c1cb5af 100644 --- a/pages/projectDetail/projectDetail.js +++ b/pages/projectDetail/projectDetail.js @@ -1,18 +1,34 @@ -// pages/meeting/meeting.js +import UserApi from '../../assets/js/http/userApi' +import { previewFile, initFileList } from '../../assets/js/preview' Page({ /** * 页面的初始数据 */ data: { - + form: {}, + noticeFileList: [] // 通知文件 + }, + // 预览 + preview(e){ + const fileObj = e.currentTarget.dataset.file + previewFile(fileObj.id,fileObj.name) }, - /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + UserApi.projectDetail({id: options.id}).then(res=>{ + this.setData({ + form: res.result + }) + // 获取通知文件list + initFileList(this.data.form.files).then(res => { + this.setData({ + noticeFileList:res + }) + }) + }) }, /** @@ -26,7 +42,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + }, /** @@ -63,4 +79,4 @@ Page({ onShareAppMessage: function () { } -}) \ No newline at end of file +}) diff --git a/pages/projectDetail/projectDetail.wxml b/pages/projectDetail/projectDetail.wxml index 414b684..71cce4a 100644 --- a/pages/projectDetail/projectDetail.wxml +++ b/pages/projectDetail/projectDetail.wxml @@ -2,116 +2,111 @@ 项目名称 - 会议名称会议名称 + {{form.chargeProject}} 款项用途 - arff4ds8a3s6651 + + {{form.chargeUse_dictText}} 运行年份 - 找找 + {{form.year}}年 - 企业负责人 - 张三 + 项目负责人 + {{form.principalName}} 应付金额 - 500元 + {{form.receivableAmount ? form.receivableAmount + '元' : '0'}} 实付金额 - 500元 + {{form.paidAmount ? form.paidAmount + '元' : '0'}} - 经办人 - 500元 + 企业联系人 + {{form.contactsTemporaryName}} - 是否打包 - 500元 + 邮寄联系人 + {{form.mailContactsTemporaryName}} + + + 打包 + {{form.pack_dictText}} 需要发票 - 500元 + {{form.needInvoice_dictText}} 付款方式 - 500元 + {{form.chargeWay_dictText}} - - 备注 - 500元 + + + 合同 + + {{form.contractNo}} + + + + 收费通知号 + {{form.chargeNoticeNo}} + + + + 通知文件 + + {{item.name}} + 到账信息 - - 2021年到账12021元 + + {{item.paymentDate}}到账{{item.amountReceived}}元 - - 开票邮寄信息 - - - - 顺丰速递 - - - - - - 开票人:张三 - 开票时间:2021年10月9日 - + + + 开票邮寄信息 - 开票号5465 - - - - - - 开票人:张三 - 开票时间:2021年10月9日 - + + + + {{item.sendMethod_dictText}} - 开票号5465 - - - 金额:200元 - 查看物流 - - - - EMS速运 - - - - - - 开票人:张三 - 开票时间:2021年10月9日 + + + + + 开票人:{{item.createBy}} + 开票时间:{{item.billDate}} + + 开票号{{item.billNo}} - 开票号5465 - - - - - - 开票人:张三 - 开票时间:2021年10月9日 + + + + + 邮寄人:{{item.createBy}} + 邮寄时间:{{item.sendDate}} + + 快递号:{{item.postNo}} + + + 金额:{{item.invoiceAmount}}元 + 查看物流 - 开票号5465 - - - 金额:200元 - 查看物流 - + \ No newline at end of file diff --git a/pages/projectDetail/projectDetail.wxss b/pages/projectDetail/projectDetail.wxss index a315a86..5015108 100644 --- a/pages/projectDetail/projectDetail.wxss +++ b/pages/projectDetail/projectDetail.wxss @@ -125,6 +125,18 @@ page{ top: -3px; right: -3px; } +.way-box{ + display: block !important; + padding: 0 !important; + height: auto !important; +} +.info-file{ + padding: 0 !important; + display: flex; + flex-direction: column; + align-items: flex-end !important; + height: auto !important; +} .basic-info .way{ padding: 0 15px; display: flex;