urge-delivery-dialog.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. // 调用催发货接口
  41. uni.showLoading({ title: '处理中' });
  42. this.$u.api.urgeSendAjax(order.orderId).then(res => {
  43. uni.hideLoading();
  44. if (res.code === 200) {
  45. // 计算发货截止时间
  46. let baseTime = new Date();
  47. if (order && order.createTime) {
  48. // 兼容处理 ios 时间格式
  49. baseTime = new Date(order.createTime.replace(/-/g, '/'));
  50. }
  51. // 加72小时
  52. const deadline = new Date(baseTime.getTime() + 72 * 60 * 60 * 1000);
  53. this.deadlineTime = this.formatDate(deadline);
  54. this.$refs.urgeDialog.openPopup();
  55. }
  56. }).catch(() => {
  57. uni.hideLoading();
  58. });
  59. },
  60. closePopup() {
  61. this.$refs.urgeDialog.closePopup();
  62. },
  63. handleContact() {
  64. // 联系卖家逻辑,目前仅提示
  65. this.$u.toast('正在跳转联系卖家...');
  66. this.closePopup();
  67. },
  68. formatDate(date) {
  69. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  70. const day = date.getDate().toString().padStart(2, '0');
  71. const hours = date.getHours().toString().padStart(2, '0');
  72. const minutes = date.getMinutes().toString().padStart(2, '0');
  73. return `${month}月${day}日 ${hours}:${minutes}`;
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .urge-dialog-box {
  80. padding: 50rpx 40rpx 40rpx;
  81. position: relative;
  82. background: #fff;
  83. display: flex;
  84. flex-direction: column;
  85. align-items: center;
  86. .close-btn {
  87. position: absolute;
  88. top: 20rpx;
  89. right: 20rpx;
  90. padding: 10rpx;
  91. z-index: 10;
  92. }
  93. .icon-area {
  94. margin-bottom: 30rpx;
  95. }
  96. .urge-title {
  97. font-size: 36rpx;
  98. font-weight: bold;
  99. color: #333;
  100. margin-bottom: 20rpx;
  101. text-align: center;
  102. }
  103. .urge-desc {
  104. font-size: 26rpx;
  105. color: #666;
  106. margin-bottom: 50rpx;
  107. text-align: center;
  108. line-height: 1.5;
  109. padding: 0 20rpx;
  110. .highlight {
  111. color: #ff4500;
  112. margin-left: 10rpx;
  113. }
  114. }
  115. .btn-group {
  116. display: flex;
  117. width: 100%;
  118. justify-content: space-between;
  119. .action-btn {
  120. flex: 1;
  121. height: 80rpx;
  122. line-height: 80rpx;
  123. border-radius: 40rpx;
  124. font-size: 28rpx;
  125. font-weight: 500;
  126. margin: 0 15rpx;
  127. &::after {
  128. border: none;
  129. }
  130. &:active {
  131. opacity: 0.9;
  132. }
  133. }
  134. .contact-btn {
  135. background: #ffb800;
  136. color: #fff;
  137. flex: 1.5;
  138. }
  139. .confirm-btn {
  140. background: #ff4500;
  141. color: #fff;
  142. }
  143. }
  144. }
  145. </style>