ソースを参照

feat:调试指令

menghui 3 ヶ月 前
コミット
15a71410e0

ファイルの差分が大きいため隠しています
+ 447 - 455
HBuilder-uniPluginDemo/Pods/Pods.xcodeproj/project.pbxproj


+ 3 - 5
HBuilder-uniPluginDemo/Pods/Target Support Files/PBSDK/PBSDK-umbrella.h

@@ -15,10 +15,12 @@
 #import "NSArray+Log.h"
 #import "NSDictionary+Log.h"
 #import "NSString+unicode.h"
+#import "PBToken.h"
 #import "PBConstants.h"
 #import "PBDefines.h"
 #import "PBIMCenter.h"
 #import "PBNetwork.h"
+#import "PBReslut.h"
 #import "PBUser.h"
 #import "PBVC.h"
 #import "UIColor+yt_creator.h"
@@ -27,19 +29,15 @@
 #import "PBChatRoomView.h"
 #import "PBChatRoomViewController.h"
 #import "EaseChatBarEmoticonView.h"
-#import "EaseChatViewModel.h"
 #import "EaseEmojiHelper.h"
 #import "EaseEmoticonGroup.h"
 #import "EaseTextView.h"
 #import "EMChatBar.h"
 #import "PBExtMenuModel.h"
+#import "PBGiftBoxCell.h"
 #import "PBGiftBoxContentView.h"
 #import "PBGiftBoxView.h"
 #import "HorizontalLayout.h"
-#import "PBCollectionInputBarExtCell.h"
-#import "PBCollectionLongPressCell.h"
-#import "PBExtFuncModel.h"
-#import "PBMoreFunctionView.h"
 #import "PBChatMessageTextCell.h"
 #import "PBVideoPlayerView.h"
 #import "PBHomeChildCell.h"

+ 1 - 0
HBuilder-uniPluginDemo/Pods/Target Support Files/WQPlayBallLiveQiu/WQPlayBallLiveQiu-umbrella.h

@@ -13,6 +13,7 @@
 #import "LiveAppProxy.h"
 #import "LiveListComponent.h"
 #import "LiveModule.h"
+#import "TokenManager.h"
 #import "WQOptions.h"
 
 FOUNDATION_EXPORT double WQPlayBallLiveQiuVersionNumber;

BIN
HBuilder-uniPluginDemo/uniPlugin.xcworkspace/xcuserdata/zhangling.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 80
HBuilder-uniPluginDemo/uniPlugin.xcworkspace/xcuserdata/zhangling.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -4,86 +4,6 @@
    type = "0"
    version = "2.0">
    <Breakpoints>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "69CAD525-67AA-49F0-B6E1-572D8A2386DA"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveListComponent.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "29"
-            endingLineNumber = "29"
-            landmarkName = "-loadView"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "C1926A23-E926-4A1A-94FA-0D95955955DA"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveListComponent.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "34"
-            endingLineNumber = "34"
-            landmarkName = "-viewDidLoad"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "4FA14936-D83D-4951-847E-857888CD95A2"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "18"
-            endingLineNumber = "18"
-            landmarkName = "-init"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "FBE10C2B-A3BC-4C7F-8DEC-5E330DB577CD"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "32"
-            endingLineNumber = "32"
-            landmarkName = "LiveModule"
-            landmarkType = "3">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "BACA257B-3323-4BB0-981A-2AB9640D2BFF"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "48"
-            endingLineNumber = "48"
-            landmarkName = "LiveModule"
-            landmarkType = "3">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent

+ 16 - 13
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveListComponent.m

@@ -9,16 +9,25 @@
 #import "LiveListComponent.h"
 #import "DCUni/DCUniConvert.h"
 #import <MapKit/MapKit.h>
+#import "PBHomeViewController.h"
 
 @interface LiveListComponent () <MKMapViewDelegate>
 
 
-
+@property (nonatomic,strong) PBHomeViewController *homeViewController;
 @end
 
 @implementation LiveListComponent
 
 
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+    }
+    return self;
+}
 
 - (void)onCreateComponentWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events uniInstance:(DCUniSDKInstance *)uniInstance
 {
@@ -26,38 +35,32 @@
 }
 
 - (UIView *)loadView {
-    return [UILabel new];
+    
+    return self.homeViewController.view;
 }
 
 - (void)viewDidLoad {
     
-    ((UILabel*)self.view).text = @"LiveListComponent";
+    self.homeViewController = [[PBHomeViewController alloc] init];
     
 }
 
 /// 前端更新属性回调方法
 /// @param attributes 更新的属性
 - (void)updateAttributes:(NSDictionary *)attributes {
-    // 解析属性
-    if (attributes[@"showsTraffic"]) {
-      
-    }
+   
 }
 
 /// 前端注册的事件会调用此方法
 /// @param eventName 事件名称
 - (void)addEvent:(NSString *)eventName {
-    if ([eventName isEqualToString:@"mapLoaded"]) {
-      
-    }
+   
 }
 
 /// 对应的移除事件回调方法
 /// @param eventName 事件名称
 - (void)removeEvent:(NSString *)eventName {
-    if ([eventName isEqualToString:@"mapLoaded"]) {
-       
-    }
+    
 }
 
 

+ 28 - 5
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m

@@ -27,15 +27,36 @@ UNI_EXPORT_METHOD_SYNC(@selector(sendCommand:))
 /// 同步方法(注:同步方法会在 js 线程执行)
 /// @param options js 端调用方法时传递的参数
 - (void)sendCommand:(NSString *)jsonString {
+    
     // options 为 js 端调用此方法时传递的参数
     NSLog(@"%@",jsonString);
 
-    /*
-     可以在该方法中实现原生功能,然后直接通过 return 返回参数给 js
-     */
-
-    // 同步返回参数给 js 端 注:只支持返回 String 或 NSDictionary (map) 类型
+    WQOptions *options =  [WQOptions mj_objectWithKeyValues:jsonString];
+  
+  
 
+    
+    if(options.cmd == 1001){
+        //未登录
+        PBSDK.shared.accessToken = nil;
+        PBSDK.shared.expiresTime = nil;
+        PBSDK.shared.refreshToken = nil;
+        return;
+    }
+    
+    if(options.cmd == 1000){
+        //登陆
+        WQCMD1000 * data = [WQCMD1000 mj_objectWithKeyValues:options.data];
+        PBSDK.shared.accessToken = data.accessToken;
+        PBSDK.shared.expiresTime = data.expiresTime;
+        PBSDK.shared.refreshToken = data.refreshToken;
+        //用户信息
+        
+        
+        return;
+    }
+    
+    
 }
 
 // 通过宏 UNI_EXPORT_METHOD 将异步方法暴露给 js 端
@@ -45,6 +66,8 @@ UNI_EXPORT_METHOD(@selector(setupConfigCallback:))
 /// @param options js 端调用方法时传递的参数
 /// @param callback 回调方法,回传参数给 js 端
 - (void)setupConfigCallback:(UniModuleKeepAliveCallback)callback {
+
+    PBSDK.shared.moduleKeepAliveCallback  = callback;
     // options 为 js 端调用此方法时传递的参数
 //    NSLog(@"%@",options);
 //    {

+ 22 - 0
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/TokenManager.h

@@ -0,0 +1,22 @@
+//
+//  TakenManager.h
+//  WQPlayBallLiveQiu
+//
+//  Created by xx on 2024/12/29.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface TokenManager : NSObject
+
+
++ (TokenManager *)shared;
+
+@property (nonatomic,assign)double refreshTime;
+
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 64 - 0
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/TokenManager.m

@@ -0,0 +1,64 @@
+//
+//  TakenManager.m
+//  WQPlayBallLiveQiu
+//
+//  Created by xx on 2024/12/29.
+//
+
+#import "TokenManager.h"
+#import "PBNetwork.h"
+#import "PBSDK.h"
+#import "PBToken.h"
+#import "MJExtension/MJExtension.h"
+
+
+@interface TokenManager()
+
+@property (nonatomic,strong) NSDate *lastDate;//上次更新时间
+
+
+@end
+
+
+@implementation TokenManager
+
+
++ (TokenManager *)shared{
+    static dispatch_once_t onceToken;
+    
+    static TokenManager *m = nil;
+    dispatch_once(&onceToken, ^{
+        m = [[TokenManager alloc] init];
+    });
+    return m;
+}
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        self.refreshTime = 30*60*60 ;//秒
+    }
+    return self;
+}
+
+
+- (void)start{
+    //
+    
+    [PBNetwork refreshToken:PBSDK.shared.refreshToken successBack:^(PBReslut * _Nonnull reslut) {
+        if(reslut.code == 200){
+            PBToken *token = [PBToken mj_objectWithKeyValues:reslut.data] ;
+            
+            PBSDK.shared.accessToken = token.token;
+            PBSDK.shared.expiresTime = token.expiresTime;
+            PBSDK.shared.refreshToken = token.refreshToken;;
+            
+            
+        }
+    } errorBack:^{
+        
+    }];
+}
+
+@end

+ 26 - 1
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/WQOptions.h

@@ -9,15 +9,40 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+
 @interface WQOptions : NSObject
 
 
 @property (nonatomic, assign) int cmd;
 
 
-@property (nonatomic, copy) NSDictionary *data;
+@property (nonatomic, strong) NSObject *data;
+
+
+@end
+
+
+@interface WQUserInfo : NSObject
+
+@property (nonatomic, copy) NSNumber *id;
+@property (nonatomic, copy) NSString *nickname;
+@property (nonatomic, copy) NSString *avatar;
+@property (nonatomic, copy) NSString *mobile;
+@property (nonatomic, copy) NSString *sex;
+@property (nonatomic, copy) NSString *point;
+@property (nonatomic, copy) NSString *experience;
+@property (nonatomic, copy) NSString *level;
+@property (nonatomic, copy) NSString *brokerageEnabled;
+@property (nonatomic, copy) NSString *userType;
+@property (nonatomic, copy) NSString *vipExpiresTime;
+@end
 
+@interface WQCMD1000 : NSObject
+@property (nonatomic,  copy ) NSString *accessToken;
+@property (nonatomic,  copy ) NSString *expiresTime;
+@property (nonatomic,  copy ) NSString *refreshToken;
 
+@property (nonatomic,strong) WQUserInfo *userInfo;
 @end
 
 NS_ASSUME_NONNULL_END

+ 21 - 12
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/WQOptions.m

@@ -10,17 +10,26 @@
 
 @implementation WQOptions
 
+//
+//- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
+//    if ([oldValue isKindOfClass:[NSNull class]]) {
+//        if ([oldValue isKindOfClass:[NSArray class]]) {
+//            return @[];
+//        } else if ([oldValue isKindOfClass:[NSDictionary class]]) {
+//            return @{};
+//        } else {
+//            return @"";
+//        }
+//    }
+//    return oldValue;
+//}
+@end
+
+
+@implementation WQCMD1000
+
+
+//+ (NSDictionary *)mj_objectClassInArray
 
-- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
-    if ([oldValue isKindOfClass:[NSNull class]]) {
-        if ([oldValue isKindOfClass:[NSArray class]]) {
-            return @[];
-        } else if ([oldValue isKindOfClass:[NSDictionary class]]) {
-            return @{};
-        } else {
-            return @"";
-        }
-    }
-    return oldValue;
-}
 @end
+

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません