CfLogistics.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="cf-logistics">
  3. <pub-loading-view :loaded="loaded" height="100%">
  4. <view class="no-data" v-if="!dataList.no || dataList.statusList.length == 0">
  5. <image mode="heightFix" src="/static/image/no-data.png" />
  6. 暂无数据
  7. </view>
  8. <view v-else>
  9. <view class="cf-logistics-top">
  10. <view class="icon"><text class="iconfont">&#xe674;</text></view>
  11. {{dataList.no}}
  12. <view class="copy-icon" @click="onCopy(dataList.no)"> <text class="iconfont">&#xe620;</text></view>
  13. </view>
  14. <view class="logistics-list">
  15. <view class="logistics-item" :class="item.className" v-for="item in dataList.statusList" :key="item.id">
  16. <view class="logistics-item-left">
  17. <view class="icon" v-if='item.icon'>
  18. <text class="iconfont">&#xe602;</text>
  19. </view>
  20. <view class="icon" :class="item.className" v-else-if="item.className=='is-finish'">
  21. </view>
  22. <view class="dot" v-else></view>
  23. <view class="line"></view>
  24. </view>
  25. <view class="logistics-item-right">
  26. <view class="logistics-item-title" v-if="item.title">{{item.title}}</view>
  27. <view class="logistics-item-time">{{item.time}}</view>
  28. <view>{{item.message}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </pub-loading-view>
  34. </view>
  35. </template>
  36. <script lang="ts" setup>
  37. import { ref, onMounted, PropType } from 'vue'
  38. const props = defineProps({
  39. dataList: {
  40. type: Object as PropType<any>,
  41. default: () => ({})
  42. },
  43. })
  44. const loaded = ref(false)
  45. const onCopy = (value : string) => {
  46. uni.setClipboardData({
  47. data: value, //要被复制的内容
  48. success: () => { //复制成功的回调函数
  49. uni.showToast({ //提示
  50. title: '复制成功'
  51. })
  52. }
  53. });
  54. }
  55. onMounted(() => {
  56. })
  57. </script>
  58. <style lang="scss" scoped>
  59. .cf-logistics {
  60. background: #fff;
  61. padding: $uni-spacing-col-s3 $page-row-spacing;
  62. height: 100%;
  63. box-sizing: border-box;
  64. overflow-y: auto;
  65. .icon {
  66. width: 64rpx;
  67. height: 64rpx;
  68. background: $uni-bg-icon;
  69. border-radius: 50%;
  70. @include flex-center;
  71. .iconfont {
  72. background: linear-gradient(180deg, #46ACFF 0%, $uni-color-primary 100%);
  73. background-clip: text;
  74. text-fill-color: transparent;
  75. -webkit-background-clip: text;
  76. -webkit-text-fill-color: transparent;
  77. }
  78. }
  79. .cf-logistics-top {
  80. @include flex;
  81. margin-bottom: 32rpx;
  82. .icon {
  83. background: $uni-color-primary-light;
  84. margin-right: 24rpx;
  85. }
  86. .copy-icon {
  87. margin-left: 16rpx;
  88. }
  89. }
  90. .logistics-list {
  91. overflow-y: auto;
  92. flex: 1;
  93. height: calc(100% - 96rpx);
  94. .logistics-item {
  95. color: $uni-text-color-grey;
  96. display: flex;
  97. min-height: 140rpx;
  98. .logistics-item-left {
  99. @include flex;
  100. flex-direction: column;
  101. margin-right: 24rpx;
  102. .icon {
  103. .iconfont {
  104. background: linear-gradient(180deg, #C2CFE7 0%, #899AB9 100%);
  105. background-clip: text;
  106. text-fill-color: transparent;
  107. -webkit-background-clip: text;
  108. -webkit-text-fill-color: transparent;
  109. }
  110. &.is-finish {
  111. background: $uni-color-primary;
  112. color: #fff;
  113. }
  114. }
  115. .dot {
  116. width: 24rpx;
  117. height: 24rpx;
  118. background: $uni-border-color;
  119. border-radius: 50%;
  120. margin: 0 20rpx;
  121. }
  122. .line {
  123. flex: 1;
  124. // width: 1px;
  125. border-left: 1px dashed $uni-border-color;
  126. margin: 12rpx 0;
  127. }
  128. }
  129. .logistics-item-right {
  130. margin-bottom: 32rpx;
  131. font-size: 24rpx;
  132. line-height: $uni-line-height-sm;
  133. .logistics-item-title {
  134. font-size: 28rpx;
  135. line-height: $uni-line-height-base;
  136. margin-bottom: 8rpx;
  137. }
  138. .logistics-item-time {
  139. margin-bottom: 8rpx;
  140. }
  141. }
  142. &.is-finish {
  143. .logistics-item-left {
  144. .line {
  145. border-left: 1px dashed $uni-color-primary;
  146. }
  147. }
  148. .logistics-item-right {
  149. color: $uni-text-color;
  150. .logistics-item-title {
  151. font-weight: 800;
  152. }
  153. }
  154. }
  155. &:last-child {
  156. .logistics-item-left {
  157. .line {
  158. display: none;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>