orderManagement.vue 3.5 KB

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