cover-view.uvue 1.3 KB
Newer Older
Anne_LXM's avatar
Anne_LXM 已提交
1
<template>
DCloud-WZF's avatar
DCloud-WZF 已提交
2 3
  <view>
    <page-head title="cover-view用于覆盖map、video等原生组件"></page-head>
4 5 6
    <view class="uni-padding-wrap uni-common-mb">
      <text class="uni-subtitle-text">注意:需要正确配置地图服务商的Key才能正常显示地图组件</text>
    </view>
DCloud-WZF's avatar
DCloud-WZF 已提交
7 8 9 10 11 12
    <view class="cover-content">
      <map :latitude="latitude" :longitude="longitude"></map>
      <cover-view class="cover-view">简单的cover-view</cover-view>
      <cover-image class="cover-image" src="/static/uni.png"></cover-image>
    </view>
  </view>
Anne_LXM's avatar
Anne_LXM 已提交
13 14 15
</template>

<script lang="uts">
DCloud-WZF's avatar
DCloud-WZF 已提交
16 17 18 19
  export default {
    data() {
      return {
        showMap: false,
Anne_LXM's avatar
Anne_LXM 已提交
20 21
        latitude: 39.909,
        longitude: 116.39742
DCloud-WZF's avatar
DCloud-WZF 已提交
22 23 24
      };
    },
    onLoad() {
Anne_LXM's avatar
Anne_LXM 已提交
25
      this.showMap = true
DCloud-WZF's avatar
DCloud-WZF 已提交
26 27
    }
  }
Anne_LXM's avatar
Anne_LXM 已提交
28 29 30
</script>

<style>
DCloud-WZF's avatar
DCloud-WZF 已提交
31 32 33 34
  map {
    width: 100%;
    height: 600px;
  }
Anne_LXM's avatar
Anne_LXM 已提交
35

DCloud-WZF's avatar
DCloud-WZF 已提交
36 37 38
  .cover-content {
    position: relative;
  }
Anne_LXM's avatar
Anne_LXM 已提交
39

DCloud-WZF's avatar
DCloud-WZF 已提交
40 41 42 43 44 45 46 47
  .cover-view {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 375rpx;
    text-align: center;
    background-color: #DDDDDD;
  }
Anne_LXM's avatar
Anne_LXM 已提交
48

DCloud-WZF's avatar
DCloud-WZF 已提交
49 50 51 52 53 54 55 56 57 58
  .cover-image {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 96px;
    height: 96px;
  }
59 60 61 62 63 64

  .tips {
    font-size: 12px;
    margin-top: 15px;
    opacity: .8;
  }
Anne_LXM's avatar
Anne_LXM 已提交
65
</style>