orderManagement.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="card_order_management">
  3. <view class="card_order frame" v-for="(item,index) in datalist" :key="index" v-if="datalist.length > 0">
  4. <view @click="goDetails(item)">
  5. <view class="space_between">
  6. <view class="item_headline" v-if="item.goods && item.spec">{{item.goods.name}}{{item.spec.name}}
  7. </view>
  8. <view v-if="item.state == 3 || item.state == 4">
  9. <view class="details_title" style="color: #5ac725;" v-if="item.state == 3">已送达</view>
  10. <view class="details_title" style="color: #f56c6c;" v-else-if="item.state == 4">已取消</view>
  11. </view>
  12. <view v-else-if="item.state == 1 || item.state == 2">
  13. <view class="details_title" style="color: #3c9cff;">待配送</view>
  14. </view>
  15. <view v-else-if="item.state == 5">
  16. <view class="details_title" style="color: #f9ae3d;">配送中</view>
  17. </view>
  18. </view>
  19. <view class="item_num">×{{item.quantity}}</view>
  20. <view class="item_address">配送地址:{{item.address}}</view>
  21. <view class="item_address" v-if="item.state == 5">送气员电话:{{item.user.phone}}
  22. <u-icon color="#70B603" size="26" name="phone-fill"
  23. @click.native.stop="phone(item.user.phone)"></u-icon>
  24. </view>
  25. <view class="item_address">下单时间:{{item.orderTime}}</view>
  26. <view class="item_address" v-if="item.state == 3">送达时间:{{item.arriveTime}}</view>
  27. </view>
  28. <view class="card_delivery" v-if="item.state == 1 || item.state == 2">
  29. <view style="margin-right: 10rpx;flex: 1;">
  30. <u-button type="primary" @click="goSecurityCheck(item)">修改订单</u-button>
  31. </view>
  32. <view style="margin-left: 10rpx;flex: 1;">
  33. <u-button type="warning" @click="confirmedDelivery(item)">取消订单</u-button>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. datalist: {
  43. type: Array,
  44. default: []
  45. }
  46. },
  47. data() {
  48. return {
  49. orderId: null,
  50. }
  51. },
  52. methods: {
  53. goDetails(value) {
  54. uni.setStorageSync('detailsData', value);
  55. uni.navigateTo({
  56. url: '/pages/order/orderDetails'
  57. });
  58. },
  59. //修改订单
  60. goSecurityCheck(row) {
  61. this.$cache.setCache('orderList', row)
  62. uni.navigateTo({
  63. url: '/pages/order/booking?companyId=' + row.storeId + '&revamp=' + true
  64. });
  65. },
  66. // 取消订单
  67. confirmedDelivery(row) {
  68. this.orderId = row.id
  69. this.$emit('confirmedDelivery', this.orderId)
  70. },
  71. // 补全用户信息
  72. goCompletionTasks(row) {
  73. uni.navigateTo({
  74. url: '/pages/order/completionTasks?customerId=' + row.customerId
  75. });
  76. },
  77. phone(phone) {
  78. // console.log(phone, 66)
  79. uni.makePhoneCall({
  80. phoneNumber: phone,
  81. success: () => {
  82. console.log('拨打电话成功!');
  83. },
  84. fail: () => {
  85. console.error('拨打电话失败!');
  86. }
  87. });
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. ::v-deep .u-modal__content__text {
  94. text-align: center;
  95. }
  96. .card_order_management {
  97. margin: 0rpx 20rpx;
  98. display: flex;
  99. flex-direction: column;
  100. align-items: center;
  101. }
  102. .card_order {
  103. width: calc(100% - 40rpx);
  104. margin-top: 20rpx;
  105. // border: 1rpx solid rgba(215, 215, 215, 1);
  106. border-radius: 8rpx;
  107. padding: 30rpx 20rpx 10rpx 20rpx;
  108. }
  109. // 伪元素1rpx边框
  110. .frame {
  111. position: relative; //重要
  112. }
  113. .frame::after {
  114. position: absolute;
  115. content: '';
  116. border: 2rpx solid #e7e6e4;
  117. border-radius: 16rpx;
  118. width: 200%;
  119. height: 200%;
  120. top: 0;
  121. left: 0;
  122. transform: scale(0.5);
  123. transform-origin: 0 0;
  124. pointer-events: none;
  125. /* 使伪元素不会阻止鼠标事件 */
  126. }
  127. .item_headline {
  128. font-size: 36rpx;
  129. font-weight: 800;
  130. }
  131. .item_num {
  132. margin: 20rpx 0rpx;
  133. font-size: 26rpx;
  134. }
  135. .details_title {
  136. font-size: 26rpx;
  137. font-weight: 500;
  138. }
  139. .item_address {
  140. display: flex;
  141. align-items: center;
  142. font-size: 26rpx;
  143. color: #7f7f7f;
  144. margin-bottom: 20rpx;
  145. }
  146. .card_delivery {
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. margin-bottom: 20rpx;
  151. }
  152. </style>