Commit 46636f731c1888f5aa58e273f9e052714dda7e01
1 parent
cf8cfbed
新增我的页面案件数量,修改首页案件列表变成已归档案件,修改办理页面列表页显示
Showing
5 changed files
with
116 additions
and
16 deletions
pages/index/index.js
| @@ -76,20 +76,20 @@ Page({ | @@ -76,20 +76,20 @@ Page({ | ||
| 76 | Component({ | 76 | Component({ |
| 77 | data: { | 77 | data: { |
| 78 | surveyorId:"c64a18707e974f91945e0e872b7f5b98", | 78 | surveyorId:"c64a18707e974f91945e0e872b7f5b98", |
| 79 | - CaseList:undefined | 79 | + CaseList:undefined, |
| 80 | + num:0 | ||
| 80 | }, | 81 | }, |
| 81 | methods: { | 82 | methods: { |
| 82 | onLoad: function (options) { | 83 | onLoad: function (options) { |
| 83 | var that = this; | 84 | var that = this; |
| 84 | - console.log("onLoad1"); | ||
| 85 | const dataParams = { | 85 | const dataParams = { |
| 86 | "pageSize": 20, "pageNumber": 1 , | 86 | "pageSize": 20, "pageNumber": 1 , |
| 87 | + status: 4, | ||
| 87 | surveyorId: that.data.surveyorId | 88 | surveyorId: that.data.surveyorId |
| 88 | }; | 89 | }; |
| 89 | - | ||
| 90 | req.getRequest(Case_List_URL, dataParams, function (res) { | 90 | req.getRequest(Case_List_URL, dataParams, function (res) { |
| 91 | wx.hideLoading(); | 91 | wx.hideLoading(); |
| 92 | - // console.log(res) | 92 | + console.log(res) |
| 93 | if (res.data.code == 0) { | 93 | if (res.data.code == 0) { |
| 94 | let cases=res.data.data.list; | 94 | let cases=res.data.data.list; |
| 95 | for(let c in cases){ | 95 | for(let c in cases){ |
| @@ -104,6 +104,27 @@ Component({ | @@ -104,6 +104,27 @@ Component({ | ||
| 104 | wx.hideLoading(); | 104 | wx.hideLoading(); |
| 105 | console.log(res); | 105 | console.log(res); |
| 106 | }); | 106 | }); |
| 107 | + that.getNowCase(); | ||
| 108 | + }, | ||
| 109 | + getNowCase:function(){ | ||
| 110 | + var that = this; | ||
| 111 | + const dataParams = { | ||
| 112 | + status: 1, | ||
| 113 | + surveyorId: that.data.surveyorId | ||
| 114 | + }; | ||
| 115 | + req.getRequest(Case_List_URL, dataParams, function (res) { | ||
| 116 | + wx.hideLoading(); | ||
| 117 | + // console.log(res) | ||
| 118 | + if (res.data.code == 0) { | ||
| 119 | + | ||
| 120 | + that.setData({ | ||
| 121 | + num: res.data.data.list.length | ||
| 122 | + }); | ||
| 123 | + } | ||
| 124 | + }, function (res) { | ||
| 125 | + wx.hideLoading(); | ||
| 126 | + console.log(res); | ||
| 127 | + }); | ||
| 107 | } | 128 | } |
| 108 | }, | 129 | }, |
| 109 | pageLifetimes: { | 130 | pageLifetimes: { |
pages/index/index.wxml
| @@ -26,7 +26,9 @@ | @@ -26,7 +26,9 @@ | ||
| 26 | <image class='tipsicon' src='../../images/tipsicon.png'></image> | 26 | <image class='tipsicon' src='../../images/tipsicon.png'></image> |
| 27 | <view class="newsbox"> | 27 | <view class="newsbox"> |
| 28 | <navigator class="news" hover-class="none" url=""> | 28 | <navigator class="news" hover-class="none" url=""> |
| 29 | - <text>·</text>您有1个案件正在执行中 | 29 | + <view wx-if="num!=0"> |
| 30 | + <text>·</text>您有{{num}}个案件正在执行中 | ||
| 31 | + </view> | ||
| 30 | </navigator> | 32 | </navigator> |
| 31 | <navigator class="news" hover-class="none" url=""> | 33 | <navigator class="news" hover-class="none" url=""> |
| 32 | <text>·</text>李凤阁上传了化工厂污水排放的调查案件 | 34 | <text>·</text>李凤阁上传了化工厂污水排放的调查案件 |
pages/mine/mine.js
| 1 | // pages/mine/mine.js | 1 | // pages/mine/mine.js |
| 2 | +const req = require('../../utils/request.js') | ||
| 3 | +const util = require('../../utils/util.js') | ||
| 4 | + | ||
| 5 | +const Case_List_URL = "/platform/app/case/getCases"; | ||
| 6 | +//获取应用实例 | ||
| 7 | +const app = getApp() | ||
| 2 | Page({ | 8 | Page({ |
| 3 | 9 | ||
| 4 | /** | 10 | /** |
| @@ -26,12 +32,7 @@ Page({ | @@ -26,12 +32,7 @@ Page({ | ||
| 26 | * 生命周期函数--监听页面显示 | 32 | * 生命周期函数--监听页面显示 |
| 27 | */ | 33 | */ |
| 28 | onShow: function () { | 34 | onShow: function () { |
| 29 | - if (typeof this.getTabBar === 'function' && | ||
| 30 | - this.getTabBar()) { | ||
| 31 | - this.getTabBar().setData({ | ||
| 32 | - selected: 2 | ||
| 33 | - }) | ||
| 34 | - } | 35 | + |
| 35 | }, | 36 | }, |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| @@ -68,4 +69,80 @@ Page({ | @@ -68,4 +69,80 @@ Page({ | ||
| 68 | onShareAppMessage: function () { | 69 | onShareAppMessage: function () { |
| 69 | 70 | ||
| 70 | } | 71 | } |
| 72 | +}) | ||
| 73 | + | ||
| 74 | +Component({ | ||
| 75 | + data: { | ||
| 76 | + surveyorId:"c64a18707e974f91945e0e872b7f5b98", | ||
| 77 | + nowNum:0, | ||
| 78 | + uploadedNum:0, | ||
| 79 | + completeNum:0 | ||
| 80 | + }, | ||
| 81 | + | ||
| 82 | + methods: { | ||
| 83 | + onLoad: function (options) { | ||
| 84 | + wx.showLoading({ | ||
| 85 | + title: '加载中...', | ||
| 86 | + }); | ||
| 87 | + var that = this; | ||
| 88 | + that.getNowNum(); | ||
| 89 | + that.getUploadedNum(); | ||
| 90 | + that.getCompleteNum() | ||
| 91 | + }, | ||
| 92 | + getNowNum: function () { | ||
| 93 | + var that = this; | ||
| 94 | + const data = {surveyorId: that.data.surveyorId,status: 1}; | ||
| 95 | + req.getRequest(Case_List_URL, data, function (res) { | ||
| 96 | + wx.hideLoading(); | ||
| 97 | + if (res.data.code == 0) { | ||
| 98 | + that.setData({ | ||
| 99 | + nowNum: res.data.data.list.length | ||
| 100 | + }); | ||
| 101 | + } | ||
| 102 | + }, function (res) { | ||
| 103 | + wx.hideLoading(); | ||
| 104 | + console.log(res); | ||
| 105 | + }); | ||
| 106 | + }, | ||
| 107 | + getUploadedNum: function () { | ||
| 108 | + var that = this; | ||
| 109 | + const data = {surveyorId: that.data.surveyorId,status: 2}; | ||
| 110 | + req.getRequest(Case_List_URL, data, function (res) { | ||
| 111 | + wx.hideLoading(); | ||
| 112 | + if (res.data.code == 0) { | ||
| 113 | + that.setData({ | ||
| 114 | + uploadedNum: res.data.data.list.length | ||
| 115 | + }); | ||
| 116 | + } | ||
| 117 | + }, function (res) { | ||
| 118 | + wx.hideLoading(); | ||
| 119 | + console.log(res); | ||
| 120 | + }); | ||
| 121 | + }, | ||
| 122 | + getCompleteNum: function () { | ||
| 123 | + var that = this; | ||
| 124 | + const data = {surveyorId: that.data.surveyorId,status: 3}; | ||
| 125 | + req.getRequest(Case_List_URL, data, function (res) { | ||
| 126 | + wx.hideLoading(); | ||
| 127 | + if (res.data.code == 0) { | ||
| 128 | + that.setData({ | ||
| 129 | + completeNum: res.data.data.list.length | ||
| 130 | + }); | ||
| 131 | + } | ||
| 132 | + }, function (res) { | ||
| 133 | + wx.hideLoading(); | ||
| 134 | + console.log(res); | ||
| 135 | + }); | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + pageLifetimes: { | ||
| 139 | + show() { | ||
| 140 | + if (typeof this.getTabBar === 'function' && | ||
| 141 | + this.getTabBar()) { | ||
| 142 | + this.getTabBar().setData({ | ||
| 143 | + selected: 2 | ||
| 144 | + }) | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + }, | ||
| 71 | }) | 148 | }) |
| 72 | \ No newline at end of file | 149 | \ No newline at end of file |
pages/mine/mine.wxml
| @@ -14,15 +14,15 @@ | @@ -14,15 +14,15 @@ | ||
| 14 | <view class="count"> | 14 | <view class="count"> |
| 15 | <view class='count-item'> | 15 | <view class='count-item'> |
| 16 | <image class="counticon" src='../../images/counticon1.png'></image> | 16 | <image class="counticon" src='../../images/counticon1.png'></image> |
| 17 | - <view>执行中(<text>2</text>)</view> | 17 | + <view>执行中(<text>{{nowNum}}</text>)</view> |
| 18 | </view> | 18 | </view> |
| 19 | <view class='count-item'> | 19 | <view class='count-item'> |
| 20 | <image class="counticon" src='../../images/counticon2.png'></image> | 20 | <image class="counticon" src='../../images/counticon2.png'></image> |
| 21 | - <view>待上传(<text>5</text>)</view> | 21 | + <view>待上传(<text>{{uploadedNum}}</text>)</view> |
| 22 | </view> | 22 | </view> |
| 23 | <view class='count-item'> | 23 | <view class='count-item'> |
| 24 | <image class="counticon" src='../../images/counticon3.png'></image> | 24 | <image class="counticon" src='../../images/counticon3.png'></image> |
| 25 | - <view>已执行(<text>18</text>)</view> | 25 | + <view>已执行(<text>{{completeNum}}</text>)</view> |
| 26 | </view> | 26 | </view> |
| 27 | </view> | 27 | </view> |
| 28 | </view> | 28 | </view> |
pages/work/work.wxml
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | </view> | 32 | </view> |
| 33 | <!-- 执行中 --> | 33 | <!-- 执行中 --> |
| 34 | <!-- 待上传 --> | 34 | <!-- 待上传 --> |
| 35 | - <view class="content" hidden="{{menuTapCurrent!='0'}}"> | 35 | + <view class="content" hidden="{{menuTapCurrent!='1'}}"> |
| 36 | <view class="case" wx:for="{{CaseList}}" wx:key="{{item.id}}" wx:for-item="item" data-case-class-id="{{item.id}}" bindtap="toCaseInfo"> | 36 | <view class="case" wx:for="{{CaseList}}" wx:key="{{item.id}}" wx:for-item="item" data-case-class-id="{{item.id}}" bindtap="toCaseInfo"> |
| 37 | <view class="title">{{item.name}}</view> | 37 | <view class="title">{{item.name}}</view> |
| 38 | <text class="level danger" wx:if="item.level==2">重点</text> | 38 | <text class="level danger" wx:if="item.level==2">重点</text> |
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | </view> | 47 | </view> |
| 48 | <!-- 待上传 --> | 48 | <!-- 待上传 --> |
| 49 | <!-- 已执行 --> | 49 | <!-- 已执行 --> |
| 50 | - <view class="content" hidden="{{menuTapCurrent!='0'}}"> | 50 | + <view class="content" hidden="{{menuTapCurrent!='2'}}"> |
| 51 | <view class="case" wx:for="{{CaseList}}" wx:key="{{item.id}}" wx:for-item="item" data-case-class-id="{{item.id}}" bindtap="toCaseInfo"> | 51 | <view class="case" wx:for="{{CaseList}}" wx:key="{{item.id}}" wx:for-item="item" data-case-class-id="{{item.id}}" bindtap="toCaseInfo"> |
| 52 | <view class="title">{{item.name}}</view> | 52 | <view class="title">{{item.name}}</view> |
| 53 | <text class="level danger" wx:if="item.level==2">重点</text> | 53 | <text class="level danger" wx:if="item.level==2">重点</text> |