orderManagement.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="card_order_management">
  3. <view class="card_order" 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 == 5">
  9. <view class="item_tag" v-if="item.customer.isSyncProv">
  10. <u-tag text="已完善" plain size="mini" type="success"></u-tag>
  11. </view>
  12. <view class="item_tag" v-else>
  13. <u-tag text="补全客户信息" plain size="mini" @click="goCompletionTasks(item)"></u-tag>
  14. </view>
  15. </view>
  16. <view v-if="item.state == 3 || item.state == 4">
  17. <view class="details_title" style="color: #5ac725;" v-if="item.state == 3">已送达</view>
  18. <view class="details_title" style="color: #f56c6c;" v-else-if="item.state == 4">已取消</view>
  19. </view>
  20. </view>
  21. <view class="item_num">×{{item.quantity}}</view>
  22. <view class="item_address">配送地址:{{item.address}}</view>
  23. <view class="item_address" v-if="item.state == 5">联系电话:{{item.phone}}
  24. <u-icon color="#70B603" size="26" name="phone-fill" @click.native.stop="phone(item.phone)"></u-icon>
  25. </view>
  26. <view class="item_address">下单时间:{{item.orderTime}}</view>
  27. <view class="item_address" v-if="item.state == 3">送达时间:{{item.arriveTime}}</view>
  28. </view>
  29. <view v-if="item.state == 2">
  30. <u-button type="primary" @click="toDeliver(item)">去配送</u-button>
  31. </view>
  32. <view class="card_delivery" v-if="item.state == 5">
  33. <view style="margin-right: 10rpx;flex: 1;">
  34. <u-button type="primary" @click="goSecurityCheck(item)">修改订单</u-button>
  35. </view>
  36. <view style="margin-left: 10rpx;flex: 1;">
  37. <u-button type="warning" @click="confirmedDelivery(item)">取消订单</u-button>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. datalist: {
  47. type: Array,
  48. default: []
  49. }
  50. },
  51. data() {
  52. return {}
  53. },
  54. methods: {
  55. goDetails(value) {
  56. uni.setStorageSync('detailsData', value);
  57. uni.navigateTo({
  58. url: '/pages/order/orderDetails'
  59. });
  60. },
  61. // 入户安全检查
  62. goSecurityCheck(row) {
  63. uni.navigateTo({
  64. url: '/pages/order/securityCheck?orderId=' + row.orderId + '&customerId=' + row.customerId
  65. });
  66. },
  67. // 确认送达
  68. confirmedDelivery(row) {
  69. if (row.customer.isSyncProv) {
  70. uni.navigateTo({
  71. url: '/pages/order/delivery?id=' + '99' + '&title=' + '确定送达' + '&orderId=' + row.id
  72. });
  73. } else {
  74. uni.$u.toast('请先完善客户信息')
  75. }
  76. },
  77. // 补全用户信息
  78. goCompletionTasks(row) {
  79. uni.navigateTo({
  80. url: '/pages/order/completionTasks?customerId=' + row.customerId
  81. });
  82. },
  83. // 去配送
  84. toDeliver(row) {
  85. this.$emit('toDeliver', row)
  86. },
  87. phone(phone) {
  88. console.log(phone, 66)
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .card_order_management {
  95. margin: 0rpx 20rpx;
  96. display: flex;
  97. flex-direction: column;
  98. align-items: center;
  99. }
  100. .card_order {
  101. width: calc(100% - 40rpx);
  102. margin-top: 20rpx;
  103. border: 1rpx solid rgba(215, 215, 215, 1);
  104. border-radius: 8rpx;
  105. padding: 30rpx 20rpx;
  106. }
  107. .item_headline {
  108. font-size: 40rpx;
  109. font-weight: 800;
  110. }
  111. .item_num {
  112. margin: 20rpx 0rpx;
  113. font-size: 26rpx;
  114. }
  115. .details_title {
  116. font-size: 30rpx;
  117. font-weight: 500;
  118. }
  119. .item_address {
  120. display: flex;
  121. align-items: center;
  122. font-size: 30rpx;
  123. color: #7f7f7f;
  124. margin-bottom: 20rpx;
  125. }
  126. .card_delivery {
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. }
  131. </style>