Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ALand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
ALand
Commits
923729f1
Commit
923729f1
authored
9 years ago
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情页面bug fix
parent
38c92318
master
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
44 deletions
+47
-44
CommodityDetailBottomView.xib
...deClass/Home/View/Commodity/CommodityDetailBottomView.xib
+10
-10
CommodityDetailTopView.h
ALand/CodeClass/Home/View/Commodity/CommodityDetailTopView.h
+3
-3
CommodityDetailTopView.m
ALand/CodeClass/Home/View/Commodity/CommodityDetailTopView.m
+0
-7
CommodityDetailTopView.xib
.../CodeClass/Home/View/Commodity/CommodityDetailTopView.xib
+4
-6
CommodityDetailViewController.m
.../ViewController/Commodity/CommodityDetailViewController.m
+28
-18
AppHeader.h
ALand/Macro/AppHeader.h
+2
-0
No files found.
ALand/CodeClass/Home/View/Commodity/CommodityDetailBottomView.xib
View file @
923729f1
...
...
@@ -8,11 +8,11 @@
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"CommodityDetailBottomView"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<view
contentMode=
"scaleToFill"
id=
"iN0-l3-epB"
customClass=
"CommodityDetailBottomView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"324"
height=
"
142
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"324"
height=
"
80
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
misplaced=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
adjustsImageWhenHighlighted=
"NO"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"aoN-Hz-W7F"
>
<rect
key=
"frame"
x=
"65"
y=
"8
3
"
width=
"34"
height=
"52"
/>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
adjustsImageWhenHighlighted=
"NO"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"aoN-Hz-W7F"
>
<rect
key=
"frame"
x=
"65"
y=
"8"
width=
"34"
height=
"52"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"34"
id=
"MEe-J1-sOo"
/>
<constraint
firstAttribute=
"height"
constant=
"52"
id=
"MsZ-Sb-kDE"
/>
...
...
@@ -27,8 +27,8 @@
</mask>
</variation>
</button>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
misplaced=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
adjustsImageWhenHighlighted=
"NO"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Aw9-Qe-Nwo"
>
<rect
key=
"frame"
x=
"1
09"
y=
"83"
width=
"195
"
height=
"52"
/>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
adjustsImageWhenHighlighted=
"NO"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Aw9-Qe-Nwo"
>
<rect
key=
"frame"
x=
"1
15"
y=
"8"
width=
"193
"
height=
"52"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"195"
id=
"Hke-9r-Lpe"
/>
<constraint
firstAttribute=
"height"
constant=
"52"
id=
"mTJ-fG-h3H"
/>
...
...
@@ -40,15 +40,15 @@
</mask>
</variation>
</button>
<view
contentMode=
"scaleToFill"
misplaced=
"YES"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"dUa-UD-hsS"
>
<rect
key=
"frame"
x=
"
19"
y=
"18"
width=
"271"
height=
"39
"
/>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"dUa-UD-hsS"
>
<rect
key=
"frame"
x=
"
0.0"
y=
"0.0"
width=
"324"
height=
"2
"
/>
<color
key=
"backgroundColor"
white=
"0.66666666669999997"
alpha=
"0.16272836538461538"
colorSpace=
"calibratedWhite"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"2"
id=
"1cl-wt-sFJ"
/>
</constraints>
</view>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
misplaced=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"3sW-LB-Orb"
>
<rect
key=
"frame"
x=
"1
9"
y=
"82
"
width=
"33"
height=
"52"
/>
<button
opaque=
"NO"
contentMode=
"scaleAspectFit"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"3sW-LB-Orb"
>
<rect
key=
"frame"
x=
"1
6"
y=
"8
"
width=
"33"
height=
"52"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"52"
id=
"4vd-ba-xPJ"
/>
<constraint
firstAttribute=
"width"
constant=
"33"
id=
"QYT-a0-cxz"
/>
...
...
@@ -116,7 +116,7 @@
<outlet
property=
"buttonShare"
destination=
"Aw9-Qe-Nwo"
id=
"koi-RC-MzR"
/>
<outlet
property=
"buttonShop"
destination=
"aoN-Hz-W7F"
id=
"Vni-HC-cHY"
/>
</connections>
<point
key=
"canvasLocation"
x=
"
430"
y=
"246
"
/>
<point
key=
"canvasLocation"
x=
"
332"
y=
"214
"
/>
</view>
</objects>
<resources>
...
...
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/View/Commodity/CommodityDetailTopView.h
View file @
923729f1
...
...
@@ -7,8 +7,8 @@
//
#import <UIKit/UIKit.h>
typedef
void
(
^
topBlock
)(
void
);
@interface
CommodityDetailTopView
:
UIView
@property
(
nonatomic
,
copy
)
topBlock
bacBlock
;
@property
(
nonatomic
,
copy
)
topBlock
homeBlock
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
buttonBack
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
buttonHome
;
@end
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/View/Commodity/CommodityDetailTopView.m
View file @
923729f1
...
...
@@ -11,13 +11,6 @@
@implementation
CommodityDetailTopView
-
(
IBAction
)
backActiion
:(
UIButton
*
)
sender
{
self
.
bacBlock
();
}
-
(
IBAction
)
homeAction
:(
id
)
sender
{
self
.
homeBlock
();
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
...
...
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/View/Commodity/CommodityDetailTopView.xib
View file @
923729f1
...
...
@@ -18,16 +18,10 @@
<constraint
firstAttribute=
"height"
constant=
"44"
id=
"xgs-oj-Y1x"
/>
</constraints>
<state
key=
"normal"
image=
"commodityDetailBack"
/>
<connections>
<action
selector=
"backActiion:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"Rcx-bi-ED3"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"gWc-ej-xNw"
>
<rect
key=
"frame"
x=
"260"
y=
"36"
width=
"44"
height=
"44"
/>
<state
key=
"normal"
image=
"commodityDetailHome"
/>
<connections>
<action
selector=
"homeAction:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"2HN-As-jcv"
/>
</connections>
</button>
</subviews>
<constraints>
...
...
@@ -39,6 +33,10 @@
<constraint
firstAttribute=
"trailing"
secondItem=
"gWc-ej-xNw"
secondAttribute=
"trailing"
constant=
"16"
id=
"wvz-3B-6lR"
/>
</constraints>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<connections>
<outlet
property=
"buttonBack"
destination=
"Tkk-cJ-NcJ"
id=
"9il-f8-93p"
/>
<outlet
property=
"buttonHome"
destination=
"gWc-ej-xNw"
id=
"tyD-go-V6V"
/>
</connections>
<point
key=
"canvasLocation"
x=
"318"
y=
"89"
/>
</view>
</objects>
...
...
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/ViewController/Commodity/CommodityDetailViewController.m
View file @
923729f1
...
...
@@ -10,7 +10,7 @@
#import "CommodityDetailBottomView.h"
#import "CommodityDetailTopView.h"
#import "CommodityMutipleSelectBottomView.h"
@interface
CommodityDetailViewController
()
@interface
CommodityDetailViewController
()
<
UIWebViewDelegate
>
@property
(
nonatomic
,
strong
)
CommodityDetailBottomView
*
bottomView
;
@property
(
nonatomic
,
strong
)
CommodityDetailTopView
*
topView
;
@end
...
...
@@ -26,27 +26,28 @@
self
.
view
.
backgroundColor
=
kBacroundColor
;
[
self
setUpWebView
];
[
self
.
view
addSubview
:
self
.
topView
];
WS
(
weakSelf
)
self
.
topView
.
bacBlock
=
^
{
[
weakSelf
.
navigationController
popViewControllerAnimated
:
YES
];
};
self
.
topView
.
homeBlock
=
^
{
CLog
(
@"home"
);
};
[
self
.
view
addSubview
:
self
.
bottomView
];
[
self
.
bottomView
.
buttonShop
addTarget
:
self
action
:
@selector
(
addCommodity
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
bottomView
.
buttonShare
addTarget
:
self
action
:
@selector
(
shareAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
bottomView
.
userInteractionEnabled
=
NO
;
//添加点击事件
kButtonAddAction
(
self
.
bottomView
.
buttonShop
,
addCommodity
)
kButtonAddAction
(
self
.
bottomView
.
buttonShare
,
shareAction
)
kButtonAddAction
(
self
.
topView
.
buttonBack
,
backAction
)
kButtonAddAction
(
self
.
topView
.
buttonHome
,
homeAction
)
// Do any additional setup after loading the view.
}
-
(
void
)
backAction
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
-
(
void
)
homeAction
{
CLog
(
@"home"
);
[
self
.
navigationController
popToRootViewControllerAnimated
:
YES
];
}
-
(
void
)
addCommodity
{
CLog
(
@"添加商品"
);
UserInfo
*
info
=
[
UserInfo
shareInstance
];
...
...
@@ -92,10 +93,10 @@
-
(
void
)
setUpWebView
{
UserInfo
*
userInfo
=
[
UserInfo
shareInstance
];
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@Wap/detail/shop_id/%@/id/%@/hastbar/1/.html"
,
userInfo
.
webShopBaseUrl
,
userInfo
.
shop
.
uuid
,
self
.
model
.
uuid
];
UIWebView
*
webView
=
[[
UIWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
-
67
)];
NSURL
*
url
=
[
NSURL
URLWithString
:
urlStr
];
[
webView
loadRequest
:[
NSURLRequest
requestWithURL
:
url
]];
webView
.
delegate
=
self
;
[
self
.
view
addSubview
:
webView
];
webView
.
userInteractionEnabled
=
YES
;
...
...
@@ -113,6 +114,15 @@
[
self
.
navigationController
setNavigationBarHidden
:
YES
];
}
#pragma mark =========== webView delegate ===========
-
(
void
)
webViewDidStartLoad
:
(
UIWebView
*
)
webView
{
[
MBProgressHUD
showHUDAddedTo
:
webView
animated
:
YES
];
}
-
(
void
)
webViewDidFinishLoad
:
(
UIWebView
*
)
webView
{
self
.
bottomView
.
userInteractionEnabled
=
YES
;
[
MBProgressHUD
hideHUDForView
:
webView
];
}
#pragma mark =========== lazy loading ===========
-
(
CommodityDetailBottomView
*
)
bottomView
{
...
...
This diff is collapsed.
Click to expand it.
ALand/Macro/AppHeader.h
View file @
923729f1
...
...
@@ -52,6 +52,8 @@
#define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]]
#define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]]
#define kSysWhite [UIColor whiteColor]
#define kButtonAddAction(button, buttonAction) [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
#pragma mark =========== end ===========
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment