Skip to content

Commit

Permalink
finish comment integration
Browse files Browse the repository at this point in the history
  • Loading branch information
lingzhe committed Nov 5, 2011
1 parent c6d168f commit d422903
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 301 deletions.
2 changes: 2 additions & 0 deletions GroupBuyCommon/Controller/CommentTableViewCell.m
Expand Up @@ -75,6 +75,8 @@ + (CommentTableViewCell *)createCell

- (void)setCellInfoWithContent:(NSString *)content nickName:(NSString *)nickName createDate:(NSDate *)createDate
{
self.selectionStyle = UITableViewCellSelectionStyleNone;

self.nickNameLabel.text = nickName;
self.createDateLabel.text = [self getDateDisplayText:createDate];

Expand Down
111 changes: 34 additions & 77 deletions GroupBuyCommon/Controller/CommentTableViewCell.xib
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1056</int>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1305</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">300</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -49,82 +49,91 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{160, 10}, {140, 21}}</string>
<reference key="NSSuperview" ref="17932465"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="256498398"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Date</string>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">11</double>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwLjI1MDk4MDQwNyAwLjUwMTk2MDgxNAA</bytes>
<bytes key="NSRGB">MC40MzUyOTQxMTc2IDAuNDA3ODQzMTM3MyAwLjM2ODYyNzQ1MQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUINumberOfLines">1000</int>
<int key="IBUITextAlignment">2</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">Helvetica</string>
<string key="family">Helvetica</string>
<int key="traits">0</int>
<double key="pointSize">11</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">11</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUILabel" id="207347426">
<reference key="NSNextResponder" ref="17932465"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{10, 10}, {150, 21}}</string>
<reference key="NSSuperview" ref="17932465"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="926088145"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">name</string>
<object class="NSFont" key="IBUIFont" id="76294841">
<string key="NSName">Helvetica</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwLjI1MDk4MDQwNyAwLjUwMTk2MDgxNAA</bytes>
<bytes key="NSRGB">MC40MzUyOTQxMTc2IDAuNDA3ODQzMTM3MyAwLjM2ODYyNzQ1MQA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="329157011">
<string key="name">Helvetica</string>
<string key="family">Helvetica</string>
<int key="traits">0</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="76294841">
<string key="NSName">Helvetica</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUILabel" id="256498398">
<reference key="NSNextResponder" ref="17932465"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{10, 39}, {283, 65}}</string>
<reference key="NSSuperview" ref="17932465"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">content</string>
<reference key="IBUIFont" ref="76294841"/>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<bytes key="NSRGB">MC43NDUwOTgwMzkyIDAuNzIxNTY4NjI3NSAwLjY4NjI3NDUwOTgAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUINumberOfLines">1000</int>
<reference key="IBUIFontDescription" ref="329157011"/>
<reference key="IBUIFont" ref="76294841"/>
</object>
</object>
<string key="NSFrameSize">{320, 114}</string>
<string key="NSFrameSize">{320, 113}</string>
<reference key="NSSuperview" ref="301648898"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="207347426"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
Expand All @@ -139,7 +148,6 @@
</object>
<string key="NSFrameSize">{320, 114}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="17932465"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIContentView" ref="17932465"/>
Expand Down Expand Up @@ -260,60 +268,9 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">13</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">CommentTableViewCell</string>
<string key="superclassName">UITableViewCell</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>contentLabel</string>
<string>createDateLabel</string>
<string>nickNameLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UILabel</string>
<string>UILabel</string>
<string>UILabel</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>contentLabel</string>
<string>createDateLabel</string>
<string>nickNameLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">contentLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">createDateLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">nickNameLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CommentTableViewCell.h</string>
</object>
</object>
</object>
<int key="maxID">15</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
Expand All @@ -322,6 +279,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">300</string>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
14 changes: 8 additions & 6 deletions GroupBuyCommon/Controller/ProductCommentsController.m
Expand Up @@ -11,7 +11,7 @@
#import "GroupBuyNetworkConstants.h"
#import "TimeUtils.h"
#import "CommentTableViewCell.h"

#import "GroupBuyControllerExt.h"

@implementation ProductCommentsController

Expand Down Expand Up @@ -44,17 +44,19 @@ - (void)didReceiveMemoryWarning
- (void)viewDidLoad
{
// [self setBackgroundImageName:@"background.png"];
[self setBackgroundImageName:@"background.png"];
self.dataTableView.backgroundColor = [UIColor clearColor];
self.dataTableView.frame = CGRectMake(8, 8, 304, 480-44-20-8-55-5);

supportRefreshHeader = YES;
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"所有评论";

[self setGroupBuyNavigationBackButton];
[self setGroupBuyNavigationRightButton:@"撰写评论" action:@selector(writeComment)];
[self setGroupBuyNavigationTitle:self.navigationItem.title];

UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(writeComment)];
self.navigationItem.rightBarButtonItem = rightItem;
[rightItem release];

[self setNavigationLeftButton:@"返回" action:@selector(clickBack:)];

//[GlobalGetProductService() getCommentsWithProductId:productId viewController:self];
}
Expand Down
15 changes: 8 additions & 7 deletions GroupBuyCommon/Controller/ProductCommentsController.xib
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1056</int>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1305</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">300</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -42,17 +42,18 @@
<object class="IBUITableView" id="20633383">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 367}</string>
<string key="NSFrame">{{0, 14}, {320, 353}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<object class="NSColor" key="IBUIBackgroundColor" id="140789073">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<int key="IBUISeparatorStyle">1</int>
<reference key="IBUISeparatorColor" ref="140789073"/>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">44</float>
Expand Down Expand Up @@ -219,6 +220,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">300</string>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
45 changes: 45 additions & 0 deletions GroupBuyCommon/Controller/ProductDetailController.m
Expand Up @@ -629,11 +629,17 @@ - (void)handleForwardProduct:(NSInteger)buttonIndex

switch (buttonIndex) {
case BUTTON_SEND_BY_SMS:
{
GlobalSetNavBarBackground(nil);
[self sendSms:@"" body:smsBody];
}
break;

case BUTTON_SEND_BY_EMAIL:
{
GlobalSetNavBarBackground(nil);
[self sendEmailTo:nil ccRecipients:nil bccRecipients:nil subject:subject body:htmlBody isHTML:NO delegate:self];
}
break;

default:
Expand All @@ -651,4 +657,43 @@ - (void)clickTaobaoSearch:(id)sender
[TaobaoSearchController showController:self text:product.title price:[product.price doubleValue] value:[product.value doubleValue]];
}

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
NSLog(@"<sendSms> result=%d", result);
GlobalSetNavBarBackground(@"navigationbar.png");
[self dismissModalViewControllerAnimated:YES];

}

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
NSString* text = nil;

// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
text = @"<MFMailComposeViewController.didFinishWithResult> Result: canceled";
break;
case MFMailComposeResultSaved:
text = @"<MFMailComposeViewController.didFinishWithResult> Result: saved";
break;
case MFMailComposeResultSent:
text = @"<MFMailComposeViewController.didFinishWithResult> Result: sent";
break;
case MFMailComposeResultFailed:
text = @"<MFMailComposeViewController.didFinishWithResult> Result: failed";
break;
default:
text = @"<MFMailComposeViewController.didFinishWithResult> Result: not sent";
break;
}

NSLog(@"%@", text);
GlobalSetNavBarBackground(@"navigationbar.png");
[self dismissModalViewControllerAnimated:YES];

}


@end
5 changes: 3 additions & 2 deletions GroupBuyCommon/Controller/ProductWriteCommentController.m
Expand Up @@ -48,8 +48,9 @@ - (void)viewDidLoad
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"撰写评论";

[self setNavigationRightButton:@"提交" action:@selector(submit)];
[self setNavigationLeftButton:@"返回" action:@selector(clickBack:)];
[self setGroupBuyNavigationBackButton];
[self setGroupBuyNavigationRightButton:@"提交" action:@selector(submit)];
[self setGroupBuyNavigationTitle:self.navigationItem.title];
[self.contentTextView setRoundRectStyle];

groupbuyAppDelegate *delegate = (groupbuyAppDelegate *)[UIApplication sharedApplication].delegate;
Expand Down

0 comments on commit d422903

Please sign in to comment.