CfLogistics.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. .icon {
  65. width: 64rpx;
  66. height: 64rpx;
  67. background: $uni-bg-icon;
  68. border-radius: 50%;
  69. @include flex-center;
  70. .iconfont {
  71. background: linear-gradient(180deg, #46ACFF 0%, $uni-color-primary 100%);
  72. background-clip: text;
  73. text-fill-color: transparent;
  74. -webkit-background-clip: text;
  75. -webkit-text-fill-color: transparent;
  76. }
  77. }
  78. .cf-logistics-top {
  79. @include flex;
  80. margin-bottom: 32rpx;
  81. .icon {
  82. background: $uni-color-primary-light;
  83. margin-right: 24rpx;
  84. }
  85. .copy-icon {
  86. margin-left: 16rpx;
  87. }
  88. }
  89. .logistics-list {
  90. overflow-y: auto;
  91. flex: 1;
  92. height: calc(100% - 96rpx);
  93. .logistics-item {
  94. color: $uni-text-color-grey;
  95. display: flex;
  96. min-height: 140rpx;
  97. .logistics-item-left {
  98. @include flex;
  99. flex-direction: column;
  100. margin-right: 24rpx;
  101. .icon {
  102. .iconfont {
  103. background: linear-gradient(180deg, #C2CFE7 0%, #899AB9 100%);
  104. background-clip: text;
  105. text-fill-color: transparent;
  106. -webkit-background-clip: text;
  107. -webkit-text-fill-color: transparent;
  108. }
  109. &.is-finish {
  110. background: $uni-color-primary;
  111. color: #fff;
  112. }
  113. }
  114. .dot {
  115. width: 24rpx;
  116. height: 24rpx;
  117. background: $uni-border-color;
  118. border-radius: 50%;
  119. margin: 0 20rpx;
  120. }
  121. .line {
  122. flex: 1;
  123. // width: 1px;
  124. border-left: 1px dashed $uni-border-color;
  125. margin: 12rpx 0;
  126. }
  127. }
  128. .logistics-item-right {
  129. margin-bottom: 32rpx;
  130. font-size: 24rpx;
  131. line-height: $uni-line-height-sm;
  132. .logistics-item-title {
  133. font-size: 28rpx;
  134. line-height: $uni-line-height-base;
  135. margin-bottom: 8rpx;
  136. }
  137. .logistics-item-time {
  138. margin-bottom: 8rpx;
  139. }
  140. }
  141. &.is-finish {
  142. .logistics-item-left {
  143. .line {
  144. border-left: 1px dashed $uni-color-primary;
  145. }
  146. }
  147. .logistics-item-right {
  148. color: $uni-text-color;
  149. .logistics-item-title {
  150. font-weight: 800;
  151. }
  152. }
  153. }
  154. &:last-child {
  155. .logistics-item-left {
  156. .line {
  157. display: none;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. }
  164. </style>