Commit e7fb6b51 authored by Sandy's avatar Sandy

bug fix

parent 8127f5f0
......@@ -2920,8 +2920,8 @@
baseConfigurationReference = AAF51B5D53AE9938C03065C3 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = Aland/PrefixHeader.pch;
HEADER_SEARCH_PATHS = (
......
......@@ -28,18 +28,26 @@
self.window.backgroundColor = [UIColor whiteColor];
[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"];
[UMSocialQQHandler setQQWithAppId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" 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 setLogEnabled:YES];
......@@ -54,13 +62,13 @@
error:nil];
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 {
// 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.
......
......@@ -25,7 +25,7 @@
}
- (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.labelSubTitle.text = shop.internalBaseClassDescription;
}
......
......@@ -11,7 +11,7 @@
#import "JavenOrderModel.h"
@interface OrderDetailTopView : UIView
@property (nonatomic, assign) ORDERTOPTYPE orderType;
@property (nonatomic, strong) NSString *orderType;
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelExpress;
@property (weak, nonatomic) IBOutlet UILabel *labelExpressTime;
......
......@@ -22,7 +22,7 @@
- (void)updateByOrderType {
if (self.orderType == ORDERTOPTYPE_TRANSPORTED || self.orderType == ORDERTOPTYPE_COMMPLETE) {
if ([self.orderType isEqualToString: @"配送中"] || [self.orderType isEqualToString:@""]) {
}else{
[self.viewExpress removeFromSuperview];
......
......@@ -17,10 +17,10 @@
#import "CommodityDetailViewController.h"
#import "OrderDetailViewController.h"
#import "CommodityDetailTopView.h"
#import "MJRefresh.h"
#define kCellID @"cellId"
#define kPageSize @10
#define kPageSize 10
#define kTopHeight 291
@interface CustomerViewController ()<UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
......@@ -28,6 +28,8 @@
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrDatas;
@property (nonatomic, strong) CommodityDetailTopView *aTopBackView;
@property (nonatomic, assign) NSInteger page;
@end
......@@ -69,6 +71,11 @@
[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];
......@@ -88,8 +95,8 @@
@"parameters" : @[self.customer.consumer.uuid]}],
@"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}],
@"pageSize" : kPageSize,
@"page" : @0,
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
return myDictionary;
......@@ -109,7 +116,11 @@
self.tableView.contentInset = UIEdgeInsetsMake(kTopHeight, 0, 0, 0);
self.tableView.contentOffset = CGPointMake(0, -kTopHeight);
WS(weakSelf)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
weakSelf.page += 1;
[weakSelf setUpData];
}];
[self.tableView addSubview:self.topView];
}
......
......@@ -20,7 +20,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.isShowNavigationBar = NO;
[[HTTPCilent shareCilent] checkUpdateOnVC:self];
[self setUpView];
// Do any additional setup after loading the view.
}
......
......@@ -11,5 +11,4 @@
@property (nonatomic, copy) NSString *orderTag;
@property (nonatomic, assign) BOOL isFirstLoaded;
- (void)setUpData;
@end
......@@ -19,7 +19,7 @@
#define kExpressCell @"OrderExpressTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
#define kPageSize 4
#define kPageSize 10
#define kHeaderID @"headerId"
#define kFooterID @"footerId"
@interface NoPaymentTableViewController ()
......@@ -49,7 +49,6 @@
self.page += 1;
[weakSelf setUpData];
}];
// [self setUpData];
}
- (NSMutableArray *)arrDatas {
......@@ -64,17 +63,14 @@
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:kWindow];
[weakSelf.tableView.mj_header endRefreshing];
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic];
[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"];
if ([array count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
......@@ -82,6 +78,10 @@
[weakSelf.tableView.mj_footer endRefreshing];
}
if (weakSelf.arrDatas.count > 0) {
[weakSelf.tableView reloadData];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing];
......@@ -168,17 +168,6 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
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.model = self.arrDatas[indexPath.section];
......
......@@ -12,7 +12,7 @@
#import "JavenOrderModel.h"
@interface OrderDetailViewController : IBTUIViewController
@property (nonatomic, strong) OrderDetailTopView *topView;
@property (nonatomic, assign) ORDERTOPTYPE orderType;
@property (nonatomic, copy) NSString *orderType;
@property (nonatomic, strong) JavenOrderModel *model;
......
......@@ -44,7 +44,7 @@
self.atopView = topView;
self.atopView.labelExpressTime.text = self.model.lastModifyInfo.time;
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.tableView addSubview:topView];
......
......@@ -20,29 +20,11 @@
[super viewDidLoad];
self.navigationItem.title = @"订单管理";
[self setUpView];
[self setUPData];
// 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 {
......
......@@ -26,9 +26,13 @@
self.buttonWX.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.buttonWeibo.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.view.backgroundColor = kSysWhite;
// Do any additional setup after loading the view.
}
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
......@@ -36,8 +40,6 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES];
[self defaultLoginAction];
}
......
......@@ -38,8 +38,8 @@
<constraint firstItem="CrZ-m0-0RR" firstAttribute="top" secondItem="Wcx-lp-EEk" secondAttribute="top" id="s5U-mq-SFw"/>
</constraints>
</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">
<rect key="frame" x="16" y="223" width="180" height="18"/>
<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="165" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.50823958329999996" green="0.50823958329999996" blue="0.50823958329999996" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......
......@@ -11,12 +11,21 @@
@interface HTTPCilent : NSObject
+ (HTTPCilent *)shareCilent;
- (void)POST:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (void)GET:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
/**
* 检查更新
*
* @param vc 当前控制器
*/
- (void)checkUpdateOnVC:(UIViewController *)vc;
@end
......@@ -20,7 +20,6 @@
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
cilent = [[HTTPCilent alloc] init];
});
return cilent;
}
......@@ -46,7 +45,7 @@
NSDictionary *dic = responseObject;
// CLog(@"POST success!-------->\n%@", [dic JSONString]);
CLog(@"POST success!-------->\n%@", [dic JSONString]);
success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
......@@ -70,7 +69,7 @@
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *dic = responseObject;
// CLog(@"GET success!-------->%@", [dic JSONString]);
CLog(@"GET success!-------->%@", [dic JSONString]);
success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
......@@ -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
......@@ -87,7 +87,7 @@
* @param shopDescription 描述
* @param url 链接
* @param image 图片
* @param imageUrl 图片链接(判断图片链接是否存在,不存在则禁止分享
* @param imageUrl 图片链接(现在暂时没有用处,可用于判断用户是否上传头像
*/
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl
{
......@@ -95,9 +95,11 @@
[MBProgressHUD Javen_showError:@"请填写店铺名!" onView:kWindow delay:0.7 complete:nil];
}else if(!shopDescription || shopDescription.length == 0){
[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{
}
// else if (!imageUrl || imageUrl.length < 5) {
// [MBProgressHUD Javen_showError:@"请上传店铺头像!" onView:kWindow delay:0.7 complete:nil];
// }
else{
[self showWithTitle:title content:shopDescription url:url image:image];
}
}
......
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
......@@ -42,7 +42,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.04</string>
<string>1.0.1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<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