Commit d865c1bc authored by 勾芒's avatar 勾芒

完成分享功能,实现上传进度显示

parent 9aafd9da
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
* 总页数 * 总页数
*/ */
@property (nonatomic,assign) int totalPages; @property (nonatomic,assign) int totalPages;
/**
* 参数模型
*/
@property (nonatomic,strong) ConsumerQueryCondition *conditionModel;
@end @end
@implementation AllCustomerViewController @implementation AllCustomerViewController
...@@ -45,6 +51,18 @@ ...@@ -45,6 +51,18 @@
return _CustomerresultArray; return _CustomerresultArray;
} }
/**
* 初始化参数模型
*/
- (ConsumerQueryCondition *)conditionModel
{
if (!_conditionModel) {
_conditionModel = [[ConsumerQueryCondition alloc]init];
}
return _conditionModel;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -99,12 +117,11 @@ ...@@ -99,12 +117,11 @@
//下拉刷新 //下拉刷新
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = 1; page.page = 1;
page.rows = KROWS; page.rows = KROWS;
condition.page = page; self.conditionModel.page = page;
[self getShoppersAssociatedCustomer:condition isRemove:YES]; [self getShoppersAssociatedCustomer:self.conditionModel isRemove:YES];
}]; }];
headerRefresh.stateLabel.hidden = YES; headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES; headerRefresh.lastUpdatedTimeLabel.hidden = YES;
...@@ -114,16 +131,15 @@ ...@@ -114,16 +131,15 @@
//上拉加载 //上拉加载
self.allCustomerTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.allCustomerTableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
ConsumerQueryCondition *condition = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.rows = KROWS;
if (self.indexPage ++ > self.totalPages) { if (self.indexPage ++ > self.totalPages) {
[self.allCustomerTableview.mj_footer endRefreshingWithNoMoreData]; [self.allCustomerTableview.mj_footer endRefreshingWithNoMoreData];
}else }else
{ {
DataPage *page = [[DataPage alloc]init];
page.rows = KROWS;
page.page = self.indexPage ++; page.page = self.indexPage ++;
condition.page = page; self.conditionModel.page = page;
[self getShoppersAssociatedCustomer:condition isRemove:NO]; [self getShoppersAssociatedCustomer:self.conditionModel isRemove:NO];
} }
}]; }];
} }
...@@ -280,6 +296,7 @@ ...@@ -280,6 +296,7 @@
NSString *startString = self.begindateButton.currentTitle; NSString *startString = self.begindateButton.currentTitle;
NSString *endString = self.enddateButton.currentTitle; NSString *endString = self.enddateButton.currentTitle;
NSDateFormatter* formater = [[NSDateFormatter alloc] init]; NSDateFormatter* formater = [[NSDateFormatter alloc] init];
NSDateFormatter* endformater = [[NSDateFormatter alloc] init];
[formater setDateFormat:@"yyyy-MM-dd"]; [formater setDateFormat:@"yyyy-MM-dd"];
NSDate* date = [formater dateFromString:startString]; NSDate* date = [formater dateFromString:startString];
[formater setDateFormat:@"yyyy-MM-dd"]; [formater setDateFormat:@"yyyy-MM-dd"];
...@@ -287,54 +304,42 @@ ...@@ -287,54 +304,42 @@
//比较结果 //比较结果
NSInteger result = [self compareOneDay:date withAnotherDay:date1]; NSInteger result = [self compareOneDay:date withAnotherDay:date1];
ConsumerQueryCondition *searchCustomer = [[ConsumerQueryCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 1;
page.rows = 99999;
searchCustomer.page = page;
//比较两个NSDate的大小 //比较两个NSDate的大小
switch (result) { switch (result) {
case -1://start < end case -1://start < end
{ {
[formater setDateFormat:@"yyyy-MM-dd HH:dd:ss"]; [formater setDateFormat:@"yyyy-MM-dd 00:00:01"];
searchCustomer.createTimeBegin = [formater stringFromDate:[self ReturnZeroTime:date]]; [endformater setDateFormat:@"yyyy-MM-dd 23:59:59"];
searchCustomer.createTimeEnd = [formater stringFromDate:[self ReturnZeroTime:date1]]; self.conditionModel.createTimeBegin = [formater stringFromDate:date];
self.conditionModel.createTimeEnd = [endformater stringFromDate:date1];
} }
break; break;
case 0://start == end case 0://start == end
{ {
[formater setDateFormat:@"yyyy-MM-dd HH:dd:ss"]; [formater setDateFormat:@"yyyy-MM-dd HH:dd:ss"];
// searchCustomer.createTimeBegin = [formater stringFromDate:[self ReturnZeroTime:date]]; self.conditionModel.createTimeBegin = nil;
// searchCustomer.createTimeEnd = [formater stringFromDate:[self ReturnZeroTime:date1]]; self.conditionModel.createTimeEnd = nil;
} }
break; break;
case 1://start > end case 1://start > end
{ {
[formater setDateFormat:@"yyyy-MM-dd HH:dd:ss"]; [formater setDateFormat:@"yyyy-MM-dd 00:00:01"];
searchCustomer.createTimeBegin = [formater stringFromDate:[self ReturnZeroTime:date1]]; [endformater setDateFormat:@"yyyy-MM-dd 23:59:59"];
searchCustomer.createTimeEnd = [formater stringFromDate:[self ReturnZeroTime:date]]; self.conditionModel.createTimeBegin = [formater stringFromDate:date1];
self.conditionModel.createTimeEnd = [endformater stringFromDate:date];
} }
break; break;
default: default:
break; break;
} }
self.conditionModel.nameEquals = nil;
[self searchCustomerInforMation:searchCustomer]; self.conditionModel.mobileEquals = nil;
self.searchTextfield.text = nil;
[self.allCustomerTableview.mj_header beginRefreshing];
} }
#pragma mark -返回某天零时的时间
- (NSDate *)ReturnZeroTime:(NSDate *)date
{
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar components:NSUIntegerMax fromDate:date];
components.hour = 8;
components.minute = 0;
components.second = 0;
NSTimeInterval ts = (double)(int)[[calendar dateFromComponents:components] timeIntervalSince1970];
return [NSDate dateWithTimeIntervalSince1970:ts];
}
#pragma mark -比较两个NSDate的大小 #pragma mark -比较两个NSDate的大小
...@@ -365,71 +370,18 @@ ...@@ -365,71 +370,18 @@
- (BOOL)textFieldShouldReturn:(UITextField *)textField - (BOOL)textFieldShouldReturn:(UITextField *)textField
{ {
[textField resignFirstResponder]; [textField resignFirstResponder];
self.conditionModel.nameEquals = self.searchTextfield.text;
ConsumerQueryCondition *searchCustomer = [[ConsumerQueryCondition alloc]init]; self.conditionModel.mobileEquals = self.searchTextfield.text;
DataPage *page = [[DataPage alloc]init];
page.page = 1;
page.rows = 10;
searchCustomer.page = page;
searchCustomer.nameEquals = self.searchTextfield.text;
searchCustomer.mobileEquals = self.searchTextfield.text;
if (self.searchTextfield.text.length == 0) { if (self.searchTextfield.text.length == 0) {
[self ErrorMBProgressView:@"搜索信息不能为空"]; [self ErrorMBProgressView:@"搜索信息不能为空"];
return YES; return YES;
} }
[self searchCustomerInforMation:searchCustomer]; [self.allCustomerTableview.mj_header beginRefreshing];
return YES; return YES;
} }
#pragma amrk -搜索客户信息
- (void)searchCustomerInforMation:(ConsumerQueryCondition *)Condition
{
[self CreateMBProgressHUDLoding];
//request
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/consumer/query"] WithRequestType:0 WithParameter:Condition WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self.CustomerresultArray removeAllObjects];
ConsumerPageResult *result = [[ConsumerPageResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
self.totalPages = (int)returnValue[@"data"][@"totalPages"];
for (TOConsumerEntity *objc in result.results) {
MyclientEntityModel *myclientModel = [[MyclientEntityModel alloc]init];
myclientModel.fid = objc.fid;
myclientModel.createName = objc.createName;
myclientModel.createBy = objc.createBy;
myclientModel.createDate = objc.createDate;
myclientModel.sysOrgCode = objc.sysOrgCode;
myclientModel.name = objc.name;
myclientModel.mobile = objc.mobile;
myclientModel.province = objc.province;
myclientModel.city = objc.city;
myclientModel.country = objc.country;
myclientModel.address = objc.address;
myclientModel.picture = objc.picture;
myclientModel.lastVisitedTime = objc.lastVisitedTime;
[self.CustomerresultArray addObject:myclientModel];
}
[self.allCustomerTableview reloadData];
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
......
...@@ -333,12 +333,47 @@ ...@@ -333,12 +333,47 @@
[self.leftSubView.camerBtn setBackgroundImage:[UIImage imageNamed:@"customchangjing"] forState:UIControlStateNormal]; [self.leftSubView.camerBtn setBackgroundImage:[UIImage imageNamed:@"customchangjing"] forState:UIControlStateNormal];
} }
#pragma mark ---SharePicturedelegate
#pragma mark -上传图片进度
- (void)UploadImageProgress:(double)progress
{
dispatch_async(dispatch_get_main_queue(), ^{
[self ShowProgressView:progress];
});
}
#pragma mark -上传图片完成
- (void)UploadImageSuccess
{
dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.labelText = @"上传完成";
[self RemoveMBProgressHUDLoding];
});
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
...@@ -219,13 +219,24 @@ ...@@ -219,13 +219,24 @@
{ {
selectedIndex = 5; selectedIndex = 5;
SceneLibraryViewController *sceneVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:5]; SceneLibraryViewController *sceneVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:5];
sceneVC.conditionModel.styleEquals = nil;
sceneVC.conditionModel.spaceEquals = nil;
[sceneVC.seceneLibararyCollectionView.mj_header beginRefreshing]; [sceneVC.seceneLibararyCollectionView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"产品库"]) }else if ([Name isEqualToString:@"产品库"])
{ {
selectedIndex = 4; selectedIndex = 4;
ProductLibraryViewController *productVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4]; ProductLibraryViewController *productVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
//默认加载全部数据
productVC.barcode = nil; productVC.barcode = nil;
productVC.selectedCode = nil;
productVC.condtionModel.categoryEquals = nil;
productVC.condtionModel.styleEquals = nil;
productVC.condtionModel.spaceEquals = nil;
productVC.condtionModel.materialEqueals = nil;
productVC.condtionModel.startprice = nil;
productVC.condtionModel.endprice = nil;
productVC.condtionModel.nameLike = nil;
[productVC.productCollectionView.mj_header beginRefreshing]; [productVC.productCollectionView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"客户管理"]) }else if ([Name isEqualToString:@"客户管理"])
{ {
......
...@@ -186,14 +186,17 @@ ...@@ -186,14 +186,17 @@
{ {
SettlementViewController *settlement = [[SettlementViewController alloc]init]; SettlementViewController *settlement = [[SettlementViewController alloc]init];
//支付成功 //支付成功
__weak typeof(self) weakSelf = self;
[settlement setPaySuccessReturnBlock:^{ [settlement setPaySuccessReturnBlock:^{
[self getOrderDetailsData]; weakSelf.isDelectedButton = NO;
self.isDelectedButton = NO; weakSelf.isShowattachment = YES;
[self CreateTableviewHeaderView]; self.sectionTitle = @[@"订单信息",@"客户信息",@"收货信息",@"商品清单",@"附件信息"];
self.orderDetailsTableview.tableFooterView = nil; [weakSelf CreateTableviewHeaderView];
if (self.DelecteAndPayButtonBlock) { [weakSelf getOrderDetailsData];
self.DelecteAndPayButtonBlock(_cellindex,@"002"); weakSelf.orderDetailsTableview.tableFooterView = nil;
if (weakSelf.DelecteAndPayButtonBlock) {
weakSelf.DelecteAndPayButtonBlock(_cellindex,@"002");
} }
}]; }];
settlement.preferredContentSize = CGSizeMake(380, 500); settlement.preferredContentSize = CGSizeMake(380, 500);
...@@ -293,7 +296,6 @@ ...@@ -293,7 +296,6 @@
AdditionalTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fifthcell" forIndexPath:indexPath]; AdditionalTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fifthcell" forIndexPath:indexPath];
cell.model = self.orderDetails.order; cell.model = self.orderDetails.order;
return cell; return cell;
} }
} }
......
//
// PayViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface PayViewController : BaseViewController
/**
* 经销商名称
*/
@property (weak, nonatomic) IBOutlet UILabel *dealersName;
/**
* 经销商二维码
*/
@property (weak, nonatomic) IBOutlet UIImageView *dealersImageView;
/**
* 支付方式背景
*/
@property (weak, nonatomic) IBOutlet UIImageView *payTypeBackimageView;
@end
//
// PayViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PayViewController.h"
@interface PayViewController ()
@end
@implementation PayViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PayViewController">
<connections>
<outlet property="dealersImageView" destination="kZZ-Mx-zku" id="EkS-xw-9hm"/>
<outlet property="dealersName" destination="Qnn-EJ-jG9" id="7Xd-rp-40Q"/>
<outlet property="payTypeBackimageView" destination="65W-fM-QJC" id="IXr-70-nIX"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="281" height="378"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="weixinpay" translatesAutoresizingMaskIntoConstraints="NO" id="65W-fM-QJC">
<rect key="frame" x="0.0" y="13" width="281" height="365"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kZZ-Mx-zku">
<rect key="frame" x="60" y="92" width="160" height="160"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="欧普经销商名称" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qnn-EJ-jG9">
<rect key="frame" x="0.0" y="63" width="281" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.11764705882352941" green="0.77647058823529413" blue="0.13333333333333333" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="kZZ-Mx-zku" secondAttribute="trailing" constant="61" id="APK-0F-TZ6"/>
<constraint firstItem="kZZ-Mx-zku" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="60" id="GXV-eC-ZJb"/>
<constraint firstAttribute="trailing" secondItem="65W-fM-QJC" secondAttribute="trailing" id="L7y-ix-jMK"/>
<constraint firstAttribute="trailing" secondItem="Qnn-EJ-jG9" secondAttribute="trailing" id="MXx-9A-Ffx"/>
<constraint firstItem="kZZ-Mx-zku" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="92" id="N7Y-JB-Ueu"/>
<constraint firstItem="Qnn-EJ-jG9" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Pna-Q8-0U3"/>
<constraint firstAttribute="bottom" secondItem="65W-fM-QJC" secondAttribute="bottom" id="Ww7-uF-rTQ"/>
<constraint firstItem="kZZ-Mx-zku" firstAttribute="top" secondItem="Qnn-EJ-jG9" secondAttribute="bottom" constant="8" id="X7q-ck-CM0"/>
<constraint firstItem="Qnn-EJ-jG9" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="63" id="d8h-WT-jvW"/>
<constraint firstItem="65W-fM-QJC" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="13" id="eaq-dy-IeU"/>
<constraint firstAttribute="bottom" secondItem="kZZ-Mx-zku" secondAttribute="bottom" constant="126" id="jSm-lX-Jkm"/>
<constraint firstItem="65W-fM-QJC" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="laS-5z-ueR"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="448.5" y="228"/>
</view>
</objects>
<resources>
<image name="weixinpay" width="324" height="410"/>
</resources>
</document>
...@@ -32,4 +32,9 @@ ...@@ -32,4 +32,9 @@
*/ */
@property (nonatomic,copy) NSString *barcode; @property (nonatomic,copy) NSString *barcode;
/**
* 筛选模型
*/
@property (nonatomic,strong) GoodsCondition *condtionModel;
@end @end
...@@ -67,10 +67,7 @@ ...@@ -67,10 +67,7 @@
*/ */
@property (nonatomic,assign) int totalPages; @property (nonatomic,assign) int totalPages;
/**
* 筛选模型
*/
@property (nonatomic,strong) GoodsCondition *condtionModel;
......
...@@ -47,7 +47,10 @@ ...@@ -47,7 +47,10 @@
@property (strong, nonatomic) screeningButton *SpaceButton; @property (strong, nonatomic) screeningButton *SpaceButton;
/**
* 搜索模型
*/
@property (nonatomic,strong) SceneCondition *conditionModel;
......
...@@ -40,10 +40,7 @@ ...@@ -40,10 +40,7 @@
@property (nonatomic,assign) int totalPages; @property (nonatomic,assign) int totalPages;
/**
* 搜索模型
*/
@property (nonatomic,strong) SceneCondition *conditionModel;
@end @end
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
@interface ScreeningSecondCollectionReusableView : UICollectionReusableView @interface ScreeningSecondCollectionReusableView : UICollectionReusableView
...@@ -27,6 +26,10 @@ ...@@ -27,6 +26,10 @@
*/ */
@property (nonatomic,strong) UIButton *subTitleButton; @property (nonatomic,strong) UIButton *subTitleButton;
/**
* 传入indexpath
*/
@property (nonatomic,strong) NSIndexPath *indexPath;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom]; self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.alltitleButton.layer.masksToBounds = YES; self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius; self.alltitleButton.layer.cornerRadius = kCornerRadius;
...@@ -65,4 +66,6 @@ ...@@ -65,4 +66,6 @@
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "SettlementViewController.h" #import "SettlementViewController.h"
#import "PayViewController.h"
@interface SettlementViewController ()<ReturnTableviewcellIndexpathdelegate,UITextFieldDelegate> @interface SettlementViewController ()<ReturnTableviewcellIndexpathdelegate,UITextFieldDelegate>
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
*/ */
@property (nonatomic,copy) NSString *weiXinLabe; @property (nonatomic,copy) NSString *weiXinLabe;
/**
* 二维码界面
*/
@property (nonatomic,strong) PayViewController *payController;
...@@ -28,6 +33,16 @@ ...@@ -28,6 +33,16 @@
@implementation SettlementViewController @implementation SettlementViewController
#pragma mark -初始化二维码显示
- (PayViewController *)payController
{
if (!_payController) {
_payController = [[PayViewController alloc]init];
}
return _payController;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -145,31 +160,50 @@ ...@@ -145,31 +160,50 @@
#pragma mark -微信支付 #pragma mark -微信支付
- (IBAction)WechatButtonClick:(UIButton *)sender { - (IBAction)WechatButtonClick:(UIButton *)sender {
[self.payController dismissViewControllerAnimated:NO completion:nil];
self.showPayQrCodeImageView.hidden = NO; self.showPayQrCodeImageView.hidden = NO;
sender.selected = !sender.selected; sender.selected = NO;
if (sender.selected) {
[self.showPayQrCodeImageView sd_setImageWithURL:[NSURL URLWithString:self.weiXinLabe] placeholderImage:REPLACEIMAGE]; [self.showPayQrCodeImageView sd_setImageWithURL:[NSURL URLWithString:self.weiXinLabe] placeholderImage:REPLACEIMAGE];
self.payTreasureButton.selected = NO; self.payTreasureButton.selected = NO;
[self.payTypeButton setTitle:@"现金、支票、转账、刷卡" forState:UIControlStateNormal]; [self.payTypeButton setTitle:@"现金、支票、转账、刷卡" forState:UIControlStateNormal];
} [self BringPayController:YES withButton:sender];
} }
#pragma mark -支付宝支付 #pragma mark -支付宝支付
- (IBAction)ZhifubaoPayButtonClick:(UIButton *)sender { - (IBAction)ZhifubaoPayButtonClick:(UIButton *)sender {
[self.payController dismissViewControllerAnimated:NO completion:nil];
self.showPayQrCodeImageView.hidden = NO; self.showPayQrCodeImageView.hidden = NO;
sender.selected = !sender.selected; sender.selected = NO;
if (sender.selected) {
[self.showPayQrCodeImageView sd_setImageWithURL:[NSURL URLWithString:self.zhiFubaoLabe] placeholderImage:REPLACEIMAGE]; [self.showPayQrCodeImageView sd_setImageWithURL:[NSURL URLWithString:self.zhiFubaoLabe] placeholderImage:REPLACEIMAGE];
self.WeixiPayButton.selected = NO; self.WeixiPayButton.selected = NO;
[self.payTypeButton setTitle:@"现金、支票、转账、刷卡" forState:UIControlStateNormal]; [self.payTypeButton setTitle:@"现金、支票、转账、刷卡" forState:UIControlStateNormal];
} [self BringPayController:NO withButton:sender];
} }
#pragma mark -调出二维码支付框
- (void)BringPayController:(BOOL)weichat withButton:(UIButton *)sender
{
self.payController.preferredContentSize = CGSizeMake(281, 387);
self.payController.modalPresentationStyle = UIModalPresentationPopover;
sender.selected = YES;
UIPopoverPresentationController *pop = self.payController.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionLeft;
pop.sourceView = self.payController.view;
pop.sourceRect = [self.view convertRect:CGRectMake(sender.mj_x, sender.mj_y-30, sender.mj_w, sender.mj_h) toView:self.view.window];
self.payController.dealersName.text = weichat?@"微信支付":@"支付宝支付";
self.payController.dealersName.textColor = weichat?kTCColor(30, 198, 34):kTCColor(88, 172, 220);
[self.payController.dealersImageView sd_setImageWithURL:[NSURL URLWithString:weichat?self.weiXinLabe:self.zhiFubaoLabe] placeholderImage:REPLACEIMAGE];
self.payController.payTypeBackimageView.image = weichat?TCImage(@"weixinpay"):TCImage(@"zhifubaopay");
[self presentViewController:self.payController animated:NO completion:nil];
}
#pragma mark -是否开票 #pragma mark -是否开票
- (IBAction)isinvoiceButtonClick:(UIButton *)sender { - (IBAction)isinvoiceButtonClick:(UIButton *)sender {
...@@ -278,17 +312,15 @@ ...@@ -278,17 +312,15 @@
//发票类型 //发票类型
if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"]) { if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"]) {
order.billType = @"001"; order.billType = @"002";
if (self.invoiceHeader.text.length == 0 || !self.invoiceHeader.text) { if (self.invoiceHeader.text.length == 0 || !self.invoiceHeader.text) {
[self ErrorMBProgressView:@"发票抬头不能为空"]; [self ErrorMBProgressView:@"发票抬头不能为空"];
return; return;
} }
}else if ([self.invoiceType.currentTitle isEqualToString:@"个人发票"]) }else if ([self.invoiceType.currentTitle isEqualToString:@"个人发票"])
{ {
order.billType = @"002"; order.billType = @"001";
} }
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/payOrder"] WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/payOrder"] WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<outlet property="myScrollView" destination="Zin-kL-ulL" id="DbE-Wx-6aV"/> <outlet property="myScrollView" destination="Zin-kL-ulL" id="DbE-Wx-6aV"/>
<outlet property="payTreasureButton" destination="u1Q-iA-oUv" id="kTp-v5-rTM"/> <outlet property="payTreasureButton" destination="u1Q-iA-oUv" id="kTp-v5-rTM"/>
<outlet property="payTypeButton" destination="BtK-gu-0KG" id="kZG-tn-0Xt"/> <outlet property="payTypeButton" destination="BtK-gu-0KG" id="kZG-tn-0Xt"/>
<outlet property="showPayQrCodeImageView" destination="evA-uJ-YEb" id="nJS-kx-aPc"/>
<outlet property="sureButton" destination="wNR-jl-cxy" id="Qj2-ks-l6e"/> <outlet property="sureButton" destination="wNR-jl-cxy" id="Qj2-ks-l6e"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="BtK-gu-0KG"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="BtK-gu-0KG">
<rect key="frame" x="83" y="140" width="160" height="30"/> <rect key="frame" x="93" y="140" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/> <fontDescription key="fontDescription" type="system" pointSize="10"/>
...@@ -71,10 +70,6 @@ ...@@ -71,10 +70,6 @@
<action selector="SureButtonClick:" destination="-1" eventType="touchUpInside" id="tue-Vx-ZkB"/> <action selector="SureButtonClick:" destination="-1" eventType="touchUpInside" id="tue-Vx-ZkB"/>
</connections> </connections>
</button> </button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="evA-uJ-YEb">
<rect key="frame" x="253" y="120" width="120" height="187"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="发票类型:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="IOP-zc-e6A"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="发票类型:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="IOP-zc-e6A">
<rect key="frame" x="25" y="331" width="58" height="21"/> <rect key="frame" x="25" y="331" width="58" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
...@@ -83,7 +78,7 @@ ...@@ -83,7 +78,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="h52-sh-k1p"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="h52-sh-k1p">
<rect key="frame" x="83" y="327" width="160" height="30"/> <rect key="frame" x="93" y="327" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
...@@ -97,7 +92,7 @@ ...@@ -97,7 +92,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="RrC-9S-Ofh"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="RrC-9S-Ofh">
<rect key="frame" x="83" y="283" width="160" height="30"/> <rect key="frame" x="93" y="283" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
...@@ -118,7 +113,7 @@ ...@@ -118,7 +113,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" id="beF-Oa-HVo"> <view contentMode="scaleToFill" id="beF-Oa-HVo">
<rect key="frame" x="83" y="372" width="250" height="30"/> <rect key="frame" x="93" y="372" width="250" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="nrc-w9-AuC"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="nrc-w9-AuC">
...@@ -139,7 +134,7 @@ ...@@ -139,7 +134,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="u1Q-iA-oUv"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="u1Q-iA-oUv">
<rect key="frame" x="83" y="219" width="160" height="30"/> <rect key="frame" x="93" y="219" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" backgroundImage="图层-1"> <state key="normal" backgroundImage="图层-1">
...@@ -151,13 +146,13 @@ ...@@ -151,13 +146,13 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="pfa-IW-8J9"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="pfa-IW-8J9">
<rect key="frame" x="83" y="180" width="160" height="30"/> <rect key="frame" x="93" y="180" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" backgroundImage="wechat1"> <state key="normal" backgroundImage="weixinselected">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
<state key="selected" backgroundImage="圆角矩形-2-副本-2"/> <state key="selected" backgroundImage="weixin"/>
<connections> <connections>
<action selector="WechatButtonClick:" destination="-1" eventType="touchUpInside" id="woS-KH-v7d"/> <action selector="WechatButtonClick:" destination="-1" eventType="touchUpInside" id="woS-KH-v7d"/>
</connections> </connections>
...@@ -170,7 +165,7 @@ ...@@ -170,7 +165,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" id="kRj-KI-B8x"> <view contentMode="scaleToFill" id="kRj-KI-B8x">
<rect key="frame" x="83" y="98" width="160" height="30"/> <rect key="frame" x="93" y="98" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="Wku-Nz-Jvr"> <textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="Wku-Nz-Jvr">
...@@ -191,7 +186,7 @@ ...@@ -191,7 +186,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" id="V10-sC-tjf"> <view contentMode="scaleToFill" id="V10-sC-tjf">
<rect key="frame" x="83" y="59" width="160" height="30"/> <rect key="frame" x="93" y="59" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="kfb-PC-RSU"> <textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="kfb-PC-RSU">
...@@ -235,9 +230,9 @@ ...@@ -235,9 +230,9 @@
</objects> </objects>
<resources> <resources>
<image name="down_arr" width="22" height="12"/> <image name="down_arr" width="22" height="12"/>
<image name="wechat1" width="175" height="30"/> <image name="weixin" width="175" height="30"/>
<image name="weixinselected" width="175" height="30"/>
<image name="图层-1" width="175" height="30"/> <image name="图层-1" width="175" height="30"/>
<image name="图层-3" width="175" height="30"/> <image name="图层-3" width="175" height="30"/>
<image name="圆角矩形-2-副本-2" width="175" height="30"/>
</resources> </resources>
</document> </document>
...@@ -7,13 +7,25 @@ ...@@ -7,13 +7,25 @@
// //
#import "BaseViewController.h" #import "BaseViewController.h"
@protocol SharePicturedelegate <NSObject>
@required
@protocol SharePicturedelegate <NSObject>
//回调 //回调
- (void)ShareProductImage:(UIImage *)image ; - (void)ShareProductImage:(UIImage *)image ;
/**
* 上传图片进度(显示)
*/
- (void)UploadImageProgress:(double)progress;
/**
* 上传完成
*/
- (void)UploadImageSuccess;
@end @end
@interface ShareViewController : BaseViewController @interface ShareViewController : BaseViewController
...@@ -21,4 +33,18 @@ ...@@ -21,4 +33,18 @@
@property (nonatomic,strong) UIButton *weiXinFriend; @property (nonatomic,strong) UIButton *weiXinFriend;
@property (nonatomic,strong) UIButton *weiXinFriendCircle; @property (nonatomic,strong) UIButton *weiXinFriendCircle;
@property (nonatomic,strong) UIButton *sinaMicroBlog ; @property (nonatomic,strong) UIButton *sinaMicroBlog ;
/**
* 传入商品ID字符串(多个商品时用逗号隔开)
*/
@property (nonatomic,copy) NSString *goodsIDs;
/**
* 传入分享图片
*/
@property (nonatomic,strong) UIImage *shareImage;
@end @end
...@@ -53,22 +53,31 @@ ...@@ -53,22 +53,31 @@
[self.view addSubview:lable3]; [self.view addSubview:lable3];
} }
#pragma mark -分享
-(void)sharePicture:(UIButton*)sender -(void)sharePicture:(UIButton*)sender
{ {
if ([self.delegate respondsToSelector:@selector(addProductImage:productModel:)]) { [self dismissViewControllerAnimated:YES completion:nil];
NSData *imageData = UIImageJPEGRepresentation(TCImage(@"登录"), 1.0);
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:@"0b44439e54f735d10154f76373970028,0b44439e54f735d10154f76373970028,0b44439e54f735d10154f76373970028",@"goodsIds",@"",@"title",@"",@"remark",nil];
//上传图片
[[NetworkRequestClassManager Manager] UploadImageWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/shareGoods"] WithRequestType:0 WithImageDatas:imageData WithParameter:parameterDict WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self.delegate ShareProductImage:nil];
}
switch (sender.tag) { switch (sender.tag) {
case 101: //微信好友 case 101: //微信好友
{//自定义样式 {//自定义样式
UMSocialUrlResource *resource = [[UMSocialUrlResource alloc]initWithSnsResourceType:UMSocialUrlResourceTypeWeb url:returnValue[@"data"][@"url"]];
//使用UMShareToWechatSession,UMShareToWechatTimeline,UMShareToWechatFavorite分别代表微信好友、微信朋友圈、微信收藏 //使用UMShareToWechatSession,UMShareToWechatTimeline,UMShareToWechatFavorite分别代表微信好友、微信朋友圈、微信收藏
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:@"分享内嵌文字" image:nil location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:@"分享内嵌文字" image:TCImage(@"Icon-83.5") location:nil urlResource:resource presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) { if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!"); NSLog(@"分享成功!");
} }
}]; } }];
}
break; break;
case 102://微信朋友圈 case 102://微信朋友圈
...@@ -84,19 +93,46 @@ ...@@ -84,19 +93,46 @@
case 103://新浪微博 case 103://新浪微博
{ {
// 自定义分享样式 //自定义分享样式
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:@"分享内嵌文字" image:nil location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:@"分享内嵌文字" image:nil location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){
if (shareResponse.responseCode == UMSResponseCodeSuccess) { if (shareResponse.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!"); NSLog(@"分享成功!");
} }
}]; } }];
}
break; break;
default: default:
break; break;
} }
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
}WithprogressBlock:^(double progress) {
if (progress >= 1) {
if ([self.delegate respondsToSelector:@selector(UploadImageSuccess)]) {
[self.delegate UploadImageSuccess];
}
}else
{
if ([self.delegate respondsToSelector:@selector(UploadImageProgress:)]) {
[self.delegate UploadImageProgress:progress];
}
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) {
[self ErrorMBProgressView:error.localizedDescription];
}];
} }
//实现回调方法: //实现回调方法:
-(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response -(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
NSString *realName = [Shoppersmanager manager].Shoppers.employee.realName?[Shoppersmanager manager].Shoppers.employee.realName:@"服务导购"; NSString *realName = [Shoppersmanager manager].Shoppers.employee.realName?[Shoppersmanager manager].Shoppers.employee.realName:@"服务导购";
NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",realName,@"我的客户",@"购物袋", nil]; NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",realName,@"我的客户",@"购物袋", nil];
//图片 //图片
NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"Cog",@"data",@"ablum", nil]; NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"矢量智能对象-1",@"data",@"ablum", nil];
for (int i=1; i<5; i++) { for (int i=1; i<5; i++) {
CustomButton *button = [CustomButton buttonWithType:UIButtonTypeCustom]; CustomButton *button = [CustomButton buttonWithType:UIButtonTypeCustom];
......
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
{ {
ScreeningSecondCollectionReusableView *cell = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"screeningcell" forIndexPath:indexPath]; ScreeningSecondCollectionReusableView *cell = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"screeningcell" forIndexPath:indexPath];
[cell.alltitleButton addTarget:self action:@selector(AllButtonClick:) forControlEvents:UIControlEventTouchUpInside];
cell.clipsToBounds = YES; cell.clipsToBounds = YES;
if (self.selectedIndex == 1) { if (self.selectedIndex == 1) {
...@@ -191,6 +192,8 @@ ...@@ -191,6 +192,8 @@
#pragma mark -选中回调 #pragma mark -选中回调
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath - (void)SelectedButtonClickAction:(NSIndexPath *)indexpath
{ {
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
299249401CDB4D1D00786B1E /* AddaddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2992493F1CDB4D1D00786B1E /* AddaddressViewController.m */; }; 299249401CDB4D1D00786B1E /* AddaddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2992493F1CDB4D1D00786B1E /* AddaddressViewController.m */; };
299249441CDB51B100786B1E /* ModifyShippingAddressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 299249431CDB51B100786B1E /* ModifyShippingAddressView.m */; }; 299249441CDB51B100786B1E /* ModifyShippingAddressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 299249431CDB51B100786B1E /* ModifyShippingAddressView.m */; };
299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 299249451CDB51C800786B1E /* ModifyShippingAddressView.xib */; }; 299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 299249451CDB51C800786B1E /* ModifyShippingAddressView.xib */; };
2994C0151CFBE793005A80AF /* PayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2994C0131CFBE793005A80AF /* PayViewController.m */; };
2994C0161CFBE793005A80AF /* PayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2994C0141CFBE793005A80AF /* PayViewController.xib */; };
299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876261CD9837C00C90D0A /* OrderTableViewCell.m */; }; 299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876261CD9837C00C90D0A /* OrderTableViewCell.m */; };
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876321CD997DF00C90D0A /* OrderInformationTableViewCell.m */; }; 299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876321CD997DF00C90D0A /* OrderInformationTableViewCell.m */; };
299876361CD997F100C90D0A /* PersonInformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876351CD997F100C90D0A /* PersonInformationTableViewCell.m */; }; 299876361CD997F100C90D0A /* PersonInformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876351CD997F100C90D0A /* PersonInformationTableViewCell.m */; };
...@@ -287,6 +289,9 @@ ...@@ -287,6 +289,9 @@
299249421CDB51B100786B1E /* ModifyShippingAddressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifyShippingAddressView.h; sourceTree = "<group>"; }; 299249421CDB51B100786B1E /* ModifyShippingAddressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifyShippingAddressView.h; sourceTree = "<group>"; };
299249431CDB51B100786B1E /* ModifyShippingAddressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModifyShippingAddressView.m; sourceTree = "<group>"; }; 299249431CDB51B100786B1E /* ModifyShippingAddressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModifyShippingAddressView.m; sourceTree = "<group>"; };
299249451CDB51C800786B1E /* ModifyShippingAddressView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ModifyShippingAddressView.xib; sourceTree = "<group>"; }; 299249451CDB51C800786B1E /* ModifyShippingAddressView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ModifyShippingAddressView.xib; sourceTree = "<group>"; };
2994C0121CFBE793005A80AF /* PayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayViewController.h; sourceTree = "<group>"; };
2994C0131CFBE793005A80AF /* PayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PayViewController.m; sourceTree = "<group>"; };
2994C0141CFBE793005A80AF /* PayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PayViewController.xib; sourceTree = "<group>"; };
299876251CD9837C00C90D0A /* OrderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderTableViewCell.h; sourceTree = "<group>"; }; 299876251CD9837C00C90D0A /* OrderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderTableViewCell.h; sourceTree = "<group>"; };
299876261CD9837C00C90D0A /* OrderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OrderTableViewCell.m; sourceTree = "<group>"; }; 299876261CD9837C00C90D0A /* OrderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OrderTableViewCell.m; sourceTree = "<group>"; };
299876311CD997DF00C90D0A /* OrderInformationTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderInformationTableViewCell.h; sourceTree = "<group>"; }; 299876311CD997DF00C90D0A /* OrderInformationTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderInformationTableViewCell.h; sourceTree = "<group>"; };
...@@ -965,6 +970,9 @@ ...@@ -965,6 +970,9 @@
29698D5E1CE2C11500D72CE7 /* SettlementViewController.h */, 29698D5E1CE2C11500D72CE7 /* SettlementViewController.h */,
29698D5F1CE2C11500D72CE7 /* SettlementViewController.m */, 29698D5F1CE2C11500D72CE7 /* SettlementViewController.m */,
29698D601CE2C11500D72CE7 /* SettlementViewController.xib */, 29698D601CE2C11500D72CE7 /* SettlementViewController.xib */,
2994C0121CFBE793005A80AF /* PayViewController.h */,
2994C0131CFBE793005A80AF /* PayViewController.m */,
2994C0141CFBE793005A80AF /* PayViewController.xib */,
); );
name = controller; name = controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1390,6 +1398,7 @@ ...@@ -1390,6 +1398,7 @@
299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */, 299249461CDB51C800786B1E /* ModifyShippingAddressView.xib in Resources */,
294CF0EE1CEDCF540055F1D8 /* PromptinformationView.xib in Resources */, 294CF0EE1CEDCF540055F1D8 /* PromptinformationView.xib in Resources */,
29834EBB1CDF1FBC001A484F /* screeningFirstView.xib in Resources */, 29834EBB1CDF1FBC001A484F /* screeningFirstView.xib in Resources */,
2994C0161CFBE793005A80AF /* PayViewController.xib in Resources */,
29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */, 29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */,
2928F83D1CD0A9CD0036D761 /* qq.png in Resources */, 2928F83D1CD0A9CD0036D761 /* qq.png in Resources */,
29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */, 29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */,
...@@ -1485,6 +1494,7 @@ ...@@ -1485,6 +1494,7 @@
2928F8421CD0ABAC0036D761 /* ShoppingViewController.m in Sources */, 2928F8421CD0ABAC0036D761 /* ShoppingViewController.m in Sources */,
29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */, 29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */,
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */, 299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */,
2994C0151CFBE793005A80AF /* PayViewController.m in Sources */,
2928F7E71CD087FE0036D761 /* BaseViewController.m in Sources */, 2928F7E71CD087FE0036D761 /* BaseViewController.m in Sources */,
2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */, 2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */,
299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */, 299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */,
...@@ -1679,8 +1689,8 @@ ...@@ -1679,8 +1689,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES; CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: 超级 朱 (SXSQ6S5D55)"; CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 超级 朱 (SXSQ6S5D55)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
...@@ -1722,7 +1732,7 @@ ...@@ -1722,7 +1732,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8"; PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
...@@ -1735,8 +1745,8 @@ ...@@ -1735,8 +1745,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES; CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: 超级 朱 (SXSQ6S5D55)"; CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 超级 朱 (SXSQ6S5D55)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO; COMPRESS_PNG_FILES = NO;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
...@@ -1778,7 +1788,7 @@ ...@@ -1778,7 +1788,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8"; PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
......
...@@ -116,8 +116,7 @@ ...@@ -116,8 +116,7 @@
[UMSocialWechatHandler setWXAppId:@"wxab385878d9441f23" appSecret:@"58b85af13973bdf597fa807208ac0dff " url:@"http://www.umeng.com/social"]; [UMSocialWechatHandler setWXAppId:@"wxab385878d9441f23" appSecret:@"58b85af13973bdf597fa807208ac0dff " url:@"http://www.umeng.com/social"];
// 设置微博的AppKey、appSecret,分享url // 设置微博的AppKey、appSecret,分享url
[UMSocialSinaSSOHandler openNewSinaSSOWithAppKey:@"1111393286"secret:@"5d011c05122b5539ec9592372f944d3c" [UMSocialSinaSSOHandler openNewSinaSSOWithAppKey:@"1111393286" secret:@"5d011c05122b5539ec9592372f944d3c" RedirectURL:@"http://sns.whalecloud.com/sina2/callback"];
RedirectURL:@"http://sns.whalecloud.com/sina2/callback"];
// // 设置QQAppId、appSecret,分享url // // 设置QQAppId、appSecret,分享url
// [UMSocialQQHandler setQQWithAppId:@"AppId" appKey:@"appSecret" url:@"url链接"]; // [UMSocialQQHandler setQQWithAppId:@"AppId" appKey:@"appSecret" url:@"url链接"];
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
...@@ -15,7 +16,18 @@ ...@@ -15,7 +16,18 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="00启动页" translatesAutoresizingMaskIntoConstraints="NO" id="xXC-mz-iPM">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="xXC-mz-iPM" secondAttribute="trailing" constant="-20" id="L0G-Ig-b2y"/>
<constraint firstItem="xXC-mz-iPM" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" constant="-20" id="qH8-9x-qeD"/>
<constraint firstItem="xXC-mz-iPM" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="topMargin" id="rSq-mE-Nly"/>
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="xXC-mz-iPM" secondAttribute="bottom" id="yv0-m0-dDV"/>
</constraints>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
...@@ -23,4 +35,7 @@ ...@@ -23,4 +35,7 @@
<point key="canvasLocation" x="520" y="307"/> <point key="canvasLocation" x="520" y="307"/>
</scene> </scene>
</scenes> </scenes>
<resources>
<image name="00启动页" width="1500" height="1125"/>
</resources>
</document> </document>
{
"images" : [
{
"idiom" : "universal",
"filename" : "00启动页.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Icon-83.5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "weixin.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "weixin@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "weixinpay.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "weixinpay@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "weixinselected.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "weixinselected@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "zhifubaopay.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "zhifubaopay@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "矢量智能对象.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "矢量智能对象@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "默认场景.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -41,6 +41,113 @@ ...@@ -41,6 +41,113 @@
</array> </array>
</dict> </dict>
</array> </array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>log.umsns.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>sns.whalecloud.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<!-- 集成新浪微博对应的HTTP白名单-->
<key>sina.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>weibo.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>weibo.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>sinaimg.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>sinajs.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>sina.com.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<!-- 新浪微博-->
<!-- 集成微信、QQ、Qzone、腾讯微博授权对应的HTTP白名单-->
<key>qq.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<!-- 腾讯授权-->
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<!-- 微信 URL Scheme 白名单-->
<string>wechat</string>
<string>weixin</string>
<!-- 新浪微博 URL Scheme 白名单-->
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>sinaweibosso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
</array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
@interface BaseViewController : UIViewController @interface BaseViewController : UIViewController
/** /**
* 结束刷新 * 结束刷新
* *
...@@ -101,4 +104,20 @@ ...@@ -101,4 +104,20 @@
*/ */
- (void)promptCustomerWithString:(NSString *)message; - (void)promptCustomerWithString:(NSString *)message;
/**
* 进度条
*/
- (void)ShowProgressView:(double)progress;
/**
* 提示框
*/
@property (nonatomic,strong) MBProgressHUD*TCHud;
@end @end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@interface BaseViewController ()<UIPrintInteractionControllerDelegate,UIWebViewDelegate> @interface BaseViewController ()<UIPrintInteractionControllerDelegate,UIWebViewDelegate>
@property (nonatomic,strong) MBProgressHUD*TCHud;
@property (nonatomic,strong) UIWebView *webView; @property (nonatomic,strong) UIWebView *webView;
/** /**
...@@ -103,10 +103,25 @@ ...@@ -103,10 +103,25 @@
self.TCHud.removeFromSuperViewOnHide = YES; self.TCHud.removeFromSuperViewOnHide = YES;
} }
#pragma mark -进度条
- (void)ShowProgressView:(double)progress
{
self.TCHud.mode = MBProgressHUDModeDeterminateHorizontalBar;
self.TCHud.labelText = @"上传中....";
self.TCHud.labelFont = [UIFont systemFontOfSize:12];
self.TCHud.progress = progress;
self.TCHud.removeFromSuperViewOnHide = YES;
}
#pragma mark -移除MBProgressHUD等待视图 #pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding; - (void)RemoveMBProgressHUDLoding;
{ {
// [self.TCHud hide:YES afterDelay:1]; // [self.TCHud hide:YES afterDelay:0.5];
[_TCHud hide:YES]; [_TCHud hide:YES];
_TCHud = nil; _TCHud = nil;
} }
...@@ -176,6 +191,8 @@ ...@@ -176,6 +191,8 @@
} }
#pragma mark -结束MJRfresh刷新 #pragma mark -结束MJRfresh刷新
- (void)endRefreshingForTableView:(UIScrollView *)TableView - (void)endRefreshingForTableView:(UIScrollView *)TableView
{ {
...@@ -296,6 +313,10 @@ ...@@ -296,6 +313,10 @@
[self.view addSubview:self.promptView]; [self.view addSubview:self.promptView];
} }
#pragma mark -删除提示文本、图片 #pragma mark -删除提示文本、图片
- (void)RemovePromptinformationView - (void)RemovePromptinformationView
{ {
......
...@@ -14,6 +14,8 @@ typedef void (^ReturnValueBlock) (id returnValue); ...@@ -14,6 +14,8 @@ typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue); typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(NSError *error); typedef void (^FailureBlock)(NSError *error);
//上传图片返回当前进度
typedef void (^UploadprogressBlock)(double progress);
//定义请求类型 //定义请求类型
typedef enum { typedef enum {
...@@ -91,5 +93,46 @@ typedef enum { ...@@ -91,5 +93,46 @@ typedef enum {
/**
* 上传分享图片
*
* @param requestURLString 网址
* @param requestType 请求类型
* @param parameter 参数
* @param successBlock 成功回调
* @param progressBlock 上传进度
* @param errorCodeBlock 错误编码回调
* @param failureBlock 失败回调
*/
- (void)UploadImageWithURL:(NSString *) requestURLString
WithRequestType:(NetworkRequestType) requestType
WithImageDatas:(NSData *) imagedata
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock;
@end @end
...@@ -219,14 +219,60 @@ static NetworkRequestClassManager *manager = nil; ...@@ -219,14 +219,60 @@ static NetworkRequestClassManager *manager = nil;
//开始请求 //开始请求
[task resume]; [task resume];
}
}
/**
* 上传分享图片
*
* @param requestURLString 网址
* @param requestType 请求类型
* @param parameter 参数
* @param successBlock 成功回调
* @param errorCodeBlock 错误编码回调
* @param failureBlock 失败回调
*/
- (void)UploadImageWithURL:(NSString *) requestURLString
WithRequestType:(NetworkRequestType) requestType
WithImageDatas:(NSData *) imagedata
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock
{
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
[manager POST:requestURLString parameters:parameter constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
[formData appendPartWithFileData:imagedata name:@"file" fileName:@"file.png" mimeType:@"image/png"];
} progress:^(NSProgress * _Nonnull uploadProgress) {
progressBlock(uploadProgress.fractionCompleted);
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
successBlock(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failureBlock(error);
}];
}
......
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