orderManagement.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 class="card_delivery" v-if="item.state == 4">
  48. <view style="flex: 1;">
  49. <u-button type="error" @click="delDelivery(item)">删除</u-button>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. props: {
  59. datalist: {
  60. type: Array,
  61. default: []
  62. }
  63. },
  64. data() {
  65. return {}
  66. },
  67. methods: {
  68. goDetails(value) {
  69. uni.setStorageSync('detailsData', value);
  70. uni.navigateTo({
  71. url: '/pages/order/orderDetails'
  72. });
  73. },
  74. // 入户安全检查
  75. goSecurityCheck(row) {
  76. uni.navigateTo({
  77. url: '/pages/order/securityCheck?orderId=' + row.orderId + '&customerId=' + row.customerId
  78. });
  79. },
  80. // 确认送达
  81. confirmedDelivery(row) {
  82. if (row.customer.isSyncProv) {
  83. uni.navigateTo({
  84. url: '/pages/order/delivery?id=' + '99' + '&title=' + '确定送达' + '&orderId=' + row.id
  85. });
  86. } else {
  87. uni.$u.toast('请先完善客户信息')
  88. }
  89. },
  90. // 补全用户信息
  91. goCompletionTasks(row) {
  92. uni.navigateTo({
  93. url: '/pages/order/completionTasks?customerId=' + row.customerId
  94. });
  95. },
  96. // 去配送
  97. toDeliver(row) {
  98. this.$emit('toDeliver', row)
  99. },
  100. // 删除已取消订单
  101. delDelivery(row) {
  102. this.$emit('delDelivery', row)
  103. },
  104. phone(phone) {
  105. uni.makePhoneCall({
  106. phoneNumber: phone,
  107. success: () => {
  108. console.log('拨打电话成功!');
  109. },
  110. fail: () => {
  111. console.error('拨打电话失败!');
  112. }
  113. });
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .card_order_management {
  120. margin: 0rpx 20rpx;
  121. display: flex;
  122. flex-direction: column;
  123. align-items: center;
  124. }
  125. .card_order {
  126. width: 100%;
  127. margin-top: 20rpx;
  128. border: 1rpx solid #d7d7d7;
  129. border-radius: 8rpx;
  130. }
  131. .frame {
  132. position: relative;
  133. }
  134. .frame::after {
  135. content: '';
  136. position: absolute;
  137. display: block;
  138. bottom: 0;
  139. pointer-events: none;
  140. // z-index: -1;
  141. width: 200%;
  142. height: 200%;
  143. border: 2rpx solid rgba(215, 215, 215, 1);
  144. border-radius: 16rpx;
  145. transform: scale(0.5);
  146. transform-origin: left bottom;
  147. }
  148. .item_headline {
  149. font-size: 34rpx;
  150. font-weight: 800;
  151. }
  152. .item_num {
  153. margin: 20rpx 0rpx;
  154. font-size: 26rpx;
  155. }
  156. .details_title {
  157. font-size: 26rpx;
  158. font-weight: 500;
  159. }
  160. .item_address {
  161. display: flex;
  162. align-items: center;
  163. font-size: 26rpx;
  164. color: #7f7f7f;
  165. margin-bottom: 16rpx;
  166. }
  167. .card_delivery {
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. }
  172. </style>