detail.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view>
  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" :style="'margin-top:-'+marTop+'rpx;'">
  10. <view class="ytbox">
  11. <view class="ytop flexc">
  12. <view class="tit">{{visitName.charAt(0)}}</view>
  13. <view class="cent">
  14. <view class="ctit">{{visitName}}</view>
  15. <view class="ctime">最新打卡:2024-07-18</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次,上下班时间:08:30-17:30</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 luncCalendar from "@/components/lunc-calendar/lunc-calendar.vue"
  57. export default {
  58. components: {luncCalendar},
  59. data() {
  60. return {
  61. cirimg:require("@/static/images/home/chose.png"),
  62. navbg:require("@/static/images/navbg.png"),
  63. backgroundColor: "transparent",
  64. datainfo:{},
  65. nvaHeight: 44,
  66. marTop: 0, //距离顶部的距离
  67. stubarHeight: 0, //
  68. visitName:'林涵宇',
  69. signList: [],
  70. configWeek:[],
  71. configHoliday:'Y',
  72. firstDayOfWeek:'sunday',
  73. // dayflag:false,
  74. // month:'',
  75. // year:'',
  76. // kaTime:'',
  77. // changetime:'',//改变的日期
  78. // timeday:'',//选择的日期
  79. // visitDate:'',
  80. }
  81. },
  82. onPageScroll(e) {
  83. var scrollTop = Number(e.scrollTop);
  84. if (scrollTop > 0) {
  85. this.backgroundColor = '#0491FD'
  86. } else {
  87. this.backgroundColor = 'transparent'
  88. }
  89. },
  90. onLoad: function() {
  91. this.init()
  92. // this.getDataFn()
  93. uni.getSystemInfo({
  94. success: (e) => {
  95. this.stubarHeight = Number(e.statusBarHeight);
  96. this.nvaHeight = Number(e.statusBarHeight) + 44;
  97. this.tabscheight = Number(this.nvaHeight) * 2 + 100;
  98. }
  99. })
  100. // 3c8cadac11af4f1298a2882addc8788d
  101. },
  102. onShow() {},
  103. mounted() {
  104. this.getHeightFn()
  105. },
  106. methods: {
  107. checkPermi,
  108. checkRole,
  109. getBack() {
  110. uni.navigateBack({
  111. delta: 1
  112. })
  113. },
  114. dayChange(e){
  115. // if(e.daySign&&e.daySign.length){
  116. // var daySign=e.daySign[0];
  117. // this.amList=daySign.amList||[];
  118. // this.pmList=daySign.pmList||[];
  119. // if(this.reservatConfigType==1){
  120. // this.timeList=this.amList;
  121. // }else if(this.reservatConfigType==2){
  122. // this.timeList=this.pmList;
  123. // }
  124. // this.timeid='';
  125. // this.datainfo.visitDate=daySign.date;
  126. // this.datainfo.visitTime='';
  127. // }
  128. },
  129. monthChange(e){
  130. // var y=e.year;
  131. // var m=e.month;
  132. // if(y==this.year&&m==this.month){
  133. // this.getCalendarList()
  134. // this.changetime='';
  135. // }else{
  136. // var time=y + '-' + m + '-' + '01'
  137. // this.changetime=time
  138. // this.getCalendarList(time)
  139. // }
  140. },
  141. // 选中的日期
  142. getIsSelDayFn(e){
  143. // if(e.sign&&e.sign.length&&this.timeday!=e.date){
  144. // this.timeday=e.date;
  145. // if(this.configWeek.indexOf(e.week)!=-1 || e.isHoliday&&this.configHoliday=='N'){
  146. // this.dayflag=false;
  147. // }else{
  148. // if(e.sign&&e.sign.length){
  149. // var sign=JSON.parse(JSON.stringify(e.sign))
  150. // var signes=JSON.parse(JSON.stringify(sign[0]));
  151. // var amList=[],pmList=[];
  152. // if(signes.amList){
  153. // amList=JSON.parse(JSON.stringify(signes.amList))||[];
  154. // }
  155. // if(signes.pmList){
  156. // pmList=JSON.parse(JSON.stringify(signes.pmList))||[];
  157. // }
  158. // this.jdryflag=true;
  159. // if(this.timeType==1){
  160. // this.timeList=amList;
  161. // }else{
  162. // this.timeList=pmList;
  163. // }
  164. // this.amList=amList
  165. // this.pmList=pmList
  166. // this.timeid='';
  167. // var y=e.year;
  168. // var m=e.month;
  169. // var d=e.day;
  170. // this.datainfo.visitDate=y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
  171. // this.datainfo.visitTime='';
  172. // if(signes.title=='可预约'){
  173. // this.dayflag=true;
  174. // }else{
  175. // this.dayflag=false;
  176. // }
  177. // }
  178. // }
  179. // }
  180. },
  181. shrinkClick(e){
  182. console.log(e,3)
  183. },
  184. getHeightFn() {
  185. let query = uni.createSelectorQuery().in(this);
  186. //需要给黄色区域设置一个id标识,在这里是demo
  187. query.select('.navbox').boundingClientRect(data => {
  188. var top = data.top < 0 ? -data.top : data.top;
  189. var stubarHeight = Number(this.stubarHeight);
  190. this.marTop = stubarHeight > 0 ? 692 - Number(data.height) * 2 : 692 - Number(data.height) *
  191. 2 + 40 //赋值,待会要用
  192. if (top <= this.nvaHeight) {
  193. const opacity = top / 100 // 计算透明度值
  194. const color = `rgba(4, 145, 253, ${opacity})`
  195. this.backgroundColor = color // 更新盒子背景颜色
  196. } else {
  197. this.backgroundColor = '#00A9F0'
  198. }
  199. }).exec();
  200. },
  201. init() {
  202. // 门卫
  203. // getDictionaryFn('is_read').then(res=>{
  204. // if(res.code==200){
  205. // this.ydztlist = res.data.map(v => {
  206. // return {
  207. // label: v.dictLabel,
  208. // value: v.dictValue
  209. // }
  210. // })
  211. // }
  212. // })
  213. },
  214. getDataFn() {
  215. var params = {
  216. pageSize: this.pageSize,
  217. pageNo: this.pageNum,
  218. // visitType:3
  219. }
  220. getCameraList(params).then(res => {
  221. if (res.code == 200) {
  222. if (res.rows.length < this.pageSize) {
  223. this.reachflag = false
  224. this.wtdt = '到底了~';
  225. } else {
  226. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  227. 1)
  228. if (num < res.total) {
  229. this.reachflag = true
  230. this.wtdt = '上拉加载更多'
  231. } else {
  232. this.reachflag = false
  233. this.wtdt = '到底了~';
  234. }
  235. }
  236. if (this.pageNum == 1) {
  237. this.list = res.rows;
  238. } else {
  239. this.list = this.list.concat(res.rows)
  240. }
  241. } else {
  242. this.$toast(res.msg)
  243. }
  244. })
  245. },
  246. },
  247. }
  248. </script>
  249. <style>
  250. /* page {
  251. background: #ffffff;
  252. } */
  253. </style>
  254. <style lang="scss" scoped>
  255. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  256. .navbg{width: 100%;height: 692rpx;}
  257. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;}
  258. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 12rpx;border-radius: 14rpx;
  259. .ytop{padding: 16rpx 0 24rpx 16rpx;
  260. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  261. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  262. .cent{
  263. flex: 1;
  264. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  265. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  266. }
  267. }
  268. .tips{font-weight: 500;font-size: 26rpx;color: #888888;padding-left: 34rpx;margin-bottom: 24rpx;}
  269. // 步骤条
  270. .steps{position: relative;display: flex;padding-bottom:40rpx;
  271. &::after{
  272. content: '';position: absolute;left:6rpx;top: 34rpx;bottom: 4rpx;background-color: #DADADA;width: 2rpx;
  273. }
  274. .cir{width: 14rpx;height: 14rpx;background: #AFAFAF;border-radius: 50%;flex: 0 0 auto;margin-right: 38rpx;margin-top: 13rpx;}
  275. .stepsa{flex: 1;
  276. .steptit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 20rpx;}
  277. .steptxt{display: flex;
  278. image{width: 20rpx;height: 20rpx;margin-right: 14rpx;flex: 0 0 auto;margin-top: 7rpx;}
  279. view{font-weight: bold;font-size: 26rpx;color: #888888;}
  280. }
  281. }
  282. }
  283. }
  284. </style>