delivery.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view>
  3. <view class='logistics'>
  4. <view class='logisticsCon'>
  5. <view class='company'>
  6. <view v-if="status == 0 || status == 2" class="order_head">
  7. <view class="order_number">{{status == 0 ? '待接单' : '待取货'}}</view>
  8. <view class="">等待配送员接单完成后开始派送</view>
  9. </view>
  10. <view v-if="code && (status != 0 && status != 2)" class="order_head">
  11. <view class="order_number">{{code}}</view>
  12. <view>稍后请将收货码告诉配送员</view>
  13. </view>
  14. <view class="order_delivery">
  15. <view class="delivery_info">
  16. <view class="delivery_pic">
  17. <image :src="`${domain}/static/images/delivery_man.png`"></image>
  18. </view>
  19. <view v-if="deliveryInfo.delivery_id" class="delivery_name">
  20. <view>{{deliveryInfo.delivery_name}}<br/>{{deliveryInfo.delivery_id}}</view>
  21. </view>
  22. <view v-else class="delivery_name_not">配送员未接单</view>
  23. </view>
  24. <view class="delivery_phone iconfont" @click="call">&#xe634;</view>
  25. </view>
  26. </view>
  27. <view class="order_logistic">
  28. <view class="recip_info">
  29. <view class="title">收件人信息</view>
  30. <view>
  31. <view class='items acea-row row-between'>
  32. <view>姓名:</view>
  33. <view class='conter'>{{deliveryInfo.real_name}}</view>
  34. </view>
  35. <view class='items acea-row row-between'>
  36. <view>手机号:</view>
  37. <view class='conter'>{{deliveryInfo.user_phone}}</view>
  38. </view>
  39. <view class='items acea-row row-between'>
  40. <view>地址:</view>
  41. <view class='conter'>{{deliveryInfo.user_address}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="logistic_count">
  46. <view class='item' v-for="(item,index) in expressList" :key="index">
  47. <view class='circular' :class='index === 0 ? "on iconfont icon-xuanzhong1":""'></view>
  48. <view class='text' :class='index===0 ? "on-font on":""'>
  49. <view>{{item.change_message}}</view>
  50. <view class='data' :class='index===0 ? "on-font on":""'>{{item.change_time}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. // +----------------------------------------------------------------------
  61. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  62. // +----------------------------------------------------------------------
  63. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  64. // +----------------------------------------------------------------------
  65. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  66. // +----------------------------------------------------------------------
  67. // | Author: CRMEB Team <admin@crmeb.com>
  68. // +----------------------------------------------------------------------
  69. import {
  70. develiveryDetail
  71. } from '@/api/order.js';
  72. import { mapGetters } from "vuex";
  73. import { HTTP_REQUEST_URL } from '@/config/app';
  74. import { toLogin } from '@/libs/login.js';
  75. export default {
  76. components: {
  77. },
  78. data() {
  79. return {
  80. orderId: '',
  81. code: '',
  82. status: 0,
  83. deliveryInfo: {},
  84. expressList: [],
  85. domain: HTTP_REQUEST_URL,
  86. };
  87. },
  88. computed: mapGetters(['isLogin']),
  89. onLoad: function (options) {
  90. if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
  91. this.orderId = options.orderId;
  92. if (this.isLogin) {
  93. this.getExpress();
  94. } else {
  95. toLogin()
  96. }
  97. },
  98. onReady: function() {
  99. },
  100. methods: {
  101. getExpress:function(){
  102. let that=this;
  103. develiveryDetail(that.orderId).then(function(res){
  104. let result = res.data.storeOrderStatus || {};
  105. that.$set(that,'deliveryInfo',res.data.storeOrder);
  106. that.$set(that,'code',res.data.finish_code);
  107. that.$set(that,'status',res.data.status);
  108. that.$set(that,'expressList',result || []);
  109. });
  110. },
  111. /**
  112. * 拨打电话
  113. */
  114. call: function() {
  115. uni.makePhoneCall({
  116. phoneNumber: this.deliveryInfo.delivery_id
  117. })
  118. },
  119. },
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .logistics{
  124. padding: 0 30rpx;
  125. }
  126. .order_head {
  127. text-align: center;
  128. color: #282828;
  129. font-size: 24rpx;
  130. border-bottom: 1px dashed #D8D8D8;
  131. padding-bottom: 40rpx;
  132. .order_number{
  133. font-size: 66rpx;
  134. font-weight: bold;
  135. }
  136. }
  137. .order_delivery {
  138. padding: 30rpx;
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. .delivery_info{
  143. width: 300rpx;
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. .delivery_name {
  148. color: #666666;
  149. &_not {
  150. font-weight: bold;
  151. }
  152. }
  153. image,uni-image {
  154. width: 80rpx;
  155. height: 80rpx;
  156. }
  157. }
  158. .delivery_phone {
  159. width: 44rpx;
  160. height: 44rpx;
  161. border-radius: 100%;
  162. background: #E7E7E7;
  163. text-align: center;
  164. line-height: 44rpx;
  165. font-size: 20rpx;
  166. color: #666;
  167. }
  168. }
  169. .logistics .logisticsCon {
  170. margin: 12rpx 0;
  171. }
  172. .logistics .logisticsCon .company {
  173. background-color: #fff;
  174. padding: 30rpx 0;
  175. border-radius: 16rpx;
  176. }
  177. .order_logistic{
  178. background-color: #fff;
  179. margin-top: 30rpx;
  180. border-radius: 16rpx;
  181. padding: 30rpx;
  182. }
  183. .recip_info {
  184. border-bottom: 1px dashed #D8D8D8;
  185. padding-bottom: 30rpx;
  186. }
  187. .recip_info .title {
  188. font-size: 30rpx;
  189. font-weight: bold;
  190. color: #282828;
  191. margin-bottom: 30rpx;
  192. }
  193. .recip_info .items~.items {
  194. margin-top: 24rpx;
  195. }
  196. .recip_info .items .conter {
  197. color: #868686;
  198. width: 460rpx;
  199. text-align: right;
  200. }
  201. .logistic_count {
  202. margin-top: 30rpx;
  203. }
  204. .logistics .logisticsCon .item {
  205. padding: 0 40rpx;
  206. position: relative;
  207. }
  208. .logistics .logisticsCon .item .circular {
  209. width: 20rpx;
  210. height: 20rpx;
  211. border-radius: 50%;
  212. position: absolute;
  213. top: -1rpx;
  214. left: 31.5rpx;
  215. background-color: #ddd;
  216. }
  217. .logistics .logisticsCon .item .circular.on {
  218. color: #e93323;
  219. background-color: transparent;
  220. font-size: 30rpx;
  221. left: 30rpx;
  222. }
  223. .logistics .logisticsCon .item .text.on-font {
  224. color: #282828;
  225. font-size: 30rpx;
  226. font-weight: bold;
  227. }
  228. .logistics .logisticsCon .item .text .data.on-font {
  229. color: #282828;
  230. font-weight: normal;
  231. }
  232. .logistics .logisticsCon .item .text {
  233. font-size: 26rpx;
  234. color: #666;
  235. width: 615rpx;
  236. border-left: 1px solid #e6e6e6;
  237. padding: 0 0 60rpx 38rpx;
  238. }
  239. .logistics .logisticsCon .item .text.on {
  240. border-left-color: #f8c1bd;
  241. }
  242. .logistics .logisticsCon .item .text .data {
  243. font-size: 24rpx;
  244. color: #999;
  245. margin-top: 10rpx;
  246. }
  247. .logistics .logisticsCon .item .text .data .time {
  248. margin-left: 15rpx;
  249. }
  250. </style>