Commit 9714aa24 authored by 曹云霄's avatar 曹云霄

修改首页门店编号输入,opple提供原型图

parent b294026b
//
// ResellerTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2017/3/6.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ResellerTableViewCell : UITableViewCell
/**
门店编号
*/
@property (weak, nonatomic) IBOutlet UITextField *resellerTextField;
/**
查看门店编号帮助
*/
@property (nonatomic,copy) void(^storeNumberHelpBlock)();
@end
//
// ResellerTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2017/3/6.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import "ResellerTableViewCell.h"
@implementation ResellerTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
/**
获取查看门店编号帮助
*/
- (IBAction)storeNumberButtonClick:(UIButton *)sender {
if (self.storeNumberHelpBlock) {
self.storeNumberHelpBlock();
}
}
@end
......@@ -11,8 +11,17 @@
@interface ResellerViewController : BaseViewController
/**
经销商资料
门店编号
*/
@property (weak, nonatomic) IBOutlet UITableView *resellerTableView;
@property (weak, nonatomic) IBOutlet UITextField *storeNumberTextField;
@end
......@@ -7,10 +7,10 @@
//
#import "ResellerViewController.h"
#import "ResellerTableViewCell.h"
#import "CustomWKWebViewController.h"
@interface ResellerViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate>
@interface ResellerViewController ()<UITextFieldDelegate>
@end
......@@ -19,27 +19,20 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.resellerTableView.tableFooterView = [UIView new];
self.title = @"欧普到家门店编号";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleDone target:self action:@selector(modifyResellerInformation)];
self.navigationItem.rightBarButtonItem.enabled = [Shoppersmanager manager].Shoppers.validate;
}
#pragma mark -保存经销商ID ->验证
- (void)modifyResellerInformation
{
ResellerTableViewCell *cell = [self.resellerTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
if ([cell.resellerTextField.text isEqualToString:@"无"]) {
[self saveResellerInformation:cell.resellerTextField.text];return;
NSString *storeNumber = self.storeNumberTextField.text;
if ([[self class] isBlankString:storeNumber]) {
[XBLoadingView showHUDViewWithText:@"输入无效"];return;
}
if ([storeNumber isEqualToString:@"无"]) {
[self saveResellerInformation:storeNumber];return;
}
//验证
NSDictionary *dict = @{@"mfcode":cell.resellerTextField.text};
NSDictionary *dict = @{@"mfcode":storeNumber};
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
[HTTP networkWithDictionaryRequestWithURL:RESELLER withRequestType:NetworkRequestWithGET withParameter:dict withReturnValueBlock:^(id returnValue) {
......@@ -47,7 +40,7 @@
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToString:@"1"]) {
[XBLoadingView showHUDViewWithSuccessText:@"验证成功" completeBlock:^{
[weakSelf saveResellerInformation:cell.resellerTextField.text];
[weakSelf saveResellerInformation:storeNumber];
}];
}else {
[XBLoadingView showHUDViewWithText:returnValue[@"msg"]];
......@@ -84,38 +77,40 @@
}];
}
#pragma mark -<UITableViewDelegate,UITableViewDataSource>
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ResellerTableViewCell *resellerCell = [tableView dequeueReusableCellWithIdentifier:@"ResellerTableViewCell" forIndexPath:indexPath];
resellerCell.resellerTextField.delegate = self;
WS(weakSelf);
[resellerCell setStoreNumberHelpBlock:^{
NSLog(@"获取帮助");
}];
return resellerCell;
#pragma mark -帮助按钮
- (IBAction)helpButtonClickAction:(UIButton *)sender {
CustomWKWebViewController *webView = [[CustomWKWebViewController alloc] init];
webView.type = Image;
webView.urlString = [[NSBundle mainBundle] pathForResource:@"reference" ofType:@"png"];
[self presentViewController:webView animated:YES completion:nil];
}
#pragma mark -结束编辑
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
if ([[self class] isBlankString:textField.text]) {
return NO;
}
self.navigationItem.rightBarButtonItem.enabled = YES;
return YES;
}
#pragma mark -结束编辑
- (void)textFieldDidEndEditing:(UITextField *)textField
{
BOOL boolValue = ![[self class] isBlankString:textField.text];
self.navigationItem.rightBarButtonItem.enabled = boolValue;
#pragma mark -确认按钮
- (IBAction)sureButtonClickAction:(UIButton *)sender {
[self.storeNumberTextField resignFirstResponder];
[self modifyResellerInformation];
}
@end
......@@ -55,6 +55,8 @@
293163FA1DCE3CBA0075129D /* LuckyDrawDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 293163F91DCE3CBA0075129D /* LuckyDrawDetailsViewController.m */; };
293164001DCE3F6D0075129D /* NotDrawTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 293163FF1DCE3F6D0075129D /* NotDrawTableViewCell.m */; };
293164031DCE3F780075129D /* UsedDrawTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 293164021DCE3F780075129D /* UsedDrawTableViewCell.m */; };
293221501E6F9F1B00DD4980 /* XYTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 2932214F1E6F9F1B00DD4980 /* XYTextField.m */; };
293221531E6FA20D00DD4980 /* reference.png in Resources */ = {isa = PBXBuildFile; fileRef = 293221521E6FA20D00DD4980 /* reference.png */; };
2933934F1CD3158B000D997B /* instructionsLabe.m in Sources */ = {isa = PBXBuildFile; fileRef = 2933934E1CD3158B000D997B /* instructionsLabe.m */; };
293393551CD3379E000D997B /* ShoppingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 293393541CD3379E000D997B /* ShoppingTableViewCell.m */; };
29360C2F1CDDC47E002A5D89 /* ScreeningView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29360C2E1CDDC47E002A5D89 /* ScreeningView.m */; };
......@@ -83,7 +85,6 @@
2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BABC1CD2EFA00049385A /* InformationTableViewCell.m */; };
2949BAC21CD3055A0049385A /* MMExampleDrawerVisualStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */; };
294B86D11E6D2B04004E2D0F /* ResellerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 294B86D01E6D2B04004E2D0F /* ResellerViewController.m */; };
294B86D41E6D2B17004E2D0F /* ResellerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 294B86D31E6D2B17004E2D0F /* ResellerTableViewCell.m */; };
294B86D71E6D46EA004E2D0F /* CommentTagTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 294B86D61E6D46E9004E2D0F /* CommentTagTableViewCell.m */; };
294B86DA1E6D5828004E2D0F /* ThroughHistoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 294B86D91E6D5828004E2D0F /* ThroughHistoryViewController.m */; };
294BFDD11D47225A00BFD53F /* OppleMain.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 294BFDD01D47225A00BFD53F /* OppleMain.storyboard */; };
......@@ -399,6 +400,9 @@
293163FF1DCE3F6D0075129D /* NotDrawTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotDrawTableViewCell.m; sourceTree = "<group>"; };
293164011DCE3F780075129D /* UsedDrawTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UsedDrawTableViewCell.h; sourceTree = "<group>"; };
293164021DCE3F780075129D /* UsedDrawTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UsedDrawTableViewCell.m; sourceTree = "<group>"; };
2932214E1E6F9F1B00DD4980 /* XYTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XYTextField.h; sourceTree = "<group>"; };
2932214F1E6F9F1B00DD4980 /* XYTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XYTextField.m; sourceTree = "<group>"; };
293221521E6FA20D00DD4980 /* reference.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = reference.png; sourceTree = "<group>"; };
2933934D1CD3158B000D997B /* instructionsLabe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = instructionsLabe.h; sourceTree = "<group>"; };
2933934E1CD3158B000D997B /* instructionsLabe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = instructionsLabe.m; sourceTree = "<group>"; };
293393531CD3379E000D997B /* ShoppingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingTableViewCell.h; sourceTree = "<group>"; };
......@@ -453,8 +457,6 @@
2949BAC11CD3055A0049385A /* MMExampleDrawerVisualStateManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMExampleDrawerVisualStateManager.m; sourceTree = "<group>"; };
294B86CF1E6D2B04004E2D0F /* ResellerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResellerViewController.h; sourceTree = "<group>"; };
294B86D01E6D2B04004E2D0F /* ResellerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResellerViewController.m; sourceTree = "<group>"; };
294B86D21E6D2B17004E2D0F /* ResellerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResellerTableViewCell.h; sourceTree = "<group>"; };
294B86D31E6D2B17004E2D0F /* ResellerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResellerTableViewCell.m; sourceTree = "<group>"; };
294B86D51E6D46E9004E2D0F /* CommentTagTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentTagTableViewCell.h; sourceTree = "<group>"; };
294B86D61E6D46E9004E2D0F /* CommentTagTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentTagTableViewCell.m; sourceTree = "<group>"; };
294B86D81E6D5828004E2D0F /* ThroughHistoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThroughHistoryViewController.h; sourceTree = "<group>"; };
......@@ -1101,6 +1103,7 @@
2928F7DE1CD085430036D761 /* Tools */ = {
isa = PBXGroup;
children = (
293221511E6FA1F900DD4980 /* Resource */,
2985345D1DD4B0100023BBAE /* AirPrint */,
29C4C2471E14BFA20093B100 /* AnaimationImageView */,
2972312F1E0948BE00D8CA9B /* Bank */,
......@@ -1149,6 +1152,8 @@
children = (
2928F7E51CD087FE0036D761 /* BaseViewController.h */,
2928F7E61CD087FE0036D761 /* BaseViewController.m */,
2932214E1E6F9F1B00DD4980 /* XYTextField.h */,
2932214F1E6F9F1B00DD4980 /* XYTextField.m */,
);
path = parentclass;
sourceTree = "<group>";
......@@ -1204,6 +1209,14 @@
path = Cells;
sourceTree = "<group>";
};
293221511E6FA1F900DD4980 /* Resource */ = {
isa = PBXGroup;
children = (
293221521E6FA20D00DD4980 /* reference.png */,
);
path = Resource;
sourceTree = "<group>";
};
293393501CD329EC000D997B /* controller */ = {
isa = PBXGroup;
children = (
......@@ -1314,21 +1327,11 @@
294B86C91E6D2AA2004E2D0F /* Reseller */ = {
isa = PBXGroup;
children = (
294B86CD1E6D2AF9004E2D0F /* Cell */,
294B86CE1E6D2AF9004E2D0F /* Controller */,
);
path = Reseller;
sourceTree = "<group>";
};
294B86CD1E6D2AF9004E2D0F /* Cell */ = {
isa = PBXGroup;
children = (
294B86D21E6D2B17004E2D0F /* ResellerTableViewCell.h */,
294B86D31E6D2B17004E2D0F /* ResellerTableViewCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
294B86CE1E6D2AF9004E2D0F /* Controller */ = {
isa = PBXGroup;
children = (
......@@ -2738,6 +2741,7 @@
29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */,
29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */,
299C7F5B1CE21FA800E7D7CB /* AddressViewController.xib in Resources */,
293221531E6FA20D00DD4980 /* reference.png in Resources */,
29706DB41CD082990003C412 /* Assets.xcassets in Resources */,
291A37791DBA58D700299F0D /* GetJDCardView.xib in Resources */,
29EC331B1CE023D5005F0C13 /* ChangePasswordViewController.xib in Resources */,
......@@ -2915,6 +2919,7 @@
29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */,
29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */,
291D6A5C1CFFDCCA007891AE /* SceneListModel.m in Sources */,
293221501E6F9F1B00DD4980 /* XYTextField.m in Sources */,
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */,
29837B5E1DE5A3D3009CF614 /* ScreeningButton.m in Sources */,
29E9443D1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m in Sources */,
......@@ -3078,7 +3083,6 @@
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */,
299249441CDB51B100786B1E /* ModifyShippingAddressView.m in Sources */,
29E9445F1DE455AC007CD26C /* PrizeExchangeInformationTableViewCell.m in Sources */,
294B86D41E6D2B17004E2D0F /* ResellerTableViewCell.m in Sources */,
298111161DFE6E5000F7EAFF /* NSDate+Formatting.m in Sources */,
29B78C0F1DFA8B3700C7C6D8 /* ContentTableViewCell.m in Sources */,
29B78C181DFA982000C7C6D8 /* PhotoManagerCollectionViewCell.m in Sources */,
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "oppledj.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "oppledj@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "oppledj@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "reference.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "sureButtonBack.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sureButtonBack@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sureButtonBack@3x.png",
"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",
"filename" : "编号在哪里?点击这里@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -14,10 +14,12 @@
- Announcement: 公告
- Study: 学习
- Image: 本地图片
*/
typedef NS_ENUM(NSInteger,CALL_TYPE) {
Announcement = 0,
Study
Study,
Image
};
@interface CustomWKWebViewController : BaseViewController
......
......@@ -51,7 +51,7 @@
}
#pragma mark - 停止播放
-(void) viewDidDisappear:(BOOL)animated{
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
}
......@@ -84,7 +84,11 @@
- (void)setUrlString:(NSString *)urlString
{
_urlString = urlString;
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_urlString]]];
if (self.type == Image) {
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:urlString]]];
}else {
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
}
}
#pragma mark - 添加删除按钮
......
......@@ -91,13 +91,12 @@
- (void)perfectResellerInformation
{
ResellerViewController *resellerVc = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"ResellerViewController"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:resellerVc];
nav.preferredContentSize = CGSizeMake(ScreenHeight-300, 100);
nav.modalPresentationStyle = UIModalPresentationFormSheet;
UIPopoverPresentationController *pop = nav.popoverPresentationController;
resellerVc.preferredContentSize = CGSizeMake(400, 400);
resellerVc.modalPresentationStyle = UIModalPresentationFormSheet;
UIPopoverPresentationController *pop = resellerVc.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = nav.view;
[self presentViewController:nav animated:YES completion:nil];
pop.sourceView = resellerVc.view;
[self presentViewController:resellerVc animated:YES completion:nil];
}
......
//
// XYTextField.h
// SaleHelper
//
// Created by 曹云霄 on 2017/1/11.
// Copyright © 2017年 上海勾芒信息科技. All rights reserved.
//
#import <UIKit/UIKit.h>
//重写父类方法,控制缩进
@interface XYTextField : UITextField
- (CGRect)textRectForBounds:(CGRect)bounds;
- (CGRect)editingRectForBounds:(CGRect)bounds;
@end
//
// XYTextField.m
// SaleHelper
//
// Created by 曹云霄 on 2017/1/11.
// Copyright © 2017年 上海勾芒信息科技. All rights reserved.
//
#import "XYTextField.h"
@implementation XYTextField
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectInset( bounds , 20 , 0 );
}
//控制编辑文本时所在的位置,左右缩 30
- (CGRect)editingRectForBounds:(CGRect)bounds {
return CGRectInset( bounds , 20 , 0 );
}
@end
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