From f1027d1f40cde46fa7d310c5b49d6bb3d3d3c0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E7=BB=A7=E7=BB=AD=E5=90=B9?= <17611323298@163.com> Date: Mon, 28 Aug 2023 10:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 4 +- pages.json | 2 +- pages/center/Piabodata/Groupcontrast.vue | 2 +- pages/mine/messageList.vue | 737 +++++++++++------------ 4 files changed, 371 insertions(+), 374 deletions(-) diff --git a/manifest.json b/manifest.json index d5d21c5..374cacc 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "数智工牌", + "name" : "AI销讲助手", "appid" : "__UNI__7A1611D", "description" : "AI销讲助手", "versionName" : "1.1.0", @@ -72,7 +72,7 @@ }, "quickapp" : {}, "mp-weixin" : { - "appid" : "wxe044603515ff2cb5", + "appid" : "wx83fec12ec03d9349", "setting" : { "urlCheck" : false, "es6" : true, diff --git a/pages.json b/pages.json index cdd8f2c..c1c82ff 100644 --- a/pages.json +++ b/pages.json @@ -323,7 +323,7 @@ }, { "path": "messageDetail", "style": { - "navigationBarTitleText": "升级公告", + "navigationBarTitleText": "系统公告", "navigationBarBackgroundColor": "#2671E2", "navigationBarTextStyle": "white" } diff --git a/pages/center/Piabodata/Groupcontrast.vue b/pages/center/Piabodata/Groupcontrast.vue index 62e709d..87938f5 100644 --- a/pages/center/Piabodata/Groupcontrast.vue +++ b/pages/center/Piabodata/Groupcontrast.vue @@ -755,7 +755,7 @@ .percent { height: 100%; - background: #F1F3FF; + background: #2671E2; border-radius: 15px; } } diff --git a/pages/mine/messageList.vue b/pages/mine/messageList.vue index 6ab69a6..fb6886e 100644 --- a/pages/mine/messageList.vue +++ b/pages/mine/messageList.vue @@ -1,371 +1,368 @@ - - - - - + projectId: uni.getStorageSync('buildingID').id, + list: [{ + name: '接待报告', + id: 1, // 1日报 2周报 3其他(非3为接待报告,3是系统消息) + }, { + name: '系统公告', + id: 3, // 1日报 2周报 3其他(非3为接待报告,3是系统消息) + }], + count: 0, // 全部条数 + current: 0, + pageNum: 1, + pageSize: 10, + }; + }, + onShow() { + this.updateAnnList = [] + this.pageNum = 1 + this.updateInit() + this.getMessageNotRed() + }, + + onLoad() { + this._freshing = false; + setTimeout(() => { + this.triggered = true; + }, 1000) + }, + + onPullDownRefresh() { + this.initPage() + setTimeout(function() { + uni.stopPullDownRefresh(); + }, 1000); + }, + + methods: { + onPulling(e) { + console.log("onpulling", e); + }, + onRefresh() { + if (this._freshing) return; + this.updateAnnList = [] + this.pageNum = 1 + this.updateInit() + this._freshing = true; + setTimeout(() => { + this.triggered = false; + this._freshing = false; + }, 3000) + }, + + onRestore() { + this.triggered = 'restore'; // 需要重置 + console.log("onRestore"); + }, + + lower(e) { + this.pageNum++ + this.updateInit() + }, + + initPage() { + this.updateAnnList = [] + this.pageNum = 1 + this.updateInit() + }, + + // 全部标记已读 + allRead() { + this.$u.get('/zkMessage/updateState', { + accountId: uni.getStorageSync('weapp_session_userInfo_data').accountId, + projectId: this.projectId, + }).then(res => { + uni.showToast({ + title: '全部已读成功!', + duration: 2000 + }); + this.initPage() + }).catch(e => { + console.log(e) + }) + }, + + updateInit() { + let obj = { + messageType: this.list[this.current].id, + id: uni.getStorageSync('weapp_session_userInfo_data').accountId, + num: this.pageNum, + size: this.pageSize, + projectId: this.projectId, + } + uni.request({ + url: config.service.updateList, + method: "GET", + data: obj, + header: { + 'content-type': 'application/json', + 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token + }, + success: (res) => { + if (res.data.data) { + if (this.pageNum != 1) { + this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.records]; + } else { + this.updateAnnList = res.data.data.list.records || [] + } + } + + }, + fail: e => { + console.log(e) + } + }) + }, + goDetail(data) { + this.$store.commit('setMessageObj', data) + uni.navigateTo({ + url: "./messageDetail" + }) + }, + + // 获取未读消息数量 + getMessageNotRed() { + uni.request({ + url: config.service.notReadNum, + method: "GET", + data: { + id: uni.getStorageSync('weapp_session_userInfo_data').accountId, + projectId: this.projectId, + }, + header: { + 'content-type': 'application/json', + 'Authorization': 'Bearer ' + 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/reportExcel/weekReport?id=${data.id}` + }) + } else { + uni.navigateTo({ + 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() + } + } + } + + + \ No newline at end of file