detail.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="打卡记录" :background-color="backgroundColor"
  5. :border="false" statusBar='true' fixed="true" @clickLeft='getBack'>
  6. </uni-nav-bar>
  7. </view>
  8. <image :src="navbg" class="navbg"></image>
  9. <view class="zxmain">
  10. <view class="ytbox">
  11. <view class="ytop flexc">
  12. <view class="tit" v-if="dataobj.name">{{dataobj.name.charAt(0)}}</view>
  13. <view class="cent">
  14. <view class="ctit">{{dataobj.name}}</view>
  15. <view class="ctime">最新打卡:{{dataobj.time}}</view>
  16. </view>
  17. </view>
  18. <!-- 日历 -->
  19. <view class="mb24">
  20. <lunc-calendar ref="calendar" :showLunar="false" :configWeek="configWeek" :configHoliday="configHoliday" :firstDayOfWeek="firstDayOfWeek" :showMonthBg="false" :showShrink="true" :signList="signList"
  21. @dayChange="dayChange" weekType="" @monthChange="monthChange" @getIsSelDayFn="getIsSelDayFn" @shrinkClick="shrinkClick">
  22. </lunc-calendar>
  23. </view>
  24. <view class="tips">出勤统计:打卡2次,上下班时间:{{dataobj.workTime}}</view>
  25. <!-- 步骤条 -->
  26. <view class="mb16 plr18">
  27. <view class="steps">
  28. <view class="cir"></view>
  29. <view class="stepsa">
  30. <view class="steptit">上班打卡</view>
  31. <view class="steptxt">
  32. <image :src="cirimg"></image>
  33. <view>08:27已打卡</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="steps">
  38. <view class="cir"></view>
  39. <view class="stepsa">
  40. <view class="steptit">下班打卡</view>
  41. <view class="steptxt">
  42. <image :src="cirimg"></image>
  43. <view>17:41已打卡</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="tips">统计截至 2024-07-18 16:13</view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  55. import {getDictionaryFn} from "@/api/mine/register.js"
  56. import {getClockRl} from "@/api/mine/work.js"
  57. import luncCalendar from "@/work/components/lunc-calendar/lunc-calendar.vue"
  58. export default {
  59. components: {luncCalendar},
  60. data() {
  61. return {
  62. cirimg:require("@/static/images/home/chose.png"),
  63. navbg:require("@/static/images/navbg.png"),
  64. backgroundColor: "transparent",
  65. datainfo:{},
  66. dataobj:{},
  67. nvaHeight: 44,
  68. marTop: 0, //距离顶部的距离
  69. stubarHeight: 0, //
  70. visitName:'林涵宇',
  71. signList: [],
  72. configWeek:[],
  73. configHoliday:'Y',
  74. firstDayOfWeek:'sunday',
  75. // dayflag:false,
  76. // month:'',
  77. // year:'',
  78. // kaTime:'',
  79. // changetime:'',//改变的日期
  80. // timeday:'',//选择的日期
  81. // visitDate:'',
  82. userId:'',
  83. recordTime:'',
  84. }
  85. },
  86. onPageScroll(e) {
  87. var scrollTop = Number(e.scrollTop);
  88. if (scrollTop > 0) {
  89. this.backgroundColor = '#0491FD'
  90. } else {
  91. this.backgroundColor = 'transparent'
  92. }
  93. },
  94. onLoad: function() {
  95. if(e.data){
  96. var data=JSON.parse(decodeURIComponent(e.data))
  97. this.userId=data.userId;
  98. this.recordTime=data.recordTime;
  99. this.getCalendarList()
  100. }
  101. uni.getSystemInfo({
  102. success: (e) => {
  103. this.stubarHeight = Number(e.statusBarHeight);
  104. this.nvaHeight = Number(e.statusBarHeight) + 44;
  105. }
  106. })
  107. // 3c8cadac11af4f1298a2882addc8788d
  108. },
  109. onShow() {},
  110. methods: {
  111. checkPermi,
  112. checkRole,
  113. getBack() {
  114. uni.navigateBack({
  115. delta: 1
  116. })
  117. },
  118. dayChange(e){
  119. if(e.daySign&&e.daySign.length){
  120. var daySign=e.daySign[0];
  121. this.datainfo=JSON.parse(JSON.stringify(daySign))
  122. }
  123. },
  124. monthChange(e){
  125. var y=e.year;
  126. var m=e.month;
  127. if(y==this.year&&m==this.month){
  128. this.getCalendarList()
  129. this.changetime='';
  130. }else{
  131. var time=y + '-' + m + '-' + '01'
  132. this.changetime=time
  133. this.getCalendarList(time)
  134. }
  135. },
  136. // 选中的日期
  137. getIsSelDayFn(e){
  138. if(e.sign&&e.sign.length){
  139. var date=e.sign[0].date;
  140. if(date==this.recordTime){
  141. var daySign=e.sign[0];
  142. this.datainfo=JSON.parse(JSON.stringify(daySign))
  143. }
  144. }
  145. },
  146. shrinkClick(e){
  147. console.log(e,3)
  148. },
  149. init() {
  150. // 门卫
  151. // getDictionaryFn('is_read').then(res=>{
  152. // if(res.code==200){
  153. // this.ydztlist = res.data.map(v => {
  154. // return {
  155. // label: v.dictLabel,
  156. // value: v.dictValue
  157. // }
  158. // })
  159. // }
  160. // })
  161. },
  162. getCalendarList() {
  163. var params = {
  164. userId: this.userId,
  165. recordTime: this.recordTime,
  166. }
  167. getClockRl(params).then(res => {
  168. if (res.code == 200) {
  169. var data=res.data;
  170. this.dataobj=res.data;
  171. if(data.rlData&&data.rlData.length){
  172. this.signList=data.rlData;
  173. }
  174. } else {
  175. this.$toast(res.msg)
  176. }
  177. })
  178. },
  179. },
  180. }
  181. </script>
  182. <style>
  183. /* page {
  184. background: #ffffff;
  185. } */
  186. </style>
  187. <style lang="scss" scoped>
  188. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  189. .navbg{width: 100%;height: 692rpx;}
  190. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;}
  191. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 12rpx;border-radius: 14rpx;
  192. .ytop{padding: 16rpx 0 24rpx 16rpx;
  193. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  194. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  195. .cent{
  196. flex: 1;
  197. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  198. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  199. }
  200. }
  201. .tips{font-weight: 500;font-size: 26rpx;color: #888888;padding-left: 34rpx;margin-bottom: 24rpx;}
  202. // 步骤条
  203. .steps{position: relative;display: flex;padding-bottom:40rpx;
  204. &::after{
  205. content: '';position: absolute;left:6rpx;top: 34rpx;bottom: 4rpx;background-color: #DADADA;width: 2rpx;
  206. }
  207. .cir{width: 14rpx;height: 14rpx;background: #AFAFAF;border-radius: 50%;flex: 0 0 auto;margin-right: 38rpx;margin-top: 13rpx;}
  208. .stepsa{flex: 1;
  209. .steptit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 20rpx;}
  210. .steptxt{display: flex;
  211. image{width: 20rpx;height: 20rpx;margin-right: 14rpx;flex: 0 0 auto;margin-top: 7rpx;}
  212. view{font-weight: bold;font-size: 26rpx;color: #888888;}
  213. }
  214. }
  215. }
  216. }
  217. </style>