urge-delivery-dialog.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. <!-- #ifdef MP-ALIPAY -->
  16. <button class="action-btn contact-btn" @click="handleContact">
  17. 继续联系卖家
  18. </button>
  19. <!-- #endif -->
  20. <!-- #ifndef MP-ALIPAY -->
  21. <button class="action-btn contact-btn" open-type="contact">继续联系卖家
  22. </button>
  23. <!-- #endif -->
  24. <button class="action-btn confirm-btn" @click="closePopup">
  25. 我知道了
  26. </button>
  27. </view>
  28. </view>
  29. </common-dialog>
  30. </template>
  31. <script>
  32. import CommonDialog from '@/components/common-dialog.vue';
  33. export default {
  34. components: {
  35. CommonDialog
  36. },
  37. data() {
  38. return {
  39. order: null,
  40. deadlineTime: ''
  41. };
  42. },
  43. methods: {
  44. open(order) {
  45. this.order = order;
  46. // 调用催发货接口
  47. uni.showLoading({ title: '处理中' });
  48. this.$u.api.urgeSendAjax(order.orderId).then(res => {
  49. uni.hideLoading();
  50. if (res.code === 200) {
  51. // 计算发货截止时间
  52. let baseTime = new Date();
  53. if (order && order.createTime) {
  54. // 兼容处理 ios 时间格式
  55. baseTime = new Date(order.createTime.replace(/-/g, '/'));
  56. }
  57. // 加72小时
  58. const deadline = new Date(baseTime.getTime() + 72 * 60 * 60 * 1000);
  59. this.deadlineTime = this.formatDate(deadline);
  60. this.$refs.urgeDialog.openPopup();
  61. this.$emit('success');
  62. }
  63. }).catch(() => {
  64. uni.hideLoading();
  65. });
  66. },
  67. closePopup() {
  68. this.$refs.urgeDialog.closePopup();
  69. },
  70. handleContact() {
  71. this.closePopup();
  72. uni.navigateTo({
  73. url: '/pages-mine/pages/customer-service'
  74. });
  75. },
  76. formatDate(date) {
  77. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  78. const day = date.getDate().toString().padStart(2, '0');
  79. const hours = date.getHours().toString().padStart(2, '0');
  80. const minutes = date.getMinutes().toString().padStart(2, '0');
  81. return `${month}月${day}日 ${hours}:${minutes}`;
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .urge-dialog-box {
  88. padding: 50rpx 40rpx 40rpx;
  89. position: relative;
  90. background: #fff;
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. .close-btn {
  95. position: absolute;
  96. top: 20rpx;
  97. right: 20rpx;
  98. padding: 10rpx;
  99. z-index: 10;
  100. }
  101. .icon-area {
  102. margin-bottom: 30rpx;
  103. }
  104. .urge-title {
  105. font-size: 36rpx;
  106. font-weight: bold;
  107. color: #333;
  108. margin-bottom: 20rpx;
  109. text-align: center;
  110. }
  111. .urge-desc {
  112. font-size: 26rpx;
  113. color: #666;
  114. margin-bottom: 50rpx;
  115. text-align: center;
  116. line-height: 1.5;
  117. padding: 0 20rpx;
  118. .highlight {
  119. color: #38C148;
  120. margin-left: 10rpx;
  121. }
  122. }
  123. .btn-group {
  124. display: flex;
  125. width: 100%;
  126. justify-content: space-between;
  127. .action-btn {
  128. flex: 1;
  129. height: 80rpx;
  130. line-height: 80rpx;
  131. border-radius: 40rpx;
  132. font-size: 28rpx;
  133. font-weight: 500;
  134. margin: 0 15rpx;
  135. &::after {
  136. border: none;
  137. }
  138. &:active {
  139. opacity: 0.9;
  140. }
  141. }
  142. .contact-btn {
  143. background: #fff;
  144. color: #38C148;
  145. border: 2rpx solid #38C148;
  146. flex: 1.5;
  147. box-sizing: border-box;
  148. line-height: 76rpx; // 调整线高因为有边框
  149. }
  150. .confirm-btn {
  151. background: #38C148;
  152. color: #fff;
  153. }
  154. }
  155. }
  156. </style>