guardSuccessPopup.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <up-popup :show="showPopup" @close="handleClose" mode="center" bgColor="transparent" overlayOpacity="0.8">
  3. <view class="success-popup">
  4. <view class="success-title">恭喜你,已守护成功!</view>
  5. <view class="success-content">
  6. <image class="right-star" :src="`${config.BASIC_IMG}img/treePage/star.png`" alt="" />
  7. <image class="left-star" :src="`${config.BASIC_IMG}img/treePage/star.png`" alt="" />
  8. <view class="card">
  9. <image class="img"
  10. src="https://birdseye-img-ali-cdn.sysuimars.com/562ba414-9517-4789-98f9-42fdae26cee4/bc27ee0c-8177-47fb-823c-c81d6f8b514c/DJI_202507281100_002_bc27ee0c-8177-47fb-823c-c81d6f8b514c/DJI_20250728110246_0016_Z_code-ws0y1mu3uwb2.jpeg">
  11. </image>
  12. <!-- <image class="img" v-lazyload="getImageUrl(treeObj.treeImages[0].filename)" alt="" /> -->
  13. <!-- <view class="code">{{treeObj.buyList[0].code}}</view> -->
  14. <view class="code">LCJGHN-GZCH-LBY1003</view>
  15. </view>
  16. </view>
  17. <view class="button" @click="handleClose">我知道了</view>
  18. </view>
  19. </up-popup>
  20. </template>
  21. <script setup>
  22. import {
  23. ref,
  24. watch
  25. } from "vue";
  26. import config from "@/api/config.js"
  27. const resize = "?x-oss-process=image/resize,w_1000";
  28. const props = defineProps({
  29. show: {
  30. type: Boolean,
  31. defalut: false,
  32. },
  33. treeObj: {
  34. type: Object,
  35. defalut: () => {},
  36. },
  37. });
  38. const getImageUrl = (filename) => {
  39. if (filename.startsWith("https")) {
  40. return filename; // 直接使用完整 URL
  41. } else {
  42. return base_img_url2 + filename + resize; // 拼接基础 URL
  43. }
  44. };
  45. const formatDate = (dateStr) => {
  46. return dateStr.split(" ")[0].replace(/-/g, ".");
  47. };
  48. const showPopup = ref(false);
  49. const handleClose = () => {
  50. showPopup.value = false;
  51. };
  52. watch(
  53. () => props.show,
  54. () => {
  55. showPopup.value = true;
  56. }
  57. );
  58. </script>
  59. <style lang="scss" scoped>
  60. @import "@/static/style/mixin.scss";
  61. .success-popup {
  62. width: 90vw;
  63. color: #fff;
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. flex-direction: column;
  68. .success-title {
  69. font-size: 56rpx;
  70. text-align: center;
  71. @include ossBg("treePage/ribbon.png");
  72. margin-bottom: 42rpx;
  73. font-family: "PangMenZhengDao";
  74. padding: 14rpx 46rpx 0;
  75. line-height: 130rpx;
  76. }
  77. .success-content {
  78. width: 88%;
  79. border-radius: 40rpx;
  80. padding: 14rpx;
  81. background: rgba(255, 255, 255, 0.15);
  82. box-shadow: 0 0 12rpx 0 rgba(255, 255, 255, 0.63) inset;
  83. box-sizing: border-box;
  84. backdrop-filter: blur(8rpx);
  85. position: relative;
  86. .right-star {
  87. width: 56rpx;
  88. height: 54rpx;
  89. position: absolute;
  90. top: 110rpx;
  91. right: -38rpx;
  92. }
  93. .left-star {
  94. width: 64rpx;
  95. height: 62rpx;
  96. position: absolute;
  97. top: 280rpx;
  98. left: -36rpx;
  99. }
  100. .card {
  101. position: relative;
  102. color: #000;
  103. border-radius: 32rpx;
  104. .img {
  105. border-radius: 32rpx;
  106. width: 100%;
  107. height: 646rpx;
  108. object-fit: cover;
  109. }
  110. .code {
  111. position: absolute;
  112. top: 0;
  113. left: calc(50% - 340rpx / 2);
  114. background: rgba(26, 26, 26, 0.5);
  115. font-size: 24rpx;
  116. color: #fff;
  117. padding: 12rpx 30rpx;
  118. border-radius: 4rpx 4rpx 20rpx 20rpx;
  119. }
  120. }
  121. }
  122. .button {
  123. font-size: 32rpx;
  124. color: #fff;
  125. padding: 20rpx 144rpx;
  126. border: 2rpx solid #fff;
  127. border-radius: 50rpx;
  128. text-align: center;
  129. margin: 50rpx 0 40rpx;
  130. background-image: linear-gradient(120deg, #00d4ff, #008eff);
  131. }
  132. }
  133. </style>