calendar.wxs 705 B

12345678910111213141516171819202122232425262728293031
  1. // 获取是否打卡class
  2. function getClass(json) {
  3. if (json) {
  4. if (json.startPunchClock && json.endPunchClock) {
  5. return 'all';
  6. } else if (json.startPunchClock || json.endPunchClock) {
  7. return 'shortage';
  8. }
  9. }
  10. return ''
  11. }
  12. function getSelectClass(blue, selectedIndex, index, json) {
  13. if (selectedIndex === index && json) {
  14. if (blue === index) {
  15. return 'text-blue';
  16. }
  17. if (json.startPunchClock && json.endPunchClock) {
  18. return 'text-blue';
  19. } else if (json.startPunchClock || json.endPunchClock) {
  20. return 'text-yellow';
  21. }
  22. return 'text-blue';
  23. }
  24. return ''
  25. }
  26. module.exports = {
  27. getClass: getClass,
  28. getSelectClass: getSelectClass
  29. };