张涛 11 months ago
parent
commit
2f82d1e370
4 changed files with 28 additions and 28 deletions
  1. 9
    1
      config/index.js
  2. 17
    14
      src/layouts/index.jsx
  3. 2
    12
      src/pages/issue/components/Issue/index.jsx
  4. 0
    1
      src/pages/issue/edit/index.jsx

+ 9
- 1
config/index.js View File

@@ -26,7 +26,10 @@ export default defineConfig(async (merge, { command, mode }) => {
26 26
       828: 1.81 / 2,
27 27
       375: 2 / 1,
28 28
     },
29
-
29
+    // jsMinimizer: 'terser',
30
+    // terser: {
31
+    //   enable: false,
32
+    // },
30 33
     sourceRoot: "src",
31 34
     outputRoot: "dist",
32 35
     plugins: [],
@@ -110,6 +113,11 @@ export default defineConfig(async (merge, { command, mode }) => {
110 113
          
111 114
         },
112 115
       },
116
+      webpackChain(chain, webpack) {
117
+        chain.merge({
118
+          mode: "development",
119
+        })
120
+      },
113 121
     },
114 122
   };
115 123
   if (process.env.NODE_ENV === "development") {

+ 17
- 14
src/layouts/index.jsx View File

@@ -17,23 +17,26 @@ export default (props) => {
17 17
   const containerClass = `${laySty["page-conatiner"]} ${
18 18
     tabBar ? laySty["with-tabbar"] : ""
19 19
   } ${className}`;
20
-  
21 20
   React.useEffect(() => {
22 21
     const currentPage = Taro.getCurrentPages().slice().pop();
23
-console.log("--user***************************",user)
24
-    if (!user) {
25
-      current().then((res) => {
26
-        console.log('---当前人员----', res);
27
-      }).catch((err) => {
28
-        console.log('---当前人员--报错了--');
29
-        console.error(err);
30 22
 
31
-        if (!currentPage.route.includes("pages/login/index")) {
32
-          Taro.navigateTo({
33
-            url: "/pages/login/index",
34
-          });
35
-        }
36
-      });
23
+    if (!user) {
24
+      try {
25
+        current().then((res) => {
26
+          console.log('---当前人员----', res);
27
+        }).catch((err) => {
28
+          console.log('---当前人员--报错了--');
29
+          console.error(err);
30
+  
31
+          if (!currentPage.route.includes("pages/login/index")) {
32
+            Taro.navigateTo({
33
+              url: "/pages/login/index",
34
+            });
35
+          }
36
+        });
37
+      } catch (error) {
38
+        console.error(error);
39
+      }
37 40
     }
38 41
 
39 42
     // if (!person || !user) {

+ 2
- 12
src/pages/issue/components/Issue/index.jsx View File

@@ -190,7 +190,7 @@ export default (props) => {
190 190
       />
191 191
 
192 192
       <CellGroup>
193
-        {issue?.issueId && <Cell title="ID" value={issue.issueId} />}
193
+        {!!issue?.issueId && <Cell title="ID" value={issue.issueId} />}
194 194
         <Cell
195 195
           title="点位"
196 196
           isLink={!readOnly}
@@ -205,7 +205,7 @@ export default (props) => {
205 205
           onChange={(e) => setFieldChange("addr", e.detail)}
206 206
         />
207 207
       </CellGroup>
208
-
208
+ 
209 209
       {readOnly && (
210 210
         <CellGroup style={{ marginTop: "20px" }}>
211 211
           <IssueStatus issue={issue} />
@@ -221,16 +221,6 @@ export default (props) => {
221 221
           onClick={() => !readOnly && setShowIssueType(true)}
222 222
         />
223 223
         <Cell title="问题描述" border={false} />
224
-        {/* <Textarea
225
-          // type="textarea"
226
-          name="content"
227
-          placeholder="请输入问题描述"
228
-          readonly={readOnly}
229
-          autosize={{ minHeight: "120px" }}
230
-          style={{ marginLeft: "20px" }}
231
-          value={formData.content}
232
-          onChange={onChangeText}
233
-        ></Textarea> */}
234 224
         <Field
235 225
           type="textarea"
236 226
           placeholder="请输入问题描述"

+ 0
- 1
src/pages/issue/edit/index.jsx View File

@@ -1,7 +1,6 @@
1 1
 import React from "react";
2 2
 import Taro from "@tarojs/taro";
3 3
 import { View } from "@tarojs/components";
4
-import { CellGroup, Cell } from "@antmjs/vantui";
5 4
 import Page from "@/layouts/index";
6 5
 import { useModel } from "@/store";
7 6
 import {