|
5 | 5 | :enable-overlooking="enableOverlooking" :enable-zoom="enableZoom" :enable-scroll="enableScroll" |
6 | 6 | :enable-rotate="enableRotate" :enable-satellite="enableSatellite" :enable-traffic="enableTraffic" :markers="markers" |
7 | 7 | :polyline="polyline" :circles="circles" :polygons="polygons" :include-points="includePoints"></map> |
8 | | - <scroll-view class="scrollview" scroll-y="true"> |
9 | | - <view class="list-item"> |
10 | | - <text class="list-text">显示3D楼块</text> |
11 | | - <switch :checked="enable3D" @change="enableThreeD" /> |
12 | | - </view> |
13 | | - <view class="list-item"> |
14 | | - <text class="list-text">显示指南针</text> |
15 | | - <switch :checked="showCompass" @change="changeShowCompass" /> |
16 | | - </view> |
17 | | - <view class="list-item"> |
18 | | - <text class="list-text">开启俯视</text> |
19 | | - <switch :checked="enableOverlooking" @change="changeEnableOverlooking" /> |
20 | | - </view> |
21 | | - <view class="list-item"> |
22 | | - <text class="list-text">是否支持缩放</text> |
23 | | - <switch :checked="enableZoom" @change="changeEnableZoom" /> |
24 | | - </view> |
25 | | - <view class="list-item"> |
26 | | - <text class="list-text">是否支持拖动</text> |
27 | | - <switch :checked="enableScroll" @change="changeEnableScroll" /> |
28 | | - </view> |
29 | | - <view class="list-item"> |
30 | | - <text class="list-text">是否支持旋转</text> |
31 | | - <switch :checked="enableRotate" @change="changeEnableRotate" /> |
32 | | - </view> |
33 | | - <view class="list-item"> |
34 | | - <text class="list-text">是否开启卫星图</text> |
35 | | - <switch :checked="enableSatellite" @change="changeEnableSatellite" /> |
36 | | - </view> |
37 | | - <view class="list-item"> |
38 | | - <text class="list-text">是否开启实时路况</text> |
39 | | - <switch :checked="enableTraffic" @change="changeEnableTraffic" /> |
40 | | - </view> |
41 | | - </scroll-view> |
| 8 | + <view class="line"></view> |
| 9 | + <uni-list class="scrollview"> |
| 10 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enable3D" title="显示3D楼块" @switchChange="enableThreeD" /> |
| 11 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="showCompass" title="显示指南针" @switchChange="changeShowCompass" /> |
| 12 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableOverlooking" title="开启俯视" @switchChange="changeEnableOverlooking" /> |
| 13 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableZoom" title="是否支持缩放" @switchChange="changeEnableZoom" /> |
| 14 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableScroll" title="是否支持拖动" @switchChange="changeEnableScroll" /> |
| 15 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableRotate" title="是否支持旋转" @switchChange="changeEnableRotate" /> |
| 16 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableSatellite" title="是否开启卫星图" @switchChange="changeEnableSatellite" /> |
| 17 | + <uni-list-item :show-arrow="false" :show-switch="true" :switch-checked="enableTraffic" title="是否开启实时路况" @switchChange="changeEnableTraffic" /> |
| 18 | + </uni-list> |
42 | 19 | </view> |
43 | 20 | </template> |
44 | 21 |
|
45 | 22 | <script> |
46 | | - |
| 23 | + import uniList from '@/components/uni-list/uni-list.vue' |
| 24 | + import uniListItem from '@/components/uni-list-item/uni-list-item.vue' |
47 | 25 | const testMarkers = [{ |
48 | 26 | id: 0, |
49 | 27 | latitude: 39.989631, |
|
224 | 202 | } |
225 | 203 | ]; |
226 | 204 | module.exports = { |
| 205 | + components: { |
| 206 | + uniList, |
| 207 | + uniListItem |
| 208 | + }, |
227 | 209 | data() { |
228 | 210 | return { |
229 | 211 | location: { |
|
273 | 255 | this.skew = this.skew == 30 ? 0 : 30; |
274 | 256 | }, |
275 | 257 | enableThreeD(e) { |
276 | | - this.enable3D = e.detail.value; |
| 258 | + this.enable3D = e.value; |
277 | 259 | }, |
278 | 260 | changeShowCompass(e) { |
279 | | - this.showCompass = e.detail.value; |
| 261 | + this.showCompass = e.value; |
280 | 262 | }, |
281 | 263 | changeEnableOverlooking(e) { |
282 | | - this.enableOverlooking = e.detail.value; |
| 264 | + this.enableOverlooking = e.value; |
283 | 265 | }, |
284 | 266 | changeEnableZoom(e) { |
285 | | - this.enableZoom = e.detail.value; |
| 267 | + this.enableZoom = e.value; |
286 | 268 | }, |
287 | 269 | changeEnableScroll(e) { |
288 | | - this.enableScroll = e.detail.value; |
| 270 | + this.enableScroll = e.value; |
289 | 271 | }, |
290 | 272 | changeEnableRotate(e) { |
291 | | - this.enableRotate = e.detail.value; |
| 273 | + this.enableRotate = e.value; |
292 | 274 | }, |
293 | 275 | changeEnableSatellite(e) { |
294 | | - this.enableSatellite = e.detail.value; |
| 276 | + this.enableSatellite = e.value; |
295 | 277 | }, |
296 | 278 | changeEnableTraffic(e) { |
297 | | - this.enableTraffic = e.detail.value; |
| 279 | + this.enableTraffic = e.value; |
298 | 280 | } |
299 | 281 | } |
300 | 282 | } |
|
303 | 285 | <style> |
304 | 286 | .content { |
305 | 287 | flex: 1; |
306 | | - ; |
307 | 288 | } |
308 | 289 |
|
309 | 290 | .map { |
|
312 | 293 | background-color: #f0f0f0; |
313 | 294 | } |
314 | 295 |
|
315 | | - .scrollview { |
316 | | - flex: 1; |
317 | | - padding: 10px; |
| 296 | + .line { |
| 297 | + height: 4px; |
318 | 298 | } |
319 | 299 |
|
320 | | - .list-item { |
321 | | - flex-direction: row; |
322 | | - flex-wrap: nowrap; |
323 | | - align-items: center; |
324 | | - padding: 5px 0px; |
325 | | - } |
326 | | - |
327 | | - .list-text { |
| 300 | + .scrollview { |
328 | 301 | flex: 1; |
329 | 302 | } |
330 | | - |
331 | | - .button { |
332 | | - margin-top: 5px; |
333 | | - margin-bottom: 5px; |
334 | | - } |
335 | 303 | </style> |
0 commit comments