index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view>
  3. <view v-show="showPop" class="confirmation-bar">
  4. <view class="pop-title">{{title}}</view>
  5. <view class="pop-close" @tap="closePop()">
  6. <image style="width: 42rpx;height: 42rpx;" class="image" src="/static/pages/images/close.png"></image>
  7. </view>
  8. <view class="pop-content">
  9. <slot></slot>
  10. </view>
  11. <view class="pop-btn" v-if="showBtn">
  12. <view class="pop-btn-cancal" @tap="closePop"><slot name="leftbtnname">取消</slot></view>
  13. <view class="pop-btn-submit" :style="'background-color:'+btnColor+';border:1rpx solid '+btnColor+';'" @tap="popSubmit"><slot name="rightbtnname">确认</slot></view>
  14. </view>
  15. </view>
  16. <!-- 遮罩层 -->
  17. <view v-show="showPop" @tap="closePop" class="mask"></view>
  18. </view>
  19. </template>
  20. <script>
  21. const app = getApp();
  22. const req = require("../../utils/request.js");
  23. export default {
  24. data() {
  25. return {
  26. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0
  27. };
  28. },
  29. components: {
  30. },
  31. props: {
  32. showPop: {
  33. type: Boolean,
  34. default: true
  35. },
  36. showBtn: {
  37. type: Boolean,
  38. default: true
  39. },
  40. title:{
  41. type: String,
  42. default:''
  43. },
  44. btnColor:{
  45. type: String,
  46. default:'#009AFF'
  47. }
  48. },
  49. watch: {
  50. },
  51. mounted() {
  52. },
  53. methods: {
  54. closePop(){
  55. this.$emit('closePop',false)
  56. },
  57. popSubmit(){
  58. this.$emit('popSubmit')
  59. }
  60. }
  61. };
  62. </script>
  63. <style>
  64. @import "./index.css";
  65. </style>