submit-confirm.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <u-popup v-model="showPopup" @close="closePopup" mode="center" border-radius="30" :width="width">
  3. <view class="submit-confirm">
  4. <view class="container-form">
  5. <view class="icon-wrapper">
  6. <image src="/static/tabbar/home2.png" class="tip-icon"></image>
  7. <text class="tip-text">温馨提示</text>
  8. </view>
  9. <view class="content">
  10. <view> 目前付款后<span class="highlight">24小时</span>内发货,如有发货超时或者物流异常情况,您可联系在线客服处理。
  11. </view>
  12. <view class="mt-20"> 页面库存同步有延迟为预估数字,<span
  13. class="highlight">实际库存以发货为准。</span>下单后如有售后电话或短信通知无货,请留意查收短信通知及时申请退款。</view>
  14. </view>
  15. <view class="footer">
  16. <button class="cancel-btn" @click="handleCancel">取消</button>
  17. <button class="confirm-btn" :disabled="countdown > 0" @click="handleConfirm">
  18. 确定提交{{ countdown > 0 ? `(${countdown}s)` : "" }}
  19. </button>
  20. </view>
  21. </view>
  22. </view>
  23. </u-popup>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. width: {
  29. type: String,
  30. default: "92%",
  31. },
  32. },
  33. data() {
  34. return {
  35. showPopup: false,
  36. countdown: 15,
  37. };
  38. },
  39. methods: {
  40. openPopup() {
  41. this.showPopup = true;
  42. this.startCountdown();
  43. },
  44. closePopup() {
  45. this.showPopup = false;
  46. this.countdown = 10;
  47. },
  48. handleConfirm() {
  49. this.$emit("confirm");
  50. this.closePopup();
  51. },
  52. handleCancel() {
  53. this.$emit("cancel");
  54. this.closePopup();
  55. },
  56. startCountdown() {
  57. this.countdown = 3;
  58. const timer = setInterval(() => {
  59. if (this.countdown > 0) {
  60. this.countdown--;
  61. } else {
  62. clearInterval(timer);
  63. }
  64. }, 1000);
  65. },
  66. },
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .submit-confirm {
  71. background: #ffffff;
  72. border-radius: 26rpx;
  73. overflow: hidden;
  74. padding: 16rpx;
  75. background: linear-gradient(-90deg, #98e05f, #0de3ac);
  76. .container-form {
  77. background: #effcf3;
  78. border-radius: 26rpx;
  79. padding: 30rpx;
  80. padding-bottom: 40rpx;
  81. }
  82. .icon-wrapper {
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. margin-bottom: 20rpx;
  87. .tip-icon {
  88. width: 48rpx;
  89. height: 48rpx;
  90. margin-right: 10rpx;
  91. }
  92. .tip-text {
  93. font-family: Source Han Sans CN;
  94. font-weight: bold;
  95. font-size: 36rpx;
  96. color: #37c148;
  97. }
  98. }
  99. .content {
  100. padding: 0 10rpx;
  101. font-size: 32rpx;
  102. color: #333333;
  103. line-height: 48rpx;
  104. view {
  105. font-size: 32rpx;
  106. }
  107. .highlight {
  108. color: #ff0000;
  109. }
  110. }
  111. .mt-20 {
  112. margin-top: 20rpx;
  113. }
  114. .footer {
  115. display: flex;
  116. gap: 30rpx;
  117. margin-top: 30rpx;
  118. padding: 0 10rpx;
  119. button {
  120. height: 88rpx;
  121. line-height: 88rpx;
  122. font-size: 32rpx;
  123. border: none;
  124. border-radius: 10rpx;
  125. &::after {
  126. border: none;
  127. }
  128. &.cancel-btn {
  129. flex: 1;
  130. background-color: #E3E3E3;
  131. color: #ffffff;
  132. width: 135rpx;
  133. }
  134. &.confirm-btn {
  135. flex: 2.5;
  136. width: 335rpx;
  137. background-color: #38c148;
  138. color: #ffffff;
  139. &:disabled {
  140. opacity: 0.7;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>