| | |
| | | } |
| | | |
| | | |
| | | //清除水 |
| | | public func clearALL(){ |
| | | drop1 = nil |
| | | drop2 = nil |
| | | selects.removeAll() |
| | | collectionView.reloadData() |
| | | } |
| | | |
| | | |
| | | /// 获得请求后,更新的高度,来使父更新并缓存,滑动时获取 |
| | | func updateInnerHeight(clouse:@escaping (Double,Int)->Void){ |
| | | self.clouse = clouse |
| | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_CalendarDateTimeTCell", for: indexPath) as! CalendarDateTimeTCell |
| | | let m = items[indexPath.row] |
| | | cell.label_content.text = m.time |
| | | if m.selectable == 0{ |
| | | cell.contentView.backgroundColor = UIColor(hexStr: "#EC0808").withAlphaComponent(0.16) |
| | | cell.label_content.textColor = UIColor(hexStr: "#EC0808") |
| | | }else if m.selectable == 1{ |
| | | cell.contentView.backgroundColor = UIColor.white |
| | | cell.label_content.textColor = UIColor(hexStr: "#323232") |
| | | } |
| | | let d = date.jq_format("yyyy-MM-dd ") + m.time.components(separatedBy: "-").last! |
| | | let interval = Date.jq_StringToTimeInterval(d, "yyyy-MM-dd HH:mm") |
| | | |
| | | let canSelect = Date().timeIntervalSince1970 < interval |
| | | |
| | | if canSelect && m.selectable == 1{ |
| | | cell.contentView.backgroundColor = UIColor.white |
| | | cell.label_content.textColor = UIColor(hexStr: "#323232") |
| | | }else{ |
| | | cell.contentView.backgroundColor = UIColor(hexStr: "#EC0808").withAlphaComponent(0.16) |
| | | cell.label_content.textColor = UIColor(hexStr: "#EC0808") |
| | | } |
| | | |
| | | // if m.selectable == 0{ |
| | | // cell.contentView.backgroundColor = UIColor(hexStr: "#EC0808").withAlphaComponent(0.16) |
| | | // cell.label_content.textColor = UIColor(hexStr: "#EC0808") |
| | | // }else if m.selectable == 1{ |
| | | // cell.contentView.backgroundColor = UIColor.white |
| | | // cell.label_content.textColor = UIColor(hexStr: "#323232") |
| | | // } |
| | | |
| | | if indexPath.row == drop2 || indexPath.row == drop1{ |
| | | cell.contentView.backgroundColor = UIColor(hexStr: "#256D0F").withAlphaComponent(0.24) |