alertPop.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <uni-popup :ref="popid" type="center" @close="$emit('close')">
  3. <view class="pop-box" :class="{popupBox1:type==1,popupBox2:type==2}">
  4. <view class="tit">
  5. {{title}}
  6. </view>
  7. <view class="content">
  8. <slot />
  9. </view>
  10. <view v-if="buttomShow" class="btn" @click="confrim()">
  11. <view class="flex-center">
  12. <image v-if="icon" class="alertIcon" :src="icon" mode="widthFix"></image>
  13. <view class="title">
  14. {{btntitle}}
  15. </view>
  16. </view>
  17. </view>
  18. <image src="@/static/user/close.png" mode="" class="close" @click="close()"></image>
  19. </view>
  20. </uni-popup>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. buttomShow:{
  26. type: Boolean,
  27. default: true
  28. },
  29. icon:{
  30. type: String,
  31. default: ""
  32. },
  33. show:{
  34. type: Boolean,
  35. default: false
  36. },
  37. btntitle:{
  38. type: String,
  39. default: "確定"
  40. },
  41. title:{
  42. type: String,
  43. default: ""
  44. },
  45. popid: {
  46. type: String,
  47. default: "pop"
  48. },
  49. type: {
  50. type: Number,
  51. default: 2
  52. }
  53. },
  54. watch: {
  55. show(newValue, oldValue) {
  56. if(newValue){
  57. this.open()
  58. }else{
  59. this.close();
  60. }
  61. }
  62. },
  63. data() {
  64. return {
  65. };
  66. },
  67. onLoad(options) {
  68. },
  69. onShow() {},
  70. methods: {
  71. confrim(){
  72. this.$emit("confrim")
  73. },
  74. open() {
  75. this.$refs[this.popid].open()
  76. },
  77. close() {
  78. this.$emit('close')
  79. this.$refs[this.popid].close()
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .pop-box {
  86. width: 633rpx;
  87. background-size: 100% 100%;
  88. position: relative;
  89. .content{
  90. min-height: 500rpx;
  91. }
  92. .tit {
  93. font-weight: bold;
  94. font-size: 44rpx;
  95. color: #222222;
  96. text-align: center;
  97. padding-top: 10rpx;
  98. letter-spacing: 10rpx;
  99. }
  100. .close {
  101. width: 80rpx;
  102. height: 80rpx;
  103. position: absolute;
  104. left: 0;
  105. right: 0;
  106. bottom: -110rpx;
  107. margin: auto;
  108. }
  109. .btn {
  110. line-height: 77rpx;
  111. background: linear-gradient(268deg, rgba(113, 87, 185, 0.99), #8667C3, #7258B9);
  112. border-radius: 10rpx;
  113. text-align: center;
  114. font-weight: bold;
  115. font-size: 35rpx;
  116. color: #FFFFFF;
  117. position: absolute;
  118. bottom: 90rpx;
  119. left: 100rpx;
  120. right: 100rpx;
  121. }
  122. }
  123. .popupBox1 {
  124. height: 1076rpx;
  125. background-image: url('@/static/user/b-tc.png');
  126. }
  127. .popupBox2 {
  128. height: 823rpx;
  129. background-image: url('@/static/user/lm/tc-vip.png');
  130. }
  131. </style>