Layout.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!-- 公共布局组件 -->
  2. <template>
  3. <view class="custom-camera">
  4. <view class="camera-wrap" :style="{height:cameraHeight+'px'}">
  5. <slot></slot>
  6. </view>
  7. <view class="camera-footer" id="camera-footer">
  8. <view class="usenum">当前可免费试用<text style="color: #F54D04;margin: 0 6rpx;">{{usenum || 0}}</text>次</view>
  9. <view class="camera-options">
  10. <view class="camera-options-left camera-item">
  11. <image src="@/static/images/album_icon.png" mode="scaleToFill" style="width: 65rpx;height:60rpx;" @click="handleClikFn('album')"></image>
  12. <text>相册上传</text>
  13. </view>
  14. <view class="camera-options-center camera-item" @click="handleClikFn('shutter')">
  15. <view class="photograph-btn"></view>
  16. </view>
  17. <view class="camera-options-ritht camera-item">
  18. <image src="/static/images/tongue_diagnosis_record_icon.png" mode="scaleToFill" style="width: 67rpx;height:60rpx;" @click="handleClikFn('reportlist')"></image>
  19. <text>舌诊记录</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. // 提供一个相机的插槽位置
  27. // 底部可以自定义最右侧按钮(相册/反转)
  28. export default {
  29. data() {
  30. return {
  31. cameraHeight: '', //相机画面宽度
  32. optionsHeight: '', //操作区域
  33. usenum: 2
  34. }
  35. },
  36. methods: {
  37. handleClikFn(instruct) {
  38. this.$emit('instruct', instruct)
  39. }
  40. },
  41. mounted() {
  42. const query = uni.createSelectorQuery().in(this);
  43. query
  44. .select("#camera-footer")
  45. .boundingClientRect((data) => {
  46. this.cameraHeight = uni.getSystemInfoSync().screenHeight - data.height
  47. })
  48. .exec();
  49. },
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .custom-camera {
  54. height: 100vh;
  55. background-color: #000;
  56. .usenum {
  57. font-family: SourceHanSansCN;
  58. font-weight: 400;
  59. font-size: 19rpx;
  60. color: #FFFFFF;
  61. padding: 14rpx;
  62. text-align: center;
  63. }
  64. .camera-options {
  65. width: 100%;
  66. padding-top: 13rpx;
  67. padding-bottom: 60rpx;
  68. box-sizing: border-box;
  69. font-family: SourceHanSansCN;
  70. font-weight: 400;
  71. font-size: 27rpx;
  72. color: #FFFFFF;
  73. display: flex;
  74. align-items: center;
  75. justify-content: space-evenly;
  76. .camera-item {
  77. display: flex;
  78. flex-direction: column;
  79. align-items: center;
  80. image {
  81. margin-bottom: 21rpx;
  82. }
  83. }
  84. .camera-options-center {
  85. width: 131rpx;
  86. height: 131rpx;
  87. border-radius: 50%;
  88. border: 3px solid #FFFFFF;
  89. display: flex;
  90. align-items: center;
  91. justify-content: center;
  92. }
  93. .photograph-btn {
  94. width: 109rpx;
  95. height: 109rpx;
  96. background: #F54D04;
  97. border-radius: 50%;
  98. }
  99. }
  100. }
  101. </style>