Commit e7fb6b51 authored by Sandy's avatar Sandy

bug fix

parent 8127f5f0
...@@ -2920,8 +2920,8 @@ ...@@ -2920,8 +2920,8 @@
baseConfigurationReference = AAF51B5D53AE9938C03065C3 /* Pods.release.xcconfig */; baseConfigurationReference = AAF51B5D53AE9938C03065C3 /* Pods.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = Aland/PrefixHeader.pch; GCC_PREFIX_HEADER = Aland/PrefixHeader.pch;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
......
...@@ -28,18 +28,26 @@ ...@@ -28,18 +28,26 @@
self.window.backgroundColor = [UIColor whiteColor]; self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
[self setUpUM];
LoginViewController *loginVC = [[LoginViewController alloc] init];
IBTUINavigationController *navc = [[IBTUINavigationController alloc] initWithRootViewController:loginVC];
self.window.rootViewController = navc;
[[[IQKeyboardManager sharedManager] disabledDistanceHandlingClasses] addObject:[ZCUIBaseController class]];
[[IQKeyboardManager sharedManager].disabledToolbarClasses addObject:[ZCUIBaseController class]];
return YES;
}
/** 设置友盟相关 */
- (void)setUpUM
{
[UMSocialData setAppKey:@"573ed34ae0f55a408c000018"]; [UMSocialData setAppKey:@"573ed34ae0f55a408c000018"];
[UMSocialQQHandler setQQWithAppId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" url:@"http://www.umeng.com/social"]; [UMSocialQQHandler setQQWithAppId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" url:@"http://www.umeng.com/social"];
[UMSocialWechatHandler setWXAppId:@"wx2e218a9fb84928fa" appSecret:@"400c1925383f36f7768de707c69035e2" url:@"http://www.umeng.com/social"]; [UMSocialWechatHandler setWXAppId:@"wx2e218a9fb84928fa" appSecret:@"400c1925383f36f7768de707c69035e2" url:@"http://www.umeng.com/social"];
if ([UserInfo shareInstance].uuid) {
BaseViewController *baseVC = [[BaseViewController alloc] init];
self.window.rootViewController = baseVC;
}else{
LoginViewController *loginVC = [[LoginViewController alloc] init];
IBTUINavigationController *navc = [[IBTUINavigationController alloc] initWithRootViewController:loginVC];
self.window.rootViewController = navc;
}
[MobClick startWithAppkey:@"573ed34ae0f55a408c000018" reportPolicy:(REALTIME) channelId:nil]; [MobClick startWithAppkey:@"573ed34ae0f55a408c000018" reportPolicy:(REALTIME) channelId:nil];
[MobClick setLogEnabled:YES]; [MobClick setLogEnabled:YES];
...@@ -54,13 +62,13 @@ ...@@ -54,13 +62,13 @@
error:nil]; error:nil];
NSLog(@"%@", [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]); NSLog(@"%@", [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]);
[[[IQKeyboardManager sharedManager] disabledDistanceHandlingClasses] addObject:[ZCUIBaseController class]];
[[IQKeyboardManager sharedManager].disabledToolbarClasses addObject:[ZCUIBaseController class]];
return YES;
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
} }
- (void)updateTopViewInfo:(JavenShopModel *)shop { - (void)updateTopViewInfo:(JavenShopModel *)shop {
[self.imageViewUserIcon sd_setImageWithURL:[NSURL URLWithString:shop.pictures] placeholderImage:kUserIconPlaceHolderImage]; [self.imageViewUserIcon sd_setImageWithURL:[NSURL URLWithString:shop.pictures] placeholderImage:[UIImage imageNamed:@"default_commodity_placeholder"]];
self.labelName.text = shop.name; self.labelName.text = shop.name;
self.labelSubTitle.text = shop.internalBaseClassDescription; self.labelSubTitle.text = shop.internalBaseClassDescription;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#import "JavenOrderModel.h" #import "JavenOrderModel.h"
@interface OrderDetailTopView : UIView @interface OrderDetailTopView : UIView
@property (nonatomic, assign) ORDERTOPTYPE orderType; @property (nonatomic, strong) NSString *orderType;
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelExpress; @property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelExpress;
@property (weak, nonatomic) IBOutlet UILabel *labelExpressTime; @property (weak, nonatomic) IBOutlet UILabel *labelExpressTime;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
- (void)updateByOrderType { - (void)updateByOrderType {
if (self.orderType == ORDERTOPTYPE_TRANSPORTED || self.orderType == ORDERTOPTYPE_COMMPLETE) { if ([self.orderType isEqualToString: @"配送中"] || [self.orderType isEqualToString:@""]) {
}else{ }else{
[self.viewExpress removeFromSuperview]; [self.viewExpress removeFromSuperview];
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
#import "CommodityDetailViewController.h" #import "CommodityDetailViewController.h"
#import "OrderDetailViewController.h" #import "OrderDetailViewController.h"
#import "CommodityDetailTopView.h" #import "CommodityDetailTopView.h"
#import "MJRefresh.h"
#define kCellID @"cellId" #define kCellID @"cellId"
#define kPageSize @10 #define kPageSize 10
#define kTopHeight 291 #define kTopHeight 291
@interface CustomerViewController ()<UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate> @interface CustomerViewController ()<UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrDatas; @property (nonatomic, strong) NSMutableArray *arrDatas;
@property (nonatomic, strong) CommodityDetailTopView *aTopBackView; @property (nonatomic, strong) CommodityDetailTopView *aTopBackView;
@property (nonatomic, assign) NSInteger page;
@end @end
...@@ -69,6 +71,11 @@ ...@@ -69,6 +71,11 @@
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil]; [MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
} }
if ([(NSArray *)responseObject[@"queryResult"] count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView reloadData]; [weakSelf.tableView reloadData];
...@@ -88,8 +95,8 @@ ...@@ -88,8 +95,8 @@
@"parameters" : @[self.customer.consumer.uuid]}], @"parameters" : @[self.customer.consumer.uuid]}],
@"orders" : @[@{@"field" : @"createInfo.time", @"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}], @"direction" : @"desc"}],
@"pageSize" : kPageSize, @"pageSize" : @(kPageSize),
@"page" : @0, @"page" : @(self.page),
@"probePages" : @0}, @"probePages" : @0},
@"fetchParts" : @[@"string"]}; @"fetchParts" : @[@"string"]};
return myDictionary; return myDictionary;
...@@ -109,7 +116,11 @@ ...@@ -109,7 +116,11 @@
self.tableView.contentInset = UIEdgeInsetsMake(kTopHeight, 0, 0, 0); self.tableView.contentInset = UIEdgeInsetsMake(kTopHeight, 0, 0, 0);
self.tableView.contentOffset = CGPointMake(0, -kTopHeight); self.tableView.contentOffset = CGPointMake(0, -kTopHeight);
WS(weakSelf)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
weakSelf.page += 1;
[weakSelf setUpData];
}];
[self.tableView addSubview:self.topView]; [self.tableView addSubview:self.topView];
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.isShowNavigationBar = NO; self.isShowNavigationBar = NO;
[[HTTPCilent shareCilent] checkUpdateOnVC:self];
[self setUpView]; [self setUpView];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
......
...@@ -11,5 +11,4 @@ ...@@ -11,5 +11,4 @@
@property (nonatomic, copy) NSString *orderTag; @property (nonatomic, copy) NSString *orderTag;
@property (nonatomic, assign) BOOL isFirstLoaded; @property (nonatomic, assign) BOOL isFirstLoaded;
- (void)setUpData;
@end @end
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#define kExpressCell @"OrderExpressTableViewCell.h" #define kExpressCell @"OrderExpressTableViewCell.h"
#define kCellId @"OrderTableViewCell.h" #define kCellId @"OrderTableViewCell.h"
#define kPageSize 4 #define kPageSize 10
#define kHeaderID @"headerId" #define kHeaderID @"headerId"
#define kFooterID @"footerId" #define kFooterID @"footerId"
@interface NoPaymentTableViewController () @interface NoPaymentTableViewController ()
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
self.page += 1; self.page += 1;
[weakSelf setUpData]; [weakSelf setUpData];
}]; }];
// [self setUpData];
} }
- (NSMutableArray *)arrDatas { - (NSMutableArray *)arrDatas {
...@@ -64,17 +63,14 @@ ...@@ -64,17 +63,14 @@
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:kWindow]; [MBProgressHUD hideHUDForView:kWindow];
[weakSelf.tableView.mj_header endRefreshing];
for (NSDictionary *dic in responseObject[@"queryResult"]) { for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic]; JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic];
[weakSelf.arrDatas addObject:model]; [weakSelf.arrDatas addObject:model];
} }
[weakSelf.tableView reloadData]; //判断后面是否还有数据
if (weakSelf.arrDatas.count < kPageSize) {
weakSelf.tableView.mj_footer.hidden = YES;
}
[weakSelf.tableView.mj_header endRefreshing];
NSArray *array = responseObject[@"queryResult"]; NSArray *array = responseObject[@"queryResult"];
if ([array count] < kPageSize) { if ([array count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData]; [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
...@@ -82,6 +78,10 @@ ...@@ -82,6 +78,10 @@
[weakSelf.tableView.mj_footer endRefreshing]; [weakSelf.tableView.mj_footer endRefreshing];
} }
if (weakSelf.arrDatas.count > 0) {
[weakSelf.tableView reloadData];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) { } failure:^(NSURLSessionDataTask *task, NSError *error) {
[weakSelf.tableView.mj_header endRefreshing]; [weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing]; [weakSelf.tableView.mj_footer endRefreshing];
...@@ -168,17 +168,6 @@ ...@@ -168,17 +168,6 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
OrderDetailViewController *orderDetailVC = [[OrderDetailViewController alloc] init]; OrderDetailViewController *orderDetailVC = [[OrderDetailViewController alloc] init];
if ([self.title isEqualToString:@"代支付"]) {
orderDetailVC.orderType = ORDERTOPTYPE_NOPAYMENT;
}else if([self.title isEqualToString:@"待发货"]){
orderDetailVC.orderType = ORDERTOPTYPE_WAITFORDISPATCH;
}else if ([self.title isEqualToString:@"已发货"]){
orderDetailVC.orderType = ORDERTOPTYPE_TRANSPORTED;
}else if ([self.title isEqualToString:@"已完成"]){
orderDetailVC.orderType = ORDERTOPTYPE_COMMPLETE;
}else if ([self.title isEqualToString:@"已取消"]){
orderDetailVC.orderType = ORDERTOPTYPE_CANCELED;
}
orderDetailVC.isShowNavigationBar = YES; orderDetailVC.isShowNavigationBar = YES;
orderDetailVC.model = self.arrDatas[indexPath.section]; orderDetailVC.model = self.arrDatas[indexPath.section];
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#import "JavenOrderModel.h" #import "JavenOrderModel.h"
@interface OrderDetailViewController : IBTUIViewController @interface OrderDetailViewController : IBTUIViewController
@property (nonatomic, strong) OrderDetailTopView *topView; @property (nonatomic, strong) OrderDetailTopView *topView;
@property (nonatomic, assign) ORDERTOPTYPE orderType; @property (nonatomic, copy) NSString *orderType;
@property (nonatomic, strong) JavenOrderModel *model; @property (nonatomic, strong) JavenOrderModel *model;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
self.atopView = topView; self.atopView = topView;
self.atopView.labelExpressTime.text = self.model.lastModifyInfo.time; self.atopView.labelExpressTime.text = self.model.lastModifyInfo.time;
self.atopView.labelExpress.text = self.model.shipType; self.atopView.labelExpress.text = self.model.shipType;
self.atopView.orderType = self.orderType; self.atopView.orderType = [self.model.state getOrderStateString];;
[self.atopView viewWithModel:self.model]; [self.atopView viewWithModel:self.model];
[self.tableView addSubview:topView]; [self.tableView addSubview:topView];
......
...@@ -20,29 +20,11 @@ ...@@ -20,29 +20,11 @@
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"订单管理"; self.navigationItem.title = @"订单管理";
[self setUpView]; [self setUpView];
[self setUPData];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)setUPData {
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"shop uuid equals",
@"parameters" : @[[UserInfo shareInstance].shop.uuid]}],
@"orders" : @[@{@"field" : @"state",
@"direction" : @"desc"}],
@"pageSize" : @0,
@"page" : @99,
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
[[HTTPCilent shareCilent] POST:@"order/query" parameters:myDictionary success:^(NSURLSessionDataTask *task, id responseObject) {
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)setUpView { - (void)setUpView {
......
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
self.buttonWX.imageView.contentMode = UIViewContentModeScaleAspectFit; self.buttonWX.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.buttonWeibo.imageView.contentMode = UIViewContentModeScaleAspectFit; self.buttonWeibo.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.view.backgroundColor = kSysWhite; self.view.backgroundColor = kSysWhite;
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (UIStatusBarStyle)preferredStatusBarStyle { - (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault; return UIStatusBarStyleDefault;
} }
...@@ -36,8 +40,6 @@ ...@@ -36,8 +40,6 @@
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES]; [self.navigationController setNavigationBarHidden:YES];
[self defaultLoginAction]; [self defaultLoginAction];
} }
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<constraint firstItem="CrZ-m0-0RR" firstAttribute="top" secondItem="Wcx-lp-EEk" secondAttribute="top" id="s5U-mq-SFw"/> <constraint firstItem="CrZ-m0-0RR" firstAttribute="top" secondItem="Wcx-lp-EEk" secondAttribute="top" id="s5U-mq-SFw"/>
</constraints> </constraints>
</view> </view>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="给你的店铺来个自我介绍吧" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="glN-vA-Czn"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="给自己设置一个签名吧!" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="glN-vA-Czn">
<rect key="frame" x="16" y="223" width="180" height="18"/> <rect key="frame" x="16" y="223" width="165" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/> <fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.50823958329999996" green="0.50823958329999996" blue="0.50823958329999996" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.50823958329999996" green="0.50823958329999996" blue="0.50823958329999996" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -11,12 +11,21 @@ ...@@ -11,12 +11,21 @@
@interface HTTPCilent : NSObject @interface HTTPCilent : NSObject
+ (HTTPCilent *)shareCilent; + (HTTPCilent *)shareCilent;
- (void)POST:(NSString *)URLString - (void)POST:(NSString *)URLString
parameters:(id)parameters parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (void)GET:(NSString *)URLString - (void)GET:(NSString *)URLString
parameters:(id)parameters parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
/**
* 检查更新
*
* @param vc 当前控制器
*/
- (void)checkUpdateOnVC:(UIViewController *)vc;
@end @end
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
cilent = [[HTTPCilent alloc] init]; cilent = [[HTTPCilent alloc] init];
}); });
return cilent; return cilent;
} }
...@@ -46,7 +45,7 @@ ...@@ -46,7 +45,7 @@
NSDictionary *dic = responseObject; NSDictionary *dic = responseObject;
// CLog(@"POST success!-------->\n%@", [dic JSONString]); CLog(@"POST success!-------->\n%@", [dic JSONString]);
success(task, responseObject); success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
...@@ -70,7 +69,7 @@ ...@@ -70,7 +69,7 @@
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *dic = responseObject; NSDictionary *dic = responseObject;
// CLog(@"GET success!-------->%@", [dic JSONString]); CLog(@"GET success!-------->%@", [dic JSONString]);
success(task, responseObject); success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
...@@ -86,4 +85,72 @@ ...@@ -86,4 +85,72 @@
} }
- (void)checkUpdateOnVC:(UIViewController *)vc{
//版本号 取的是build
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSDictionary *params = @{@"domain": kDomain,
@"version": version,
@"type": @"ipa"
};
[[[self class] shareCilent] POST:@"app/getUpgrade" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
if (kIsResponseSuccess(responseObject)) {
NSDictionary *dic = responseObject[@"upgradeInfo"];
NSString *lastestVersion = dic[@"version"];
BOOL isForceUpdate = [dic[@"forceUpdate"] boolValue];
NSArray *arrVersion = [version componentsSeparatedByString:@"."];
NSArray *arrLatestVersion = [lastestVersion componentsSeparatedByString:@"."];
NSURL *trackViewUrl = [NSURL URLWithString:@"https://itunes.apple.com/us/app/xin-ying-yang-bu-luo/id1116490021?mt=8&uo=4"];
if (![arrVersion[0] isEqualToString: arrLatestVersion[0]]) {
CLog(@"大版本号有更新");
if (isForceUpdate) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"已经有新版本可以下载\n不更新将会软件将无法正常使用!!" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:({
UIAlertAction *action = [UIAlertAction actionWithTitle:@"前往更新" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:trackViewUrl];
[vc PresentModalViewController:alert animated:YES];
}];
action;
})];
[vc PresentModalViewController:alert animated:YES];
return ;
}
}
for (int i = 1; i < 3; i++) {
if (![arrVersion[i] isEqualToString:arrLatestVersion[i]]) {
CLog(@"小版本号有更新");
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"已经有新版本可以下载了哟!" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:({
UIAlertAction *action = [UIAlertAction actionWithTitle:@"前往更新" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:trackViewUrl];
}];
action;
})];
[alert addAction:({
UIAlertAction *action = [UIAlertAction actionWithTitle:@"暂不更新" style:UIAlertActionStyleDefault handler:nil];
action;
})];
[vc PresentModalViewController:alert animated:YES];
return ;
}
}
}
CLog(@"d");
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
@end @end
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
* @param shopDescription 描述 * @param shopDescription 描述
* @param url 链接 * @param url 链接
* @param image 图片 * @param image 图片
* @param imageUrl 图片链接(判断图片链接是否存在,不存在则禁止分享 * @param imageUrl 图片链接(现在暂时没有用处,可用于判断用户是否上传头像
*/ */
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl - (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl
{ {
...@@ -95,9 +95,11 @@ ...@@ -95,9 +95,11 @@
[MBProgressHUD Javen_showError:@"请填写店铺名!" onView:kWindow delay:0.7 complete:nil]; [MBProgressHUD Javen_showError:@"请填写店铺名!" onView:kWindow delay:0.7 complete:nil];
}else if(!shopDescription || shopDescription.length == 0){ }else if(!shopDescription || shopDescription.length == 0){
[MBProgressHUD Javen_showError:@"请填写店铺简介!" onView:kWindow delay:0.7 complete:nil]; [MBProgressHUD Javen_showError:@"请填写店铺简介!" onView:kWindow delay:0.7 complete:nil];
}else if (!imageUrl || imageUrl.length < 5) { }
[MBProgressHUD Javen_showError:@"请上传店铺头像!" onView:kWindow delay:0.7 complete:nil]; // else if (!imageUrl || imageUrl.length < 5) {
}else{ // [MBProgressHUD Javen_showError:@"请上传店铺头像!" onView:kWindow delay:0.7 complete:nil];
// }
else{
[self showWithTitle:title content:shopDescription url:url image:image]; [self showWithTitle:title content:shopDescription url:url image:image];
} }
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.0</string> <string>1.0.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0.04</string> <string>1.0.1</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>wechat</string> <string>wechat</string>
......
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