urge-delivery-dialog.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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="#38C148"></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. this.$emit('success');
  56. }
  57. }).catch(() => {
  58. uni.hideLoading();
  59. });
  60. },
  61. closePopup() {
  62. this.$refs.urgeDialog.closePopup();
  63. },
  64. handleContact() {
  65. this.closePopup();
  66. uni.navigateTo({
  67. url: '/pages-mine/pages/customer-service'
  68. });
  69. },
  70. formatDate(date) {
  71. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  72. const day = date.getDate().toString().padStart(2, '0');
  73. const hours = date.getHours().toString().padStart(2, '0');
  74. const minutes = date.getMinutes().toString().padStart(2, '0');
  75. return `${month}月${day}日 ${hours}:${minutes}`;
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .urge-dialog-box {
  82. padding: 50rpx 40rpx 40rpx;
  83. position: relative;
  84. background: #fff;
  85. display: flex;
  86. flex-direction: column;
  87. align-items: center;
  88. .close-btn {
  89. position: absolute;
  90. top: 20rpx;
  91. right: 20rpx;
  92. padding: 10rpx;
  93. z-index: 10;
  94. }
  95. .icon-area {
  96. margin-bottom: 30rpx;
  97. }
  98. .urge-title {
  99. font-size: 36rpx;
  100. font-weight: bold;
  101. color: #333;
  102. margin-bottom: 20rpx;
  103. text-align: center;
  104. }
  105. .urge-desc {
  106. font-size: 26rpx;
  107. color: #666;
  108. margin-bottom: 50rpx;
  109. text-align: center;
  110. line-height: 1.5;
  111. padding: 0 20rpx;
  112. .highlight {
  113. color: #38C148;
  114. margin-left: 10rpx;
  115. }
  116. }
  117. .btn-group {
  118. display: flex;
  119. width: 100%;
  120. justify-content: space-between;
  121. .action-btn {
  122. flex: 1;
  123. height: 80rpx;
  124. line-height: 80rpx;
  125. border-radius: 40rpx;
  126. font-size: 28rpx;
  127. font-weight: 500;
  128. margin: 0 15rpx;
  129. &::after {
  130. border: none;
  131. }
  132. &:active {
  133. opacity: 0.9;
  134. }
  135. }
  136. .contact-btn {
  137. background: #fff;
  138. color: #38C148;
  139. border: 2rpx solid #38C148;
  140. flex: 1.5;
  141. box-sizing: border-box;
  142. line-height: 76rpx; // 调整线高因为有边框
  143. }
  144. .confirm-btn {
  145. background: #38C148;
  146. color: #fff;
  147. }
  148. }
  149. }
  150. </style>