Commit ea83a676 authored by 曹云霄's avatar 曹云霄

修改项说明:抽奖优化

parent 38cc7ea4
......@@ -42,7 +42,7 @@
self.cardNumberLabel.text = [NSString stringWithFormat:@"卡号: %@",_cardModel.cardNumber];
self.cardPasswordLabel.text = [NSString stringWithFormat:@"密码: %@",_cardModel.cardPassword];
/// 判断状态
BOOL isUsed = [_cardModel.state isEqualToString:LOOKED];
BOOL isUsed = [_cardModel.state isEqualToString:USED];
BOOL isActived = [_cardModel.state isEqualToString:ACTIVED];
BOOL isDispensed = [_cardModel.state isEqualToString:DISPENSED];
if (isDispensed) {
......
......@@ -34,7 +34,7 @@
self.self.amountLabel.attributedText = attributedString;
/// 判断状态
BOOL isUsed = [_Cardmodel.state isEqualToString:LOOKED];
BOOL isUsed = [_Cardmodel.state isEqualToString:USED];
BOOL isActived = [_Cardmodel.state isEqualToString:ACTIVED];
BOOL isDispensed = [_Cardmodel.state isEqualToString:DISPENSED];
if (isDispensed) {
......
......@@ -39,7 +39,7 @@
[self addChildViewController:beenUseVc];
/// 已使用
CardBeenUseViewController *usedVc = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"CardBeenUseViewController"];
usedVc.cardState = LOOKED;
usedVc.cardState = USED;
[self addChildViewController:usedVc];
dontUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
beenUseVc.view.frame = CGRectMake(0, 0, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h);
......
......@@ -230,7 +230,6 @@
}
#pragma mark -RightVCselectedDelegate 方法
- (void)SelectedControllerWithIndex:(NSString *)Name
{
......@@ -243,8 +242,8 @@
}else if ([Name isEqualToString:@"场景库"])
{
selectedIndex = 5;
SceneLibraryViewController *sceneVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:5];
selectedIndex = 4;
SceneLibraryViewController *sceneVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
sceneVC.conditionModel.styleEquals = nil;
sceneVC.conditionModel.spaceEquals = nil;
[sceneVC.StyleButton setTitle:@"风格" forState:UIControlStateNormal];
......@@ -253,8 +252,8 @@
}else if ([Name isEqualToString:@"产品库"])
{
selectedIndex = 4;
ProductLibraryViewController *productVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:4];
selectedIndex = 5;
ProductLibraryViewController *productVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:5];
//默认加载全部数据
productVC.barcode = nil;
productVC.selectedCode = nil;
......@@ -268,8 +267,8 @@
[productVC.productCollectionView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"所有客户"])
{
selectedIndex = 3;
AllCustomerViewController *AllcustomerVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:3];
selectedIndex = 6;
AllCustomerViewController *AllcustomerVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:6];
AllcustomerVC.searchTextfield.text = nil;
AllcustomerVC.conditionModel.resellerCodeEquals = nil;
AllcustomerVC.conditionModel.mobileEquals = nil;
......@@ -279,8 +278,8 @@
[AllcustomerVC.allCustomerTableview.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"客户订单"])
{
selectedIndex = 2;
CustomerOrderViewController *customerVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:2];
selectedIndex = 7;
CustomerOrderViewController *customerVC = [SHARED_APPDELEGATE.allControllerArray objectAtIndex_opple:7];
customerVC.searchCustomerOrder.text = nil;
[customerVC.StyleButton setTitle:@"全部订单" forState:UIControlStateNormal];
customerVC.model.consumerNameOrMobileEquals = nil;
......@@ -288,7 +287,7 @@
[customerVC.customerOrderTableView.mj_header beginRefreshing];
}else if ([Name isEqualToString:@"关于"])
{
selectedIndex = 1;
selectedIndex = 8;
}
self.customtabbar.selectedIndex = selectedIndex;
}
......
......@@ -12,13 +12,36 @@
/**
* 抽奖主题标识
*/
@property (nonatomic,copy) NSString *lotteryId;
/**
* 奖品类型<discount/redPackage>
*/
@property (nonatomic,copy) NSString *type;
/**
* 折扣率、面额
*/
@property (nonatomic,copy) NSString *number;
/**
* 奖品描述
*/
@property (nonatomic,copy) NSString *descriptionString;
/**
* 中奖记录标识
*/
@property (nonatomic,copy) NSString *drawId;
/**
* 为nil时未中奖
*/
@property (nonatomic,copy) NSString *awardId;
/**
* 通过抽奖列表结果初始化抽奖结果
*/
......
......@@ -173,6 +173,11 @@
make.size.mas_equalTo(CGSizeMake(50, 20));
make.centerY.equalTo(cell);
}];
[cell.orderNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(cell.orderNumberTitle.mas_right).offset(-10);
make.centerY.equalTo(cell.orderNumberTitle);
make.right.equalTo(cell).offset(-100);
}];
}
return cell;
}
......@@ -186,6 +191,11 @@
cell.orderNumberTitle.font = [UIFont systemFontOfSize:12];
cell.trophyLabel.font = [UIFont systemFontOfSize:12];
cell.orderNumber.font = [UIFont systemFontOfSize:12];
[cell.orderNumber mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(cell.orderNumberTitle.mas_right).offset(-10);
make.centerY.equalTo(cell.orderNumberTitle);
make.right.equalTo(cell).offset(-100);
}];
}
return cell;
}
......@@ -202,13 +212,16 @@
RsAwardDraw *drawEntity = self.datasArray[sender.tag];
[self showLuckyDrawControl:drawEntity.draw.lotteryId andOrderNumber:drawEntity.draw.orderNumber andDrawid:drawEntity.draw.fid luckyDrawFinish:^(NSDictionary *dict) {
id json = [NSJSONSerialization JSONObjectWithData:[[dict[@"body"] firstObject] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
id json = [NSJSONSerialization JSONObjectWithData:[dict[@"body"] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
if (json) {
if ([json isKindOfClass:[NSDictionary class]]) {
[weakSelf SHOWPrompttext:[NSString stringWithFormat:@"恭喜获得%@元红包",dict[@"number"]]];
}
if ([BaseViewController isBlankString:json[@"awardId"]]) {
[weakSelf SHOWPrompttext:@"未中奖"];
}else {
[weakSelf SHOWPrompttext:@"没有中奖,欢迎再来"];
NSString *string = [NSString stringWithFormat:@"恭喜获得%ld元红包",[json[@"number"] integerValue]];
[weakSelf SHOWPrompttext:string];
}
}
}
}];
}
......
......@@ -225,7 +225,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
queryDrawState.orderNumberEquals = self.orderCode;
}
queryDrawState.winnerIdEquals = [Customermanager manager].model.fid;
queryDrawState.stateEquals = !self.isShowPayButton?@"used":ACCOMPLISHED;
queryDrawState.stateEquals = !self.isShowPayButton?USED:ACCOMPLISHED;
DataPage *page = [[DataPage alloc]init];
page.page = ZERO;
page.rows = ONE;
......@@ -288,7 +288,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
/// 我知道了
}else if (indexPath.row == 0)
{
[[NSNotificationCenter defaultCenter] postNotificationName:OPENCONTROLLER object:@(0)];
[[NSNotificationCenter defaultCenter] postNotificationName:OPENCONTROLLER object:@(3)];
}
}];
success.preferredContentSize = CGSizeMake(315, 320);
......@@ -398,17 +398,19 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:nil message:@"恭喜您获得一次大转盘抽奖机会!" preferredStyle:UIAlertControllerStyleAlert];
[alertControl addAction:[UIAlertAction actionWithTitle:@"马上参与" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[weakSelf showLuckyDrawControl:model.lottery.uuid andOrderNumber:weakSelf.orderCode luckyDrawFinish:^(NSDictionary *dict) {
id json = [NSJSONSerialization JSONObjectWithData:[[dict[@"body"] firstObject] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
id json = [NSJSONSerialization JSONObjectWithData:[dict[@"body"] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
if (json) {
if ([json isKindOfClass:[NSDictionary class]]) {
weakSelf.customerDrawModel = [[LuckDrawResultModel alloc]initWithDictionary:json error:nil];
if ([BaseViewController isBlankString:weakSelf.customerDrawModel.awardId]) {
[weakSelf SHOWPrompttext:@"未中奖"];
}else {
NSString *string = [NSString stringWithFormat:@"恭喜获得%ld折优惠,会在支付时直接扣除!",[weakSelf.customerDrawModel.number integerValue]/10];
[weakSelf SHOWPrompttext:string];
}
}else {
[weakSelf SHOWPrompttext:@"没有中奖,欢迎再来"];
}
return ;
}
return;
}];
}]];
[self presentViewController:alertControl animated:YES completion:nil];
......
......@@ -36,7 +36,7 @@
/**
* 控制器数组
*/
@property (nonatomic,strong) NSArray *vcArray;
@property (nonatomic,strong) NSMutableArray *vcArray;
/**
* 工具栏
......@@ -56,11 +56,19 @@
{
if (_identifierArray == nil) {
_identifierArray = [NSArray arrayWithObjects:@"searchvc",@"shopping",@"Client",@"followheart",@"scenelibrary",@"productlibrary",@"allcustomer",@"customerorder",@"about", nil];
_identifierArray = [NSArray arrayWithObjects:@"SearchViewController",@"ShoppingViewController",@"ClientViewController",@"RebateViewController",@"SceneLibraryViewController",@"ProductLibraryViewController",@"AllCustomerViewController",@"CustomerOrderViewController",@"AboutViewController", nil];
}
return _identifierArray;
}
- (NSMutableArray *)vcArray
{
if (!_vcArray) {
_vcArray = [NSMutableArray array];
}
return _vcArray;
}
-(void)viewWillAppear:(BOOL)animated
{
......@@ -105,7 +113,7 @@
[self.tabBar addSubview:self.toolview];
//显示体验中心
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ShowFollowHeart:) name:OPENFOLLOWHEARTVC object:nil];
//2016年08月26日15:52:28显示我的账户
//打开相应控制器
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openControllerWithIndex:) name:OPENCONTROLLER object:nil];
}
......@@ -113,34 +121,17 @@
#pragma mark -添加controller到viewControllers
- (void)addViewcontroller
{
NSMutableArray *controllerArray = [NSMutableArray array];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
SearchViewController *searchVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:0]];
ShoppingViewController *shoppingVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:1]];
ClientViewController *clientVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:2]];
SceneLibraryViewController *sceneVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:4]];
ProductLibraryViewController *productVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:5]];
AllCustomerViewController *allcustomerVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:6]];
CustomerOrderViewController *customerOrderVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:7]];
AboutViewController *aboutVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:8]];
//2016年08月26日15:13:04新增返利
RebateViewController *rebateVC = [storyboard instantiateViewControllerWithIdentifier:@"RebateViewController"];
UINavigationController *searchNav = [[UINavigationController alloc]initWithRootViewController:searchVC];
UINavigationController *shoppingNav = [[UINavigationController alloc]initWithRootViewController:shoppingVC];
UINavigationController *clientNav = [[UINavigationController alloc]initWithRootViewController:clientVC];
UINavigationController *sceneNav = [[UINavigationController alloc]initWithRootViewController:sceneVC];
UINavigationController *productNav = [[UINavigationController alloc]initWithRootViewController:productVC];
UINavigationController *allcustomerNav = [[UINavigationController alloc]initWithRootViewController:allcustomerVC];
UINavigationController *cutomerorderNav = [[UINavigationController alloc]initWithRootViewController:customerOrderVC];
UINavigationController *aboutNav = [[UINavigationController alloc]initWithRootViewController:aboutVC];
UINavigationController *rebateNav = [[UINavigationController alloc]initWithRootViewController:rebateVC];
self.vcArray = [NSArray arrayWithObjects:rebateNav,aboutNav,cutomerorderNav,allcustomerNav,productNav,sceneNav,clientNav,shoppingNav,searchNav, nil];
for (int i=0; i<self.identifierArray.count; i++) {
BaseViewController *control = [storyboard instantiateViewControllerWithIdentifier:self.identifierArray[i]];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:control];
[self.vcArray addObject:nav];
[controllerArray addObject:control];
}
self.viewControllers = self.vcArray;
SHARED_APPDELEGATE.allControllerArray = [NSArray arrayWithObjects:rebateVC,aboutVC,customerOrderVC,allcustomerVC,productVC,sceneVC,clientVC,shoppingVC,searchVC, nil];
self.selectedIndex = 6;
SHARED_APPDELEGATE.allControllerArray = controllerArray;
self.selectedIndex = 2;
}
......@@ -189,7 +180,7 @@
//我的客户
case 102:
self.selectedIndex = 6;
self.selectedIndex = 2;
break;
......@@ -211,7 +202,7 @@
}else
{
self.selectedIndex = 7;
self.selectedIndex = 1;
}
break;
......@@ -295,9 +286,7 @@
#pragma mark -搜索框代理方法
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
//返回根视图
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
self.selectedIndex = 8;
self.selectedIndex = 0;
return YES;
}
......
......@@ -68,10 +68,10 @@
}
#pragma mark -返利余额点击
#pragma mark -我的账户点击
- (void)rebateViewClickAction:(UITapGestureRecognizer *)tap
{
[[NSNotificationCenter defaultCenter] postNotificationName:OPENCONTROLLER object:@(0)];
[[NSNotificationCenter defaultCenter] postNotificationName:OPENCONTROLLER object:@(3)];
}
#pragma mark -用户头像点击
......
This diff is collapsed.
......@@ -293,7 +293,7 @@ extern NSString *const ACTIVED;
/**
* 京东卡状态<查看>
*/
extern NSString *const LOOKED;
extern NSString *const USED;
/**
* 更新购物车商品
......
......@@ -292,7 +292,7 @@ NSString *const ACTIVED = @"actived";
/**
* 京东卡状态<查看>
*/
NSString *const LOOKED = @"used";
NSString *const USED = @"used";
/**
* 更新购物车商品
......
......@@ -245,7 +245,7 @@
- (IBAction)ShoppingBagButtonClickAction:(UIButton *)sender {
sender.selected = YES;
ShoppingBagViewController *shoppingBag = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"shoppingbagController"];
ShoppingBagViewController *shoppingBag = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"ShoppingBagViewController"];
[shoppingBag setDismissBlock:^{
sender.selected = NO;
}];
......
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