notice-item.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="notice-item">
  3. <view class="item-head">
  4. <view class="item-head-msg">
  5. <view class="image-box">
  6. <u-badge
  7. type="error"
  8. :isDot="true"
  9. :show="!item.isRead"
  10. :absolute="true"
  11. :offset="[-2, -2]"
  12. ></u-badge>
  13. <image :src="img" mode=""></image>
  14. </view>
  15. <view>{{ item.type }}</view>
  16. </view>
  17. <view class="time-box">
  18. {{ $u.timeFormat(item.time, "hh:MM:ss") }}
  19. </view>
  20. </view>
  21. <view class="item-cont">
  22. 您有1条新的{{ item.type }}(单号:{{
  23. item.content
  24. }}),请点击查看并及时处理!
  25. </view>
  26. <view class="item-footer" @click="toDetail">
  27. <view>查看详情</view>
  28. <u-icon name="arrow-right" color="#7E838D"></u-icon>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. props: {
  35. item: {
  36. type: Object,
  37. default: () => {},
  38. },
  39. },
  40. computed: {
  41. img() {
  42. const type = this.item.type;
  43. let src = "";
  44. switch (type) {
  45. case "拣货任务":
  46. src = require("@/static/image/home/icon-jhrw.png");
  47. break;
  48. case "采购入库":
  49. src = require("@/static/image/home/icon-cgrk.png");
  50. break;
  51. case "盘点任务":
  52. src = require("@/static/image/home/icon-pdrw.png");
  53. break;
  54. case "复核任务":
  55. src = require("@/static/image/home/icon-fhrw.png");
  56. break;
  57. default:
  58. break;
  59. }
  60. return src;
  61. },
  62. },
  63. methods: {
  64. toDetail() {
  65. this.$emit("toDetail", { ...this.item });
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="scss" scoped>
  71. .notice-item {
  72. border-radius: 16px;
  73. background: #fff;
  74. padding: 24rpx 24rpx 0;
  75. margin-bottom: 24rpx;
  76. .item-head {
  77. display: flex;
  78. align-items: center;
  79. justify-content: space-between;
  80. &-msg {
  81. display: flex;
  82. align-items: center;
  83. color: #333;
  84. font-family: "PingFang SC";
  85. font-size: 32rpx;
  86. font-weight: bold;
  87. .image-box {
  88. position: relative;
  89. margin-right: 24rpx;
  90. image {
  91. width: 48rpx;
  92. height: 48rpx;
  93. z-index: 2;
  94. }
  95. ::v-deep .u-badge {
  96. z-index: 3;
  97. }
  98. }
  99. }
  100. }
  101. .item-cont {
  102. color: #666;
  103. font-family: "PingFang SC";
  104. font-size: 28rpx;
  105. font-weight: 400;
  106. padding: 17rpx 0 24rpx;
  107. border-bottom: 1px solid #f4f4f4;
  108. }
  109. .item-footer {
  110. height: 88rpx;
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. color: #333;
  115. font-family: "PingFang SC";
  116. font-size: 28rpx;
  117. font-weight: 400;
  118. }
  119. }
  120. </style>