orderManagement.vue 4.4 KB

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