From 9e48536a89c19d922989921b2d5e04c93942c512 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 31 Aug 2023 13:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=94=E7=A4=BA=E7=8E=AF=E5=A2=83,=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 7 +------ pages/index/index.js | 20 ++++++++++++++++--- pages/index/index.wxml | 4 ++-- pages/login/login.js | 18 ++++++----------- pages/work/work.js | 5 +++++ pages/work/work.wxml | 8 ++++---- pages/work/work.wxss | 9 +++++++-- subpages/addResi/pages/addResi/addResi.js | 9 ++++++++- subpages/addResi/pages/addResi/addResi.json | 2 -- .../gatherInformation/gatherInformation.wxml | 2 +- .../pages/searchRecords/searchRecords.js | 5 +++++ utils/api.js | 6 +++++- utils/config.js | 2 +- 13 files changed, 62 insertions(+), 35 deletions(-) diff --git a/app.json b/app.json index fbd5b69..28c91e0 100644 --- a/app.json +++ b/app.json @@ -64,12 +64,7 @@ "iconPath": "images/home/work.png", "selectedIconPath": "images/home/workSelected.png" }, - { - "pagePath": "pages/information/information", - "text": "数据", - "iconPath": "images/home/information.png", - "selectedIconPath": "images/home/informationSelected.png" - }, + { "pagePath": "pages/mine/mine", "text": "我的", diff --git a/pages/index/index.js b/pages/index/index.js index 4e2872b..ae8758e 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,7 +1,7 @@ // index.js // 获取应用实例 const app = getApp() -import {getIntelligentMessage,getToken,getStaffbasicinfo} from "../../utils/api" +import {getIntelligentMessage,getToken,getStaffbasicinfo,clearMessage} from "../../utils/api" Page({ data: { selectList:['全部信息','居民信息采集','房屋信息采集','社区满意度自查'], @@ -26,7 +26,9 @@ Page({ await this.getIntelligentMessage() await this.getStaffbasicinfo() }, - + onShow(){ + this.getStaffbasicinfo() + }, onScrollToLower(e){ if (this.data.loadMoreType === 'more') { this.setData({ @@ -44,7 +46,6 @@ onScrollToLower(e){ }) const parm = { type:this.data.selectValue == 0? null :this.data.selectValue - 1, - readFlag:0, limit:this.data.pageSize, page:this.data.pageNo } @@ -102,6 +103,9 @@ onScrollToLower(e){ app.globalData.user = res.data }).catch(err=>{ console.log(err); + wx.navigateTo({ + url: '/pages/login/login', + }) }) }, handleChangeFilter(e){ @@ -110,5 +114,15 @@ onScrollToLower(e){ tableData:[], }) this.getIntelligentMessage() + }, + handelClickClear(){ + clearMessage().then(res=>{ + this.setData({ + tableData:[] + }) + this.getIntelligentMessage() + }).catch(err=>{ + console.log(err); + }) } }) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 92463cd..8092e71 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -14,12 +14,12 @@ {{selectValue == 1?'居民信息采集':selectValue == 2?'房屋信息采集':selectValue == 3?'社区满意度自查':'全部信息'}} - 全部已读 + 全部已读 - {{item.content}} + {{item.content}} diff --git a/pages/login/login.js b/pages/login/login.js index 43f1021..0841abf 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -86,13 +86,10 @@ Page({ wx.showToast({ title: '请输入密码', icon:'none', - duration:3000 + duration:3000 }) return } - wx.showLoading({ - title:"登录中..." - }) const parm = { wxCode :'', ...this.data.formData @@ -102,22 +99,19 @@ Page({ parm.wxCode = res.code console.log(parm.wxCode); userLoginlog(parm).then((res)=>{ - wx.hideLoading() console.log(res); if(res.code == 0){ wx.switchTab({ url: '/pages/index/index', }) wx.setStorageSync('token', res.data.token) - }else{ - wx.showToast({ - title: res.msg, - icon:'none', - duration:2000 - }) } }).catch(err=>{ - wx.hideLoading() + wx.showToast({ + title: res.msg, + icon:'none', + duration:3000 + }) console.log(err); }) }, diff --git a/pages/work/work.js b/pages/work/work.js index 1f68f00..1d19669 100644 --- a/pages/work/work.js +++ b/pages/work/work.js @@ -138,5 +138,10 @@ Page({ wx.navigateTo({ url: '/subpages/searchResult/pages/searchRecords/searchRecords', }) + }, + toGatherInformation(){ + wx.navigateTo({ + url: '/subpages/gatherInformation/pages/gatherInformation/gatherInformation', + }) } }) \ No newline at end of file diff --git a/pages/work/work.wxml b/pages/work/work.wxml index 243384f..fd13603 100644 --- a/pages/work/work.wxml +++ b/pages/work/work.wxml @@ -12,7 +12,7 @@ - 搜索 + 搜索 @@ -32,7 +32,7 @@ 信息采集 - 采集记录> + 采集记录 > 关注官方公众号,可接受重要消息提醒。 @@ -57,7 +57,7 @@ - + \ No newline at end of file diff --git a/pages/work/work.wxss b/pages/work/work.wxss index 40d8af1..ac85301 100644 --- a/pages/work/work.wxss +++ b/pages/work/work.wxss @@ -111,12 +111,17 @@ page { } .header .content .inout_box .btn_box{ width: 69rpx; - height: 30rpx; - line-height: 30rpx; + height: 50rpx; position: absolute; top: 24rpx; right:30rpx; +} +.header .content .inout_box .btn_box text{ + width: 69rpx; + height: 30rpx; + line-height: 30rpx; font-size: 28rpx; + box-sizing: border-box; color:#3A80E7; padding-left: 15rpx; border-left:2rpx #3A80E7 solid ; diff --git a/subpages/addResi/pages/addResi/addResi.js b/subpages/addResi/pages/addResi/addResi.js index 431a990..a58baa4 100644 --- a/subpages/addResi/pages/addResi/addResi.js +++ b/subpages/addResi/pages/addResi/addResi.js @@ -386,7 +386,14 @@ Page({ if (this.data.isFirstLoadGrid) { // 编辑回填逻辑 const id = this.data.form.gridId; - const gridName = this.data.gridList.filter(item => item.value == id)[0].label; + const temp = this.data.gridList.filter(item => item.value == id); + const gridName = '' + if(temp.length != 0){ + gridName = temp[0].label + }else{ + this.showToast('网格信息有误') + return + } this.setData({ 'form.gridName': gridName, "form.gridId": id diff --git a/subpages/addResi/pages/addResi/addResi.json b/subpages/addResi/pages/addResi/addResi.json index 6123174..ef839c2 100644 --- a/subpages/addResi/pages/addResi/addResi.json +++ b/subpages/addResi/pages/addResi/addResi.json @@ -1,7 +1,5 @@ { "usingComponents": { - "wux-cell-group": "../../../../components/dist/cell-group", - "wux-cell": "../../../../components/dist/cell", "wux-select": "../../../../components/dist/select" }, "navigationStyle": "custom" diff --git a/subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml b/subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml index 9572d12..420ea00 100644 --- a/subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml +++ b/subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml @@ -11,7 +11,7 @@ 请选择时间 - + 筛选 diff --git a/subpages/searchResult/pages/searchRecords/searchRecords.js b/subpages/searchResult/pages/searchRecords/searchRecords.js index 6e8c38c..081b522 100644 --- a/subpages/searchResult/pages/searchRecords/searchRecords.js +++ b/subpages/searchResult/pages/searchRecords/searchRecords.js @@ -113,5 +113,10 @@ Page({ this.setData({ SearchRecordsList:[] }) + }, + back(){ + wx.navigateBack({ + delta: 1 + }) } }) \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index 828cb27..68e7aec 100644 --- a/utils/api.js +++ b/utils/api.js @@ -26,12 +26,16 @@ module.exports = { saveCommunityHouse, updateCommunityHouse, getClearHouseDeatilById, - getCollect + getCollect, + clearMessage } // 消息列表 function getIntelligentMessage(param){ return fly.get(`message/intelligentMessage/page`,param) } +function clearMessage () { + return fly.post('message/intelligentMessage/msg/clear') + } /** *小程序用户登录 */ diff --git a/utils/config.js b/utils/config.js index ba3fce9..03cf0b3 100644 --- a/utils/config.js +++ b/utils/config.js @@ -7,7 +7,7 @@ module.exports = { function BASEURL() { // return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 正式环境 - return 'http://192.168.1.144/api/' // 测试环境 + return 'https://epmet-preview.elinkservice.cn/api/' // 测试环境 } function WEBROOT() {