Commit 1020b4e0 authored by Steven杜宇's avatar Steven杜宇

// 动态

parent 05111627
......@@ -107,6 +107,9 @@ extension YHNameCardDynamicViewController: UITableViewDelegate, UITableViewDataS
if 0 <= indexPath.row, indexPath.row < self.arr.count {
let model = self.arr[indexPath.row]
cell.updateModel(model)
cell.rePublishClick = {
// model.id
}
}
return cell
}
......@@ -116,7 +119,31 @@ extension YHNameCardDynamicViewController: UITableViewDelegate, UITableViewDataS
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row, indexPath.row < self.arr.count {
let model = self.arr[indexPath.row]
var url = YHBaseUrlManager.shared.businessH5Url() + "/community/activity/" + "\(model.id)"
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
let urlHasParam = String.hasQueryParameters(urlString: url)
if urlHasParam {
url = url + "&param=" + token
} else {
url = url + "?param=" + token
}
}
var tUrl = url
if !url.contains("navigationH=") {
tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
if url.contains("?") {
tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
let vc = YHH5WebViewVC()
vc.url = tUrl
vc.isHideNavigationBar = true
vc.isFullScreenFlag = true
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
......
......@@ -15,6 +15,8 @@ class YHNameCardDynamicCell: UITableViewCell {
static let imgH: CGFloat = (KScreenWidth-20*2-4*2)/3.0
var rePublishClick:(()->())?
private lazy var publishLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
......@@ -111,6 +113,7 @@ class YHNameCardDynamicCell: UITableViewCell {
btn.layer.borderColor = UIColor.brandGrayColor8.cgColor
btn.layer.borderWidth = 1.0
btn.layer.cornerRadius = 12.0
btn.addTarget(self, action: #selector(didPublishBtnClicked), for: .touchUpInside)
return btn
}()
......@@ -123,17 +126,14 @@ class YHNameCardDynamicCell: UITableViewCell {
setupUI()
}
@objc func didPublishBtnClicked() {
self.rePublishClick?()
}
func updateModel(_ model: YHDynamicItem) {
timeLabel.text = self.formatDateString(model.created_at)
// let test = true
// if test {
// model.is_self_posts = 1
// model.audit_status = 3
// model.violation_remark = "阿是就发了时代峰峻阿克拉生发剂拉卡萨电极法卡拉是电极法考拉手机大发卡拉季湿哒哒开发逻辑阿达山卡拉代发久啊双打卡拉法基1"
// }
// 审核视图显示
var hiddenReview = true
if model.is_self_posts == 1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment