|
@@ -49,7 +49,7 @@ class PublishEditController: BaseViewController {
|
|
|
// 内容
|
|
|
var pubContent: String = ""
|
|
|
// 位置
|
|
|
- var location: String = ""
|
|
|
+ var locationStr: String = ""
|
|
|
// 视频id,当type为video时必填
|
|
|
var paraVideo: String = ""
|
|
|
|
|
@@ -246,6 +246,7 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
|
|
|
return topicCell
|
|
|
case 4:
|
|
|
let addrCell = PublishEditAddAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ addrCell.location = locationStr
|
|
|
return addrCell
|
|
|
default:
|
|
|
return UITableViewCell()
|
|
@@ -273,11 +274,16 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
|
|
|
self?.selTopicName.append(", \(topicModel.name!)")
|
|
|
}
|
|
|
}
|
|
|
- self?.tableView.reloadData()
|
|
|
+ self?.tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
|
|
|
}
|
|
|
self.navigationController?.pushViewController(vc, animated: true)
|
|
|
case 4:
|
|
|
let vc = PublishAddAddressController()
|
|
|
+ vc.selectLocationClosure = {
|
|
|
+ [weak self] (address) in
|
|
|
+ self?.locationStr = address
|
|
|
+ self?.tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
|
|
|
+ }
|
|
|
self.navigationController?.pushViewController(vc, animated: true)
|
|
|
default:
|
|
|
break
|
|
@@ -383,7 +389,7 @@ extension PublishEditController {
|
|
|
|
|
|
print("----mediaType == \(typeStr)\n----pubTitle = \(pubTitle)\n----topicJsonStr == \(topicJsonStr)\n----imgsJsonStr == \(imgsJsonStr)")
|
|
|
|
|
|
- SwiftMoyaNetWorkServiceCommunity.shared().communityPublishApi(type: typeStr, img: majorImageUrl ?? "", topic_ids: topicJsonStr, video: paraVideo, title: pubTitle, content: pubContent, location: "", imgs: imgsJsonStr) {
|
|
|
+ SwiftMoyaNetWorkServiceCommunity.shared().communityPublishApi(type: typeStr, img: majorImageUrl ?? "", topic_ids: topicJsonStr, video: paraVideo, title: pubTitle, content: pubContent, location: locationStr, imgs: imgsJsonStr) {
|
|
|
[weak self] (communityPublishModel) -> (Void) in
|
|
|
let communityPublishModel = communityPublishModel as? CommunityPublishModel
|
|
|
print("----发布成功")
|