Jelajahi Sumber

天气,陌生人

liuzhenxing1118 7 bulan lalu
induk
melakukan
41d1b281c0

+ 4 - 4
artimenring-iOS/Artimenring/Classes/Model/EModel.h

@@ -16,8 +16,8 @@
 @end
 
 @interface BaseWeatherModel : BaseModel
-@property(nonatomic, copy) NSString* cityId;
-@property(nonatomic, copy) NSString* myTextCode; //自定义气象Code
+//@property(nonatomic, copy) NSString* cityId;
+//@property(nonatomic, copy) NSString* myTextCode; //自定义气象Code
 @property(nonatomic, copy) NSString* textCode; //原始气象Code
 @property(nonatomic, assign) NSInteger high;
 @property(nonatomic, assign) NSInteger low;
@@ -36,7 +36,6 @@
 @property(nonatomic, assign) NSInteger positionTime;
 @property(nonatomic, copy) NSString* address; //地址
 @property(nonatomic, copy) NSString* adressPoint; //地址
-@property(nonatomic, copy) BaseWeatherModel* weatherResult;
 - (BOOL)isCoordinatesValid;
 - (CLLocationCoordinate2D)getCoordinates;
 - (void)setCoordinates:(double)lat lng:(double)lng;
@@ -149,6 +148,7 @@ typedef enum : NSUInteger {
 @property(nonatomic, assign) NSInteger role;
 @property(nonatomic, copy) DeviceModel* device;
 @property(nonatomic, copy) BaseCoordinatesModel* lastLocation;
+@property(nonatomic, copy) BaseWeatherModel* weather;
 - (BOOL)isChildSelected:(NSString*)cid;
 @end
 
@@ -196,7 +196,7 @@ typedef enum : NSUInteger {
 @end
 
 @interface StrangerInterceptModel : BaseModel
-@property(nonatomic, assign) NSInteger toggle;
+@property(nonatomic, assign) NSInteger isEnable;
 @end
 
 @interface SchoolTimeModel : BaseRepeatsModel

+ 2 - 8
artimenring-iOS/Artimenring/Classes/Model/EModel.m

@@ -81,13 +81,6 @@
 @end
 
 @implementation BaseCoordinatesModel
-- (instancetype)init {
-    self = [super init];
-    if (self) {
-        self.weatherResult = [[BaseWeatherModel alloc] init];
-    }
-    return self;
-}
 - (BOOL)isCoordinatesValid {
     return [self.latitude doubleValue] != 0 || [self.longitude doubleValue] != 0;
 }
@@ -266,7 +259,7 @@
     if (self) {
         self.did = -1;
         self.match = [[CloudMatchModel alloc] init];
-        self.videoType = VIDEO_TYPE_AGORA;
+        self.videoType = [UserDataHelper getLoginType] == 0 ? VIDEO_TYPE_AGORA : VIDEO_TYPE_JUPHOON;
     }
     return self;
 }
@@ -281,6 +274,7 @@
     if (self) {
         self.device = [[DeviceModel alloc] init];
         self.lastLocation = [[BaseCoordinatesModel alloc] init];
+        self.weather = [[BaseWeatherModel alloc] init];
         self.role = 0;
         self.areaCode = [EUtil getCountryCode];
     }

+ 6 - 2
artimenring-iOS/Artimenring/Classes/SKRequest/SKRequestURL.h

@@ -19,6 +19,10 @@
 #define URL_SEND_CODE                   @"/api/v2/userctx/user/sms-code"
 #define URL_SEND_CODE_EMAIL             @"/user/api/entrance/captcha/email"
 
+//APNS
+#define URL_FCM_SUBSCRIBE               @"/api/v2/gatewayctx/publish/subscribe"
+#define URL_FCM_UNSUBSCRIBE             @"/api/v2/gatewayctx/publish/unsubscribe"
+
 //绑定小孩
 #define URL_CHILD_GET                   @"/api/v2/userctx/user/child/get"
 #define URL_CHILD_ADD                   @"/api/v2/userctx/user/child/create"
@@ -37,8 +41,6 @@
 #define URL_SESSION_SEND_VOICE          @"/api/v2/messagectx/messaging/publish/chat/voice"
 #define URL_SESSION_SEND_EMOJI          @"/api/v2/messagectx/messaging/publish/chat/emoji"
 #define URL_SESSION_SEND_IMAGE          @"/api/v2/messagectx/messaging/publish/chat/image"
-#define URL_FCM_SUBSCRIBE               @"/api/v2/gatewayctx/publish/subscribe"
-#define URL_FCM_UNSUBSCRIBE             @"/api/v2/gatewayctx/publish/unsubscribe"
 
 //联系人
 #define URL_CONTACT_GET                 @"/api/v2/userctx/user/child/contacts/get"
@@ -93,6 +95,7 @@
 
 #define URL_FLOW                        @"/locate/api/flow"
 
+//消息中心
 #define URL_PUSH_MESSAGE                @"/api/v2/messagectx"
 
 #define URL_SYSTEM_APP                  @"/locate/api/systemapp"
@@ -101,6 +104,7 @@
 //监听
 #define URL_MONITOR                     @"/locate/api/monitor"
 
+//视频通话
 #define URL_VIDEO_DIAL                  @"/api/v2/messagectx/messaging/publish/video-call/dial"
 #define URL_VIDEO_HANGUP                @"/api/v2/messagectx/messaging/publish/video-call/hangup"
 #define URL_VIDEO_TOKEN                 @"http://api.w303b.sikey.com.cn/token/generate"

+ 3 - 3
artimenring-iOS/Artimenring/Classes/ViewController/Location/SKMainViewController+watch.m

@@ -48,8 +48,8 @@
 }
 
 - (void)refreshWeather {
-    BaseWeatherModel* model = [DataManager shared].mSelectChildModel.lastLocation.weatherResult;
-    if (!model || model.myTextCode.length <= 0) {
+    BaseWeatherModel* model = [DataManager shared].mSelectChildModel.weather;
+    if (!model || model.textCode.length <= 0) {
         [self.mWeatherView setHidden:YES];
         return;
     }
@@ -75,7 +75,7 @@
         _airState = 6;
     
     
-    NSInteger type = [model.myTextCode integerValue];
+    NSInteger type = [model.textCode integerValue];
     NSString* imageName = [NSString stringWithFormat:@"%@%ld", @"weather_type_", type];
     [self.mWeatherState setImage:[UIImage imageNamed:imageName]];
     

+ 2 - 2
artimenring-iOS/Artimenring/Classes/ViewController/WatchFunction/StrangerIntercept/SKStrangerInterceptViewController.m

@@ -55,7 +55,7 @@
         case 0: {
             cell.mFirstTitleLabel.text = NSLocalizedString(@"SI.Cell.Title.1", nil);
             cell.mFirstDetailTextLabel.text = NSLocalizedString(@"SI.Cell.Title.Content.1", nil);
-            [cell.mFirstSwitchBtn setOn: self.strangerModel.toggle > 0];
+            [cell.mFirstSwitchBtn setOn: self.strangerModel.isEnable > 0];
             cell.mBaseTableViewCellCallback = ^(NSInteger index, NSInteger flag) {
                 [weak_self uploadSwitchFlag:flag];
             };
@@ -153,7 +153,7 @@
     [ERequest httpRequest:param httpURL:URL_STRANGER_UPDATE httpMethod:@"GET" onSuccess:^(NSDictionary *result){
         [self HiddenHUB];
         if([ERequest isSuccessWithResult:result]) {
-            weak_self.strangerModel.toggle = flag;
+            weak_self.strangerModel.isEnable = flag;
         } else {
             [EasyTextView showErrorText:result[@"message"]];
             [weak_self.mTableView reloadData];

+ 3 - 3
artimenring-iOS/SikeyComm.xcodeproj/project.pbxproj

@@ -3434,7 +3434,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEFINES_MODULE = YES;
 				DEVELOPMENT_TEAM = YHJXY25X52;
 				ENABLE_BITCODE = NO;
@@ -3499,7 +3499,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEFINES_MODULE = YES;
 				DEVELOPMENT_TEAM = YHJXY25X52;
 				ENABLE_BITCODE = NO;
@@ -3626,7 +3626,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEFINES_MODULE = YES;
 				DEVELOPMENT_TEAM = YHJXY25X52;
 				ENABLE_BITCODE = NO;