许静 5 år sedan
förälder
incheckning
032c2cbc38
2 ändrade filer med 18 tillägg och 19 borttagningar
  1. 10
    7
      src/pages/building/list/add/amap.less
  2. 8
    12
      src/pages/building/list/add/components/amap.jsx

+ 10
- 7
src/pages/building/list/add/amap.less Visa fil

@@ -219,20 +219,23 @@ h4 {
219 219
   border-top-color: grey;
220 220
 }
221 221
 
222
-.info {
222
+.infoBox {
223 223
   padding: .75rem 1.25rem;
224
-  margin-bottom: 1rem;
225
-  border-radius: .25rem;
226
-  position: fixed;
224
+  position: absolute;
227 225
   top: 1rem;
228 226
   background-color: white;
229 227
   width: auto;
230 228
   min-width: 22rem;
231
-  border-width: 0;
232
-  right: 1rem;
229
+  left: 1rem;
233 230
   box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
234
-  position: absolute;
235 231
   z-index: 100;
232
+  .inputText{
233
+    margin-right: 10px;
234
+  }
235
+  .input{
236
+    width: 200px;
237
+  }
238
+ 
236 239
 }
237 240
 
238 241
 .code {

+ 8
- 12
src/pages/building/list/add/components/amap.jsx Visa fil

@@ -1,7 +1,7 @@
1 1
 import React from 'react';
2 2
 import ReactDOM from 'react-dom';
3 3
 import { Map, Marker } from 'react-amap';
4
-import '../amap.less'
4
+import styles from '../amap.less'
5 5
 
6 6
 class Amap extends React.Component {
7 7
   constructor(props) {
@@ -54,7 +54,7 @@ class Amap extends React.Component {
54 54
                 // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
55 55
                 // 地图显示当前城市
56 56
                 mapInstance.setBounds(citybounds);
57
-            }
57
+              }
58 58
             }
59 59
           })
60 60
         })
@@ -86,20 +86,16 @@ class Amap extends React.Component {
86 86
 
87 87
     return (
88 88
       <>
89
-        <div style={{ width: '100%', height: '400px' }}>
89
+        <div style={{ width: '100%', height: '400px', position: 'relative' }}>
90 90
           <Map events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03">
91 91
             <Marker position={this.markerPosition} events={this.markerEvents} />
92 92
           </Map>
93 93
           {
94
-              <div className="info">
95
-                <div className="input-item">
96
-                  <div className="input-item-prepend">
97
-                    <span className="input-item-text" style={{ width: '8rem' }}>请输入关键字</span>
98
-                  </div>
99
-                  <input id="amapInput" type="text" />
100
-                </div>
101
-            </div>
102
-            }
94
+          <div className={styles.infoBox}>
95
+            <span className={styles.inputText}>请输入关键字</span>
96
+            <input id="amapInput" className={styles.input} type="text" />
97
+          </div>
98
+          }
103 99
         </div>
104 100
       </>
105 101
     )