Commit 0f746e60 authored by zhangshuai's avatar zhangshuai

Merge branch 'master' of gitlab.huolea.com:lmi/luckfarm

parents f2c71023 b283a9ba
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
64022D5C255D6B7D00513333 /* GYCashSixAwardAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 64022D5B255D6B7D00513333 /* GYCashSixAwardAlertView.m */; };
64022D60255D6B8700513333 /* GYCashSixAwardAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 64022D5F255D6B8700513333 /* GYCashSixAwardAlertView.xib */; };
64D45DF125495D010066055C /* UnityFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 64D45DF025495D010066055C /* UnityFramework.framework */; }; 64D45DF125495D010066055C /* UnityFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 64D45DF025495D010066055C /* UnityFramework.framework */; };
64D45DF225495D010066055C /* UnityFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 64D45DF025495D010066055C /* UnityFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 64D45DF225495D010066055C /* UnityFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 64D45DF025495D010066055C /* UnityFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
64E8CA10254132E300AF1416 /* BGKeychainTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 64E8CA0F254132E300AF1416 /* BGKeychainTool.m */; }; 64E8CA10254132E300AF1416 /* BGKeychainTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 64E8CA0F254132E300AF1416 /* BGKeychainTool.m */; };
...@@ -110,6 +112,9 @@ ...@@ -110,6 +112,9 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
033C10D1CFA56FEA0D33753E /* Pods-GYDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GYDemo.release.xcconfig"; path = "Target Support Files/Pods-GYDemo/Pods-GYDemo.release.xcconfig"; sourceTree = "<group>"; }; 033C10D1CFA56FEA0D33753E /* Pods-GYDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GYDemo.release.xcconfig"; path = "Target Support Files/Pods-GYDemo/Pods-GYDemo.release.xcconfig"; sourceTree = "<group>"; };
64022D5A255D6B7D00513333 /* GYCashSixAwardAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GYCashSixAwardAlertView.h; sourceTree = "<group>"; };
64022D5B255D6B7D00513333 /* GYCashSixAwardAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYCashSixAwardAlertView.m; sourceTree = "<group>"; };
64022D5F255D6B8700513333 /* GYCashSixAwardAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GYCashSixAwardAlertView.xib; sourceTree = "<group>"; };
64D45DF025495D010066055C /* UnityFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UnityFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 64D45DF025495D010066055C /* UnityFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UnityFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
64E8CA062541318100AF1416 /* UnityFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UnityFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 64E8CA062541318100AF1416 /* UnityFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UnityFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
64E8CA0E254132E300AF1416 /* BGKeychainTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGKeychainTool.h; sourceTree = "<group>"; }; 64E8CA0E254132E300AF1416 /* BGKeychainTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGKeychainTool.h; sourceTree = "<group>"; };
...@@ -445,6 +450,9 @@ ...@@ -445,6 +450,9 @@
A91A797B253F244F00F9B216 /* GYGiftAlertView.h */, A91A797B253F244F00F9B216 /* GYGiftAlertView.h */,
A91A797C253F244F00F9B216 /* GYGiftAlertView.m */, A91A797C253F244F00F9B216 /* GYGiftAlertView.m */,
A91A7981253F248E00F9B216 /* GYGiftAlertView.xib */, A91A7981253F248E00F9B216 /* GYGiftAlertView.xib */,
64022D5A255D6B7D00513333 /* GYCashSixAwardAlertView.h */,
64022D5B255D6B7D00513333 /* GYCashSixAwardAlertView.m */,
64022D5F255D6B8700513333 /* GYCashSixAwardAlertView.xib */,
A91A7961253F192A00F9B216 /* GYRedPacketView.h */, A91A7961253F192A00F9B216 /* GYRedPacketView.h */,
A91A7962253F192A00F9B216 /* GYRedPacketView.m */, A91A7962253F192A00F9B216 /* GYRedPacketView.m */,
A91A796A253F193F00F9B216 /* GYRedPacketView.xib */, A91A796A253F193F00F9B216 /* GYRedPacketView.xib */,
...@@ -658,6 +666,7 @@ ...@@ -658,6 +666,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A91A79B7254019A700F9B216 /* GYOrderAlertView.xib in Resources */, A91A79B7254019A700F9B216 /* GYOrderAlertView.xib in Resources */,
64022D60255D6B8700513333 /* GYCashSixAwardAlertView.xib in Resources */,
A91A7887253EE56D00F9B216 /* LaunchScreen.storyboard in Resources */, A91A7887253EE56D00F9B216 /* LaunchScreen.storyboard in Resources */,
A9AB9D7225403E6B00F0D766 /* GYTaskCell.xib in Resources */, A9AB9D7225403E6B00F0D766 /* GYTaskCell.xib in Resources */,
A9AB9D62254039FD00F0D766 /* GYTaskAlertView.xib in Resources */, A9AB9D62254039FD00F0D766 /* GYTaskAlertView.xib in Resources */,
...@@ -772,6 +781,7 @@ ...@@ -772,6 +781,7 @@
A91A78F2253EE87500F9B216 /* AESCipher.m in Sources */, A91A78F2253EE87500F9B216 /* AESCipher.m in Sources */,
A91A7997253FDEFD00F9B216 /* GYSettingViewController.m in Sources */, A91A7997253FDEFD00F9B216 /* GYSettingViewController.m in Sources */,
A91A794E253F14C300F9B216 /* LaunchScreenPlaceHolderVC.m in Sources */, A91A794E253F14C300F9B216 /* LaunchScreenPlaceHolderVC.m in Sources */,
64022D5C255D6B7D00513333 /* GYCashSixAwardAlertView.m in Sources */,
68CA7398255BE17E002E73AD /* AddCSJADManager.m in Sources */, 68CA7398255BE17E002E73AD /* AddCSJADManager.m in Sources */,
A9AB9D842540672D00F0D766 /* GYDayTaskModel.m in Sources */, A9AB9D842540672D00F0D766 /* GYDayTaskModel.m in Sources */,
A91A7902253EE8E300F9B216 /* KeychainItemManager.m in Sources */, A91A7902253EE8E300F9B216 /* KeychainItemManager.m in Sources */,
......
//
// GYCashSixAwardAlertView.h
// GYDemo
//
// Created by Mazy on 2020/11/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYCashSixAwardAlertView : UIView
+(GYCashSixAwardAlertView *)loadFromNib;
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UIView *mainContentView;
@property(nonatomic, copy) void(^closeCallBack)(bool);
@property (weak, nonatomic) IBOutlet UILabel *gainAmountLabel;
@property (nonatomic, weak) NSTimer *timer;
@property (nonatomic, assign) NSInteger countDown;
- (void)showAlertToView: (UIView *)toView amount: (NSString *)money;
- (void)hideAlert: (BOOL)isGain;
@end
NS_ASSUME_NONNULL_END
//
// GYCashSixAwardAlertView.m
// GYDemo
//
// Created by Mazy on 2020/11/12.
//
#import "GYCashSixAwardAlertView.h"
@implementation GYCashSixAwardAlertView
+(GYCashSixAwardAlertView *)loadFromNib {
return [[UINib nibWithNibName:@"GYCashSixAwardAlertView" bundle:nil] instantiateWithOwner:self options:nil].firstObject;
}
- (void)awakeFromNib {
[super awakeFromNib];
self.mainContentView.transform = CGAffineTransformMakeScale(0.01, 0.01);
self.countDown = 4;
self.cancelButton.userInteractionEnabled = false;
[self.cancelButton setTitle:[NSString stringWithFormat:@"%ld", self.countDown] forState:UIControlStateNormal];
[self.cancelButton setImage:nil forState:UIControlStateNormal];
WEAKSELF
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 repeats:true block:^(NSTimer * _Nonnull timer) {
weakSelf.countDown--;
NSLog(@"%ld", (long)weakSelf.countDown);
[self.cancelButton setTitle:[NSString stringWithFormat:@"%ld", self.countDown] forState:UIControlStateNormal];
if (weakSelf.countDown <= 0) {
[weakSelf.timer invalidate];
[self.cancelButton setTitle: @"" forState:UIControlStateNormal];
[self.cancelButton setImage:[UIImage imageNamed:@"alert_six_cash_cancel_icon"] forState:UIControlStateNormal];
self.cancelButton.userInteractionEnabled = true;
}
}];
}
- (IBAction)cancelAction {
[self hideAlert:false];
}
// 领红包
- (IBAction)gainSixRedAwardAction:(UIButton *)sender {
[self hideAlert:true];
}
- (void)showAlertToView: (UIView *)toView amount: (NSString *)money {
self.gainAmountLabel.text = [NSString stringWithFormat:@"+%@元", money];
[toView addSubview:self];
[UIView animateWithDuration:0.15 animations:^{
self.mainContentView.transform = CGAffineTransformMakeScale(1, 1);
} completion:^(BOOL finished) {
[self.timer fire];
}];
}
- (void)hideAlert: (BOOL)isGain {
[UIView animateWithDuration:0.15 animations:^{
self.mainContentView.transform = CGAffineTransformMakeScale(0.01, 0.01);
} completion:^(BOOL finished) {
[self removeFromSuperview];
if (self.closeCallBack) {
self.closeCallBack(isGain);
}
}];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="GYCashSixAwardAlertView">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bGP-FP-Uak">
<rect key="frame" x="31.5" y="293.5" width="351.5" height="319.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="alert_six_cash_bg" translatesAutoresizingMaskIntoConstraints="NO" id="2da-nI-zSn">
<rect key="frame" x="0.0" y="0.0" width="351.5" height="319.5"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="现金奖励" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i3a-5g-mXh">
<rect key="frame" x="138.5" y="104" width="74" height="22"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+0元" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zxy-Fc-ho1">
<rect key="frame" x="75.5" y="179" width="200" height="41"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="2sQ-8M-T26"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="34"/>
<color key="textColor" red="0.99215686274509807" green="0.8784313725490196" blue="0.29803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ylj-kZ-eAE">
<rect key="frame" x="66" y="250.5" width="219" height="49"/>
<state key="normal" title=" 领6倍红包" image="alert_six_cash_play_btn_bg" backgroundImage="alert_six_cash_btn_bg"/>
<connections>
<action selector="gainSixRedAwardAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="NVa-Jv-Xxj"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HYO-Ph-Ebm">
<rect key="frame" x="308.5" y="108" width="28" height="29"/>
<state key="normal" image="alert_six_cash_cancel_icon" backgroundImage="alert_six_cash_timer_icon"/>
<connections>
<action selector="cancelAction" destination="iN0-l3-epB" eventType="touchUpInside" id="xOg-DO-O1s"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="zxy-Fc-ho1" firstAttribute="centerX" secondItem="bGP-FP-Uak" secondAttribute="centerX" id="4GD-0u-APm"/>
<constraint firstItem="2da-nI-zSn" firstAttribute="top" secondItem="bGP-FP-Uak" secondAttribute="top" id="4p2-Nu-7SY"/>
<constraint firstAttribute="bottom" secondItem="Ylj-kZ-eAE" secondAttribute="bottom" constant="20" id="8C8-cL-ljV"/>
<constraint firstItem="2da-nI-zSn" firstAttribute="leading" secondItem="bGP-FP-Uak" secondAttribute="leading" id="BQO-dq-tyf"/>
<constraint firstItem="i3a-5g-mXh" firstAttribute="centerX" secondItem="bGP-FP-Uak" secondAttribute="centerX" id="Hc7-DK-QAa"/>
<constraint firstItem="Ylj-kZ-eAE" firstAttribute="centerX" secondItem="bGP-FP-Uak" secondAttribute="centerX" id="Mj1-4u-tu2"/>
<constraint firstItem="zxy-Fc-ho1" firstAttribute="centerY" secondItem="bGP-FP-Uak" secondAttribute="centerY" constant="40" id="dse-9S-eNa"/>
<constraint firstAttribute="trailing" secondItem="2da-nI-zSn" secondAttribute="trailing" id="hIl-Ir-iTa"/>
<constraint firstItem="i3a-5g-mXh" firstAttribute="top" secondItem="bGP-FP-Uak" secondAttribute="top" constant="104" id="kV9-iw-gmM"/>
<constraint firstItem="HYO-Ph-Ebm" firstAttribute="top" secondItem="bGP-FP-Uak" secondAttribute="top" constant="108" id="ohw-4E-lwV"/>
<constraint firstAttribute="bottom" secondItem="2da-nI-zSn" secondAttribute="bottom" id="phY-Yx-BF3"/>
<constraint firstAttribute="trailing" secondItem="HYO-Ph-Ebm" secondAttribute="trailing" constant="15" id="xs3-sY-qmR"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="bGP-FP-Uak" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="UNA-FQ-Iws"/>
<constraint firstItem="bGP-FP-Uak" firstAttribute="centerY" secondItem="vUN-kp-3ea" secondAttribute="centerY" id="nlM-C2-fyE"/>
</constraints>
<connections>
<outlet property="cancelButton" destination="HYO-Ph-Ebm" id="lfV-e6-Iav"/>
<outlet property="gainAmountLabel" destination="zxy-Fc-ho1" id="G39-bM-Ys2"/>
<outlet property="mainContentView" destination="bGP-FP-Uak" id="iZP-JO-4pI"/>
</connections>
<point key="canvasLocation" x="-197.10144927536234" y="122.54464285714285"/>
</view>
</objects>
<resources>
<image name="alert_six_cash_bg" width="351.5" height="319.5"/>
<image name="alert_six_cash_btn_bg" width="218.5" height="48.5"/>
<image name="alert_six_cash_cancel_icon" width="28" height="28.5"/>
<image name="alert_six_cash_play_btn_bg" width="25" height="25"/>
<image name="alert_six_cash_timer_icon" width="28" height="28.5"/>
</resources>
</document>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#import <UMCommon/UMCommon.h> #import <UMCommon/UMCommon.h>
#import "GYSettingViewController.h" #import "GYSettingViewController.h"
#import "GYLoginViewController.h" #import "GYLoginViewController.h"
#import "GYCashSixAwardAlertView.h"
UnityFramework* UnityFrameworkLoad() UnityFramework* UnityFrameworkLoad()
{ {
...@@ -326,10 +327,10 @@ NSDictionary* appLaunchOpts; ...@@ -326,10 +327,10 @@ NSDictionary* appLaunchOpts;
// 获取首页信息 // 获取首页信息
- (void)ios_getHomeInfo { - (void)ios_getHomeInfo {
[[CGNetworkTools shared] getWithAction: getHomeInfo parameters: @{} success:^(id _Nonnull response) { [[CGNetworkTools shared] getWithAction: getHomeInfo parameters: @{} success:^(id _Nonnull response) {
if ([[response objectForKey:@"status"] integerValue] == 200) { if ([[response objectForKey:@"status"] integerValue] == 200) {
NSData *data = [NSJSONSerialization dataWithJSONObject:[[response objectForKey:@"result"] objectForKey:@"data"] options:NSJSONWritingFragmentsAllowed error:nil]; NSData *data = [NSJSONSerialization dataWithJSONObject:[[response objectForKey:@"result"] objectForKey:@"data"] options:NSJSONWritingFragmentsAllowed error:nil];
NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[[self ufw] sendMessageToGOWithName: "GameManager" functionName: "onHomeSuccess" message: [jsonStr UTF8String]]; [[self ufw] sendMessageToGOWithName: "GameManager" functionName: "onHomeSuccess" message: [jsonStr UTF8String]];
} }
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
...@@ -395,6 +396,7 @@ NSDictionary* appLaunchOpts; ...@@ -395,6 +396,7 @@ NSDictionary* appLaunchOpts;
NSData *data = [NSJSONSerialization dataWithJSONObject: dict options:NSJSONWritingFragmentsAllowed error:nil]; NSData *data = [NSJSONSerialization dataWithJSONObject: dict options:NSJSONWritingFragmentsAllowed error:nil];
NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[[self ufw] sendMessageToGOWithName: "GameManager" functionName: "onLandUnLockSuccess" message: [jsonStr UTF8String]]; [[self ufw] sendMessageToGOWithName: "GameManager" functionName: "onLandUnLockSuccess" message: [jsonStr UTF8String]];
[self ios_getHomeInfo];
} }
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
...@@ -532,7 +534,8 @@ NSDictionary* appLaunchOpts; ...@@ -532,7 +534,8 @@ NSDictionary* appLaunchOpts;
// 使用云朵加速弹窗 // 使用云朵加速弹窗
- (void)ios_checkCloud { - (void)ios_checkCloud {
[[CGNetworkTools shared] postWithAction:CloudSpeedUp parameters:@{} success:^(id _Nonnull response) {
[[CGNetworkTools shared] getWithAction:cloudCheck parameters:@{} success:^(id _Nonnull response) {
if ([[response objectForKey:@"status"] integerValue] == 200) { if ([[response objectForKey:@"status"] integerValue] == 200) {
NSData *data = [NSJSONSerialization dataWithJSONObject:[[response objectForKey:@"result"] objectForKey:@"data"] options:NSJSONWritingFragmentsAllowed error:nil]; NSData *data = [NSJSONSerialization dataWithJSONObject:[[response objectForKey:@"result"] objectForKey:@"data"] options:NSJSONWritingFragmentsAllowed error:nil];
NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSString * jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
...@@ -574,11 +577,13 @@ NSDictionary* appLaunchOpts; ...@@ -574,11 +577,13 @@ NSDictionary* appLaunchOpts;
// 收红包 // 收红包
- (void)ios_onRedPackReceive: (int)redPackId redPackMoneyNum: (const char *)moneyNum { - (void)ios_onRedPackReceive: (int)redPackId redPackMoneyNum: (const char *)moneyNum {
//redPackReceive //redPackReceive
NSString * moneyNumber = [[NSString alloc] initWithUTF8String: moneyNum];
[[CGNetworkTools shared] postWithAction:redPackReceive parameters:@{@"id": [NSString stringWithFormat:@"%d", redPackId]} success:^(id _Nonnull response) { [[CGNetworkTools shared] postWithAction:redPackReceive parameters:@{@"id": [NSString stringWithFormat:@"%d", redPackId]} success:^(id _Nonnull response) {
NSDictionary *data = [[response objectForKey:@"result"] objectForKey:@"data"]; NSDictionary *data = [[response objectForKey:@"result"] objectForKey:@"data"];
NSString *multipleSid = [[data objectForKey:@"double"] objectForKey:@"multipleSid"]; NSString *multipleSid = [[data objectForKey:@"double"] objectForKey:@"multipleSid"];
if (multipleSid) { if (multipleSid) {
[self awardMultiple: multipleSid];
[self awardMultiple: multipleSid moneyNum: moneyNumber];
} }
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
...@@ -586,33 +591,48 @@ NSDictionary* appLaunchOpts; ...@@ -586,33 +591,48 @@ NSDictionary* appLaunchOpts;
} }
//领取翻倍奖励v3 //领取翻倍奖励v3
- (void)awardMultiple: (NSString *)sid { - (void)awardMultiple: (NSString *)sid moneyNum: (NSString *)num {
[[CGNetworkTools shared] postWithAction:awardMultiple parameters:@{@"sid": sid} success:^(id _Nonnull response) {
if ([[response objectForKey:@"status"] integerValue] == 200) { GYCashSixAwardAlertView *alertVC = [GYCashSixAwardAlertView loadFromNib];
[alertVC showAlertToView:[[self ufw] appController].window amount:num];
NSDictionary *result = [[response objectForKey:@"result"] objectForKey:@"data"];
NSArray *rewardContentList = [result objectForKey:@"rewardContentList"]; WEAKSELF
if (rewardContentList.count <= 0) { alertVC.closeCallBack = ^(bool result) {
return; if (result) {
}
NSInteger totalRewardNum = [[rewardContentList.firstObject objectForKey:@"totalRewardNum"] integerValue]; // 播放视频
GYOpenBoxModel * sModel = [GYOpenBoxModel new];
sModel.type = 2; [[CGNetworkTools shared] postWithAction:awardMultiple parameters:@{@"sid": sid} success:^(id _Nonnull response) {
sModel.awardNum = totalRewardNum;
if ([[response objectForKey:@"status"] integerValue] == 200) {
GYGiftAlertView * gift = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([GYGiftAlertView class]) owner:self options:nil].firstObject;
gift.boxModel = sModel; NSDictionary *result = [[response objectForKey:@"result"] objectForKey:@"data"];
gift.frame = [[self ufw] appController].window.bounds; NSArray *rewardContentList = [result objectForKey:@"rewardContentList"];
[[[self ufw] appController].window addSubview:gift]; if (rewardContentList.count <= 0) {
[gift show:nil]; return;
}
NSInteger totalRewardNum = [[rewardContentList.firstObject objectForKey:@"totalRewardNum"] integerValue];
GYOpenBoxModel * sModel = [GYOpenBoxModel new];
sModel.type = 2;
sModel.awardNum = totalRewardNum;
GYGiftAlertView * gift = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([GYGiftAlertView class]) owner:self options:nil].firstObject;
gift.boxModel = sModel;
gift.frame = [[self ufw] appController].window.bounds;
[[[self ufw] appController].window addSubview:gift];
[gift show:nil];
[self ios_getHomeInfo];
[self ios_onGetRedPackList];
}
} failure:^(NSError * _Nonnull error) {
}];
} else {
[self ios_getHomeInfo];
[self ios_onGetRedPackList];
} }
} failure:^(NSError * _Nonnull error) { };
}];
} }
// 红包列表 // 红包列表
...@@ -691,11 +711,7 @@ NSDictionary* appLaunchOpts; ...@@ -691,11 +711,7 @@ NSDictionary* appLaunchOpts;
self.window.rootViewController = tempVC; self.window.rootViewController = tempVC;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
[[CGUserManager shared] getServiceInfo:^{
} failure:^{
}];
[ZJGuideConfig configWithWindow:self.window finishMainVC:nil showGuide:^(BOOL result) { [ZJGuideConfig configWithWindow:self.window finishMainVC:nil showGuide:^(BOOL result) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self initUnity]; [self initUnity];
...@@ -705,6 +721,18 @@ NSDictionary* appLaunchOpts; ...@@ -705,6 +721,18 @@ NSDictionary* appLaunchOpts;
}]; }];
[[CGUserManager shared] getServiceInfo:^{
NSString *status = [[CGUserManager shared].appSwitch[@"isopenH5"] stringValue];
NSLog(@"isopenH5 = %@", status);
if ([status isEqualToString:@"1"]) {
Data * data = [[Data alloc] init];
if([[data Read] objectForKey:@"refresh_token"] == nil) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(launchAdSuccesShow) name:LaunchAdSuccesShow object:nil];
}
}
} failure:^{
}];
[[IOSADManager shareADManager] showADType:ADType_OpenScreen resultBlock:^(BOOL success) { [[IOSADManager shareADManager] showADType:ADType_OpenScreen resultBlock:^(BOOL success) {
[[IOSADManager shareADManager] requestVideoAD]; [[IOSADManager shareADManager] requestVideoAD];
}]; }];
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_six_cash_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_six_cash_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_six_cash_btn_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_six_cash_btn_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_six_cash_cancel_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_six_cash_cancel_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_six_cash_play_btn_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_six_cash_play_btn_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_six_cash_timer_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_six_cash_timer_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HN2-80-MUu"> <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HN2-80-MUu">
<rect key="frame" x="78" y="823" width="258" height="29"/> <rect key="frame" x="78" y="823" width="258" height="29"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="登即同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Whn-XS-fJg"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="登即同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Whn-XS-fJg">
<rect key="frame" x="0.0" y="0.0" width="71.5" height="29"/> <rect key="frame" x="0.0" y="0.0" width="71.5" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.49803921568627452" green="0.28627450980392155" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.49803921568627452" green="0.28627450980392155" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
......
...@@ -41,7 +41,8 @@ typedef enum : NSUInteger { ...@@ -41,7 +41,8 @@ typedef enum : NSUInteger {
// getUserGuide, //是否有新手引导--app启动时加载 // getUserGuide, //是否有新手引导--app启动时加载
is_bind_wx, //是否绑定微信 is_bind_wx, //是否绑定微信
getRedPackList // 红包配置列表 getRedPackList, // 红包配置列表
cloudCheck //云朵加速校验
} TQNetwortGetAction; } TQNetwortGetAction;
......
...@@ -88,6 +88,8 @@ static CGNetworkTools* _tools = nil; ...@@ -88,6 +88,8 @@ static CGNetworkTools* _tools = nil;
return @"/app/v1/game/is_bind_wx"; return @"/app/v1/game/is_bind_wx";
case getRedPackList: //红包配置列表 case getRedPackList: //红包配置列表
return @"/app/v1/game/farm/rp_list"; return @"/app/v1/game/farm/rp_list";
case cloudCheck:
return @"/app/v1/game/farm/cloud_check";
default: default:
return @""; return @"";
} }
...@@ -356,7 +358,7 @@ static CGNetworkTools* _tools = nil; ...@@ -356,7 +358,7 @@ static CGNetworkTools* _tools = nil;
[dict setValue: [[data Read] objectForKey:@"source"] forKey: @"source"]; [dict setValue: [[data Read] objectForKey:@"source"] forKey: @"source"];
} }
NSString *uid = [[data Read] objectForKey:@"uid"]; NSString *uid = [[data Read] objectForKey:@"uid"];
if (uid != nil) { [dict setValue: uid forKey: @"uid"]; } if (uid != nil) { [dict setValue: uid forKey: @"uid"]; }
// token // token
NSString *token = [[data Read] objectForKey:@"token"]; NSString *token = [[data Read] objectForKey:@"token"];
...@@ -389,7 +391,7 @@ static CGNetworkTools* _tools = nil; ...@@ -389,7 +391,7 @@ static CGNetworkTools* _tools = nil;
} }
[dict addEntriesFromDictionary:[self signParams:dict]]; [dict addEntriesFromDictionary:[self signParams:dict]];
NSLog(@"parameters info == %@", dict); // NSLog(@"parameters info == %@", dict);
return dict; return dict;
} }
......
...@@ -55,11 +55,11 @@ ...@@ -55,11 +55,11 @@
[self WXLoginOauth:nil]; [self WXLoginOauth:nil];
}else{ }else{
[[CGUserManager shared] addLocCollection:@"click_login" value:@""]; [[CGUserManager shared] addLocCollection:@"click_login" value:@""];
// 构造SendAuthReq结构体 // 构造SendAuthReq结构体
SendAuthReq* req = [[SendAuthReq alloc] init]; SendAuthReq* req = [[SendAuthReq alloc] init];
req.scope = @"snsapi_userinfo"; req.scope = @"snsapi_userinfo";
req.state = WXLoginState; req.state = WXLoginState;
//第三方向微信终端发送一个SendAuthReq消息结构 // 第三方向微信终端发送一个SendAuthReq消息结构
[WXApi sendAuthReq:req viewController:self delegate:UIApplication.sharedApplication.delegate completion:^(BOOL success) { [WXApi sendAuthReq:req viewController:self delegate:UIApplication.sharedApplication.delegate completion:^(BOOL success) {
if (!success){ if (!success){
[[CGUserManager shared] addLocCollection:@"login_fail" value:@""]; [[CGUserManager shared] addLocCollection:@"login_fail" value:@""];
......
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
<action selector="startBtn:" destination="Drb-cr-bUK" eventType="touchUpInside" id="ReI-2A-bXq"/> <action selector="startBtn:" destination="Drb-cr-bUK" eventType="touchUpInside" id="ReI-2A-bXq"/>
</connections> </connections>
</button> </button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="每日12:00 18:00 00:00重置" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UOe-3b-Yfa"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="每日12:00 18:00 21:00 00:00重置" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UOe-3b-Yfa">
<rect key="frame" x="102" y="592" width="210" height="21"/> <rect key="frame" x="79" y="592" width="256.5" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -14,17 +14,17 @@ ...@@ -14,17 +14,17 @@
<key>BaiduMobAd_SDK.xcscheme_^#shared#^_</key> <key>BaiduMobAd_SDK.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>11</integer> <integer>14</integer>
</dict> </dict>
<key>Bytedance-UnionAD.xcscheme_^#shared#^_</key> <key>Bytedance-UnionAD.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>10</integer> <integer>7</integer>
</dict> </dict>
<key>GDTMobSDK.xcscheme_^#shared#^_</key> <key>GDTMobSDK.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>13</integer> <integer>12</integer>
</dict> </dict>
<key>KSAdSDK.xcscheme_^#shared#^_</key> <key>KSAdSDK.xcscheme_^#shared#^_</key>
<dict> <dict>
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
<key>MJExtension.xcscheme_^#shared#^_</key> <key>MJExtension.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>15</integer> <integer>8</integer>
</dict> </dict>
<key>MJRefresh.xcscheme_^#shared#^_</key> <key>MJRefresh.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>12</integer> <integer>11</integer>
</dict> </dict>
<key>Masonry.xcscheme</key> <key>Masonry.xcscheme</key>
<dict> <dict>
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
<key>RSPodKSAdaper.xcscheme_^#shared#^_</key> <key>RSPodKSAdaper.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>6</integer> <integer>16</integer>
</dict> </dict>
<key>SigmobAd-iOS.xcscheme_^#shared#^_</key> <key>SigmobAd-iOS.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>8</integer> <integer>10</integer>
</dict> </dict>
<key>SwiftyStoreKit.xcscheme</key> <key>SwiftyStoreKit.xcscheme</key>
<dict> <dict>
...@@ -82,17 +82,17 @@ ...@@ -82,17 +82,17 @@
<key>UMCCommon.xcscheme_^#shared#^_</key> <key>UMCCommon.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>9</integer> <integer>13</integer>
</dict> </dict>
<key>VLionAdSDKPoly.xcscheme_^#shared#^_</key> <key>VLionAdSDKPoly.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>14</integer> <integer>17</integer>
</dict> </dict>
<key>WechatOpenSDK.xcscheme_^#shared#^_</key> <key>WechatOpenSDK.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>7</integer> <integer>9</integer>
</dict> </dict>
</dict> </dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>Unity-iPhone.xcscheme_^#shared#^_</key> <key>Unity-iPhone.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>16</integer> <integer>6</integer>
</dict> </dict>
<key>UnityFramework.xcscheme_^#shared#^_</key> <key>UnityFramework.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>17</integer> <integer>15</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment