index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one"></view>
  5. <view class="two">
  6. <view class="two_1">
  7. <view class="two_1_1">
  8. <text>订单状态:</text>
  9. <text>{{is_check}}</text>
  10. </view>
  11. <view class="two_1_1">
  12. <text>物流单号:</text>
  13. <text>{{no}}</text>
  14. </view>
  15. </view>
  16. <view class="two_2">
  17. <uni-section title="物流记录" type="line" padding>
  18. <uni-steps :options="list" active-color="#007AFF" :active="active" direction="column" />
  19. </uni-section>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </mobile-frame>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. id: '',
  31. user: {},
  32. info: {},
  33. is_check: '',
  34. no: '',
  35. list: []
  36. };
  37. },
  38. onLoad: function(e) {
  39. const that = this;
  40. that.$set(that, `id`, e.id || '6343b53f21b24c75ad8dbf7a');
  41. that.watchLogin()
  42. },
  43. onShow: function() {},
  44. methods: {
  45. watchLogin() {
  46. const that = this;
  47. uni.getStorage({
  48. key: 'token',
  49. success: function(res) {
  50. let user = that.$jwt(res.data);
  51. if (user) that.$set(that, `user`, user);
  52. that.searchInfo();
  53. }
  54. })
  55. },
  56. async searchInfo() {
  57. const that = this;
  58. if (that.id) {
  59. let res = await that.$api(`/orderDetail/${that.id}`, 'GET')
  60. if (res.errcode == '0') {
  61. that.$set(that, `info`, res.data);
  62. that.search();
  63. } else {
  64. uni.showToast({
  65. title: res.errmsg,
  66. icon: 'none'
  67. })
  68. }
  69. }
  70. },
  71. async search() {
  72. const that = this;
  73. let res = await that.$api(`/orderDetail/sot/${that.info._id}`);
  74. if (res.errcode == '0') {
  75. that.$set(that, `is_check`, res.data.is_check);
  76. let list = res.data.list.map((i) => ({
  77. desc: i.time,
  78. title: i.context
  79. }))
  80. console.log(list);
  81. that.$set(that, `list`, list);
  82. that.$set(that, `no`, res.data.no);
  83. } else {
  84. uni.showToast({
  85. title: res.errmsg,
  86. icon: 'none'
  87. })
  88. }
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss">
  94. .main {
  95. display: flex;
  96. flex-direction: column;
  97. width: 100vw;
  98. height: 100vh;
  99. .one {
  100. position: relative;
  101. width: 100vw;
  102. height: 100vh;
  103. background-color: #ff0000;
  104. }
  105. .two {
  106. position: absolute;
  107. bottom: 0;
  108. width: 92vw;
  109. height: 60vh;
  110. overflow-y: auto;
  111. background: #fff;
  112. margin: 0 2vw;
  113. border-top-left-radius: 5px;
  114. border-top-right-radius: 5px;
  115. padding: 2vw;
  116. .two_1 {
  117. margin: 0 0 2vw 0;
  118. .two_1_1 {
  119. padding: 1vw 0;
  120. }
  121. }
  122. }
  123. }
  124. .uni-section .uni-section-header {
  125. padding: 1vw !important;
  126. }
  127. .uni-section .uni-section-content {
  128. padding: 0 !important;
  129. }
  130. </style>