Browse Source

接入支付宝支付

hjx 1 year ago
parent
commit
bccd79a305
37 changed files with 770 additions and 74 deletions
  1. 2 0
      TOKTOK/Podfile
  2. 18 0
      TOKTOK/TOKTOK.xcodeproj/project.pbxproj
  3. 1 1
      TOKTOK/TOKTOK/BeerCentre/StoreListView/XSTTStoreListViewController.m
  4. 40 0
      TOKTOK/TOKTOK/Home/BlindBox/Pay/XSTTBlindBoxPayViewController.m
  5. 1 1
      TOKTOK/TOKTOK/Home/HomeView/XSTTHomeViewController.m
  6. 15 2
      TOKTOK/TOKTOK/Info.plist
  7. 1 1
      TOKTOK/TOKTOK/Mine/Address/EditAddress/XSTTEditAddressViewController.m
  8. 4 0
      TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeTableViewController.h
  9. 37 3
      TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeTableViewController.m
  10. 5 0
      TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeViewController.h
  11. 29 11
      TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeViewController.m
  12. 41 0
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsModel.h
  13. 37 0
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsModel.m
  14. 2 1
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewCell.h
  15. 52 13
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewCell.m
  16. 3 0
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewController.h
  17. 12 3
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewController.m
  18. 3 0
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsViewController.h
  19. 60 6
      TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsViewController.m
  20. 33 0
      TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListModel.h
  21. 20 0
      TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListModel.m
  22. 2 1
      TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewCell.h
  23. 29 6
      TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewCell.m
  24. 102 9
      TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewController.m
  25. 3 3
      TOKTOK/TOKTOK/Public/Category/View/UIView+XSTTDefault.m
  26. 1 1
      TOKTOK/TOKTOK/Public/Controller/XSTTHtmlViewController.m
  27. 5 0
      TOKTOK/TOKTOK/Public/Manager/NotificationDelegate/XSTTNotificationDelegate.h
  28. 19 0
      TOKTOK/TOKTOK/Public/Manager/XSTTPayManager.h
  29. 122 0
      TOKTOK/TOKTOK/Public/Manager/XSTTPayManager.m
  30. 1 1
      TOKTOK/TOKTOK/Public/Manager/XSTTRouteManager.h
  31. 11 11
      TOKTOK/TOKTOK/Public/Manager/XSTTRouteManager.m
  32. 2 0
      TOKTOK/TOKTOK/Public/Profile/XSTTConstantProfile.h
  33. 2 0
      TOKTOK/TOKTOK/Public/Profile/XSTTConstantProfile.m
  34. 28 0
      TOKTOK/TOKTOK/Public/Profile/XSTTEnumerationProfile.h
  35. 4 0
      TOKTOK/TOKTOK/Public/Profile/XSTTURLApiProfile.h
  36. 4 0
      TOKTOK/TOKTOK/Public/Profile/XSTTURLApiProfile.m
  37. 19 0
      TOKTOK/TOKTOK/TOKTOK/UIResponder+XSTTDelegate.m

+ 2 - 0
TOKTOK/Podfile

@@ -23,6 +23,8 @@ target 'TOKTOK' do
     pod 'lottie-ios', '2.5.3'
     #闪验
     pod 'CL_ShanYanSDK'
+    #支付宝
+    pod 'AlipaySDK-iOS'
     
     #穿山甲
 #    pod 'Ads-CN'

+ 18 - 0
TOKTOK/TOKTOK.xcodeproj/project.pbxproj

@@ -76,6 +76,8 @@
 		84685AED269C3FBF002AA521 /* XSTTBeerCentreFiltrateTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84685AEC269C3FBF002AA521 /* XSTTBeerCentreFiltrateTableViewController.m */; };
 		84685AEF269D723E002AA521 /* BeerCentre.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84685AEE269D723E002AA521 /* BeerCentre.xcassets */; };
 		8472450127152CE400CDA5DE /* XSTTBeerCentreFiltrateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8472450027152CE400CDA5DE /* XSTTBeerCentreFiltrateModel.m */; };
+		8476A1772A9DE0F20043DBA3 /* XSTTOrderListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8476A1762A9DE0F20043DBA3 /* XSTTOrderListModel.m */; };
+		8476A17A2A9EDECA0043DBA3 /* XSTTOrderDetailsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8476A1792A9EDECA0043DBA3 /* XSTTOrderDetailsModel.m */; };
 		8479805E2A274A250099D03E /* XSTTPersonalPageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8479805D2A274A250099D03E /* XSTTPersonalPageModel.m */; };
 		847C877F2694387F00BEBD03 /* XSTTTabBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 847C877E2694387F00BEBD03 /* XSTTTabBarView.m */; };
 		847C8788269441C300BEBD03 /* XSTTHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 847C8787269441C300BEBD03 /* XSTTHomeViewController.m */; };
@@ -133,6 +135,7 @@
 		84B9184829F23C61003CF0A0 /* XSTTBlindBoxDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B9184729F23C61003CF0A0 /* XSTTBlindBoxDetailsViewController.m */; };
 		84B9184B29F27579003CF0A0 /* XSTTBlindBoxDetailsGoodsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B9184A29F27579003CF0A0 /* XSTTBlindBoxDetailsGoodsTableViewController.m */; };
 		84B9184E29F28858003CF0A0 /* XSTTBlindBoxDetailsTipsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B9184D29F28858003CF0A0 /* XSTTBlindBoxDetailsTipsViewController.m */; };
+		84B965712AC4278800306E03 /* XSTTPayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B965702AC4278800306E03 /* XSTTPayManager.m */; };
 		84CADD132A1CA7F1004B0600 /* t_xstt_city_data.db in Resources */ = {isa = PBXBuildFile; fileRef = 84CADD122A1CA7F1004B0600 /* t_xstt_city_data.db */; };
 		84CADD162A1DEEF9004B0600 /* XSTTBlindBoxToOrderModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CADD152A1DEEF9004B0600 /* XSTTBlindBoxToOrderModel.m */; };
 		84CADD192A1F0DD5004B0600 /* XSTTBlindBoxDetailsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CADD182A1F0DD5004B0600 /* XSTTBlindBoxDetailsModel.m */; };
@@ -315,6 +318,10 @@
 		84685AEE269D723E002AA521 /* BeerCentre.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = BeerCentre.xcassets; sourceTree = "<group>"; };
 		847244FF27152CE400CDA5DE /* XSTTBeerCentreFiltrateModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTBeerCentreFiltrateModel.h; sourceTree = "<group>"; };
 		8472450027152CE400CDA5DE /* XSTTBeerCentreFiltrateModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTBeerCentreFiltrateModel.m; sourceTree = "<group>"; };
+		8476A1752A9DE0F20043DBA3 /* XSTTOrderListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTOrderListModel.h; sourceTree = "<group>"; };
+		8476A1762A9DE0F20043DBA3 /* XSTTOrderListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTOrderListModel.m; sourceTree = "<group>"; };
+		8476A1782A9EDECA0043DBA3 /* XSTTOrderDetailsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTOrderDetailsModel.h; sourceTree = "<group>"; };
+		8476A1792A9EDECA0043DBA3 /* XSTTOrderDetailsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTOrderDetailsModel.m; sourceTree = "<group>"; };
 		8479805C2A274A250099D03E /* XSTTPersonalPageModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTPersonalPageModel.h; sourceTree = "<group>"; };
 		8479805D2A274A250099D03E /* XSTTPersonalPageModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTPersonalPageModel.m; sourceTree = "<group>"; };
 		847C877D2694387F00BEBD03 /* XSTTTabBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTTabBarView.h; sourceTree = "<group>"; };
@@ -420,6 +427,8 @@
 		84B9184A29F27579003CF0A0 /* XSTTBlindBoxDetailsGoodsTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTBlindBoxDetailsGoodsTableViewController.m; sourceTree = "<group>"; };
 		84B9184C29F28858003CF0A0 /* XSTTBlindBoxDetailsTipsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTBlindBoxDetailsTipsViewController.h; sourceTree = "<group>"; };
 		84B9184D29F28858003CF0A0 /* XSTTBlindBoxDetailsTipsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTBlindBoxDetailsTipsViewController.m; sourceTree = "<group>"; };
+		84B9656F2AC4278800306E03 /* XSTTPayManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTPayManager.h; sourceTree = "<group>"; };
+		84B965702AC4278800306E03 /* XSTTPayManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTPayManager.m; sourceTree = "<group>"; };
 		84CADD122A1CA7F1004B0600 /* t_xstt_city_data.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = t_xstt_city_data.db; sourceTree = "<group>"; };
 		84CADD142A1DEEF9004B0600 /* XSTTBlindBoxToOrderModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSTTBlindBoxToOrderModel.h; sourceTree = "<group>"; };
 		84CADD152A1DEEF9004B0600 /* XSTTBlindBoxToOrderModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSTTBlindBoxToOrderModel.m; sourceTree = "<group>"; };
@@ -733,6 +742,8 @@
 				84287A8729E53DC60037FD51 /* XSTTOrderListTableViewController.m */,
 				84287A8929E548650037FD51 /* XSTTOrderListTableViewCell.h */,
 				84287A8A29E548650037FD51 /* XSTTOrderListTableViewCell.m */,
+				8476A1752A9DE0F20043DBA3 /* XSTTOrderListModel.h */,
+				8476A1762A9DE0F20043DBA3 /* XSTTOrderListModel.m */,
 			);
 			path = OrderList;
 			sourceTree = "<group>";
@@ -746,6 +757,8 @@
 				84287A9229E68B360037FD51 /* XSTTOrderDetailsTableViewController.m */,
 				84287A9429E699450037FD51 /* XSTTOrderDetailsTableViewCell.h */,
 				84287A9529E699450037FD51 /* XSTTOrderDetailsTableViewCell.m */,
+				8476A1782A9EDECA0043DBA3 /* XSTTOrderDetailsModel.h */,
+				8476A1792A9EDECA0043DBA3 /* XSTTOrderDetailsModel.m */,
 			);
 			path = OrderDetails;
 			sourceTree = "<group>";
@@ -1137,6 +1150,8 @@
 				84D748B52683359900AD7C92 /* XSTTGeneralManager.m */,
 				84D748D726841F5300AD7C92 /* XSTTNetworkManager.h */,
 				84D748D826841F5300AD7C92 /* XSTTNetworkManager.m */,
+				84B9656F2AC4278800306E03 /* XSTTPayManager.h */,
+				84B965702AC4278800306E03 /* XSTTPayManager.m */,
 				84D7492226857A5300AD7C92 /* XSTTVerificationCodeManager.h */,
 				84D7492326857A5300AD7C92 /* XSTTVerificationCodeManager.m */,
 				84D749282689B33A00AD7C92 /* XSTTRouteManager.h */,
@@ -1553,8 +1568,10 @@
 				849C70BB28C891A500BE760C /* XSTTPhotoAlbumBottomChoseViewController.m in Sources */,
 				84685AE0269C1F7D002AA521 /* XSTTBreweryListViewController.m in Sources */,
 				8457C6A9296E5CD2004D7719 /* XSTTSafeCentreViewController.m in Sources */,
+				8476A1772A9DE0F20043DBA3 /* XSTTOrderListModel.m in Sources */,
 				84D748D62683400100AD7C92 /* UIScrollView+XSTTAutoLoadData.m in Sources */,
 				84287A9329E68B360037FD51 /* XSTTOrderDetailsTableViewController.m in Sources */,
+				8476A17A2A9EDECA0043DBA3 /* XSTTOrderDetailsModel.m in Sources */,
 				84D3FCDD268C45DE00D61979 /* UIControl+XSTTButton.m in Sources */,
 				84D748FD268458E700AD7C92 /* XSTTLoginHomeViewController.m in Sources */,
 				849C708328C5D2C500BE760C /* XSTTSocialCircleCommentTableViewController.m in Sources */,
@@ -1624,6 +1641,7 @@
 				849C707728C3308C00BE760C /* XSTTSocialCircleTableViewCell.m in Sources */,
 				84DB5B5F28C9D25C00DBFBBC /* XSTTTextField.m in Sources */,
 				847D480E2942DC5C00E039F1 /* AppDelegate+XSTTPopup.m in Sources */,
+				84B965712AC4278800306E03 /* XSTTPayManager.m in Sources */,
 				849C70D228C9CB0100BE760C /* XSTTPublishSocialCircleContentViewController.m in Sources */,
 				849C70D328C9CB0100BE760C /* XSTTPublishSocialCircleChooseTagViewController.m in Sources */,
 				840B9E7C28F15D5B0032B0D2 /* XSTTOSSManager.m in Sources */,

+ 1 - 1
TOKTOK/TOKTOK/BeerCentre/StoreListView/XSTTStoreListViewController.m

@@ -203,7 +203,7 @@
 #pragma mark - Action
 #pragma mark - XSTTBannerViewPorotocol
 - (void)bannerView:(XSTTBannerView *)bannerView choseIndex:(NSInteger)choseIndex currentImage:(nullable UIImage *)currentImage {
-    if (index >= _bannerList.count) return;
+    if (choseIndex >= _bannerList.count) return;
     [XSTTRouteManager pageJumpWithData:_bannerList[choseIndex].xstt_jumpUrl completion:^{
     }];
 }

+ 40 - 0
TOKTOK/TOKTOK/Home/BlindBox/Pay/XSTTBlindBoxPayViewController.m

@@ -17,6 +17,7 @@
 #import "UIViewController+XSTTNetworkManager.h"
 #import "XSTTEnumerationProfile.h"
 #import "XSTTBusinessManager.h"
+#import "XSTTPayManager.h"
 
 #define xstt_blindBoxPayChooseButtonTag 3000
 #define xstt_blindBoxPayChooseIconTag 4000
@@ -40,6 +41,8 @@
     UILabel *_price;
     UILabel *_cycle;
     XSTTAddressModel *_addressModel;
+    
+    XSTTPayManager *_payManager;
 }
 
 @end
@@ -53,6 +56,7 @@
 }
 
 - (void)initData {
+    _payManager = XSTTPayManager.new;
     _choosePay = -1;
     if (_xstt_data.xstt_priceList.count <= 0) {
         [self.navigationController popViewControllerAnimated:true];
@@ -138,12 +142,48 @@
         @strongify(self)
         return @{@"userAddressId": self->_addressModel.xstt_userAddressId, @"outId": self->_priceModel.xstt_priceId, @"num": @"1", @"type": @(XSTTOrderTypeBlindBox), @"deviceNo": xstt_deviceUUID()};
     } success:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        @strongify(self)
+        [self createOrderSuccess:data[@"data"]];
         return @"";
     } failure:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
         return @"创建订单失败";
     }];
 }
 
+- (void)createOrderSuccess:(id)orderId {
+    if (_choosePay == 0) {
+        [self wechatPay:orderId ];
+    } else if (_choosePay == 1) {
+        [self createAlipayOrder:orderId ];
+    }
+}
+
+- (void)createAlipayOrder:(id)orderId  {
+    @weakify(self)
+    [self networkUseMethod:XSTTNetworkMethodPOST loadingTips:@"正在下单" isLogin:true signKey:XSTTNetworkSignKeyApp url:xstt_appUrl(XSTTURLAlipay) urlParameters:nil parameters:^NSDictionary * _Nonnull{
+        return @{@"orderId": orderId};
+    } success:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        @strongify(self)
+        [self createAlipayOrderSuccess:data[@"data"]];
+        return nil;
+    } failure:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        return @"下单失败";
+    }];
+}
+
+- (void)createAlipayOrderSuccess:(id)data {
+    @weakify(self)
+    [_payManager alipayWithSign:data view:self.view seccessfulCompletion:^{
+        
+    } failureCompletion:^{
+        
+    }];
+}
+
+- (void)wechatPay:(id)orderId  {
+    debugLog(@"微信支付");
+}
+
 #pragma mark - UIScrollViewDelegate
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
     CGFloat contentOffset = scrollView.contentOffset.y;

+ 1 - 1
TOKTOK/TOKTOK/Home/HomeView/XSTTHomeViewController.m

@@ -79,7 +79,7 @@
 - (void)featureAction:(UIButton *)sender {
     switch (sender.tag - xstt_homeFeatureButtonTag) {
         case 0:
-            [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClassName:@"" property:@{} tabBarType:XSTTTabBarTypeBeerCentre]];
+            [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:@{} tabBarType:XSTTTabBarTypeBeerCentre]];
             break;
         case 1:
             [self.navigationController pushViewController:XSTTStoreListViewController.new animated:true];

+ 15 - 2
TOKTOK/TOKTOK/Info.plist

@@ -34,6 +34,14 @@
 				<string>wxb94355e8e06811c8</string>
 			</array>
 		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>XSTokTok</string>
+			</array>
+		</dict>
 	</array>
 	<key>CFBundleVersion</key>
 	<string>$(CURRENT_PROJECT_VERSION)</string>
@@ -41,7 +49,8 @@
 	<false/>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
-		<string>weixinULAPI</string>
+		<string>weixinURLParamsAPI</string>
+        <string>weixinULAPI</string>
 		<string>wechat</string>
 		<string>weixin</string>
 		<string>sinaweibohd</string>
@@ -90,6 +99,10 @@
 		<string>timopensdkdataline</string>
 		<string>wtlogintimV1</string>
 		<string>timapiV1</string>
+        <string>alipay</string>
+        <string>alipayshare</string>
+        <string>cydia</string>
+        <string>safepay</string>
 	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
@@ -117,7 +130,7 @@
 		<string>SF-Pro-Text-Regular.otf</string>
 		<string>SF-Pro-Text-Medium.otf</string>
 		<string>SF-Pro-Text-RegularItalic.otf</string>
-        <string>AlipayNumber-Regular.ttf</string>
+		<string>AlipayNumber-Regular.ttf</string>
 	</array>
 	<key>UIApplicationSceneManifest</key>
 	<dict>

+ 1 - 1
TOKTOK/TOKTOK/Mine/Address/EditAddress/XSTTEditAddressViewController.m

@@ -76,7 +76,7 @@
     @weakify(self)
     [vc setConfirmButtonTitle:@"确认" titleColor:nil action:^{
         @strongify(self)
-        [self deleteAddressWithId:_xstt_addressId];
+        [self deleteAddressWithId:self->_xstt_addressId];
     }];
     [vc setCancelButtonTitle:@"取消" titleColor:nil action:^{
         

+ 4 - 0
TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeTableViewController.h

@@ -6,11 +6,15 @@
 //
 
 #import "XSTTTableViewController.h"
+@class XSTTOrderListInfoModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderDetailsChooseTimeTableViewController : XSTTTableViewController
 
+@property (nonatomic, strong) NSArray<XSTTOrderListInfoModel *> *xstt_dataArray;
+@property (nonatomic, strong) void (^xstt_finishChose)(NSString *bbosId);
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 37 - 3
TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeTableViewController.m

@@ -7,6 +7,7 @@
 
 #import "XSTTOrderDetailsChooseTimeTableViewController.h"
 #import "XSTTUIGeneralHeader.h"
+#import "XSTTOrderListModel.h"
 
 @interface XSTTOrderDetailsChooseTimeTableViewController ()
 
@@ -73,17 +74,50 @@ static NSString * const reuseIdentifier = @"XSTTOrderDetailsChooseTimeTableView"
     }
     UILabel *cycle = [cell.contentView viewWithTag:4000];
     UILabel *status = [cell.contentView viewWithTag:4001];
-    cycle.text = @"2023040157期";
-    status.text = @"已完成";
+    cycle.text = [NSString stringWithFormat:@"%@期", _xstt_dataArray[indexPath.row].xstt_month];
+    switch (_xstt_dataArray[indexPath.row].xstt_status.integerValue) {
+        case XSTTGoodsStatusFinish:
+            status.text = @"已完成";
+            status.textColor = xstt_000000_color(0.6);
+            break;
+        case XSTTGoodsStatusRefunded:
+            status.text = @"已退款";
+            status.textColor = xstt_000000_color(0.6);
+            break;
+        case XSTTGoodsStatusNotStarted:
+            status.text = @"待开放";
+            status.textColor = xstt_FF5700_color();
+            break;
+        case XSTTGoodsStatusInProgress:
+            status.text = @"认购中";
+            status.textColor = xstt_FF5700_color();
+            break;
+        case XSTTGoodsStatusWaitForTheDelivery:
+            status.text = @"待发货";
+            status.textColor = xstt_FF5700_color();
+            break;
+        case XSTTGoodsStatusDelivered:
+            status.text = @"已发货";
+            status.textColor = xstt_FF5700_color();
+            break;
+            
+        default:
+            status.text = @"异常";
+            status.textColor = xstt_000000_color(0.6);
+            break;
+    }
     return cell;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 10;
+    return _xstt_dataArray.count;
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     [tableView deselectRowAtIndexPath:indexPath animated:false];
+    if (_xstt_finishChose) {
+        _xstt_finishChose(_xstt_dataArray[indexPath.row].xstt_bbosId);
+    }
 }
 
 #pragma mark - UI

+ 5 - 0
TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeViewController.h

@@ -6,11 +6,16 @@
 //
 
 #import "XSTTPopupViewController.h"
+@class XSTTOrderListInfoModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderDetailsChooseTimeViewController : XSTTPopupViewController
 
+@property (nonatomic, strong) NSArray<XSTTOrderListInfoModel *> *xstt_dataArray;
+@property (nonatomic, strong) NSString *xstt_name;
+@property (nonatomic, strong) void (^xstt_finishChose)(NSString *bbosId);
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 29 - 11
TOKTOK/TOKTOK/Mine/Order/ChooseTime/XSTTOrderDetailsChooseTimeViewController.m

@@ -12,6 +12,7 @@
 
 @interface XSTTOrderDetailsChooseTimeViewController () {
     JXHCornerView *_contentView;
+    NSString *_bbosId;
 }
 
 @end
@@ -40,6 +41,10 @@
         @weakify(self)
         [self dismissViewControllerAnimated:false completion:^{
             @strongify(self)
+            if (self->_bbosId && self->_xstt_finishChose) {
+                self->_xstt_finishChose(self->_bbosId);
+            }
+            
         }];
     }];
 }
@@ -71,6 +76,13 @@
 
 - (void)createTableVC {
     XSTTOrderDetailsChooseTimeTableViewController *vc = XSTTOrderDetailsChooseTimeTableViewController.new;
+    vc.xstt_dataArray = _xstt_dataArray;
+    @weakify(self)
+    vc.xstt_finishChose = ^(NSString * _Nonnull bbosId) {
+        @strongify(self)
+        self->_bbosId = bbosId;
+        [self dismissAction];
+    };
     [self addChildViewController:vc];
     [_contentView addSubview:vc.tableView];
     [vc.tableView makeConstraints:^(JXHConstraintMaker *make) {
@@ -84,8 +96,14 @@
     [_contentView setCornerWithRadius:16 position:JXHCornerPositionMake(true, true, false, false) backgroundColor:xstt_FFFFFF_color(1.f)];
     [self.view addSubview:_contentView];
         
-    [_contentView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(emptyAction)]];
-    [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissAction)]];
+    
+    UIView *touchView = UIView.new;
+    [self.view addSubview:touchView];
+    [touchView makeConstraints:^(JXHConstraintMaker *make) {
+        make.top.and.leading.and.trailing.equalTo(0);
+        make.bottom.equalTo(self->_contentView.top);
+    }];
+    [touchView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissAction)]];
     [_contentView makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.and.trailing.equalTo(0);
         make.top.equalTo(self.view.bottom);
@@ -113,21 +131,21 @@
         make.size.equalTo(64);
     }];
     
-    UILabel *name = [UILabel convenienceWithFont:xstt_mediumFont(17) text:@"入门精酿·盲盒订制" textColor:xstt_000000_color(0.87)];
+    UILabel *name = [UILabel convenienceWithFont:xstt_mediumFont(17) text:_xstt_name textColor:xstt_000000_color(0.87)];
     [_contentView addSubview:name];
     [name makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.equalTo(20);
         make.top.equalTo(82);
     }];
     
-    UIButton *refundButton = [UIButton convenienceWithTarget:self action:@selector(refundAction)];
-    [refundButton setStatusType:XSTTButtonStatusTypeLineBorder font:xstt_font(12) size:(CGSize){72, 28} corner:-1 calculateLabel:nil];
-    [refundButton setTitle:@"申请退款" titleColor:xstt_000000_color(0.6) state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
-    [_contentView addSubview:refundButton];
-    [refundButton makeConstraints:^(JXHConstraintMaker *make) {
-        make.trailing.equalTo(-20);
-        make.centerY.equalTo(name);
-    }];
+//    UIButton *refundButton = [UIButton convenienceWithTarget:self action:@selector(refundAction)];
+//    [refundButton setStatusType:XSTTButtonStatusTypeLineBorder font:xstt_font(12) size:(CGSize){72, 28} corner:-1 calculateLabel:nil];
+//    [refundButton setTitle:@"申请退款" titleColor:xstt_000000_color(0.6) state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+//    [_contentView addSubview:refundButton];
+//    [refundButton makeConstraints:^(JXHConstraintMaker *make) {
+//        make.trailing.equalTo(-20);
+//        make.centerY.equalTo(name);
+//    }];
 }
 
 @end

+ 41 - 0
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsModel.h

@@ -0,0 +1,41 @@
+//
+//  XSTTOrderDetailsModel.h
+//  TOKTOK
+//
+//  Created by shanp on 2023/8/30.
+//
+
+#import "XSTTBaseNetworkModel.h"
+
+typedef NS_ENUM(NSUInteger, XSTTOrderDetailsNodeActionType) {
+    XSTTOrderDetailsNodeActionTypeNone,
+    XSTTOrderDetailsNodeActionTypeAddress = 1001,
+    XSTTOrderDetailsNodeActionTypeExpressNumber = 2001,
+    XSTTOrderDetailsNodeActionTypeHighlight = 3001
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface XSTTOrderDetailsNodeModel : XSTTBaseNetworkModel
+
+@property (nonatomic, strong) NSString *xstt_nodeName;
+@property (nonatomic, strong) NSString *xstt_nodeTime;
+@property (nonatomic, strong) NSString *xstt_nodeDes;
+@property (nonatomic, strong) NSString *xstt_nodeAction;
+@property (nonatomic, strong) NSString *xstt_busiData;
+@property (nonatomic, strong) NSString *xstt_status;
+@property (nonatomic, strong) NSString *xstta_showTime;
+
+@end
+
+@interface XSTTOrderDetailsModel : XSTTBaseNetworkModel
+
+@property (nonatomic, strong) NSString *xstt_bbosId;
+@property (nonatomic, strong) NSString *xstt_boxName;
+@property (nonatomic, strong) NSString *xstt_month;
+@property (nonatomic, strong) NSString *xstt_cutOffTime;
+@property (nonatomic, strong) NSArray<XSTTOrderDetailsNodeModel *> *xstt_nodeList;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 37 - 0
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsModel.m

@@ -0,0 +1,37 @@
+//
+//  XSTTOrderDetailsModel.m
+//  TOKTOK
+//
+//  Created by shanp on 2023/8/30.
+//
+
+#import "XSTTOrderDetailsModel.h"
+#import <JXHSystemShortcut.h>
+
+@implementation XSTTOrderDetailsNodeModel
+
+- (bool)handleAdditionalProperty {
+    if (_xstt_nodeTime.length >= 16) {
+        NSString *year = [_xstt_nodeTime substringWithRange:NSMakeRange(0, 4)];
+        NSString *now = [[jxh_dateFormatter() stringFromDate:NSDate.new] substringWithRange:NSMakeRange(0, 4)];
+        if ([now isEqualToString:year]) {
+            _xstta_showTime = [_xstt_nodeTime substringWithRange:NSMakeRange(5, 11)];
+        } else {
+            _xstta_showTime = [_xstt_nodeTime substringWithRange:NSMakeRange(0, 16)];
+        }
+        
+    } else {
+        _xstta_showTime = _xstt_nodeTime;
+    }
+    return [super handleAdditionalProperty];
+}
+
+@end
+
+@implementation XSTTOrderDetailsModel
+
+- (id)GETxstt_nodeListWithDictionary:(nullable NSDictionary *)dic key:(NSString *)key {
+    return [XSTTOrderDetailsNodeModel getModelListWithArray:dic[key]];
+}
+
+@end

+ 2 - 1
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewCell.h

@@ -6,12 +6,13 @@
 //
 
 #import <UIKit/UIKit.h>
+@class XSTTOrderDetailsNodeModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderDetailsTableViewCell : UITableViewCell
 
-- (void)reloadData:(NSIndexPath *)data;
+- (void)reloadData:(XSTTOrderDetailsNodeModel *)data isFirst:(bool)isFirst isLast:(bool)isLast;
 
 @end
 

+ 52 - 13
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewCell.m

@@ -7,11 +7,14 @@
 
 #import "XSTTOrderDetailsTableViewCell.h"
 #import "XSTTUIGeneralHeader.h"
+#import <JXHCoreText.h>
+#import "XSTTOrderDetailsModel.h"
 
 @interface XSTTOrderDetailsTableViewCell () {
     UILabel *_title;
     UILabel *_time;
-    UILabel *_content;
+    JXHCoreTextLabel *_content;
+    JXHCTFrameParserConfig *_config;
     UIButton *_button;
     UIView *_topLine;
     UIView *_bottomLine;
@@ -51,10 +54,13 @@
         make.bottom.equalTo(0);
     }];
     
-    _content = [UILabel convenienceWithFont:xstt_font(13) textColor:xstt_000000_color(0.87) limitWidth:jxh_screenWidth() - 84 - 40];
+    _config = [[JXHCTFrameParserConfig alloc] initWithMaxWidth:jxh_screenWidth() - 84 - 40 font:xstt_font(13) lineSpace:3.5 color:xstt_000000_color(0.87)];
+    _content = JXHCoreTextLabel.new;
+    _content.backgroundColor = UIColor.clearColor;
     [content addArrangedSubview:_content];
     [_content makeConstraints:^(JXHConstraintMaker *make) {
         make.width.equalTo(jxh_screenWidth() - 84 - 40);
+        make.height.equalTo(0);
     }];
     
     _button = [UIButton convenienceWithTarget:self action:@selector(buttonAction)];
@@ -96,23 +102,56 @@
     
 }
 
-- (void)reloadData:(NSIndexPath *)data {
-    _title.text = @"订购成功";
-    _time.text = @"03-25 18:20";
-    [_content setAttributedStringWithText:@"请耐心等待,  新鲜的精酿啤酒将会抓紧时间酿制的哦" lineSpacing:3.5];
+- (void)reloadData:(XSTTOrderDetailsNodeModel *)data isFirst:(bool)isFirst isLast:(bool)isLast {
+    _title.text = data.xstt_nodeName;
     
-    [_button setTitle:@"更改收货地址" state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
-    [_button setStatusType:XSTTButtonStatusTypeLineBorder font:xstt_font(11) size:(CGSize){24, 28} corner:-1 calculateLabel:_button.titleLabel];
-    [_button setTitleColor:xstt_000000_color(0.6) state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
-    
-    if (data.row == 0) {
-        _icon.image = jxh_getImage(order_details_current);
+    if (isFirst) {
+        _icon.image = jxh_getImage(order_details_finish);
         _topLine.hidden = true;
+        _title.textColor = xstt_000000_color(0.87);
+        _time.text = data.xstta_showTime;
+        _config.jxh_textColor = xstt_000000_color(0.87);
     } else {
         _icon.image = jxh_getImage(order_details_pass);
         _topLine.hidden = false;
+        _title.textColor = xstt_000000_color(0.4);
+        _time.text = @"";
+        _config.jxh_textColor = xstt_000000_color(0.4);
+    }
+    _bottomLine.hidden = isLast;
+    
+    XSTTOrderDetailsNodeActionType type = data.xstt_nodeAction.integerValue;
+    if (type == XSTTOrderDetailsNodeActionTypeHighlight) {
+        _content.jxh_coreTextData = [JXHCTFrameParser getAttributsDataWithArray:@[[JXHCoreTextModel getContent:data.xstt_nodeDes font:nil color:nil], [JXHCoreTextModel getContent:data.xstt_busiData font:nil color:xstt_FF5700_color()]] config:_config];
+    } else {
+        _content.jxh_coreTextData = [JXHCTFrameParser getAttributsDataWithArray:@[[JXHCoreTextModel getContent:data.xstt_nodeDes font:nil color:nil]] config:_config];
     }
-    _bottomLine.hidden = data.row == 9;
+    [_content setNeedsDisplay];
+    [_content makeConstraints:^(JXHConstraintMaker *make) {
+        make.height.update(self->_content.jxh_coreTextData.jxh_height);
+    }];
+    switch (type) {
+        case XSTTOrderDetailsNodeActionTypeNone:
+        case XSTTOrderDetailsNodeActionTypeHighlight:
+            _button.hidden = true;
+            break;
+        case XSTTOrderDetailsNodeActionTypeAddress:
+            _button.hidden = false;
+            [_button setTitle:@"更改收货地址" state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+            [_button setStatusType:XSTTButtonStatusTypeLineBorder font:xstt_font(11) size:(CGSize){24, 28} corner:-1 calculateLabel:_button.titleLabel];
+            [_button setTitleColor:xstt_000000_color(0.6) state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+            break;
+        case XSTTOrderDetailsNodeActionTypeExpressNumber:
+            _button.hidden = false;
+            [_button setTitle:@"查看物流进度" state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+            [_button setStatusType:XSTTButtonStatusTypeLineBorder font:xstt_font(11) size:(CGSize){24, 28} corner:-1 calculateLabel:_button.titleLabel];
+            [_button setTitleColor:xstt_000000_color(0.6) state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+            break;
+            
+        default:
+            break;
+    }
+    
 }
 
 @end

+ 3 - 0
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewController.h

@@ -6,11 +6,14 @@
 //
 
 #import "XSTTTableViewController.h"
+@class XSTTOrderDetailsNodeModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderDetailsTableViewController : XSTTTableViewController
 
+- (void)reloadData:(NSArray<XSTTOrderDetailsNodeModel *> *)data;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 12 - 3
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsTableViewController.m

@@ -8,8 +8,11 @@
 #import "XSTTOrderDetailsTableViewController.h"
 #import "XSTTUIGeneralHeader.h"
 #import "XSTTOrderDetailsTableViewCell.h"
+#import "XSTTOrderDetailsModel.h"
 
-@interface XSTTOrderDetailsTableViewController ()
+@interface XSTTOrderDetailsTableViewController () {
+    NSArray<XSTTOrderDetailsNodeModel *> *_data;
+}
 
 @end
 
@@ -18,6 +21,7 @@
 - (instancetype)init {
     self = [super initWithStyle:UITableViewStyleGrouped backgroundColor:XSTTTableViewBackgroundColorWhite];
     if (!self) return nil;
+    _data = NSArray.new;
     return self;
 }
 
@@ -27,6 +31,11 @@
 }
 
 #pragma mark - Action
+- (void)reloadData:(NSArray<XSTTOrderDetailsNodeModel *> *)data {
+    _data = data;
+    [self.tableView reloadData];
+}
+
 #pragma mark - Network Action
 #pragma mark - Delegate & DataSource
 
@@ -37,12 +46,12 @@ static NSString * const reuseIdentifier = @"XSTTOrderDetailsTableViewCell";
     if (!cell) {
         cell = [[XSTTOrderDetailsTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
     }
-    [cell reloadData:indexPath];
+    [cell reloadData:_data[indexPath.row] isFirst:indexPath.row == 0 isLast:indexPath.row == _data.count - 1];
     return cell;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 10;
+    return _data.count;
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

+ 3 - 0
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsViewController.h

@@ -6,11 +6,14 @@
 //
 
 #import <UIKit/UIKit.h>
+@class XSTTOrderListInfoModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderDetailsViewController : UIViewController
 
+@property (nonatomic, strong) NSArray<XSTTOrderListInfoModel *> *xstt_dataArray;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 60 - 6
TOKTOK/TOKTOK/Mine/Order/OrderDetails/XSTTOrderDetailsViewController.m

@@ -11,12 +11,19 @@
 #import "UIViewController+XSTTNavigationBar.h"
 #import "XSTTOrderDetailsTableViewController.h"
 #import "XSTTOrderDetailsChooseTimeViewController.h"
+#import "XSTTOrderListModel.h"
+#import "XSTTOrderDetailsModel.h"
+#import "UIViewController+XSTTNetworkManager.h"
+#import "UIView+XSTTLoadingTipsView.h"
 
 @interface XSTTOrderDetailsViewController () {
     UIView *_headerView;
     XSTTOrderDetailsTableViewController *_tableVC;
+    UILabel *_name;
     UILabel *_number;
     UILabel *_time;
+    XSTTOrderDetailsModel *_data;
+    NSString *_bbosId;
 }
 
 @end
@@ -28,13 +35,54 @@
     [self setupUI];
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    if (!_data) {
+        _bbosId = _xstt_dataArray[0].xstt_bbosId;
+        [self getData];
+    }
+}
+
 #pragma mark - Action
 - (void)chooseOrder {
     XSTTOrderDetailsChooseTimeViewController *vc = XSTTOrderDetailsChooseTimeViewController.new;
+    vc.xstt_dataArray = _xstt_dataArray;
+    vc.xstt_name = _data.xstt_boxName;
+    @weakify(self)
+    vc.xstt_finishChose = ^(NSString * _Nonnull bbosId) {
+        @strongify(self)
+        if (![self->_bbosId isEqualToString:bbosId]) {
+            self->_bbosId = bbosId;
+            [self getData];
+        }
+    };
     [self presentViewController:vc animated:false completion:nil];
 }
 
 #pragma mark - Network Action
+- (void)getData {
+    [self networkUseMethod:XSTTNetworkMethodGET loadingTips:@"加载中" isLogin:true signKey:XSTTNetworkSignKeyApp url:xstt_appUrl(XSTTURLGetMineBlindBoxDetails) urlParameters:nil parameters:^NSDictionary * _Nonnull{
+        return @{@"bbosId": self->_bbosId};
+    } success:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        [self getDataSuccess:data];
+        return @"";
+    } failure:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        [self getDataFailure:error];
+        return @"加载失败";
+    }];
+}
+
+- (void)getDataSuccess:(id)data {
+    _data = [XSTTOrderDetailsModel getModelWithDictionary:data[@"data"]];
+    [self reloadUI];
+    [_tableVC reloadData:_data.xstt_nodeList];
+}
+
+- (void)getDataFailure:(NSError *)error {
+    if (_data) return;
+    [self.navigationController popViewControllerAnimated:true];
+}
+
 #pragma mark - UI
 - (void)setupUI {
     self.xstt_isHiddenNavigationBar = true;
@@ -43,6 +91,12 @@
     [self createTableVC];
 }
 
+- (void)reloadUI {
+    _name.text = _data.xstt_boxName;
+    _number.text = [NSString stringWithFormat:@"%@期", _data.xstt_month];
+    _time.text = _data.xstt_cutOffTime;
+}
+
 - (void)createTableVC {
     _tableVC = XSTTOrderDetailsTableViewController.new;
     [self addChildViewController:_tableVC];
@@ -63,9 +117,9 @@
         make.height.equalTo(160);
     }];
     
-    UILabel *title = [UILabel convenienceWithFont:xstt_mediumFont(23) text:@"入门精酿·盲盒订制" textColor:xstt_000000_color(0.87)];
-    [_headerView addSubview:title];
-    [title makeConstraints:^(JXHConstraintMaker *make) {
+    _name = [UILabel convenienceWithFont:xstt_mediumFont(23) text:nil textColor:xstt_000000_color(0.87)];
+    [_headerView addSubview:_name];
+    [_name makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.equalTo(XSTTMargin);
         make.top.equalTo(24);
     }];
@@ -88,14 +142,14 @@
         make.top.equalTo(12);
     }];
     
-    _number = [UILabel convenienceWithFont:xstt_AlipayFont(17) text:@"2023040159期" textColor:xstt_000000_color(0.87)];
+    _number = [UILabel convenienceWithFont:xstt_AlipayFont(17) text:nil textColor:xstt_000000_color(0.87)];
     [contentView addSubview:_number];
     [_number makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.equalTo(numberTtitle);
         make.bottom.equalTo(-12);
     }];
     
-    if (1) {
+    if (_xstt_dataArray.count > 1) {
         UIImageView *arrow = [[UIImageView alloc] initWithImage:jxh_getImage(order_arrow_down)];
         [contentView addSubview:arrow];
         [arrow makeConstraints:^(JXHConstraintMaker *make) {
@@ -125,7 +179,7 @@
         make.top.equalTo(numberTtitle);
     }];
     
-    _time = [UILabel convenienceWithFont:xstt_AlipayFont(17) text:@"2023/03/20" textColor:xstt_000000_color(0.87)];
+    _time = [UILabel convenienceWithFont:xstt_AlipayFont(17) text:nil textColor:xstt_000000_color(0.87)];
     [contentView addSubview:_time];
     [_time makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.equalTo(timeTtitle);

+ 33 - 0
TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListModel.h

@@ -0,0 +1,33 @@
+//
+//  XSTTOrderListModel.h
+//  TOKTOK
+//
+//  Created by shanp on 2023/8/29.
+//
+
+#import "XSTTBaseNetworkModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface XSTTOrderListInfoModel : XSTTBaseNetworkModel
+
+@property (nonatomic, strong) NSString *xstt_bbosId;
+@property (nonatomic, strong) NSString *xstt_month;
+@property (nonatomic, strong) NSString *xstt_status;
+
+@end
+
+@interface XSTTOrderListModel : XSTTBaseNetworkModel
+
+@property (nonatomic, strong) NSString *xstt_beerBoxOrderId;
+@property (nonatomic, strong) NSString *xstt_boxOrderStatus;
+@property (nonatomic, strong) NSString *xstt_boxName;
+@property (nonatomic, strong) NSString *xstt_boxLogo;
+@property (nonatomic, strong) NSString *xstt_month;
+@property (nonatomic, strong) NSString *xstt_price;
+@property (nonatomic, strong) NSString *xstt_buyTime;
+@property (nonatomic, strong) NSArray<XSTTOrderListInfoModel *> *xstt_orderInfoList;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 20 - 0
TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListModel.m

@@ -0,0 +1,20 @@
+//
+//  XSTTOrderListModel.m
+//  TOKTOK
+//
+//  Created by shanp on 2023/8/29.
+//
+
+#import "XSTTOrderListModel.h"
+
+@implementation XSTTOrderListInfoModel
+
+@end
+
+@implementation XSTTOrderListModel
+
+- (id)GETxstt_orderInfoListWithDictionary:(nullable NSDictionary *)dic key:(NSString *)key {
+    return [XSTTOrderListInfoModel getModelListWithArray:dic[key]];
+}
+
+@end

+ 2 - 1
TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewCell.h

@@ -6,12 +6,13 @@
 //
 
 #import <UIKit/UIKit.h>
+@class XSTTOrderListModel;
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTOrderListTableViewCell : UITableViewCell
 
-- (void)reloadData:(NSIndexPath *)data;
+- (void)reloadData:(XSTTOrderListModel *)data;
 
 @end
 

+ 29 - 6
TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewCell.m

@@ -7,6 +7,9 @@
 
 #import "XSTTOrderListTableViewCell.h"
 #import "XSTTUIGeneralHeader.h"
+#import "XSTTOrderListModel.h"
+#import <UIImageView+WebCache.h>
+#import "XSTTEnumerationProfile.h"
 
 @interface XSTTOrderListTableViewCell () {
     UILabel *_name;
@@ -103,12 +106,32 @@
     return self;
 }
 
-- (void)reloadData:(NSIndexPath *)data {
-    _name.text = @"入门精酿·盲盒订制入门精酿·盲盒订制";
-    _status.text = @"交易成功";
-    _cycle.text = @"订购周期 (3个月)";
-    _time.text = @"订购时间 2023/03/20订购时间 2023/03/20";
-    _price.text = @"¥299.00";
+- (void)reloadData:(XSTTOrderListModel *)data {
+    [_icon sd_setImageWithURL:[NSURL URLWithString:data.xstt_boxLogo]];
+    _name.text = data.xstt_boxName;
+    switch (data.xstt_boxOrderStatus.integerValue) {
+        case XSTTOrderStatusFinish:
+            _status.text = @"交易成功";
+            _status.textColor = xstt_000000_color(0.6);
+            break;
+        case XSTTOrderStatusInProgress:
+            _status.text = @"进行中";
+            _status.textColor = xstt_FF5700_color();
+            break;
+        case XSTTOrderStatusPartOfTheRefund:
+            _status.text = @"部分退款";
+            _status.textColor = xstt_000000_color(0.6);
+            break;
+            
+        default:
+            _status.text = @"订单异常";
+            _status.textColor = xstt_FF5700_color();
+            break;
+    }
+    
+    _cycle.text = [NSString stringWithFormat:@"订购周期 (%@个月)", data.xstt_month];
+    _time.text = [NSString stringWithFormat:@"订购时间 %@", data.xstt_buyTime];
+    _price.text = [NSString stringWithFormat:@"¥%@", data.xstt_price];
 }
 
 @end

+ 102 - 9
TOKTOK/TOKTOK/Mine/Order/OrderList/XSTTOrderListTableViewController.m

@@ -9,12 +9,21 @@
 #import "XSTTUIGeneralHeader.h"
 #import "XSTTOrderListTableViewCell.h"
 #import "XSTTOrderDetailsViewController.h"
-
-CONST_STRING XSTTOrderListTableViewTypeAll = @"";
-CONST_STRING XSTTOrderListTableViewTypeInProgress = @"";
-CONST_STRING XSTTOrderListTableViewTypeFinish = @"";
-
-@interface XSTTOrderListTableViewController ()
+#import "XSTTOrderListModel.h"
+#import "UITableViewController+XSTTLoadDataStatus.h"
+#import "UIScrollView+XSTTAutoLoadData.h"
+#import "UIViewController+XSTTNetworkManager.h"
+#import "XSTTRouteManager.h"
+#import "XSTTBlindBoxToOrderTableViewController.h"
+
+CONST_STRING XSTTOrderListTableViewTypeAll = @"ALL";
+CONST_STRING XSTTOrderListTableViewTypeInProgress = @"RUN_TIME";
+CONST_STRING XSTTOrderListTableViewTypeFinish = @"FINISH";
+
+@interface XSTTOrderListTableViewController () {
+    NSString *_lastBeerBoxOrderId;
+    NSMutableArray<XSTTOrderListModel *> *_data;
+}
 
 @end
 
@@ -28,11 +37,86 @@ CONST_STRING XSTTOrderListTableViewTypeFinish = @"";
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    [self setupData];
     [self setupTableView];
 }
 
+- (void)setupData {
+    _lastBeerBoxOrderId = @"0";
+    _data = NSMutableArray.new;
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    if ([_lastBeerBoxOrderId isEqualToString:@"0"]) {
+        [self getData];
+    }
+}
+
 #pragma mark - Action
+- (void)toBlindBox {
+    [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:[XSTTBlindBoxToOrderTableViewController class] property:@{} tabBarType:XSTTTabBarTypeHome]];
+}
+
 #pragma mark - Network Action
+- (void)getData {
+    self.tableView.xstt_canLoadData = false;
+    @weakify(self)
+    [self networkUseMethod:XSTTNetworkMethodGET loadingTips:nil isLogin:true signKey:XSTTNetworkSignKeyApp url:xstt_appUrl(XSTTURLGetMineBlindBoxList) urlParameters:nil parameters:^NSDictionary * _Nonnull{
+        return @{@"type": self->_xstt_type, @"lastBeerBoxOrderId": self->_lastBeerBoxOrderId};
+    } success:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        @strongify(self)
+        [self getDataSuccess:data];
+        return nil;
+    } failure:^NSString * _Nullable(NSError * _Nonnull error, id  _Nullable data) {
+        @strongify(self)
+        [self getDataFailure:error];
+        return @"加载失败";
+    }];
+}
+
+- (void)getDataSuccess:(id)data {
+    NSArray<XSTTOrderListModel *> *array = [XSTTOrderListModel getModelListWithArray:data[@"data"]];
+    if (array.count == 0) {
+        [self.tableView reloadData];
+        if (_data.count == 0) {
+            self.tableView.backgroundColor = xstt_FFFFFF_color(1.f);
+            UIView *view = [self.tableView setDefaultFootViewWithError:nil image:jxh_getImage(no_data) tips:@"哎呀, 你太矜持啦\n还没有任何订购信息哦" height:jxh_viewHeight(self.view) - jxh_safeInsets(self.view).top - jxh_safeInsets(self.view).bottom - 106 - 106 action:nil];
+            UIButton *button = [UIButton convenienceWithTarget:self action:@selector(toBlindBox)];
+            [button setTitle:@"去看看盲盒订制" titleColor:xstt_FFFFFF_color(1.f) state:JXHButtonControlStateNormal];
+            [button setStatusType:XSTTButtonStatusTypePrimary  font:xstt_mediumFont(17) size:(CGSize){223, 50}];
+            [view.superview addSubview:button];
+            [button makeConstraints:^(JXHConstraintMaker *make) {
+                make.centerX.equalTo(0);
+                make.top.equalTo(view.bottom).offset(56);
+                make.size.equalTo((CGSize){223, 50});
+            }];
+        }
+        [self endLoadDataStatusWithCanRefresh:true canLoad:false];
+    } else {
+        self.tableView.backgroundColor = xstt_F7F7F7_color();
+        _lastBeerBoxOrderId = array.lastObject.xstt_beerBoxOrderId;
+        [self.tableView removeDefaultFootView];
+        [_data addObjectsFromArray:array];
+        [self.tableView reloadData];
+        [self endLoadDataStatusWithCanRefresh:true canLoad:true];
+    }
+}
+
+- (void)getDataFailure:(NSError *)error {
+    if (_data.count == 0) {
+        self.tableView.backgroundColor = xstt_FFFFFF_color(1.f);
+        @weakify(self)
+        [self.tableView setDefaultFootViewWithError:error image:nil tips:nil height:jxh_viewHeight(self.view) - jxh_safeInsets(self.view).top - jxh_safeInsets(self.view).bottom action:^{
+            @strongify(self)
+            [self getData];
+        }];
+        [self endLoadDataStatusWithCanRefresh:false canLoad:false];
+    } else {
+        [self endLoadDataStatusWithCanRefresh:true canLoad:true];
+    }
+    
+}
 #pragma mark - Delegate & DataSource
 
 static NSString * const reuseIdentifier = @"XSTTOrderListTableViewCell";
@@ -42,17 +126,20 @@ static NSString * const reuseIdentifier = @"XSTTOrderListTableViewCell";
     if (!cell) {
         cell = [[XSTTOrderListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
     }
-    [cell reloadData:indexPath];
+    [cell reloadData:_data[indexPath.row]];
     return cell;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 10;
+    return _data.count;
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     [tableView deselectRowAtIndexPath:indexPath animated:false];
-    [self.navigationController pushViewController:XSTTOrderDetailsViewController.new animated:true];
+    if (_data.count <= indexPath.row || _data[indexPath.row].xstt_orderInfoList.count == 0) return;
+    XSTTOrderDetailsViewController *vc = XSTTOrderDetailsViewController.new;
+    vc.xstt_dataArray = _data[indexPath.row].xstt_orderInfoList;
+    [self.navigationController pushViewController:vc animated:true];
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
@@ -79,6 +166,12 @@ static NSString * const reuseIdentifier = @"XSTTOrderListTableViewCell";
     self.tableView.showsHorizontalScrollIndicator = false;
     self.tableView.showsVerticalScrollIndicator = false;
     self.tableView.alwaysBounceVertical = true;
+    
+    @weakify(self)
+    [self.tableView setAutoLoadDataWithAction:^{
+        @strongify(self)
+        [self getData];
+    }];
 }
 
 @end

+ 3 - 3
TOKTOK/TOKTOK/Public/Category/View/UIView+XSTTDefault.m

@@ -16,14 +16,14 @@
     if (!image) {
         switch (type) {
             case XSTTNetworkDataDefaultNoData:
-                image = jxh_getImage(empty_default);
+                image = jxh_getImage(no_data);
                 break;
             case XSTTNetworkDataDefaultMissData:
-                image = jxh_getImage(failure_default);
+                image = jxh_getImage(address_list_default);
                 tips = @"数据加载失败";
                 break;
             case XSTTNetworkDataDefaultMissNetwork:
-                image = jxh_getImage(miss_network_default);
+                image = jxh_getImage(address_list_default);
                 tips = @"网络异常,请刷新重试";
                 
             default:

+ 1 - 1
TOKTOK/TOKTOK/Public/Controller/XSTTHtmlViewController.m

@@ -81,7 +81,7 @@
 - (void)dealloc {
     xstt_removeNotificationKey(XSTTLoggingNotificationKey);
     if (_isBackHome) {
-        [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClassName:@"" property:@{} tabBarType:XSTTTabBarTypeHome]];
+        [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:@{} tabBarType:XSTTTabBarTypeHome]];
     }
 }
 

+ 5 - 0
TOKTOK/TOKTOK/Public/Manager/NotificationDelegate/XSTTNotificationDelegate.h

@@ -23,9 +23,14 @@ static XSTTNotificationDelegateKey XSTTSocialCircleNotificationKey = @"XSTTSocia
 
 static XSTTNotificationDelegateKey XSTTUserNotificationKey = @"XSTTUserNotificationKey";
 
+static XSTTNotificationDelegateKey XSTTPayNotificationKey = @"XSTTPayNotificationKey";
+
 @protocol XSTTNotificationDelegate <NSObject>
 @optional
 
+#pragma mark - XSTTPayNotificationKey
+- (void)xstt_payResultWithType:(XSTTPayType)type data:(id)data;
+
 #pragma mark - XSTTUserNotificationKey
 - (void)xstt_userInformationChanged;
 

+ 19 - 0
TOKTOK/TOKTOK/Public/Manager/XSTTPayManager.h

@@ -0,0 +1,19 @@
+//
+//  XSTTPayManger.h
+//  TOKTOK
+//
+//  Created by shanp on 2023/9/27.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface XSTTPayManager : NSObject
+
+- (void)alipayWithSign:(NSString *)sign view:(UIView *)view seccessfulCompletion:(void(^)(void))seccessful failureCompletion:(void(^)(void))fail;
+- (void)wechatPayWithDict:(NSDictionary *)dict orderNo:(NSString *)orderNo seccessfulCompletion:(void(^)(void))seccessful failureCompletion:(void(^)(void))fail;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 122 - 0
TOKTOK/TOKTOK/Public/Manager/XSTTPayManager.m

@@ -0,0 +1,122 @@
+//
+//  XSTTPayManger.m
+//  TOKTOK
+//
+//  Created by shanp on 2023/9/27.
+//
+
+#import "XSTTPayManager.h"
+#import <JXHSystemShortcut.h>
+#import "UIView+XSTTLoadingTipsView.h"
+#import <AlipaySDK/AlipaySDK.h>
+#import "WXApi.h"
+#import "WXApiObject.h"
+#import "XSTTConstantProfile.h"
+#import "XSTTNetworkManager.h"
+#import "XSTTNotificationDelegateManager.h"
+#import "XSTTEnumerationProfile.h"
+#import "UIResponder+XSTTDelegate.h"
+
+@interface XSTTPayManager ()<XSTTNotificationDelegate> {
+    XSTTNetworkManager *_networkManager;
+    void (^_successAction)(void);
+    void (^_failureAction)(void);
+    NSString *_sign;
+    NSString *_orderNo;
+}
+
+@end
+
+@implementation XSTTPayManager
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) return nil;
+    _networkManager = XSTTNetworkManager.new;
+    xstt_setNotificationKey(XSTTPayNotificationKey);
+    return self;
+}
+
+- (void)dealloc {
+    xstt_removeNotificationKey(XSTTPayNotificationKey);
+}
+
+- (void)alipayWithSign:(NSString *)sign view:(UIView *)view seccessfulCompletion:(void(^)(void))seccessful failureCompletion:(void(^)(void))fail {
+    _successAction = seccessful;
+    _failureAction = fail;
+    _sign = sign;
+    if ([jxh_application() canOpenURL:[NSURL URLWithString:@"alipay://"]] || [jxh_application() canOpenURL:[NSURL URLWithString:@"alipayshare://"]] || [jxh_application() canOpenURL:[NSURL URLWithString:@"cydia://"]] || [jxh_application() canOpenURL:[NSURL URLWithString:@"safepay://"]]) {
+        [view showLoadingToastWithUserClick:false];
+    }
+    jxh_windowUserInteractionEnabled(true);
+    //应用注册scheme,在AlixPayDemo-Info.plist定义URL types
+    NSString *appScheme = XSTTUrlScheme;
+    
+        @weakify(self)
+        [[AlipaySDK defaultService] payOrder:_sign fromScheme:appScheme callback:^(NSDictionary *resultDic) {
+            @strongify(self)
+            debugLog(@"reslut = %@",resultDic);
+            if ([resultDic[@"resultStatus"] integerValue] == 9000) {
+                self->_successAction();
+                [self cleanUp];
+            } else {
+                self->_failureAction();
+                [self cleanUp];
+            }
+        }];
+}
+
+
+- (void)wechatPayWithDict:(NSDictionary *)dict orderNo:(NSString *)orderNo seccessfulCompletion:(void(^)(void))seccessful failureCompletion:(void(^)(void))fail {
+    [UIResponder setWechatDelegate:jxh_appDelegate()];
+}
+
+- (void)cleanUp {
+    _successAction = nil;
+    _failureAction = nil;
+    _orderNo = nil;
+}
+
+#pragma mark - XSTTNotificationDelegate
+- (void)xstt_payResultWithType:(XSTTPayType)type data:(id)data {
+    switch (type) {
+        case XSTTPayTypeWechet: {
+            switch ([data integerValue]) {
+                case 0:
+                    debugLog(@"支付成功-PaySuccess,retcode = %ld", [data integerValue]);
+                    break;
+                    
+                default:
+                    debugLog(@"错误,retcode = %ld", [data integerValue]);
+                    break;
+            }
+//            @weakify(self)
+//            [_networkManager networkUseMethod:SPSBNetworkMethodPOST isLogin:false url:spsb_appUrl(SPSBUrlQueryOrder) urlParameters:nil parameters:@{@"buy_no" : _orderNo} completion:^(NSError * _Nonnull error, id  _Nullable data) {
+//                @strongify(self)
+//                if (error.code == SPSBNetworkErrorCodeSuccess) {
+//                    self->_successAction();
+//                    [self cleanUp];
+//                } else {
+//                    self->_failureAction();
+//                    [self cleanUp];
+//                }
+//            }];
+        }
+            break;
+        case XSTTPayTypeAlipay: {
+            if ([data[@"resultStatus"] integerValue] == 9000) {
+                _successAction();
+                [self cleanUp];
+            } else {
+                _failureAction();
+                [self cleanUp];
+            }
+        }
+            break;
+            
+        default:
+            break;
+    }
+}
+
+@end

+ 1 - 1
TOKTOK/TOKTOK/Public/Manager/XSTTRouteManager.h

@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) bool xstt_needNavi;
 @property (nonatomic, assign) bool xstt_needLogin;
 
-- (instancetype)initWithClassName:(NSString *)className property:(NSDictionary *)property tabBarType:(XSTTTabBarType)tabBarType;
+- (instancetype)initWithClass:(nullable Class)class property:(NSDictionary *)property tabBarType:(XSTTTabBarType)tabBarType;
 
 @end
 

+ 11 - 11
TOKTOK/TOKTOK/Public/Manager/XSTTRouteManager.m

@@ -81,7 +81,7 @@ static force_inline NSNumber *_Nullable xstt_NSNumberCreateFromID(id value) {
 }
 
 @interface XSTTRouter () {
-    NSString *_className;
+    Class _class;
     NSDictionary *_property;
 }
 
@@ -89,18 +89,18 @@ static force_inline NSNumber *_Nullable xstt_NSNumberCreateFromID(id value) {
 
 @implementation XSTTRouter
 
-- (instancetype)initWithClassName:(NSString *)className property:(NSDictionary *)property tabBarType:(XSTTTabBarType)tabBarType {
+- (instancetype)initWithClass:(nullable Class)class property:(NSDictionary *)property tabBarType:(XSTTTabBarType)tabBarType {
     self = [super init];
     if (!self) return nil;
-    _className = className;
+    _class = class;
     _property = property;
     _xstt_tabBarType = tabBarType;
     return self;
 }
 
 - (UIViewController *)getTarget {
-    Class class = NSClassFromString(_className);
-    UIViewController *controller = [[class alloc] init];
+    if (!_class) return nil;
+    UIViewController *controller = [[_class alloc] init];
     if (!controller) {
         return nil;
     }
@@ -110,7 +110,7 @@ static force_inline NSNumber *_Nullable xstt_NSNumberCreateFromID(id value) {
     }
     [_property enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
         if ([key isKindOfClass:[NSString class]] && [(NSString *)key hasPrefix:@"xstt_"]) {
-            canReturn = [self handleKey:key Value:obj controller:controller class:class];
+            canReturn = [self handleKey:key Value:obj controller:controller class:_class];
         }
     }];
     if (canReturn) {
@@ -124,7 +124,7 @@ static force_inline NSNumber *_Nullable xstt_NSNumberCreateFromID(id value) {
     if (![controller canPerformAction:NSSelectorFromString(key) withSender:nil]) {
         return false;//没有查到类有相关属性
     }
-    Class _class = NSClassFromString(_className);
+//    Class _class = NSClassFromString(_className);
     while ([NSStringFromClass(_class) hasPrefix:@"XSTT"]) {
         objc_property_t property = class_getProperty(class, [key UTF8String]);
         if (property) {
@@ -228,19 +228,19 @@ static force_inline NSNumber *_Nullable xstt_NSNumberCreateFromID(id value) {
             NSMutableDictionary *dict = [jxh_jsonToDictionary(param) mutableCopy];
             if (dict[@"page"]) {
                 if ([NSStringFromClass([XSTTHomeViewController class]) isEqualToString:dict[@"page"]]) {
-                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClassName:@"" property:dict tabBarType:XSTTTabBarTypeHome]];
+                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:dict tabBarType:XSTTTabBarTypeHome]];
                     return true;
                 }
                 if ([NSStringFromClass([XSTTBeerCentreViewController class]) isEqualToString:dict[@"page"]]) {
-                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClassName:@"" property:dict tabBarType:XSTTTabBarTypeBeerCentre]];
+                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:dict tabBarType:XSTTTabBarTypeBeerCentre]];
                     return true;
                 }
                 if ([NSStringFromClass([XSTTMineViewController class]) isEqualToString:dict[@"page"]]) {
-                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClassName:@"" property:dict tabBarType:XSTTTabBarTypeMine]];
+                    [self navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:dict tabBarType:XSTTTabBarTypeMine]];
                     return true;
                 }
                 
-                XSTTRouter *router = [[XSTTRouter alloc] initWithClassName:dict[@"page"] property:dict tabBarType:XSTTTabBarTypeHome];
+                XSTTRouter *router = [[XSTTRouter alloc] initWithClass:NSClassFromString(dict[@"page"]) property:dict tabBarType:XSTTTabBarTypeHome];
                 if (dict[@"needNavi"]) {
                     router.xstt_needNavi = [dict[@"needNavi"] boolValue];
                 }

+ 2 - 0
TOKTOK/TOKTOK/Public/Profile/XSTTConstantProfile.h

@@ -32,6 +32,8 @@ CONST_FLOAT_INTERFACE XSTTDefaultViewCenterYOffsetProportion;
 CONST_INTEGER_INTERFACE XSTTCurrentInsideVersion;
 CONST_INTEGER_INTERFACE XSTTCurrentApiVersion;
 
+CONST_STRING_INTERFACE XSTTUrlScheme;
+
 CONST_STRING_INTERFACE XSTTUniversalLink;
 
 CONST_STRING_INTERFACE XSTTShopRedirctScheme;

+ 2 - 0
TOKTOK/TOKTOK/Public/Profile/XSTTConstantProfile.m

@@ -29,6 +29,8 @@ CONST_FLOAT XSTTDefaultViewCenterYOffsetProportion = 0.12;
 CONST_INTEGER XSTTCurrentInsideVersion = 100;
 CONST_INTEGER XSTTCurrentApiVersion = 200;
 
+CONST_STRING XSTTUrlScheme = @"XSTokTok";
+
 CONST_STRING XSTTUniversalLink = @"https://app.toktok.beer/";
 
 CONST_STRING XSTTShopRedirctScheme = @"toktok.n.weimob.com://";

+ 28 - 0
TOKTOK/TOKTOK/Public/Profile/XSTTEnumerationProfile.h

@@ -72,11 +72,33 @@ typedef NS_ENUM(NSUInteger, XSTTGoodsUnitType) {
     XSTTGoodsUnitTypeLitre = 3
 };
 
+typedef NS_ENUM(NSUInteger, XSTTGoodsStatus) {
+    XSTTGoodsStatusFinish = 0,//已完成
+    XSTTGoodsStatusNotStarted,//待开放
+    XSTTGoodsStatusInProgress,//认购中
+    XSTTGoodsStatusDistribution,//待分配
+    XSTTGoodsStatusWaitForTheDelivery,//待发货
+    XSTTGoodsStatusDelivered,//已发货
+    XSTTGoodsStatusApplicationForRefund = 11,//申请退款
+    XSTTGoodsStatusRefunded//已退款
+};
+
 #pragma mark - Order
 typedef NS_ENUM(NSUInteger, XSTTOrderType) {
     XSTTOrderTypeBlindBox = 1
 };
 
+typedef NS_ENUM(NSUInteger, XSTTOrderStatus) {
+    XSTTOrderStatusWaitForPaying = 1,//待支付
+    XSTTOrderStatusInProgress,//进行中
+    XSTTOrderStatusCancelPaying,//取消支付
+    XSTTOrderStatusFinish = 10,//已完成
+    XSTTOrderStatusApplicationForRefund,//申请退款
+    XSTTOrderStatusPartOfTheRefund,//部分退款
+    XSTTOrderStatusRefunded,//全额退款
+    XSTTOrderStatusException = 99//订单异常
+};
+
 #pragma mark - Report
 typedef NS_ENUM(NSUInteger, XSTTReportType) {
     XSTTReportTypeIllegal,//违法违规
@@ -90,3 +112,9 @@ typedef NS_ENUM(NSUInteger, XSTTReportTargetType) {
     XSTTReportTargetTypeContent,
     XSTTReportTargetTypeComment,
 };
+
+#pragma mark - 支付
+typedef NS_ENUM(NSUInteger, XSTTPayType) {
+    XSTTPayTypeWechet,
+    XSTTPayTypeAlipay
+};

+ 4 - 0
TOKTOK/TOKTOK/Public/Profile/XSTTURLApiProfile.h

@@ -74,9 +74,13 @@ CONST_STRING_INTERFACE XSTTURLGetStoreList;//门店列表
 #pragma mark - 盲盒相关
 CONST_STRING_INTERFACE XSTTURLGetBlindBoxList;//盲盒列表
 CONST_STRING_INTERFACE XSTTURLGetBlindBoxDetails;//盲盒详情
+CONST_STRING_INTERFACE XSTTURLGetMineBlindBoxList;//我订阅盲盒列表
+CONST_STRING_INTERFACE XSTTURLGetMineBlindBoxDetails;//我订阅盲盒详情
+CONST_STRING_INTERFACE XSTTURLChangeBlindBoxOrderAddress;//修改盲盒订单地址
 
 #pragma mark - 订单相关
 CONST_STRING_INTERFACE XSTTURLCreateOrder;//创建订单
+CONST_STRING_INTERFACE XSTTURLAlipay;//支付宝支付
 
 #pragma mark - 地址相关
 CONST_STRING_INTERFACE XSTTURLCreateNewAddress;//新增地址

+ 4 - 0
TOKTOK/TOKTOK/Public/Profile/XSTTURLApiProfile.m

@@ -110,9 +110,13 @@ CONST_STRING XSTTURLGetStoreList = @"/stores/list";//门店列表
 #pragma mark - 盲盒相关
 CONST_STRING XSTTURLGetBlindBoxList = @"/box/list";//盲盒列表
 CONST_STRING XSTTURLGetBlindBoxDetails = @"/box/detail";//盲盒详情
+CONST_STRING XSTTURLGetMineBlindBoxList = @"/box/order/list";//我订阅盲盒列表
+CONST_STRING XSTTURLGetMineBlindBoxDetails = @"/box/order/sp/info";//我订阅盲盒详情
+CONST_STRING XSTTURLChangeBlindBoxOrderAddress = @"/box/update/addree";//修改盲盒订单地址
 
 #pragma mark - 订单相关
 CONST_STRING XSTTURLCreateOrder = @"/order/create";//创建订单
+CONST_STRING XSTTURLAlipay = @"/pay/alipay/unified";//支付宝支付
 
 #pragma mark - 地址相关
 CONST_STRING XSTTURLCreateNewAddress = @"/user/address/create";//新增地址

+ 19 - 0
TOKTOK/TOKTOK/TOKTOK/UIResponder+XSTTDelegate.m

@@ -14,6 +14,11 @@
 #import <UMShare/UMShare.h>
 #import <TencentOpenAPI/TencentOAuth.h>
 #import <TencentOpenAPI/QQApiInterface.h>
+#import <AlipaySDK/AlipaySDK.h>
+#import "XSTTEnumerationProfile.h"
+#import "XSTTNotificationDelegateManager.h"
+#import "WXApi.h"
+#import "WXApiObject.h"
 
 static bool xstt_isFirstLaunch = true;
 
@@ -55,6 +60,13 @@ static bool xstt_isFirstLaunch = true;
 }
 
 - (bool)handleOpenURL:(NSURL *)url {
+    if ([url.host isEqualToString:@"safepay"]) {
+        //跳转支付宝钱包进行支付,处理支付结果
+        [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
+            xstt_postNotification(XSTTPayNotificationKey, @selector(xstt_payResultWithType:data:), xstt_payResultWithType:XSTTPayTypeAlipay data:resultDic);
+        }];
+        return true;
+    }
     if ([WXApi handleOpenURL:url delegate:[UIResponder getWechatDelegate]]) {
         return true;
     }
@@ -64,6 +76,13 @@ static bool xstt_isFirstLaunch = true;
     return true;
 }
 
+- (void)onResp:(BaseResp*)resp {
+//    if([resp isKindOfClass:[PayResp class]]){
+//        //支付返回结果,实际支付结果需要去微信服务器端查询
+//        spsb_postNotification(SPSBPayNotificationKey, @selector(spsb_payResultWithType:data:), spsb_payResultWithType:SPSBPayTypeWechet data:[NSNumber numberWithInt:resp.errCode]);
+//    }
+}
+
 - (void)xstt_didBecomeActive:(UIResponder *)responder {
     xstt_setAppActive(true);
     [jxh_application() setApplicationIconBadgeNumber:0];