express.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <app-layout>
  3. <view class="express">
  4. <image class="logo" src='./../image/express.png'></image>
  5. <view class="company-name">{{express_company}}</view>
  6. <view class="express-no">运单编号:{{express_no}}<image @click='copy' src="./../image/copy.png"></image></view>
  7. </view>
  8. <view class='logistics-box dir-top t-small-color t-medium'>
  9. <block v-if='express.list'>
  10. <view class='item-box'>
  11. <view :class="['dir-top-nowrap','item',`${index == 0 ? 'sign-text' : ''}`]" v-for='item in express.list' :key='item.id'>
  12. <image v-if='index == 0' class='sign-big' src='/static/image/icon/order/point-green.png'></image>
  13. <image v-else class='sign' src='/static/image/icon/order/point-gray.png'></image>
  14. <view>{{item.desc}}</view>
  15. <view>{{item.datetime}}</view>
  16. </view>
  17. </view>
  18. </block>
  19. <view v-else class='main-center'>
  20. <view>暂无物流信息</view>
  21. </view>
  22. </view>
  23. </app-layout>
  24. </template>
  25. <script>
  26. import { mapState } from "vuex";
  27. export default {
  28. data() {
  29. return {
  30. express: '',
  31. id: '',
  32. express_no: '',
  33. express_company: ''
  34. }
  35. },
  36. computed: {
  37. ...mapState({
  38. theme: state => state.mallConfig.theme,
  39. userInfo: state => state.user.info,
  40. adminImg: state => state.mallConfig.__wxapp_img.app_admin,
  41. })
  42. },
  43. methods: {
  44. copy() {
  45. uni.setClipboardData({
  46. data: this.express_no,
  47. success(res) {
  48. uni.getClipboardData({
  49. success(res) {
  50. uni.showToast({
  51. title: '复制成功',
  52. duration: 1000
  53. });
  54. console.log(res.data) // data
  55. }
  56. })
  57. }
  58. })
  59. },
  60. },
  61. onLoad(options) {
  62. let that = this;
  63. that.$showLoading({
  64. type: 'global',
  65. text: '加载中...'
  66. });
  67. that.$request({
  68. url: that.$api.app_admin.express_detail,
  69. data: {
  70. id: options.id,
  71. express: options.express,
  72. customer_name: options.customer_name,
  73. express_no: options.express_no
  74. }
  75. }).then(response => {
  76. that.$hideLoading();
  77. if (response.code == 0) {
  78. that.express = response.data.express;
  79. that.id = options.id;
  80. that.express_company = options.express;
  81. that.express_no = options.express_no;
  82. } else {
  83. uni.showToast({
  84. title: response.msg,
  85. icon: 'none',
  86. duration: 1000
  87. });
  88. }
  89. }).catch(response => {
  90. that.$hideLoading();
  91. uni.showToast({
  92. title: response,
  93. icon: 'none',
  94. duration: 1000
  95. });
  96. });
  97. }
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. .logo {
  102. height: #{100rpx};
  103. width: #{100rpx};
  104. float: left;
  105. margin-right: #{34rpx};
  106. }
  107. .express {
  108. margin: #{24rpx};
  109. display: block;
  110. margin-bottom: 0;
  111. padding: #{32rpx};
  112. padding-left: #{24rpx};
  113. position: relative;
  114. font-size: #{32rpx};
  115. background-color: #fff;
  116. color: #353535;
  117. border-radius: #{16rpx};
  118. height: #{160rpx};
  119. }
  120. .to-more {
  121. height: #{24rpx};
  122. width: #{12rpx};
  123. position: absolute;
  124. right: #{24rpx};
  125. top: 50%;
  126. margin-top: #{-6rpx};
  127. }
  128. .express-list {
  129. padding: #{40rpx} #{32rpx};
  130. background-color: #fff;
  131. color: #25ae5f;
  132. font-size: #{32rpx};
  133. margin: #{24rpx};
  134. border-radius: #{16rpx};
  135. }
  136. .express-box .top-box {
  137. background-color: #fff;
  138. padding: #{20rpx};
  139. }
  140. .express-box .label {
  141. margin-right: #{10rpx};
  142. }
  143. .express-box .goods-pic {
  144. width: #{130rpx};
  145. height: #{130rpx};
  146. margin-right: #{20rpx};
  147. }
  148. .logistics-box {
  149. padding: #{20rpx} #{25rpx};
  150. margin: 0 #{24rpx};
  151. border-radius: #{16rpx};
  152. background-color: #fff;
  153. margin-top: #{25rpx};
  154. }
  155. .logistics-box .item-box {
  156. border-left: #{1rpx} solid #e2e2e2;
  157. padding-left: #{45rpx};
  158. position: relative;
  159. }
  160. .logistics-box .item {
  161. margin-bottom: #{25rpx};
  162. padding-bottom: #{25rpx};
  163. border-bottom: #{1rpx} solid #e2e2e2;
  164. }
  165. .logistics-box .item .sign {
  166. width: #{16rpx};
  167. height: #{16rpx};
  168. position: absolute;
  169. left: #{-7rpx};
  170. }
  171. .logistics-box .item .sign-big {
  172. width: #{32rpx};
  173. height: #{32rpx};
  174. position: absolute;
  175. left: #{-16rpx};
  176. }
  177. .sign-text {
  178. color: #25ae5f;
  179. }
  180. .company-name {
  181. margin-top: #{6rpx};
  182. }
  183. .express-no {
  184. color:#666666;
  185. font-size: #{28rpx};
  186. margin-top: #{10rpx};
  187. }
  188. .express-no image {
  189. height: #{24rpx};
  190. width: #{24rpx};
  191. margin-left: #{16rpx};
  192. }
  193. </style>