Ver Fonte

add timepa

wenweiwei há 3 anos atrás
pai
commit
d3d6c9b2b4

+ 3 - 3
BFStuckPointKit/Classes/BFUtils/PQThirdPlatformUtil.swift

@@ -124,7 +124,7 @@ public class PQSingletoWXApiUtil: NSObject {
     ///   - videoId: 视频ID type == 1时不为空
     ///   - pageSource: 页面pageSource type == 1时不为空
     /// - Returns: <#description#>
-    public func share(type: Int = 1, scene: Int32, shareWeappRawId: String? = nil, title: String?, description: String?, imageUrl: String?, path: String?, videoId: String, pageSource: PAGESOURCE, shareId: String) -> PQSingletoWXApiUtil {
+    public func share(rootPageTimestamp:Int64?,type: Int = 1, scene: Int32, shareWeappRawId: String? = nil, title: String?, description: String?, imageUrl: String?, path: String?, videoId: String, pageSource: PAGESOURCE, shareId: String) -> PQSingletoWXApiUtil {
         if !isInstallWX() {
             if wxApiUtilHander != nil {
                 wxApiUtilHander!(nil, "您还未安装微信客户端!")
@@ -135,7 +135,7 @@ public class PQSingletoWXApiUtil: NSObject {
         message.title = (title?.count ?? 0) > 0 ? title! : "分享一个视频给你"
         message.description = description ?? ""
         BFLog(1, message: "test - \(String(describing: imageUrl))")
-
+        
         ImageDownloader.default.downloadImage(with: URL(string: imageUrl ?? "")!, options: nil) { result in
             switch result {
             case let .success(imageResult):
@@ -156,7 +156,7 @@ public class PQSingletoWXApiUtil: NSObject {
                         targetPagePath = "user-videos"
                         isRhythmVideo = 0
                     }
-                    var params = (targetPagePath + "?id=\(videoId)&tp=share&rootPageSource=\(pageSource.rawValue)&shareDepth=1&rootLaunchShareId=\(shareId)&parentShareId=\(shareId)&shareId=\(shareId)&shareAppType=\(BFConfig.shared.appType)&mid=\(getMachineCode())&su=\(BFLoginUserInfo.shared.uid)&isRhythmVideo=\(isRhythmVideo)").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
+                    var params = (targetPagePath + "?id=\(videoId)&tp=share&rootPageSource=\(pageSource.rawValue)&shareDepth=1&rootLaunchShareId=\(shareId)&parentShareId=\(shareId)&shareId=\(shareId)&shareAppType=\(BFConfig.shared.appType)&mid=\(getMachineCode())&su=\(BFLoginUserInfo.shared.uid)&isRhythmVideo=\(isRhythmVideo)&rootPageTimestamp=\(rootPageTimestamp ?? Int64(Date().timeIntervalSince1970 * 1000))").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
                     ["/", "=", "?", "&"].forEach { char in
                         let custom = CharacterSet(charactersIn: char).inverted
                         params = params?.addingPercentEncoding(withAllowedCharacters: custom) ?? ""

+ 4 - 2
BFStuckPointKit/Classes/Controller/PQStuckPointPublicController.swift

@@ -1519,13 +1519,14 @@ extension PQStuckPointPublicController {
             }
             cShowHUB(superView: nil, msg: nil)
             let shareId = getUniqueId(desc: "\(videoData?.uniqueId ?? "")shareId")
+            let rootPageTimestamp = Int64(Date().timeIntervalSince1970 * 1000)
             PQBaseViewModel.wxFriendShareInfo(videoId: (videoData?.uniqueId)!) { [weak self] imagePath, title, shareWeappRawId, msg in
                 if msg != nil {
                     cShowHUB(superView: nil, msg: "网络不佳哦")
                     return
                 }
                 self?.isShared = true
-                PQSingletoWXApiUtil.shared.share(type: 3, scene: Int32(WXSceneSession.rawValue), shareWeappRawId: shareWeappRawId, title: title, description: title, imageUrl: imagePath, path: self?.videoData?.videoPath, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                PQSingletoWXApiUtil.shared.share(rootPageTimestamp:rootPageTimestamp,type: 3, scene: Int32(WXSceneSession.rawValue), shareWeappRawId: shareWeappRawId, title: title, description: title, imageUrl: imagePath, path: self?.videoData?.videoPath, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
                 }
                 cHiddenHUB(superView: nil)
             }
@@ -1541,6 +1542,7 @@ extension PQStuckPointPublicController {
                 return
             }
             let shareId = getUniqueId(desc: "\(videoData?.uniqueId ?? "")shareId")
+            let rootPageTimestamp = Int64(Date().timeIntervalSince1970 * 1000)
             PQBaseViewModel.h5ShareLinkInfo(videoId: videoData?.uniqueId ?? "", pageSource: videoData?.pageSource ?? .sp_category) { [weak self] path, _ in
                 cHiddenHUB(superView: nil)
                 if path != nil {
@@ -1551,7 +1553,7 @@ extension PQStuckPointPublicController {
                         }
                         self?.isShared = true
 
-                        PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: self?.videoData?.title ?? "\(BFLoginUserInfo.shared.nickName)made a music video for you", description: "", imageUrl: imagePath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                        PQSingletoWXApiUtil.shared.share(rootPageTimestamp:rootPageTimestamp,type: 1, scene: Int32(WXSceneTimeline.rawValue), title: self?.videoData?.title ?? "\(BFLoginUserInfo.shared.nickName)made a music video for you", description: "", imageUrl: imagePath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
                         }
                     }
                 } else {