cover-view.uvue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view>
  3. <page-head title="cover-view用于覆盖map、video等原生组件"></page-head>
  4. <view class="uni-padding-wrap uni-common-mb">
  5. <text class="uni-subtitle-text">注意:Web和App需正确配置地图SDK的Key才能正常显示地图组件</text>
  6. </view>
  7. <view class="cover-content">
  8. <map class="map" :latitude="latitude" :longitude="longitude"></map>
  9. <cover-view class="cover-view">简单的cover-view</cover-view>
  10. <cover-image class="cover-image" src="/static/uni.png"></cover-image>
  11. </view>
  12. </view>
  13. </template>
  14. <script lang="uts">
  15. export default {
  16. data() {
  17. return {
  18. showMap: false,
  19. latitude: 39.909,
  20. longitude: 116.39742
  21. };
  22. },
  23. onLoad() {
  24. this.showMap = true
  25. }
  26. }
  27. </script>
  28. <style>
  29. .map {
  30. width: 100%;
  31. height: 600px;
  32. }
  33. .cover-content {
  34. position: relative;
  35. }
  36. .cover-view {
  37. position: absolute;
  38. left: 5px;
  39. top: 5px;
  40. width: 188px;
  41. text-align: center;
  42. background-color: #DDDDDD;
  43. }
  44. .cover-image {
  45. position: absolute;
  46. left: 0;
  47. top: 0;
  48. right: 0;
  49. bottom: 0;
  50. margin: auto;
  51. width: 96px;
  52. height: 96px;
  53. }
  54. .tips {
  55. font-size: 12px;
  56. margin-top: 15px;
  57. opacity: .8;
  58. }
  59. </style>