From 46636f731c1888f5aa58e273f9e052714dda7e01 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 May 2020 14:36:01 +0800 Subject: [PATCH] 新增我的页面案件数量,修改首页案件列表变成已归档案件,修改办理页面列表页显示 --- pages/index/index.js | 29 +++++++++++++++++++++++++---- pages/index/index.wxml | 4 +++- pages/mine/mine.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ pages/mine/mine.wxml | 6 +++--- pages/work/work.wxml | 4 ++-- 5 files changed, 116 insertions(+), 16 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 50176fc..c6ff997 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -76,20 +76,20 @@ Page({ Component({ data: { surveyorId:"c64a18707e974f91945e0e872b7f5b98", - CaseList:undefined + CaseList:undefined, + num:0 }, methods: { onLoad: function (options) { var that = this; - console.log("onLoad1"); const dataParams = { "pageSize": 20, "pageNumber": 1 , + status: 4, surveyorId: that.data.surveyorId }; - req.getRequest(Case_List_URL, dataParams, function (res) { wx.hideLoading(); - // console.log(res) + console.log(res) if (res.data.code == 0) { let cases=res.data.data.list; for(let c in cases){ @@ -104,6 +104,27 @@ Component({ wx.hideLoading(); console.log(res); }); + that.getNowCase(); + }, + getNowCase:function(){ + var that = this; + const dataParams = { + status: 1, + surveyorId: that.data.surveyorId + }; + req.getRequest(Case_List_URL, dataParams, function (res) { + wx.hideLoading(); + // console.log(res) + if (res.data.code == 0) { + + that.setData({ + num: res.data.data.list.length + }); + } + }, function (res) { + wx.hideLoading(); + console.log(res); + }); } }, pageLifetimes: { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0a83053..0c1aede 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -26,7 +26,9 @@ - ·您有1个案件正在执行中 + + ·您有{{num}}个案件正在执行中 + ·李凤阁上传了化工厂污水排放的调查案件 diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 5454c63..5900e79 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -1,4 +1,10 @@ // pages/mine/mine.js +const req = require('../../utils/request.js') +const util = require('../../utils/util.js') + +const Case_List_URL = "/platform/app/case/getCases"; +//获取应用实例 +const app = getApp() Page({ /** @@ -26,12 +32,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - if (typeof this.getTabBar === 'function' && - this.getTabBar()) { - this.getTabBar().setData({ - selected: 2 - }) - } + }, /** @@ -68,4 +69,80 @@ Page({ onShareAppMessage: function () { } +}) + +Component({ + data: { + surveyorId:"c64a18707e974f91945e0e872b7f5b98", + nowNum:0, + uploadedNum:0, + completeNum:0 + }, + + methods: { + onLoad: function (options) { + wx.showLoading({ + title: '加载中...', + }); + var that = this; + that.getNowNum(); + that.getUploadedNum(); + that.getCompleteNum() + }, + getNowNum: function () { + var that = this; + const data = {surveyorId: that.data.surveyorId,status: 1}; + req.getRequest(Case_List_URL, data, function (res) { + wx.hideLoading(); + if (res.data.code == 0) { + that.setData({ + nowNum: res.data.data.list.length + }); + } + }, function (res) { + wx.hideLoading(); + console.log(res); + }); + }, + getUploadedNum: function () { + var that = this; + const data = {surveyorId: that.data.surveyorId,status: 2}; + req.getRequest(Case_List_URL, data, function (res) { + wx.hideLoading(); + if (res.data.code == 0) { + that.setData({ + uploadedNum: res.data.data.list.length + }); + } + }, function (res) { + wx.hideLoading(); + console.log(res); + }); + }, + getCompleteNum: function () { + var that = this; + const data = {surveyorId: that.data.surveyorId,status: 3}; + req.getRequest(Case_List_URL, data, function (res) { + wx.hideLoading(); + if (res.data.code == 0) { + that.setData({ + completeNum: res.data.data.list.length + }); + } + }, function (res) { + wx.hideLoading(); + console.log(res); + }); + } + }, + pageLifetimes: { + show() { + if (typeof this.getTabBar === 'function' && + this.getTabBar()) { + this.getTabBar().setData({ + selected: 2 + }) + } + } + }, }) \ No newline at end of file diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index 614d019..07808ed 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -14,15 +14,15 @@ - 执行中(2) + 执行中({{nowNum}}) - 待上传(5) + 待上传({{uploadedNum}}) - 已执行(18) + 已执行({{completeNum}}) diff --git a/pages/work/work.wxml b/pages/work/work.wxml index 2c1acb2..a71ba27 100644 --- a/pages/work/work.wxml +++ b/pages/work/work.wxml @@ -32,7 +32,7 @@ -