index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. type: '',
  32. user: {},
  33. info: {},
  34. is_check: '',
  35. no: '',
  36. list: []
  37. };
  38. },
  39. onLoad: function(e) {
  40. const that = this;
  41. that.$set(that, `id`, e.id || '');
  42. that.$set(that, `type`, e.type || '');
  43. that.watchLogin()
  44. },
  45. methods: {
  46. watchLogin() {
  47. const that = this;
  48. uni.getStorage({
  49. key: 'token',
  50. success: function(res) {
  51. let user = that.$jwt(res.data);
  52. if (user) that.$set(that, `user`, user);
  53. that.searchInfo();
  54. }
  55. })
  56. },
  57. async searchInfo() {
  58. const that = this;
  59. if (that.id) {
  60. let res;
  61. if (that.type == 'integral') {
  62. res = await that.$api(`/zrOrder/${that.id}`, `GET`, {}, `integral`)
  63. } else {
  64. res = await that.$api(`/orderDetail/${that.id}`, 'GET')
  65. }
  66. if (res.errcode == '0') {
  67. that.$set(that, `info`, res.data);
  68. that.search();
  69. } else {
  70. uni.showToast({
  71. title: res.errmsg,
  72. icon: 'none'
  73. })
  74. }
  75. }
  76. },
  77. async search() {
  78. const that = this;
  79. let res;
  80. if (that.type == 'integral') {
  81. res = await that.$api(`/zrOrder/sot/${that.info._id}`, `GET`, {}, `integral`);
  82. } else {
  83. res = await that.$api(`/orderDetail/sot/${that.info._id}`, `GET`);
  84. }
  85. if (res.errcode == '0') {
  86. that.$set(that, `is_check`, res.data.is_check);
  87. let list = res.data.list.map((i) => ({
  88. desc: i.time,
  89. title: i.context
  90. }))
  91. that.$set(that, `list`, list);
  92. that.$set(that, `no`, res.data.no);
  93. } else {
  94. uni.showToast({
  95. title: res.errmsg,
  96. icon: 'none'
  97. })
  98. }
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. .main {
  105. display: flex;
  106. flex-direction: column;
  107. width: 100vw;
  108. height: 100vh;
  109. .one {
  110. position: relative;
  111. width: 100vw;
  112. height: 100vh;
  113. background-color: #ff0000;
  114. }
  115. .two {
  116. position: absolute;
  117. bottom: 0;
  118. width: 92vw;
  119. height: 60vh;
  120. overflow-y: auto;
  121. background: #fff;
  122. margin: 0 2vw;
  123. border-top-left-radius: 5px;
  124. border-top-right-radius: 5px;
  125. padding: 2vw;
  126. .two_1 {
  127. margin: 0 0 2vw 0;
  128. .two_1_1 {
  129. padding: 1vw 0;
  130. }
  131. }
  132. }
  133. }
  134. .uni-section .uni-section-header {
  135. padding: 1vw !important;
  136. }
  137. .uni-section .uni-section-content {
  138. padding: 0 !important;
  139. }
  140. </style>