|
@@ -147,8 +147,8 @@ extension CommunityVideoListController: UICollectionViewDelegateFlowLayout,UICol
|
|
self?.navigationController?.popViewController(animated: true)
|
|
self?.navigationController?.popViewController(animated: true)
|
|
}
|
|
}
|
|
cell.shareClosure = {
|
|
cell.shareClosure = {
|
|
- [weak self] in
|
|
|
|
- print("------点击了[分享]")
|
|
|
|
|
|
+ [weak self] (videoItemMdl) in
|
|
|
|
+ self?.share(videoItemMdl)
|
|
}
|
|
}
|
|
cell.followClosure = { (videoItemMdl, followButton) in
|
|
cell.followClosure = { (videoItemMdl, followButton) in
|
|
CommunityFollowUserViewModel.shared.follow(communityVideoItemModel: videoItemMdl, button: followButton)
|
|
CommunityFollowUserViewModel.shared.follow(communityVideoItemModel: videoItemMdl, button: followButton)
|
|
@@ -241,8 +241,48 @@ extension CommunityVideoListController {
|
|
}) {
|
|
}) {
|
|
[weak self] (payType) in
|
|
[weak self] (payType) in
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 分享
|
|
|
|
+ func share(_ videoItemModel: CommunityVideoItemModel) {
|
|
|
|
+ var title = videoItemModel.title?.prefix(12)
|
|
|
|
+ if title == nil || title == "" {
|
|
|
|
+ title = videoItemModel.content?.prefix(12) ?? ""
|
|
|
|
+ }
|
|
|
|
+ let shareCommunityView = ShareCommunityView.shareCommunityView(
|
|
|
|
+ title: "向好友传递美好生活,送TA 500彩虹豆",
|
|
|
|
+ detailTitle: "越多好友看到,收获彩虹豆越多",
|
|
|
|
+ h5Str: (videoItemModel.h5url ?? "" + "\(UserModel.shared().getModel()?.inviteCode ?? "")"),
|
|
|
|
+ thumbnailImg: videoItemModel.img ?? "",
|
|
|
|
+ sharedTitle: String(title ?? ""),
|
|
|
|
+ sharedDetailTitle: kCommunityPostDetailTitleShare,
|
|
|
|
+ shareCommunityViewType: ShareCommunityViewType.postDetail,
|
|
|
|
+ completion: {
|
|
|
|
+ VirusViewModel.shared.forwarVirueRecordAddApi(postId: videoItemModel.id, postAuthorUid: "\(videoItemModel.uid ?? 0)", title: videoItemModel.title, content: videoItemModel.content, postType: videoItemModel.type, postCover: videoItemModel.img)
|
|
|
|
+ })
|
|
|
|
+ shareCommunityView.saveCompletion = {
|
|
|
|
+ [weak self] in
|
|
|
|
+ let vc = CommunityShareContentViewController()
|
|
|
|
+ vc.imgUrl = videoItemModel.img
|
|
|
|
+ let communityPostDetailTopicModel = videoItemModel.topic?[0]
|
|
|
|
+ vc.topicStr = communityPostDetailTopicModel?.name ?? ""
|
|
|
|
+ if videoItemModel.title == "" || videoItemModel.title == nil {
|
|
|
|
+ vc.titleStr =
|
|
|
|
+ String(videoItemModel.content?.prefix(20) ?? "")
|
|
|
|
+ }else {
|
|
|
|
+ vc.titleStr = String(videoItemModel.title?.prefix(20) ?? "")
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ vc.avatarStr = videoItemModel.avatar
|
|
|
|
+ vc.nameStr = videoItemModel.username
|
|
|
|
+ vc.H5UrlStr = (videoItemModel.h5url ?? "" + "\(UserModel.shared().getModel()?.inviteCode ?? "")")
|
|
|
|
+ vc.bean = videoItemModel.willCollectBean
|
|
|
|
+ vc.postId = videoItemModel.id
|
|
|
|
+ vc.uid = videoItemModel.uid
|
|
|
|
+ vc.type = videoItemModel.type
|
|
|
|
+ vc.contentStr = videoItemModel.content
|
|
|
|
+ self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|