ClockInRecord.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="clock-record">
  3. <view class="clock-record__action" v-if="isEdit">
  4. <u-button type="primary" :plain="true" text="打卡" size="mini" @click="handleClockIn"></u-button>
  5. </view>
  6. <view class="clock-record__body">
  7. <u-steps current="1" direction="column" dot>
  8. <u-steps-item :title="item.create_time" v-for="item in dataSource.clock_in_list || []">
  9. <view slot="desc" class="step-item">
  10. <view class="step-item__title">
  11. <view class="text">
  12. {{item.address || ''}}
  13. </view>
  14. <uni-icons type="location-filled" color="#1B76FF"></uni-icons>
  15. </view>
  16. <view class="step-item__content">
  17. <!-- <view v-for="(imgItem,index) in item.img_list" :key="imgItem+index">{{imgItem}}
  18. </view> -->
  19. <image v-for="(imgItem,index) in item.img_list" :key="imgItem+index" :src="baseUrl+imgItem"
  20. mode="aspectFit" class="img"></image>
  21. </view>
  22. <view class="step-item__tips">
  23. 签到描述:{{item.message || ''}}
  24. </view>
  25. </view>
  26. </u-steps-item>
  27. </u-steps>
  28. <u-empty text="暂无数据" v-if="dataSource.clock_in_list && !dataSource.clock_in_list.length">
  29. </u-empty>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. props: {
  36. dataSource: {
  37. type: Object,
  38. default: () => ({})
  39. },
  40. isEdit: {
  41. type: Boolean,
  42. default: false,
  43. }
  44. },
  45. data() {
  46. return {};
  47. },
  48. methods: {
  49. handleClockIn() {
  50. if (!this.dataSource.task_id) {
  51. return
  52. }
  53. uni.navigateTo({
  54. url: '/pages/index/clockDetail?taskID=' + this.dataSource.task_id
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .clock-record {
  62. box-sizing: border-box;
  63. width: 100%;
  64. padding: 24rpx 32rpx;
  65. &__action {
  66. display: inline-block;
  67. margin-bottom: 40rpx;
  68. }
  69. &__body {
  70. ::v-deep .u-steps-item__content {
  71. width: 0;
  72. }
  73. }
  74. .step-item {
  75. &__title {
  76. display: flex;
  77. align-items: center;
  78. font-size: 12px;
  79. line-height: 18px;
  80. color: #1B76FF;
  81. .text {
  82. text-decoration: underline;
  83. }
  84. }
  85. &__content {
  86. padding: 16rpx 0;
  87. display: flex;
  88. align-items: center;
  89. margin-left: -40rpx;
  90. .img {
  91. width: 64px;
  92. height: 64px;
  93. margin-left: 40rpx;
  94. }
  95. }
  96. &__tips {
  97. padding: 8rpx 16rpx;
  98. font-size: 12px;
  99. line-height: 18px;
  100. color: #1B76FF;
  101. background: linear-gradient(270deg, #FFFFFF 0%, #E2EFFF 100%);
  102. @include line;
  103. }
  104. }
  105. }
  106. </style>