index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="alert-wrapper">
  3. <view class="alert-box">
  4. <image src="/static/images/success.png" mode=""></image>
  5. <view class="txt">{{msg}}</view>
  6. <view class="btn" @click="close">我知道了</view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default{
  12. props:{
  13. msg:{
  14. type:String,
  15. default:''
  16. },
  17. },
  18. methods:{
  19. close(){
  20. this.$emit('bindClose');
  21. }
  22. }
  23. }
  24. </script>
  25. <style lang="scss">
  26. .alert-wrapper{
  27. position: fixed;
  28. left: 0;
  29. top: 0;
  30. width: 100%;
  31. height: 100%;
  32. background-color: rgba(0,0,0,.5);
  33. .alert-box{
  34. position: absolute;
  35. left: 50%;
  36. top: 50%;
  37. transform: translate(-50%,-50%);
  38. display: flex;
  39. flex-direction: column;
  40. align-items: center;
  41. justify-content: center;
  42. width: 500rpx;
  43. height: 540rpx;
  44. background-color: #fff;
  45. border-radius: 10rpx;
  46. font-size: 34rpx;
  47. image{
  48. width: 149rpx;
  49. height: 230rpx;
  50. }
  51. .txt{
  52. margin-bottom: 20rpx;
  53. }
  54. .btn{
  55. width:340rpx;
  56. height:90rpx;
  57. line-height: 90rpx;
  58. text-align: center;
  59. background:linear-gradient(-90deg,$bg-end 0%,$bg-star 100%);
  60. border-radius:45rpx;
  61. color: #fff;
  62. }
  63. }
  64. }
  65. </style>