Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
Conflicts:
	GroupBuyCommon/Controller/ProductDetailController.m
  • Loading branch information
lingzhe committed Nov 4, 2011
2 parents 89ed4ee + 52539c7 commit c6d168f
Show file tree
Hide file tree
Showing 15 changed files with 689 additions and 565 deletions.
65 changes: 30 additions & 35 deletions GroupBuyCommon/Controller/AddShoppingItemController.xib
Expand Up @@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">1305</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.SystemVersion">10K549</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 All @@ -21,11 +21,8 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -45,9 +42,10 @@
<object class="IBUITableView" id="448631273">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 460}</string>
<string key="NSFrame">{{0, 15}, {320, 400}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
Expand All @@ -65,9 +63,10 @@
<float key="IBUISectionFooterHeight">22</float>
</object>
</object>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<string key="NSFrame">{{0, 64}, {320, 416}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="448631273"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
Expand All @@ -76,6 +75,9 @@
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
<bool key="IBUIPrompted">NO</bool>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
Expand All @@ -90,14 +92,6 @@
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="448631273"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataTableView</string>
Expand All @@ -106,13 +100,23 @@
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="448631273"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">17</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
Expand Down Expand Up @@ -151,16 +155,18 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>-2.IBPluginDependency</string>
<string>1.IBPluginDependency</string>
<string>13.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>AddShoppingItemController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>{{408, 244}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
Expand Down Expand Up @@ -217,17 +223,6 @@
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">datePicker</string>
<string key="NS.object.0">UIDatePicker</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">datePicker</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">datePicker</string>
<string key="candidateClassName">UIDatePicker</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AddShoppingItemController.h</string>
Expand Down Expand Up @@ -270,14 +265,14 @@
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="1024" key="NS.object.0"/>
<real value="1280" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</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>
60 changes: 41 additions & 19 deletions GroupBuyCommon/Controller/ProductDetailController.m
Expand Up @@ -415,7 +415,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
case SECTION_SHOP_ADDRESS:
{
cell.textLabel.text = [self getAddress];
if ([cell.textLabel.text length] > 0)
if ([[self.product addressArray] count] > 0)
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
break;
Expand All @@ -432,7 +432,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
case SECTION_TEL:
{
cell.textLabel.text = [self getTel];
if ([cell.textLabel.text length] > 0)
if ([[self.product telArray] count] > 0)
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}

Expand Down Expand Up @@ -470,19 +470,14 @@ - (void)gotoBuy
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

if (indexPath.section == SECTION_MORE ||
indexPath.section == SECTION_TITLE ||
indexPath.section == SECTION_IMAGE){

if (indexPath.section == SECTION_MORE) {
[GroupBuyReport reportClickShowProductMore:product];
[self gotoBuy];
}else if(indexPath.section == SECTION_TEL){
NSArray *telArr = [product telArray];
if(telArr == nil || [telArr count] == 0)
if(telArr && [telArr count] > 0)
{
[GroupBuyReport reportClickShowProductMore:product];
[self gotoBuy];
}else{
TelPickerViewController *tvc = [[TelPickerViewController alloc] initWithTelArray:telArr];
[tvc enableGroupBuySettings];
[self.navigationController pushViewController:tvc animated:YES];
Expand All @@ -492,12 +487,41 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
{
NSArray *locationArray = [product gpsArray];
NSArray *addressArray = [product addressArray];
ShowAddressViewController *savc = [[ShowAddressViewController alloc]initWithLocationArray:locationArray addressList:addressArray];
[savc enableGroupBuySettings];
[self.navigationController pushViewController:savc animated:YES];
[savc release];

if (addressArray && [addressArray count] > 0) {
ShowAddressViewController *savc = [[ShowAddressViewController alloc]initWithLocationArray:locationArray addressList:addressArray];
[savc enableGroupBuySettings];
[self.navigationController pushViewController:savc animated:YES];
[savc release];
}
}

// if (indexPath.section == SECTION_MORE ||
// indexPath.section == SECTION_TITLE ||
// indexPath.section == SECTION_IMAGE){
// [GroupBuyReport reportClickShowProductMore:product];
// [self gotoBuy];
// }else if(indexPath.section == SECTION_TEL){
// NSArray *telArr = [product telArray];
// if(telArr == nil || [telArr count] == 0)
// {
// [GroupBuyReport reportClickShowProductMore:product];
// [self gotoBuy];
// }else{
// TelPickerViewController *tvc = [[TelPickerViewController alloc] initWithTelArray:telArr];
// [self.navigationController pushViewController:tvc animated:YES];
// [tvc release];
// }
// }else if(indexPath.section == SECTION_SHOP_ADDRESS)
// {
// NSArray *locationArray = [product gpsArray];
// NSArray *addressArray = [product addressArray];
// if (addressArray && [addressArray count] > 0) {
// ShowAddressViewController *savc = [[ShowAddressViewController alloc]initWithLocationArray:locationArray addressList:addressArray];
// [self.navigationController pushViewController:savc animated:YES];
// [savc release];
// }
//
// }

}

Expand All @@ -506,15 +530,15 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
- (IBAction)clickBuy:(id)sender
{

[self.buyButton setSelected:YES];

[GlobalGetProductService() actionOnProduct:product.productId actionName:PRODUCT_ACTION_BUY actionValue:1];
[GroupBuyReport reportClickBuyProduct:product];
[self gotoBuy];
}

- (IBAction)clickSave:(id)sender
{
[self.savaButton setSelected:YES];

[GlobalGetProductService() actionOnProduct:product.productId actionName:PRODUCT_ACTION_ADD_FAVORITE actionValue:1];
[GroupBuyReport reportClickSaveProduct:product];
if ([ProductManager createProductForFavorite:product]){
Expand All @@ -525,7 +549,6 @@ - (IBAction)clickSave:(id)sender
- (IBAction)clickForward:(id)sender
{
[GlobalGetProductService() actionOnProduct:product.productId actionName:PRODUCT_ACTION_FORWARD actionValue:1];
[self.forwardButton setSelected:YES];
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:NSLS(@"取消") destructiveButtonTitle:nil otherButtonTitles:NSLS(@"短信转发"), NSLS(@"邮件转发"), nil];

[actionSheet showFromTabBar:self.tabBarController.tabBar];
Expand All @@ -546,7 +569,6 @@ - (void)clickDown:(id)sender

- (IBAction)clickComment:(id)sender
{
[self.commetButton setSelected:YES];
ProductCommentsController *controller = [[ProductCommentsController alloc] init];
controller.productId = self.product.productId;
[self.navigationController pushViewController:controller animated:YES];
Expand Down

0 comments on commit c6d168f

Please sign in to comment.