From 4b48bacef8646cee8b66f5e10b0ed7124534e93e Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期五, 12 五月 2023 17:10:47 +0800
Subject: [PATCH] 首页修改

---
 miniprogram/pages/user/report/submitReport/index.ts |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/miniprogram/pages/user/report/submitReport/index.ts b/miniprogram/pages/user/report/submitReport/index.ts
index 673a373..5eb26a5 100644
--- a/miniprogram/pages/user/report/submitReport/index.ts
+++ b/miniprogram/pages/user/report/submitReport/index.ts
@@ -4,6 +4,7 @@
 import { formatTime } from 'miniprogram/utils/util';
 Page({
     data: {
+        phoneDisab:true,
         isInGroup:'',
         remarks: '',
         addFig:false,
@@ -81,6 +82,11 @@
     getuserIdCard(e) {
         this.setData({
             userIdCard: e.detail
+        })
+    },
+    getuserPhone(e){
+        this.setData({
+            phone: e.detail
         })
     },
     getLocation(e) {
@@ -273,6 +279,22 @@
         //     })
         //     return
         // }
+      if (wx.getStorageSync('role')==1) {
+        wx.request(
+            {
+                url: submitReport.globalData.url + "/wx/user/policeAddReport",
+                method: this.data.addFig?"PUT":"POST",
+                data: this.data.reportDetail,
+                header: {
+                    'token': wx.getStorageSync('token'),
+                    'content-type': 'application/json'
+                }, success: (res) => {
+                    wx.reLaunch({
+                        url: '../../report/index'
+                    })
+                }
+            })
+      }else{
         wx.request(
             {
                 url: submitReport.globalData.url + "/wx/user/addReport",
@@ -287,10 +309,18 @@
                     })
                 }
             })
+      }
+      
     },
     onLoad:function(e) {
         console.log(e);
         let that = this
+        let role = wx.getStorageSync('role')
+        if (role==1) {
+            that.setData({
+                phoneDisab :false
+            })
+        }
         let phone = wx.getStorageSync('phone')
         that.setData({
             phone: phone

--
Gitblit v1.8.0