From 6f261ba5a144055b1a2137f9165313e56a356659 Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Fri, 10 Jun 2022 23:10:05 +0800 Subject: [PATCH] tijiao --- pages.json | 37 ++-- pages/mine/messageList.vue | 65 +++++- pages/{mine => }/reportExcel/dayReport.vue | 66 +++--- pages/{mine => }/reportExcel/weekReport.vue | 217 ++++++++++---------- 4 files changed, 232 insertions(+), 153 deletions(-) rename pages/{mine => }/reportExcel/dayReport.vue (88%) rename pages/{mine => }/reportExcel/weekReport.vue (85%) diff --git a/pages.json b/pages.json index eb31055..e1e8161 100644 --- a/pages.json +++ b/pages.json @@ -60,6 +60,25 @@ "navigationBarBackgroundColor": "#2671E2", "navigationBarTextStyle": "white" } + }, + + { + "path": "pages/reportExcel/dayReport", + "style": { + "navigationBarTitleText": "数智工牌日报", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black" + } + + }, + { + "path": "pages/reportExcel/weekReport", + "style": { + "navigationBarTitleText": "数智工牌周报", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black" + } + } ], //这下面是分包 @@ -234,24 +253,6 @@ "navigationBarTextStyle": "black" } - }, - { - "path": "reportExcel/dayReport", - "style": { - "navigationBarTitleText": "数智工牌日报", - "navigationBarBackgroundColor": "#ffffff", - "navigationBarTextStyle": "black" - } - - }, - { - "path": "reportExcel/weekReport", - "style": { - "navigationBarTitleText": "数智工牌周报", - "navigationBarBackgroundColor": "#ffffff", - "navigationBarTextStyle": "black" - } - }, { "path": "selectBuilding", "style": { diff --git a/pages/mine/messageList.vue b/pages/mine/messageList.vue index 9e3b7f3..c27570c 100644 --- a/pages/mine/messageList.vue +++ b/pages/mine/messageList.vue @@ -4,7 +4,7 @@ - 全部{{ count }}条消息 + 全部{{ count }}条新消息 全部已读 @@ -24,7 +24,15 @@ + + + {{item.title}} + @@ -101,6 +109,7 @@ this.updateAnnList = [] this.pageNum = 1 this.updateInit() + this.getMessageNotRed() }, onLoad() { @@ -182,7 +191,6 @@ }, success: (res) => { if (res.data.data) { - this.count = res.data.data.sum if (this.pageNum != 1) { this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.results]; } else { @@ -203,20 +211,69 @@ }) }, + // 获取未读消息数量 + getMessageNotRed() { + uni.request({ + url: config.service.notReadNum, + method: "GET", + data: { + id: uni.getStorageSync('weapp_session_userInfo_data').accountId, + projectId: uni.getStorageSync('buildingID').id, + }, + header: { + 'content-type': 'application/json', + 'Access-Token': uni.getStorageSync('weapp_session_login_data').token + }, + success: (res) => { + this.count = res.data.data || 0 + } + }) + }, + // 跳转日报 goReception(data, index) { this.$store.commit('setMessageObj', data) data.readFlag = 1 if (data.messageType == 2) { uni.navigateTo({ - url: `/pages/mine/reportExcel/weekReport?id=${data.id}` + url: `/pages/reportExcel/weekReport?id=${data.id}` }) } else { uni.navigateTo({ - url: `/pages/mine/reportExcel/dayReport?id=${data.id}` + url: `/pages/reportExcel/dayReport?id=${data.id}` }) } }, + + fomatDate(date) { + if (!date) return '--' + let arr = date.split(' ') + let str = arr[0] + let result = str.split('-') + return `${result[1]}月${result[2]}日` + }, + + // 转换时间 + getTimeLine(date, type = 1) { + let resu = '--' + if (!date) return resu + let time = new Date(date.replace(/-/g, '/')) + time.setDate(time.getDate() - 7) + let arr = date.split(' ') + let str = arr[0] + let result = str.split('-') + + let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1) + let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate() + + if (type == 1) { + resu = `${m}.${d}-${result[1]}.${result[2]}` + } else { + resu = `${m}月${d}日~${result[1]}月${result[2]}日` + } + return resu + }, + change(index) { this.current = index; this.initPage() diff --git a/pages/mine/reportExcel/dayReport.vue b/pages/reportExcel/dayReport.vue similarity index 88% rename from pages/mine/reportExcel/dayReport.vue rename to pages/reportExcel/dayReport.vue index 73ca204..3ea4c75 100644 --- a/pages/mine/reportExcel/dayReport.vue +++ b/pages/reportExcel/dayReport.vue @@ -17,7 +17,6 @@ - 1 @@ -29,15 +28,15 @@ - 接待量{{ weekObj.receptionCount || 0 }} + 接待量{{ weekObj.receptionCount || 0 }} - 有效接待{{ weekObj.activeCustomer || 0 }} + 有效接待{{ weekObj.activeCustomer || 0 }} - 有效接待率{{ weekObj.validReceptionRate || 0 }}% - 对比昨天{{ weekObj.validReceptionRatePK || 0 }} + 有效接待率{{ weekObj.validReceptionRate || 0 }}% + 对比昨天{{ weekObj.validReceptionRatePK > 0 ? '+' : '' }}{{ weekObj.validReceptionRatePK || 0 }}% @@ -55,9 +54,9 @@ - 销讲执行率{{ weekObj.fraction || 0 }}% - 对比昨天{{ weekObj.fractionPK || 0 }} + 销讲执行率{{ weekObj.fraction || 0 }}% + 对比昨天{{ weekObj.fractionPK > 0 ? '+' : '' }}{{ weekObj.fractionPK || 0 }}% @@ -74,9 +73,9 @@ - 平均接待时长{{ weekObj.avgDuration || 0 }}min + 平均接待时长{{ weekObj.avgDuration || 0 }}min 对比昨天{{ weekObj.avgDurationPK }} + :class="{down: weekObj.avgDurationPK < 0, up: weekObj.avgDurationPK > 0}">{{ weekObj.avgDurationPK > 0 ? '+' : '' }}{{ weekObj.avgDurationPK }}min @@ -194,7 +193,7 @@ {{ rank.title || '--' }} - ({{ rank.value || 0 }}%) + ({{ rank.value || 0 }}min) @@ -222,7 +221,7 @@ {{ rank.title || '--' }} - + {{ rank.value || 0 }}% @@ -238,7 +237,7 @@ 客户画像触达: - {{ weekObj.reachSum || 0 }}次 + {{ weekObj.reachSum || 0 }}次 @@ -250,8 +249,9 @@ 未标记接待数: - {{ weekObj.unlabelledReceptionNum || 0 }}条 + {{ weekObj.unlabelledReceptionNum || 0 }} + @@ -266,9 +266,9 @@ - 在线{{ weekObj.equipmentInfo.onlineNum || 0 }} + 在线{{ weekObj.equipmentInfo.onlineNum || 0 }} - 离线{{ weekObj.equipmentInfo.offlineNum || 0 }} + 离线{{ weekObj.equipmentInfo.offlineNum || 0 }} @@ -316,7 +316,7 @@ return { title: `${this.projectName}数智工牌日报`, type: 2, - path: `/pages/mine/reportExcel/dayReport?id=${this.id}` + path: `/pages/reportExcel/dayReport?id=${this.id}` } }, @@ -437,7 +437,7 @@ .c-head-card { padding: 30rpx; width: 100%; - height: 252rpx; + min-height: 252rpx; border: 2rpx solid #000000; border-radius: 12rpx; box-shadow: 10rpx 10rpx #2671E2; @@ -479,6 +479,7 @@ .arrs-items { margin: 40rpx 0 0 0; display: flex; + min-height: 100rpx; .left { flex-shrink: 0; @@ -585,11 +586,12 @@ .nav-footer { position: sticky; - bottom: 32rpx; - margin: 32rpx 0; + bottom: 0; + padding: 32rpx 0; width: 100%; display: flex; justify-content: center; + background: #fff; .footer-item { width: 686rpx; @@ -619,13 +621,23 @@ } + .up { + color: #43CD80 !important; + } + + .down { + color: #E6273A !important; + } + .empty { width: 100%; - height: 240rpx; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; + line-height: 48rpx; + } + + .value { + margin-left: 5rpx; + font-size: 30rpx; + font-weight: bold; } } diff --git a/pages/mine/reportExcel/weekReport.vue b/pages/reportExcel/weekReport.vue similarity index 85% rename from pages/mine/reportExcel/weekReport.vue rename to pages/reportExcel/weekReport.vue index 92cb22d..1898036 100644 --- a/pages/mine/reportExcel/weekReport.vue +++ b/pages/reportExcel/weekReport.vue @@ -24,10 +24,10 @@ - + {{ data.name }} - + {{ data.num || 0 }} @@ -35,7 +35,8 @@ {{ data.percent || '0' }} @@ -50,15 +51,21 @@ 销讲场景执行排名