result.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="cu-modal" :class="{'show': visible}">
  3. <view class="mask" @click="close"></view>
  4. <view class="cu-dialog" style="background-color: transparent; width:100%">
  5. <view v-if="message" class="relative wrapper flex-column-align-center">
  6. <view class="paddingX20 color-white font8">{{message}}</view>
  7. </view>
  8. <view class="paddingT30 flex-align-center">
  9. <image :src="resource.close" class="x" @click="close" />
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import resource from '@/utils/resource'
  16. export default {
  17. data() {
  18. return {
  19. resource,
  20. visible: false,
  21. message: null
  22. }
  23. },
  24. methods: {
  25. show(message, duration = 2000) {
  26. this.message = message
  27. this.visible = true
  28. setTimeout(() => {
  29. this.close()
  30. }, duration);
  31. },
  32. close() {
  33. this.visible = false
  34. this.message = ''
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .mask {
  41. position: absolute;
  42. left: 0;
  43. right: 0;
  44. top: 0;
  45. bottom: 0;
  46. }
  47. .wrapper {
  48. padding: 63rpx 40rpx 82rpx;
  49. z-index: 1001;
  50. width: 604rpx;
  51. margin: 0 auto;
  52. position: relative;
  53. background: linear-gradient(135deg, #8B3DFF 0%, #4223C8 100%);
  54. box-shadow: 0px 0px 10rpx 0px rgba(255, 129, 0, 0.5);
  55. border-radius: 16rpx;
  56. border: 1rpx solid rgba(255, 211, 155, 0.4);
  57. }
  58. .x {
  59. width: 60rpx;
  60. height: 60rpx;
  61. }
  62. </style>