From f05a26bb7e036c3d09c84e295f1b77fdb8d9ba08 Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 06 四月 2023 20:46:42 +0800
Subject: [PATCH] 修改定时

---
 miniprogram/pages/user/group/index.ts |   77 ++++++++++++++++++++++++++++----------
 1 files changed, 57 insertions(+), 20 deletions(-)

diff --git a/miniprogram/pages/user/group/index.ts b/miniprogram/pages/user/group/index.ts
index 5165c9e..a0ae1fa 100644
--- a/miniprogram/pages/user/group/index.ts
+++ b/miniprogram/pages/user/group/index.ts
@@ -10,9 +10,17 @@
         wx.navigateBack()
     },
     openGroup(e) {
-        wx.navigateTo({
-            url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid
-        })
+        if (wx.getStorageSync('role')==1) {
+            wx.navigateTo({
+                url: "../../manager/group/message/index?id=" + e.currentTarget.id
+            })
+        }else{
+            wx.navigateTo({
+                url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid
+            })
+        }
+       
+       
     },
     onLoad() {
         var date = new Date()
@@ -39,22 +47,51 @@
         }
         time = date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + secends
         var lastTime = wx.getStorageSync('time')
-        wx.request(
-            {
-                url: userGroup.globalData.url + "/wx/user/group/list",
-                method: "GET",
-                data: {
-                    id: wx.getStorageSync('id'),
-                    newDate: time,
-                    lastDate: lastTime
-                },
-                header: { 'token': wx.getStorageSync('token') },
-                success: (res) => {
-                    console.log(res.data.data)
-                    this.setData({
-                        groupList: res.data.data
-                    })
-                }
-            })
+        console.log(wx.getStorageSync('role'));
+        
+        if (wx.getStorageSync('role')==1) {
+            wx.request(
+                {
+                    url: userGroup.globalData.url + "/wx/manager/group/list",
+                    method: "GET",
+                    data: {
+                        id: wx.getStorageSync('id'),
+                        newDate: time,
+                        lastDate: lastTime
+                    },
+                    header: { 'token': wx.getStorageSync('token') },
+                    success: (res) => {
+                        console.log(res.data.data)
+                        res.data.data.map(item => {
+                            if (item.time) {
+                                item.time = item.time.substr(-8)
+                            } 
+                        })
+                        this.setData({
+                            groupList: res.data.data
+                        })
+                    }
+    
+                })
+        }else{
+            wx.request(
+                {
+                    url: userGroup.globalData.url + "/wx/user/group/list",
+                    method: "GET",
+                    data: {
+                        id: wx.getStorageSync('id'),
+                        newDate: time,
+                        lastDate: lastTime
+                    },
+                    header: { 'token': wx.getStorageSync('token') },
+                    success: (res) => {
+                        console.log(res.data.data)
+                        this.setData({
+                            groupList: res.data.data
+                        })
+                    }
+                })
+        }
+      
     }
 })

--
Gitblit v1.8.0