lotnoLog.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="history">
  3. <view class="item" v-for="(item, i) in lotnoLogHistory" :key="i">
  4. <text class="type">{{ item.type }}</text>
  5. <text class="code" :style="{ color: item.status ? 'green' : '#666' }">{{ item.orderNum }}</text>
  6. <uni-icons v-if="item.status" type="checkmarkempty" class="status" size="16" color="green"></uni-icons>
  7. <text class="status fail" v-else>F</text>
  8. <text style="margin-left: 10rpx; font-weight: 300">
  9. {{ '\r\n' + item.createTime }}
  10. </text>
  11. </view>
  12. <view v-if="lotnoLogHistory.length === 0" class="is-empty">暂无历史</view>
  13. </view>
  14. </template>
  15. <script setup lang="ts">
  16. import { reactive, ref } from 'vue';
  17. import { onLoad } from '@dcloudio/uni-app';
  18. const lotnoLogHistory = ref([]);
  19. const getHistory = () => {
  20. lotnoLogHistory.value = uni.getStorageSync('lotnoLogHistory');
  21. };
  22. onLoad(() => {
  23. getHistory();
  24. });
  25. </script>
  26. <style lang="scss" scoped>
  27. .history {
  28. display: flex;
  29. width: 100%;
  30. flex-direction: column;
  31. justify-items: start;
  32. .title {
  33. padding: 20rpx;
  34. font-size: 24rpx;
  35. font-weight: 600;
  36. }
  37. .type {
  38. padding-right: 20rpx;
  39. font-size: 24rpx;
  40. }
  41. .code {
  42. font-weight: 600;
  43. }
  44. .item {
  45. padding: 20rpx;
  46. font-size: 20rpx;
  47. color: #666;
  48. .status {
  49. padding-left: 20rpx;
  50. }
  51. .fail {
  52. font-weight: 600;
  53. color: #f00;
  54. }
  55. }
  56. .is-empty {
  57. text-align: center;
  58. margin: 40px 0;
  59. color: #999;
  60. }
  61. }
  62. </style>