NicknamePopup.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <uv-popup ref="popup" mode="bottom" bgColor="none" :closeOnClickOverlay="closeOnClickOverlay">
  3. <view class="heard">
  4. <slot name="heard"></slot>
  5. <text class="title" v-if="title">{{ title }}</text>
  6. </view>
  7. <view v-if="subtitle" class="subtitle">{{ subtitle }}</view>
  8. <view class="content">
  9. <slot name="content"></slot>
  10. </view>
  11. <image class="close" src="@/static/icon/wd_icon_guanbi.png" @click="closeIcon()"></image>
  12. <view class="bottomCompatibility"></view>
  13. </uv-popup>
  14. </template>
  15. <script>
  16. import uvPopup from '@/uni_modules/uv-popup/components/uv-popup/uv-popup.vue'
  17. export default {
  18. name: 'NicknamePopup',
  19. components: {
  20. uvPopup
  21. },
  22. props: {
  23. title: {
  24. type: String,
  25. default: ''
  26. },
  27. subtitle: {
  28. type: String,
  29. default: ''
  30. },
  31. closeOnClickOverlay: {
  32. type: Boolean,
  33. default: true
  34. }
  35. },
  36. methods: {
  37. open() {
  38. this.$refs.popup.open();
  39. },
  40. close() {
  41. this.$refs.popup.close();
  42. },
  43. closeIcon() {
  44. if (this.$listeners.close) {
  45. this.$emit('close')
  46. }
  47. this.$refs.popup.close();
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. /* 添加样式 */
  54. .bottomCompatibility {
  55. height: --window-bottom;
  56. }
  57. .subtitle {
  58. font-family: 'PingFang SC-Medium';
  59. color: #999;
  60. font-size: 24rpx;
  61. font-weight: 400;
  62. text-align: center;
  63. padding-top: 18rpx;
  64. }
  65. ::v-deep.uv-popup .uv-popup__content {
  66. border-radius: 28rpx 28rpx 0 0;
  67. min-height: 400rpx;
  68. background: url("../../static/me/wd_bg_jianjie.png") center top/100% auto no-repeat, #fff !important;
  69. padding-bottom: 40rpx;
  70. }
  71. .heard {
  72. padding-top: 28rpx;
  73. height: 72rpx;
  74. display: flex;
  75. align-items: center;
  76. justify-content: center;
  77. .title {
  78. font-size: 36rpx;
  79. font-weight: 700;
  80. font-family: 'Alimama ShuHeiTi-Bold';
  81. color: #1F1F1F;
  82. }
  83. }
  84. .close {
  85. position: absolute;
  86. right: 44rpx;
  87. top: 36rpx;
  88. width: 40rpx;
  89. height: 40rpx;
  90. border-radius: 50%;
  91. }
  92. ::v-deep.content .btn-box {
  93. background: #1F1F1F;
  94. border-radius: 76rpx;
  95. color: #fff;
  96. margin: 0 auto;
  97. width: 626rpx;
  98. height:88rpx;
  99. display: flex;
  100. align-items: center;
  101. justify-content: center;
  102. }
  103. .content{
  104. margin-top: 32rpx;
  105. }
  106. </style>