金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.3 KiB

  1. <template>
  2. <view v-if="$isRight(logistics_data)">
  3. <lf-nav title="物流详情" :showIcon="true"></lf-nav>
  4. <view class="top">
  5. <image class="img" :src="order_details.items[0].item_meta.image" mode="aspectFill"></image>
  6. <view>{{logistics_data.state_text}}</view>
  7. </view>
  8. <view class="head">
  9. <view class="lf-flex">
  10. <image class="avatar" src="https://picsum.photos/200/300" mode="aspectFill"></image>
  11. <view class="name">{{logistics_data.com}} {{order_no}}</view>
  12. </view>
  13. <view class="copy" @click="copy">复制</view>
  14. </view>
  15. <view>
  16. <uni-steps :options="logistics_data.data" active-color="#15716E" direction="column" :active="0"></uni-steps>
  17. </view>
  18. <view style="height: 90rpx;"></view>
  19. </view>
  20. </template>
  21. <script>
  22. import uniSteps from '@/components/uni-steps/uni-steps.vue';
  23. export default {
  24. components: {
  25. uniSteps
  26. },
  27. data(){
  28. return {
  29. logistics_data: {},
  30. order_no: '',
  31. order_details: {}
  32. }
  33. },
  34. onLoad(e){
  35. this.order_no = e.order_no;
  36. if(this.order_no) {
  37. this.searchLogistics();
  38. this.getOrderDetails();
  39. }
  40. },
  41. methods: {
  42. getOrderDetails() {
  43. this.$http.get({
  44. api: 'api/order/' + this.order_no,
  45. header: {
  46. Authorization: this.$cookieStorage.get('user_token')
  47. }
  48. }).then(res => {
  49. this.order_details = res.data.data;
  50. })
  51. },
  52. searchLogistics() {
  53. this.$http.get({
  54. api: 'api/express/query',
  55. data: {
  56. no: this.order_no
  57. },
  58. header: {
  59. Authorization: this.$cookieStorage.get('user_token')
  60. }
  61. }).then(res => {
  62. this.logistics_data = res.data.data;
  63. })
  64. },
  65. copy(){
  66. uni.setClipboardData({
  67. data: this.order_no
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped="scoped">
  74. .top{
  75. width: 750rpx;
  76. height: 100rpx;
  77. background: #15716E;
  78. display: flex;
  79. align-items: center;
  80. padding: 0 32rpx;
  81. font-size: 36rpx;
  82. color: #FFFFFF;
  83. .img{
  84. border-radius: 5rpx;
  85. width: 70rpx;
  86. height: 70rpx;
  87. margin-right: 20rpx;
  88. }
  89. }
  90. .head{
  91. width: 750rpx;
  92. height: 130rpx;
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. padding: 0 32rpx;
  97. .avatar{
  98. width: 70rpx;
  99. height: 70rpx;
  100. border-radius: 50%;
  101. margin-right: 20rpx;
  102. }
  103. .name{
  104. font-size: 28rpx;
  105. color: #222222;
  106. }
  107. .copy{
  108. font-size: 28rpx;
  109. color: #777;
  110. }
  111. }
  112. </style>