Quellcode durchsuchen

fix:推送、7.11 bug修改

“wangdongchao” vor 1 Jahr
Ursprung
Commit
06d2b3dcbc
26 geänderte Dateien mit 270 neuen und 23 gelöschten Zeilen
  1. 29 1
      Asteria.xcodeproj/project.pbxproj
  2. 17 12
      Asteria/AppDelegate.m
  3. 3 1
      Asteria/Fuction/Cart/Cart_CheckoutC.m
  4. 1 1
      Asteria/Fuction/Cart/Cell/MyCartItemCell.m
  5. 1 1
      Asteria/Fuction/Cart/Checkout/ASCheckoutGoodsItemCell.m
  6. 2 2
      Asteria/Fuction/Category/vm/KWHisAndHotWordsViewModel.m
  7. 8 0
      Asteria/Fuction/Home/ASHomeViewController.m
  8. 3 0
      Asteria/Fuction/Home/vm/ASProductListViewModel.m
  9. 18 0
      Asteria/Fuction/Manager/NotificationManager/ASJumpHandler.h
  10. 24 0
      Asteria/Fuction/Manager/NotificationManager/ASJumpHandler.m
  11. 30 0
      Asteria/Fuction/Manager/NotificationManager/ASPushOneSignalManager.h
  12. 125 0
      Asteria/Fuction/Manager/NotificationManager/ASPushOneSignalManager.m
  13. 0 0
      Asteria/Fuction/Manager/UserManager/currency/ASCurrencyManager.h
  14. 0 0
      Asteria/Fuction/Manager/UserManager/currency/ASCurrencyManager.m
  15. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASUserInfoManager.h
  16. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASUserInfoManager.m
  17. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASUserModel.h
  18. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASUserModel.m
  19. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASVipModel.h
  20. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASVipModel.m
  21. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASVipUrlTempModel.h
  22. 0 0
      Asteria/Fuction/Manager/UserManager/info/ASVipUrlTempModel.m
  23. 2 0
      Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.h
  24. 1 1
      Asteria/Fuction/UserCenter/Orders/View/ASOrderDetailsItemsCell.m
  25. 2 1
      Asteria/NetTools/ASUserNotifyStatic.h
  26. 4 3
      Asteria/ThirdPartService.m

+ 29 - 1
Asteria.xcodeproj/project.pbxproj

@@ -231,7 +231,9 @@
 		8810F5A22BFF448C00346FD4 /* ASMyCartNoDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5A12BFF448C00346FD4 /* ASMyCartNoDataView.m */; };
 		8810F5A82C01849C00346FD4 /* ASGoodsReviewFootCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5A72C01849C00346FD4 /* ASGoodsReviewFootCell.m */; };
 		8810F5AB2C045FD600346FD4 /* ToolStripePayment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5AA2C045FD600346FD4 /* ToolStripePayment.swift */; };
+		88484D262C4132AB007C3293 /* ASJumpHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 88484D252C4132AB007C3293 /* ASJumpHandler.m */; };
 		88516B6E2C12E51600F2E396 /* ASLoginBindingC.m in Sources */ = {isa = PBXBuildFile; fileRef = 88516B6D2C12E51600F2E396 /* ASLoginBindingC.m */; };
+		88C9F9202C3FC64400B47ADA /* ASPushOneSignalManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C9F91F2C3FC64400B47ADA /* ASPushOneSignalManager.m */; };
 		8C24ECE114420CDEE7B9B22B /* Pods_Asteria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54DCE8001991D89B696E7D44 /* Pods_Asteria.framework */; };
 		9A1247942A1B082300126226 /* Fuction_Tool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247932A1B082300126226 /* Fuction_Tool.m */; };
 		9A1247972A1B0A2800126226 /* AS_ForgotC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247962A1B0A2800126226 /* AS_ForgotC.m */; };
@@ -814,8 +816,12 @@
 		8810F5A72C01849C00346FD4 /* ASGoodsReviewFootCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASGoodsReviewFootCell.m; sourceTree = "<group>"; };
 		8810F5A92C045FD600346FD4 /* Asteria-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Asteria-Bridging-Header.h"; sourceTree = "<group>"; };
 		8810F5AA2C045FD600346FD4 /* ToolStripePayment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToolStripePayment.swift; sourceTree = "<group>"; };
+		88484D242C4132AB007C3293 /* ASJumpHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASJumpHandler.h; sourceTree = "<group>"; };
+		88484D252C4132AB007C3293 /* ASJumpHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASJumpHandler.m; sourceTree = "<group>"; };
 		88516B6C2C12E51600F2E396 /* ASLoginBindingC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLoginBindingC.h; sourceTree = "<group>"; };
 		88516B6D2C12E51600F2E396 /* ASLoginBindingC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASLoginBindingC.m; sourceTree = "<group>"; };
+		88C9F91E2C3FC64400B47ADA /* ASPushOneSignalManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASPushOneSignalManager.h; sourceTree = "<group>"; };
+		88C9F91F2C3FC64400B47ADA /* ASPushOneSignalManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASPushOneSignalManager.m; sourceTree = "<group>"; };
 		9A1247922A1B082300126226 /* Fuction_Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Fuction_Tool.h; sourceTree = "<group>"; };
 		9A1247932A1B082300126226 /* Fuction_Tool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Fuction_Tool.m; sourceTree = "<group>"; };
 		9A1247952A1B0A2800126226 /* AS_ForgotC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AS_ForgotC.h; sourceTree = "<group>"; };
@@ -2004,6 +2010,26 @@
 			path = Controller;
 			sourceTree = "<group>";
 		};
+		88C9F9212C3FC6E800B47ADA /* Manager */ = {
+			isa = PBXGroup;
+			children = (
+				812021122B14657D0026B8B5 /* UserManager */,
+				88C9F9222C3FC74100B47ADA /* NotificationManager */,
+			);
+			path = Manager;
+			sourceTree = "<group>";
+		};
+		88C9F9222C3FC74100B47ADA /* NotificationManager */ = {
+			isa = PBXGroup;
+			children = (
+				88C9F91E2C3FC64400B47ADA /* ASPushOneSignalManager.h */,
+				88C9F91F2C3FC64400B47ADA /* ASPushOneSignalManager.m */,
+				88484D242C4132AB007C3293 /* ASJumpHandler.h */,
+				88484D252C4132AB007C3293 /* ASJumpHandler.m */,
+			);
+			path = NotificationManager;
+			sourceTree = "<group>";
+		};
 		9A1247912A1B07F400126226 /* Tool */ = {
 			isa = PBXGroup;
 			children = (
@@ -2555,9 +2581,9 @@
 		9AD364CC2A05EBE800452C7A /* Fuction */ = {
 			isa = PBXGroup;
 			children = (
+				88C9F9212C3FC6E800B47ADA /* Manager */,
 				9A78E0112B6388F500CA4E32 /* Cart */,
 				8131A27D2B3687CA00A191BE /* Windows */,
-				812021122B14657D0026B8B5 /* UserManager */,
 				81DFA55A2A46C44800DA708B /* WebView */,
 				81717CAC2A3C453900648139 /* Category */,
 				81601FE32A2D938B00E4A8F1 /* Home */,
@@ -2965,6 +2991,7 @@
 				817244B029F3B2EE005FA9C9 /* main.m in Sources */,
 				8131A2872B36890200A191BE /* ASWindowManager.m in Sources */,
 				81717D202A3C4AE000648139 /* KWSearchSubTypeCell.m in Sources */,
+				88C9F9202C3FC64400B47ADA /* ASPushOneSignalManager.m in Sources */,
 				8810F5AB2C045FD600346FD4 /* ToolStripePayment.swift in Sources */,
 				9A3F5CAB2B3BBEAB00DDB6A7 /* GoodsDetailsPayV.m in Sources */,
 				81C796242A4FD63A003083B8 /* ASVipCouponsViewController.m in Sources */,
@@ -3019,6 +3046,7 @@
 				9ADA8A212B4E96C900BACDEA /* GoodWritUpImgV.m in Sources */,
 				9A3F5CB82B3BF90100DDB6A7 /* GoodsDetailsIntroduceV.m in Sources */,
 				8134C1BD2A1372D5006EB0EC /* ASUserCenterTableHeadView.m in Sources */,
+				88484D262C4132AB007C3293 /* ASJumpHandler.m in Sources */,
 				9AD346002A08D60F005CA070 /* ZFPresentTransition.m in Sources */,
 				81717D112A3C4AE000648139 /* KWSearchViewModel.m in Sources */,
 				9A337E3B2A04EE1A00D058A5 /* BViewController.m in Sources */,

+ 17 - 12
Asteria/AppDelegate.m

@@ -14,6 +14,8 @@
 
 #import <OneSignal/OneSignal.h>
 
+#import "ASPushOneSignalManager.h"
+
 @import Stripe;
 
 @interface AppDelegate ()<UNUserNotificationCenterDelegate>
@@ -184,20 +186,23 @@
 //    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMessage:) name:MobPushDidReceiveMessageNotification object:nil];
     */
     
+    //初始化OneSignal SDK
+    [ASOneSignalManager initOneSignalSDKWithPushConfig:launchOptions];
     
     
-    // Remove this method to stop OneSignal Debugging
-      [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE];
-      
-      // OneSignal initialization
-      [OneSignal initWithLaunchOptions:launchOptions];
-      [OneSignal setAppId:@"618fe580-bc97-4bf4-b2bb-5039f9dbbc82"];
-
-      // promptForPushNotifications will show the native iOS notification permission prompt.
-      // We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step 8)
-      [OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
-        NSLog(@"User accepted notifications: %d", accepted);
-      }];
+    
+//    // Remove this method to stop OneSignal Debugging
+//      [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE];
+//      
+//      // OneSignal initialization
+//      [OneSignal initWithLaunchOptions:launchOptions];
+//      [OneSignal setAppId:@"618fe580-bc97-4bf4-b2bb-5039f9dbbc82"];
+//
+//      // promptForPushNotifications will show the native iOS notification permission prompt.
+//      // We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step 8)
+//      [OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
+//        NSLog(@"User accepted notifications: %d", accepted);
+//      }];
     
     
       

+ 3 - 1
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -75,6 +75,8 @@
     if (!self.totalsM) {
         [self reqNet_Cart_cartsMineTotals];
     }
+    
+    NSLog(@"======%@======%@", [ASUserInfoManager shared].userInfo.Id, [ASUserInfoManager shared].userInfo.group_id);
 }
 
 - (void)initSubviews {
@@ -298,7 +300,7 @@
 
 - (void)updateData{
     
-    [self.topView setTopViewData:AS_String_NotNull(self.totalsM.items_qty) price:[NSString stringWithFormat:@"%@%@",AS_String_NotNull(self.totalsM.currency_symbol),AS_String_NotNull(self.totalsM.subtotal)]];
+    [self.topView setTopViewData:AS_String_NotNull(self.totalsM.items_qty) price:[NSString stringWithFormat:@"%@%.2f",AS_String_NotNull(self.totalsM.currency_symbol),[AS_String_NotNull(self.totalsM.subtotal) floatValue]]];
     
     [self.TableV.infodata removeAllObjects];
     self.TableV.infodata = [NSMutableArray arrayWithArray:self.totalsM.items];

+ 1 - 1
Asteria/Fuction/Cart/Cell/MyCartItemCell.m

@@ -172,7 +172,7 @@
 }
 #pragma mark - **************** tool ****************
 +(NSMutableAttributedString *)tool_changePriceAtr:(CartTotalsItemsM *)model{
-    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.price_incl_tax]];
+    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%.2f",model.currency_symbol,[model.price_incl_tax floatValue]]];
     [priceAtr addAttribute: NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#0B0B0B"] range:NSMakeRange(0, priceAtr.length)];
     [priceAtr addAttribute:NSFontAttributeName value:[UIFont fontWithName:Rob_Bold size:20] range:NSMakeRange(0, priceAtr.length)];
     [priceAtr appendAttributedString:[[NSAttributedString alloc]initWithString:@"  "]];

+ 1 - 1
Asteria/Fuction/Cart/Checkout/ASCheckoutGoodsItemCell.m

@@ -175,7 +175,7 @@
 }
 #pragma mark - **************** tool ****************
 +(NSMutableAttributedString *)tool_changePriceAtr:(CartTotalsItemsM *)model{
-    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.price_incl_tax]];
+    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%.2f",model.currency_symbol, [model.price_incl_tax floatValue]]];
     [priceAtr addAttribute: NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#0B0B0B"] range:NSMakeRange(0, priceAtr.length)];
     [priceAtr addAttribute:NSFontAttributeName value:[UIFont fontWithName:Rob_Bold size:20] range:NSMakeRange(0, priceAtr.length)];
     [priceAtr appendAttributedString:[[NSAttributedString alloc]initWithString:@"  "]];

+ 2 - 2
Asteria/Fuction/Category/vm/KWHisAndHotWordsViewModel.m

@@ -30,7 +30,7 @@ static NSString *localSearchList = @"localSearchList";
     
     __weak typeof(self) weakSelf = self;
     [ASNetTools.shared getWithPath:getLinkingKey param:@{@"q":key} success:^(id _Nonnull json) {
-        NSLog(@"------url:%@---json:%@------", getHotList, json);
+        NSLog(@"------url:%@---json:%@------", getLinkingKey, json);
         NSArray *arr = json;
         NSMutableArray *result = [NSMutableArray array];
         if ([arr isKindOfClass:[NSArray class]]) {
@@ -50,7 +50,7 @@ static NSString *localSearchList = @"localSearchList";
         self.aboutKeys = result;
         success();
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
-        NSLog(@"------url:%@---code:%@---msg:%@---", getHotList, code, msg);
+        NSLog(@"------url:%@---code:%@---msg:%@---", getLinkingKey, code, msg);
         self.aboutKeys = @[];
         success();
     }];

+ 8 - 0
Asteria/Fuction/Home/ASHomeViewController.m

@@ -39,6 +39,8 @@
     
     //切换币种之后通知首页数据刷新
     [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(getHomeListData) name:HomeDataUpdateByCurrency object:nil];
+    //网络变化后通知
+    [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(netGetRefresh) name:netStatusUpdate object:nil];
 
     
     __block typeof(self) wSelf = self;
@@ -51,6 +53,12 @@
     [self updateTopLinkData];
 }
 
+- (void)netGetRefresh {
+    if (!AS_Array_valid(self.vm.listData)) {
+        //请求数据
+        [self.tableV.mj_header beginRefreshing];
+    }
+}
 
 - (void)getTopLinkData {
     __weak typeof(self) weakSelf = self;

+ 3 - 0
Asteria/Fuction/Home/vm/ASProductListViewModel.m

@@ -83,6 +83,9 @@
     }
     
     [ASNetTools.shared getWithPath:getProductListUrl param:para success:^(id _Nonnull json) {
+        
+        NSLog(@"------url:%@----param----%@---json:%@------", getProductListUrl, para, json);
+        
         ASProductListCategoryModel *m = [ASProductListCategoryModel mj_objectWithKeyValues:json[@"category"]];
         self.cateModel = m;
         NSArray *arr = json[@"product"][@"productLists"];

+ 18 - 0
Asteria/Fuction/Manager/NotificationManager/ASJumpHandler.h

@@ -0,0 +1,18 @@
+//
+//  ASJumpHandler.h
+//  Asteria
+//
+//  Created by xingyu on 2024/7/12.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASJumpHandler : NSObject
+
++ (instancetype)shareInstance;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 24 - 0
Asteria/Fuction/Manager/NotificationManager/ASJumpHandler.m

@@ -0,0 +1,24 @@
+//
+//  ASJumpHandler.m
+//  Asteria
+//
+//  Created by xingyu on 2024/7/12.
+//
+
+#import "ASJumpHandler.h"
+
+@implementation ASJumpHandler
+
+static  ASJumpHandler *jumpHandler = nil;
+
++ (instancetype)shareInstance{
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        jumpHandler = [[ASJumpHandler alloc] init];
+    });
+    return jumpHandler;
+}
+
+
+
+@end

+ 30 - 0
Asteria/Fuction/Manager/NotificationManager/ASPushOneSignalManager.h

@@ -0,0 +1,30 @@
+//
+//  ASPushOneSignalManager.h
+//  Asteria
+//
+//  Created by xingyu on 2024/7/11.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#define ASOneSignalManager [ASPushOneSignalManager shared]
+
+
+@interface ASPushOneSignalManager : NSObject
+
++ (instancetype)shared;
+
+//初始化OneSignal  SDK
+- (void)initOneSignalSDKWithPushConfig:(NSDictionary *)launchOptions;
+
+//处理推送消息
+- (void)handlePushAction:(NSDictionary *)payLoad;
+
+//设置用户推送标签  userInfo 为nil 默认取本地
+- (void)setPushApnsTagWithUserInfo:(ASUserModel *)userInfo;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 125 - 0
Asteria/Fuction/Manager/NotificationManager/ASPushOneSignalManager.m

@@ -0,0 +1,125 @@
+//
+//  ASPushOneSignalManager.m
+//  Asteria
+//
+//  Created by xingyu on 2024/7/11.
+//
+
+#import "ASPushOneSignalManager.h"
+#import <OneSignal/OneSignal.h>
+
+@interface ASPushOneSignalManager()<UNUserNotificationCenterDelegate>
+
+@end
+
+@implementation ASPushOneSignalManager
+
++ (instancetype)shared {
+    static id sharedInstance = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        sharedInstance = [[self alloc] init];
+    });
+    return sharedInstance;
+}
+
+- (void)initOneSignalSDKWithPushConfig:(NSDictionary *)launchOptions {
+    
+    [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE];
+    
+    // OneSignal initialization
+    [OneSignal initWithLaunchOptions:launchOptions];
+    [OneSignal setAppId:@"618fe580-bc97-4bf4-b2bb-5039f9dbbc82"];
+
+    // promptForPushNotifications will show the native iOS notification permission prompt.
+    // We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step 8)
+    [OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
+      NSLog(@"User accepted notifications: %d", accepted);
+    }];
+    
+    
+//    [UNUserNotificationCenter currentNotificationCenter].delegate = self;
+//    [self pushAuthRequest];
+    
+}
+
+- (void)handlePushAction:(NSDictionary *)payLoad {
+    
+    NSDictionary *customData = payLoad[@"custom"][@"a"];
+    NSString *title = customData[@"title"];
+    NSString *push_para = customData[@"push_para"];
+    NSString *message_id = customData[@"message_id"];
+    NSNumber *push_type = customData[@"push_type"];
+    if (!push_type) {
+        return;
+    }
+    NSInteger type = push_type.integerValue;
+    
+    
+//    [[KWPushMessageHandler shareInstance] handleMessage:title messageId:message_id pushPara:push_para pushType:type];
+    
+    
+}
+
+#pragma mark ---- 设置用户推送标签 ----
+- (void)setPushApnsTagWithUserInfo:(ASUserModel *)userInfo {
+    
+    if ([ASUserInfoManager shared].isLogin) {
+        if (!userInfo) {
+            userInfo = [[ASUserInfoManager shared] userInfo];
+        }
+        
+        if (!userInfo.Id.isEmpty) {
+            NSInteger sufix = userInfo.Id.integerValue%10;
+            [OneSignal sendTag:@"SufixUid" value:[NSString stringWithFormat:@"%ld", sufix]];
+        }
+        if (userInfo.group_id.intValue == 5) {
+            [OneSignal sendTag:@"IsOrdered" value:@"true"];
+#if (DEBUG)
+            [OneSignal sendTag:@"testOrderd" value:@"true"];
+#endif
+        } else {
+#if (DEBUG)
+            [OneSignal deleteTag:@"testOrderd"];
+#endif
+            [OneSignal deleteTag:@"IsOrdered"];
+        }
+        
+    } else {
+        [OneSignal sendTag:@"SufixUid" value:@"-"];
+    }
+    
+}
+
+
+#pragma mark ---- UNUserNotificationCenterDelegate ----
+- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
+    // 用户点击了通知
+        // 通过response参数处理用户的点击事件
+    completionHandler();
+    NSDictionary *payLoad = response.notification.request.content.userInfo;
+    [self handlePushAction:payLoad];
+}
+
+
+- (void)pushAuthRequest {
+    // 申请权限1
+    [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
+        if (settings.authorizationStatus == UNAuthorizationStatusNotDetermined) {
+            UNAuthorizationOptions authOptions =
+            UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
+            [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions
+                                                                                completionHandler:^(BOOL granted, NSError *_Nullable error){
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [[UIApplication sharedApplication] registerForRemoteNotifications]; //注册获得device Token
+                });
+            }];
+            
+        }
+    }];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[UIApplication sharedApplication] registerForRemoteNotifications]; //注册获得device Token
+    });
+}
+
+@end

Asteria/Fuction/UserManager/currency/ASCurrencyManager.h → Asteria/Fuction/Manager/UserManager/currency/ASCurrencyManager.h


Asteria/Fuction/UserManager/currency/ASCurrencyManager.m → Asteria/Fuction/Manager/UserManager/currency/ASCurrencyManager.m


Asteria/Fuction/UserManager/info/ASUserInfoManager.h → Asteria/Fuction/Manager/UserManager/info/ASUserInfoManager.h


Asteria/Fuction/UserManager/info/ASUserInfoManager.m → Asteria/Fuction/Manager/UserManager/info/ASUserInfoManager.m


Asteria/Fuction/UserManager/info/ASUserModel.h → Asteria/Fuction/Manager/UserManager/info/ASUserModel.h


Asteria/Fuction/UserManager/info/ASUserModel.m → Asteria/Fuction/Manager/UserManager/info/ASUserModel.m


Asteria/Fuction/UserManager/info/ASVipModel.h → Asteria/Fuction/Manager/UserManager/info/ASVipModel.h


Asteria/Fuction/UserManager/info/ASVipModel.m → Asteria/Fuction/Manager/UserManager/info/ASVipModel.m


Asteria/Fuction/UserManager/info/ASVipUrlTempModel.h → Asteria/Fuction/Manager/UserManager/info/ASVipUrlTempModel.h


Asteria/Fuction/UserManager/info/ASVipUrlTempModel.m → Asteria/Fuction/Manager/UserManager/info/ASVipUrlTempModel.m


+ 2 - 0
Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.h

@@ -47,6 +47,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *currency_symbol;
 @property (nonatomic, copy) NSString *is_gift;
 
+@property (nonatomic, copy) NSString *original_price;//订单详情原价
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 1
Asteria/Fuction/UserCenter/Orders/View/ASOrderDetailsItemsCell.m

@@ -126,7 +126,7 @@
     _countLab.text = [NSString stringWithFormat:@"X%@", AS_String_NotNull(_itemModel.qty_ordered)];
     _realPriceLab.text = [NSString stringWithFormat:@"%@%.2f", AS_String_NotNull(_itemModel.currency_symbol), [AS_String_NotNull(_itemModel.price) floatValue]];
     
-    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%.2f",AS_String_NotNull(_itemModel.currency_symbol),  [AS_String_NotNull(_itemModel.price_incl_tax) floatValue]]];
+    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%.2f",AS_String_NotNull(_itemModel.currency_symbol),  [AS_String_NotNull(_itemModel.original_price) floatValue]]];
     [priceAtr addAttribute:NSStrikethroughStyleAttributeName
                     value:[NSNumber numberWithInteger:NSUnderlineStyleSingle]
                     range:NSMakeRange(0, priceAtr.length)];

+ 2 - 1
Asteria/NetTools/ASUserNotifyStatic.h

@@ -8,7 +8,8 @@
 #ifndef ASUserNotifyStatic_h
 #define ASUserNotifyStatic_h
 
-
+//网络状态更新通知
+#define netStatusUpdate @"netStatusUpdate"
 
 /// 保存用户选择的货币
 #define UserLocalCur @"UserLocalCur"

+ 4 - 3
Asteria/ThirdPartService.m

@@ -56,7 +56,7 @@
     Reachability* curReach = [note object];
     if ([curReach isKindOfClass:[Reachability class]]) {
         NSParameterAssert([curReach isKindOfClass: [Reachability class]]);
-//        [self updateInterfaceWithReachability: curReach];
+        [self updateInterfaceWithReachability: curReach];
     } else {
         UIViewController *topVc = topViewController();
         [topVc.view makeToast:@"Network status has been switched."];
@@ -66,6 +66,7 @@
 - (void)updateInterfaceWithReachability:(Reachability *)reachability {
     NetworkStatus netStatus = [reachability currentReachabilityStatus];
     UIViewController *topVc = topViewController();
+    [NSNotificationCenter.defaultCenter postNotificationName:netStatusUpdate object:nil];
     switch (netStatus) {
         case NotReachable:
             NSLog(@"====当前网络状态不可达=======");
@@ -73,11 +74,11 @@
             break;
         case ReachableViaWiFi:
             NSLog(@"====当前网络状态为Wifi=======");
-            [topVc.view makeToast:@"The current network status is WiFi."];
+//            [topVc.view makeToast:@"The current network status is WiFi."];
             break;
         case ReachableViaWWAN:
             NSLog(@"====当前网络状态为蜂窝网络=======");
-            [topVc.view makeToast:@"The current status is cellular network."];
+//            [topVc.view makeToast:@"The current status is cellular network."];
             break;
     }
 }