张涛 1 年之前
父節點
當前提交
4622374c43

+ 0
- 52
src/components/H5Map/index.jsx 查看文件

1
-import Taro from "@tarojs/taro";
2
-import { getLocation, h5GetLocation } from "@/utils/authorize";
3
-import React from "react";
4
-import { useEffect } from "react";
5
-export default (props) => {
6
-  const { location, onChange } = props;
7
-  useEffect(() => {
8
-    if (location) {
9
-      console.log(location)
10
-      const [lat, lng] = (location || DEFAULT_POS).split(",");
11
-   
12
-      const center = new TMap.LatLng(parseFloat(lat), parseFloat(lng));
13
-      new TMap.Map("container", {
14
-        rotation: 20, //设置地图旋转角度
15
-        pitch: 30, //设置俯仰角度(0~45)
16
-        zoom: 20, //设置地图缩放级别
17
-        center: center, //设置地图中心点坐标
18
-      });
19
-    }
20
-  }, [location]);
21
-
22
-  useEffect(() => {
23
-    fixedLocation().then((res) => {
24
-      console.log(res);
25
-      const {lat,lng   } = res.location;
26
-      onChange([lat,lng].join(","));
27
-    });
28
-  }, []);
29
-
30
-  const fixedLocation = () => {
31
-    return new Promise((resolve) => {
32
-      Taro.showLoading({
33
-        title: "加载中",
34
-      });
35
-      return h5GetLocation()
36
-        .then((res) => {
37
-          Taro.hideLoading();
38
-          resolve(res.data.result);
39
-        })
40
-        .catch((err) => {
41
-          console.error(err);
42
-          Taro.hideLoading();
43
-          Taro.showToast({
44
-            title: "定位失败",
45
-            icon: "none",
46
-          });
47
-        });
48
-    });
49
-  };
50
-
51
-  return <div id="container"></div>;
52
-};

+ 8
- 8
src/components/map/index.jsx 查看文件

15
 
15
 
16
   console.log("-----map---readOnly---", readOnly, location);
16
   console.log("-----map---readOnly---", readOnly, location);
17
 
17
 
18
-  const id = React.useMemo(
19
-    () => `map-${Math.random().toString(36).substring(2, 10)}`,
20
-    []
21
-  );
22
-  const idReadOnly = React.useMemo(
23
-    () => `map-${Math.random().toString(36).substring(2, 10)}`,
24
-    []
25
-  );
18
+  // const id = React.useMemo(
19
+  //   () => `map-${Math.random().toString(36).substring(2, 10)}`,
20
+  //   []
21
+  // );
22
+  // const idReadOnly = React.useMemo(
23
+  //   () => `map-${Math.random().toString(36).substring(2, 10)}`,
24
+  //   []
25
+  // );
26
   const mapCtxRef = React.useRef();
26
   const mapCtxRef = React.useRef();
27
 
27
 
28
   useEffect(() => {
28
   useEffect(() => {

+ 1
- 1
src/pages/apply/list/index.jsx 查看文件

71
         // onChange={(e) => setIssueId(e.detail)}
71
         // onChange={(e) => setIssueId(e.detail)}
72
         placeholder="请输入问题单号"
72
         placeholder="请输入问题单号"
73
         onSearch={onSearch}
73
         onSearch={onSearch}
74
-        clearable
74
+        // clearable
75
       />
75
       />
76
       <Tabs sticky>
76
       <Tabs sticky>
77
         <Tab title="督查员" style={tabStyle}>
77
         <Tab title="督查员" style={tabStyle}>

+ 0
- 2
src/pages/issue/components/Issue/index.jsx 查看文件

13
 import { getTaOrgIssueByIssueId } from "@/services/taorgissue";
13
 import { getTaOrgIssueByIssueId } from "@/services/taorgissue";
14
 import { PROCESS_END } from "@/utils/biz";
14
 import { PROCESS_END } from "@/utils/biz";
15
 import { geocoder } from "@/utils/map";
15
 import { geocoder } from "@/utils/map";
16
-import H5Map from "@/components/H5Map";
17
 import { ROLE_ORG_USER } from "@/utils/user";
16
 import { ROLE_ORG_USER } from "@/utils/user";
18
 import IssueStatus from "./IssueStatus";
17
 import IssueStatus from "./IssueStatus";
19
 
18
 
184
         onChange={onLocationChange}
183
         onChange={onLocationChange}
185
       />
184
       />
186
 
185
 
187
-      {/* <H5Map location={formData.location} onChange={onLocationChange} /> */}
188
 
186
 
189
       <CellGroup>
187
       <CellGroup>
190
         {issue?.issueId && <Cell title="ID" value={issue.issueId} />}
188
         {issue?.issueId && <Cell title="ID" value={issue.issueId} />}

+ 1
- 1
src/pages/issue/list/index.jsx 查看文件

72
       <Search
72
       <Search
73
         placeholder="请输入问题单号"
73
         placeholder="请输入问题单号"
74
         onSearch={onSearch}
74
         onSearch={onSearch}
75
-        clearable
75
+        // clearable
76
       />
76
       />
77
       <Tabs sticky onChange={onTabChange}>
77
       <Tabs sticky onChange={onTabChange}>
78
         <Tab title="全部" style={tabStyle}>
78
         <Tab title="全部" style={tabStyle}>

+ 1
- 1
src/pages/issue/list2/index.jsx 查看文件

57
         // onChange={(e) => setIssueId(e.detail)}
57
         // onChange={(e) => setIssueId(e.detail)}
58
         placeholder="请输入问题单号"
58
         placeholder="请输入问题单号"
59
         onSearch={onSearch}
59
         onSearch={onSearch}
60
-        clearable
60
+        // clearable
61
       />
61
       />
62
       <Tabs sticky>
62
       <Tabs sticky>
63
         <Tab title="督查员" style={tabStyle}>
63
         <Tab title="督查员" style={tabStyle}>

+ 1
- 1
src/pages/org/issue/list/index.jsx 查看文件

61
         // onChange={(e) => setIssueId(e.detail)}
61
         // onChange={(e) => setIssueId(e.detail)}
62
         placeholder="请输入问题单号"
62
         placeholder="请输入问题单号"
63
         onSearch={onSearch}
63
         onSearch={onSearch}
64
-        clearable
64
+        // clearable
65
       />
65
       />
66
       <Tabs sticky>
66
       <Tabs sticky>
67
         <Tab title="督查员" style={tabStyle}>
67
         <Tab title="督查员" style={tabStyle}>

+ 1
- 1
src/utils/authorize.js 查看文件

44
   //   reject(err_1);
44
   //   reject(err_1);
45
   // }
45
   // }
46
 };
46
 };
47
-const key = "6WQBZ-5VIC4-BZTUI-DIG64-R4XO3-PWBH3";
47
+const key = "HTPBZ-HHJA7-XD2XD-PRS37-H3HVJ-U5BAA";
48
 export const h5GetLocation = () => {
48
 export const h5GetLocation = () => {
49
   return new Promise((resolve, reject) => {
49
   return new Promise((resolve, reject) => {
50
     const url = `/api2/ws/location/v1/ip?key=${key}`;
50
     const url = `/api2/ws/location/v1/ip?key=${key}`;