urge-delivery-dialog.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <common-dialog ref="urgeDialog" :showTitle="false" :showFooter="false" :showCancel="false" width="600rpx"
  3. :custom-style="{ padding: '0', borderRadius: '20rpx' }">
  4. <view class="urge-dialog-box">
  5. <view class="icon-area">
  6. <u-icon name="checkmark-circle-fill" size="100" color="#ff4500"></u-icon>
  7. </view>
  8. <view class="urge-title">
  9. 平台跟进发货中
  10. </view>
  11. <view class="urge-desc">
  12. 卖家应在{{ deadlineTime }}前发货,若超时未发货,平台客服将主动联系卖家处理,查看<text class="highlight">进度详情</text>
  13. </view>
  14. <view class="btn-group">
  15. <button class="action-btn contact-btn" @click="handleContact">
  16. 继续联系卖家
  17. </button>
  18. <button class="action-btn confirm-btn" @click="closePopup">
  19. 我知道了
  20. </button>
  21. </view>
  22. </view>
  23. </common-dialog>
  24. </template>
  25. <script>
  26. import CommonDialog from '@/components/common-dialog.vue';
  27. export default {
  28. components: {
  29. CommonDialog
  30. },
  31. data() {
  32. return {
  33. order: null,
  34. deadlineTime: ''
  35. };
  36. },
  37. methods: {
  38. open(order) {
  39. this.order = order;
  40. // 计算发货截止时间,这里假设是下单时间+48小时,如果有字段则直接使用
  41. // 如果没有 createTime,则默认为当前时间+48小时
  42. let baseTime = new Date();
  43. if (order && order.createTime) {
  44. // 兼容处理 ios 时间格式
  45. baseTime = new Date(order.createTime.replace(/-/g, '/'));
  46. }
  47. // 加48小时
  48. const deadline = new Date(baseTime.getTime() + 48 * 60 * 60 * 1000);
  49. this.deadlineTime = this.formatDate(deadline);
  50. this.$refs.urgeDialog.openPopup();
  51. },
  52. closePopup() {
  53. this.$refs.urgeDialog.closePopup();
  54. },
  55. handleContact() {
  56. // 联系卖家逻辑,目前仅提示
  57. this.$u.toast('正在跳转联系卖家...');
  58. this.closePopup();
  59. },
  60. formatDate(date) {
  61. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  62. const day = date.getDate().toString().padStart(2, '0');
  63. const hours = date.getHours().toString().padStart(2, '0');
  64. const minutes = date.getMinutes().toString().padStart(2, '0');
  65. return `${month}月${day}日 ${hours}:${minutes}`;
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .urge-dialog-box {
  72. padding: 50rpx 40rpx 40rpx;
  73. position: relative;
  74. background: #fff;
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. .close-btn {
  79. position: absolute;
  80. top: 20rpx;
  81. right: 20rpx;
  82. padding: 10rpx;
  83. z-index: 10;
  84. }
  85. .icon-area {
  86. margin-bottom: 30rpx;
  87. }
  88. .urge-title {
  89. font-size: 36rpx;
  90. font-weight: bold;
  91. color: #333;
  92. margin-bottom: 20rpx;
  93. text-align: center;
  94. }
  95. .urge-desc {
  96. font-size: 26rpx;
  97. color: #666;
  98. margin-bottom: 50rpx;
  99. text-align: center;
  100. line-height: 1.5;
  101. padding: 0 20rpx;
  102. .highlight {
  103. color: #ff4500;
  104. margin-left: 10rpx;
  105. }
  106. }
  107. .btn-group {
  108. display: flex;
  109. width: 100%;
  110. justify-content: space-between;
  111. .action-btn {
  112. flex: 1;
  113. height: 80rpx;
  114. line-height: 80rpx;
  115. border-radius: 40rpx;
  116. font-size: 28rpx;
  117. font-weight: 500;
  118. margin: 0 15rpx;
  119. &::after {
  120. border: none;
  121. }
  122. &:active {
  123. opacity: 0.9;
  124. }
  125. }
  126. .contact-btn {
  127. background: #ffb800;
  128. color: #fff;
  129. flex: 1.5;
  130. }
  131. .confirm-btn {
  132. background: #ff4500;
  133. color: #fff;
  134. }
  135. }
  136. }
  137. </style>