|
@@ -124,46 +124,46 @@
|
|
|
// get customer info
|
|
// get customer info
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
|
|
- if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
|
|
-
|
|
|
|
|
- // 检查价格类型
|
|
|
|
|
- // 提货价才能提交订单
|
|
|
|
|
- /** 价格类型
|
|
|
|
|
- * 0 提货价
|
|
|
|
|
- * 1 统一价
|
|
|
|
|
- * 2 计算价
|
|
|
|
|
- */
|
|
|
|
|
- NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
|
|
|
|
|
- if (priceType != 0) {
|
|
|
|
|
-
|
|
|
|
|
- NSString* pricename = nil;
|
|
|
|
|
- switch (priceType) {
|
|
|
|
|
- case 1:
|
|
|
|
|
- pricename=flat_price;
|
|
|
|
|
- break;
|
|
|
|
|
- case 2:
|
|
|
|
|
- pricename=given_price;
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Current price is %@, please change to %@ and try again.",pricename,[Singleton sharedInstance].deliveryString] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
-
|
|
|
|
|
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
-
|
|
|
|
|
- [alertVC dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
-
|
|
|
|
|
- }];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- [alertVC addAction:cancelAction];
|
|
|
|
|
-
|
|
|
|
|
- [self presentViewController:alertVC animated:YES completion:nil];
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
|
|
+//
|
|
|
|
|
+// // 检查价格类型
|
|
|
|
|
+// // 提货价才能提交订单
|
|
|
|
|
+// /** 价格类型
|
|
|
|
|
+// * 0 提货价
|
|
|
|
|
+// * 1 统一价
|
|
|
|
|
+// * 2 计算价
|
|
|
|
|
+// */
|
|
|
|
|
+// NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
|
|
|
|
|
+// if (priceType != 0) {
|
|
|
|
|
+//
|
|
|
|
|
+// NSString* pricename = nil;
|
|
|
|
|
+// switch (priceType) {
|
|
|
|
|
+// case 1:
|
|
|
|
|
+// pricename=flat_price;
|
|
|
|
|
+// break;
|
|
|
|
|
+// case 2:
|
|
|
|
|
+// pricename=given_price;
|
|
|
|
|
+// break;
|
|
|
|
|
+// default:
|
|
|
|
|
+// break;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Current price is %@, please change to %@ and try again.",pricename,[Singleton sharedInstance].deliveryString] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
+//
|
|
|
|
|
+// UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
+//
|
|
|
|
|
+// [alertVC dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// }];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// [alertVC addAction:cancelAction];
|
|
|
|
|
+//
|
|
|
|
|
+// [self presentViewController:alertVC animated:YES completion:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
NSString* msg;
|
|
NSString* msg;
|
|
@@ -174,6 +174,16 @@
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
msg=@"Are you sure to submit order?";
|
|
msg=@"Are you sure to submit order?";
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
|
|
+
|
|
|
|
|
+ NSString *specialInstuction = [Singleton sharedInstance].specialInstruction;
|
|
|
|
|
+ msg = [NSString stringWithFormat:@"Are you sure to submit order?\n1.Current Price Type is %@",[self currentPriceTypeName]];
|
|
|
|
|
+ if (specialInstuction.length) {
|
|
|
|
|
+ msg = [msg stringByAppendingFormat:@"\n2.Special Instruction is %@.",specialInstuction];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Submit Confirm.", nil) message:NSLocalizedString(msg, nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
|
|
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Submit Confirm.", nil) message:NSLocalizedString(msg, nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
|
|
@@ -1597,4 +1607,24 @@
|
|
|
// [self.navigationController popViewControllerAnimated:true];
|
|
// [self.navigationController popViewControllerAnimated:true];
|
|
|
//}
|
|
//}
|
|
|
|
|
|
|
|
|
|
+- (NSString *)currentPriceTypeName {
|
|
|
|
|
+ NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
|
|
|
|
|
+
|
|
|
|
|
+ NSString* pricename = nil;
|
|
|
|
|
+ switch (priceType) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ pricename=[Singleton sharedInstance].deliveryString;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ pricename=flat_price;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ pricename=given_price;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ return pricename;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|