orderManagement.vue 3.9 KB

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