test1.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <view class="card" v-for="(item,index) in 8" :key="index">
  4. <view class="item">
  5. <view class="left">
  6. <view class="tag bg-red">
  7. <text>麦</text>
  8. </view>
  9. <view class="content">
  10. <text class="text-cut-1">麦草方格(宁夏)文化传媒有限公司</text>
  11. <text class="text-cut-1">德锐斯园区A区</text>
  12. </view>
  13. </view>
  14. <view class="right">
  15. <image src="../../static/index/call.png" mode=""></image>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. }
  26. },
  27. onLoad() {
  28. this.test()
  29. },
  30. methods: {
  31. test(){
  32. let arr=[]
  33. let result= arr.filter(item=>{
  34. return item.checkinType==0 || item.checkinType==1
  35. })
  36. console.log(result);
  37. return
  38. let outPunchRecords=[]
  39. arr.forEach(item=>{
  40. if (item.checkinType==0) {
  41. console.log("我打上班卡啦");
  42. }else if (item.checkinType==1) {
  43. console.log("我打下班卡啦");
  44. }else if (item.checkinType==2) {
  45. outPunchRecords.push(item)
  46. }else{
  47. console.log("我什么都没打");
  48. }
  49. })
  50. console.log(outPunchRecords);
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss">
  56. .card{
  57. position: relative;
  58. background-color: #FFFFFF;
  59. padding: 35rpx;
  60. margin: 20rpx;
  61. .item{
  62. display: flex;
  63. justify-content: space-between;
  64. }
  65. .left{
  66. display: flex;
  67. width: 88%;
  68. .tag{
  69. border-radius: 50%;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. height: 80rpx;
  74. width: 80rpx;
  75. font-size: 32rpx;
  76. }
  77. .content{
  78. padding-left: 30rpx;
  79. display: flex;
  80. flex-direction: column;
  81. text:first-child{
  82. font-size: 32rpx;
  83. }
  84. text:last-child{
  85. font-size: 28rpx;
  86. color: #9f9f9f;
  87. padding-top: 15rpx;
  88. }
  89. }
  90. }
  91. .right{
  92. display: flex;
  93. justify-content: center;
  94. align-items: center;
  95. image{
  96. width: 50rpx;
  97. height: 50rpx;
  98. }
  99. }
  100. }
  101. </style>