cover-view.uvue 1.3 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
<template>
  <view>
    <page-head title="cover-view用于覆盖map、video等原生组件"></page-head>
    <view class="uni-padding-wrap uni-common-mb">
      <text class="uni-subtitle-text">注意:需要正确配置地图服务商的Key才能正常显示地图组件</text>
    </view>
    <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>
</template>

<script lang="uts">
  export default {
    data() {
      return {
        showMap: false,
        latitude: 39.909,
        longitude: 116.39742
      };
    },
    onLoad() {
      this.showMap = true
    }
  }
</script>

<style>
  map {
    width: 100%;
    height: 600px;
  }

  .cover-content {
    position: relative;
  }

  .cover-view {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 375rpx;
    text-align: center;
    background-color: #DDDDDD;
  }

  .cover-image {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 96px;
    height: 96px;
  }

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