expressInfo.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="container">
  3. <view class="express-box">
  4. <view class="top-text">
  5. <img class='logo' :src="expressList.result.logo" alt="">
  6. <text class="top-com" v-if="expressList.result.deliverystatus=='0'">揽件中</text>
  7. <text class="top-com" v-if="expressList.result.deliverystatus=='1'">运输中</text>
  8. <text class="top-com" v-if="expressList.result.deliverystatus=='2'">派件中</text>
  9. <text class="top-com" v-if="expressList.result.deliverystatus=='3'">已签收</text>
  10. </view>
  11. <view class="top-text">
  12. <text>国内承运物流:</text>
  13. <text class="top-com">{{expressList.result.expName}}</text>
  14. </view>
  15. <view class="top-text">
  16. <text>运单号:</text>
  17. <text>{{expressList.result.number }}</text>
  18. <view class="fz" @click="copy(expressList.result.number)">
  19. 复制
  20. </view>
  21. </view>
  22. <view class="top-text">
  23. <text>联系电话:</text>
  24. <text>{{expressList.result.expPhone }}</text>
  25. <view class="bh" @click="bh(expressList.result.expPhone)">
  26. 拨打
  27. </view>
  28. </view>
  29. <view class="express-body">
  30. <uni-steps :options="expressList.result.list" active-color="#007AFF" :active="active" direction="column">
  31. </uni-steps>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. express
  39. } from '@/api/order.js';
  40. import uniSteps from '@/components/uni-steps/uni-steps.vue';
  41. export default {
  42. components: {
  43. uniSteps
  44. },
  45. data() {
  46. return {
  47. id: '',
  48. expressList: [],
  49. active: 0
  50. }
  51. },
  52. onLoad(option) {
  53. this.id = option.id
  54. },
  55. onShow() {
  56. this.loadData()
  57. },
  58. methods: {
  59. loadData() {
  60. express({
  61. id: this.id,
  62. }).then(({
  63. data
  64. }) => {
  65. this.expressList = data.express;
  66. console.log(this.expressList, '000000')
  67. })
  68. },
  69. copy(e) {
  70. uni.setClipboardData({
  71. data: e,
  72. success: () => { //复制成功的回调函数
  73. uni.showToast({ //提示
  74. title: "复制快递单号成功"
  75. })
  76. }
  77. })
  78. },
  79. bh(e) {
  80. uni.makePhoneCall({
  81. phoneNumber: e, //电话号码
  82. success: function(e) {
  83. console.log(e);
  84. },
  85. fail: function(e) {
  86. console.log(e);
  87. }
  88. })
  89. }
  90. },
  91. }
  92. </script>
  93. <style lang="scss">
  94. .container {
  95. .logo {
  96. border-radius: 10rpx;
  97. margin: 10rpx;
  98. width: 60rpx;
  99. }
  100. .fz {
  101. text-align: center;
  102. width: 110rpx;
  103. border-radius: 30rpx;
  104. padding: 8rpx;
  105. color: #FFFFFF;
  106. background-color: #f75022;
  107. }
  108. .bh {
  109. text-align: center;
  110. width: 110rpx;
  111. border-radius: 30rpx;
  112. padding: 8rpx;
  113. color: #FFFFFF;
  114. background-color: #1090ff;
  115. }
  116. .express-box {
  117. letter-spacing: 8rpx;
  118. padding: 30rpx;
  119. border-bottom-left-radius: 40rpx;
  120. border-bottom-right-radius: 40rpx;
  121. height: 320rpx;
  122. background-color: #FFFFFF;
  123. .top-text {
  124. width: 100%;
  125. height: 60rpx;
  126. background: #FFFFFF;
  127. padding-left: 20rpx;
  128. font-size: $font-base;
  129. border-radius: $border-radius-sm;
  130. display: flex;
  131. align-items: center;
  132. .top-com {
  133. margin-right: 10rpx;
  134. }
  135. }
  136. .express-body {
  137. margin-top: 80rpx;
  138. background: #FFFFFF;
  139. border-radius: $border-radius-sm;
  140. padding: 20rpx 10rpx 20rpx 0;
  141. }
  142. }
  143. }
  144. </style>