From b4661f300194a13c4bc391f2f45a3f7a0a8dff08 Mon Sep 17 00:00:00 2001
From: 安瑾然 <m17681517455@outlook.com>
Date: 星期二, 21 三月 2023 17:26:38 +0800
Subject: [PATCH] fix bug

---
 miniprogram/pages/user/report/index.ts |   75 +++++++++++++++++++------------------
 1 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/miniprogram/pages/user/report/index.ts b/miniprogram/pages/user/report/index.ts
index 844b17e..3672873 100644
--- a/miniprogram/pages/user/report/index.ts
+++ b/miniprogram/pages/user/report/index.ts
@@ -3,41 +3,44 @@
 const userReport = getApp()
 
 Page({
-  data: {
-      reportList:[],
-    isShow:false
-  },
-  // 浜嬩欢澶勭悊鍑芥暟
-  bindViewTap() {
-    wx.navigateTo({
-      url: '../logs/logs',
-    })
-  },
-  getDetail(e){
- wx.navigateTo({
-     url:'../report/detail/index?id='+e.currentTarget.id 
- })
-  },
-report(){
- wx.navigateTo({
-     url:'../report/submitReport/index'
- })
-},
-  onLoad() {
-      wx.request(  
-        {
-          url:userReport.globalData.url+"/wx/user/cause",
-          method:"GET",
-          header:{'token':wx.getStorageSync('token')},
-          data:{
-              id:wx.getStorageSync('id')
-          },
-          success:(res)=>{
-              console.log(res)
-              this.setData({
-                reportList:res.data.data
-              })
-          }
-              })
+    data: {
+        reportList: [],
+        isShow: false
+    },
+    // 浜嬩欢澶勭悊鍑芥暟
+    bindViewTap() {
+        wx.navigateTo({
+            url: '../logs/logs',
+        })
+    },
+    getDetail(e) {
+        let url = '../report/detail/index?id=' + e.currentTarget.id
+        if (e.currentTarget.dataset.word == 2) {
+            url = '../report/submitReport/index?id=' + e.currentTarget.id
+        }
+        wx.navigateTo({
+            url
+        })
+    },
+    report() {
+        wx.navigateTo({
+            url: '../report/submitReport/index'
+        })
+    },
+    onLoad() {
+        wx.request(
+            {
+                url: userReport.globalData.url + "/wx/user/cause",
+                method: "GET",
+                header: { 'token': wx.getStorageSync('token') },
+                data: {
+                    id: wx.getStorageSync('id')
+                },
+                success: (res) => {
+                    this.setData({
+                        reportList: res.data.data
+                    })
+                }
+            })
     }
 })

--
Gitblit v1.8.0