贵族充值页需要支付宝微信
This commit is contained in:
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param clientIp ip
|
||||
/// @param uid uid
|
||||
/// @param ticket ticket
|
||||
+ (void)requestPay:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId payChannel:(NSString *)payChannel clientIp:(NSString *)clientIp uid:(NSString *)uid ticket:(NSString *)ticket;
|
||||
+ (void)requestPay:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId payChannel:(NSString *)payChannel clientIp:(NSString *)clientIp uid:(NSString *)uid ticket:(NSString *)ticket roomUid:(NSString *)roomUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -22,14 +22,19 @@
|
||||
/// @param clientIp ip
|
||||
/// @param uid uid
|
||||
/// @param ticket ticket
|
||||
+ (void)requestPay:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId payChannel:(NSString *)payChannel clientIp:(NSString *)clientIp uid:(NSString *)uid ticket:(NSString *)ticket {
|
||||
+ (void)requestPay:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId payChannel:(NSString *)payChannel clientIp:(NSString *)clientIp uid:(NSString *)uid ticket:(NSString *)ticket roomUid:(NSString *)roomUid {
|
||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||
[dic safeSetObject:chargeProdId forKey:@"chargeProdId"];
|
||||
[dic safeSetObject:payChannel forKey:@"payChannel"];
|
||||
[dic safeSetObject:clientIp forKey:@"clientIp"];
|
||||
[dic safeSetObject:uid forKey:@"uid"];
|
||||
[dic safeSetObject:ticket forKey:@"ticket"];
|
||||
[dic setValue:chargeProdId forKey:@"chargeProdId"];
|
||||
[dic setValue:payChannel forKey:@"payChannel"];
|
||||
[dic setValue:clientIp forKey:@"clientIp"];
|
||||
[dic setValue:uid forKey:@"uid"];
|
||||
[dic setValue:ticket forKey:@"ticket"];
|
||||
if (roomUid.integerValue> 0) {
|
||||
[dic setValue:roomUid forKey:@"roomUid"];
|
||||
}
|
||||
[HttpRequestHelper request:@"charge/pay/apply" method:HttpRequestHelperMethodPOST params:dic completion:completion];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 获取钱包信息
|
||||
- (void)getUserWalletInfo;
|
||||
///发起支付
|
||||
- (void)requestPay:(NSString *)chargeProdId payChannel:(NSString *)payChannel;
|
||||
- (void)requestPay:(NSString *)chargeProdId payChannel:(NSString *)payChannel roomUid:(NSString *)roomUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -34,12 +34,12 @@
|
||||
}
|
||||
|
||||
///发起支付
|
||||
- (void)requestPay:(NSString *)chargeProdId payChannel:(NSString *)payChannel {
|
||||
- (void)requestPay:(NSString *)chargeProdId payChannel:(NSString *)payChannel roomUid:(NSString *)roomUid {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
NSString * clientIp= [YYUtility ipAddress];
|
||||
[Api requestPay:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] requestPaySuccess:data.data payChannel:payChannel];
|
||||
} showLoading:YES] chargeProdId:chargeProdId payChannel:payChannel clientIp:clientIp uid:uid ticket:ticket];
|
||||
} showLoading:YES] chargeProdId:chargeProdId payChannel:payChannel clientIp:clientIp uid:uid ticket:ticket roomUid:roomUid];
|
||||
}
|
||||
@end
|
||||
|
@@ -8,12 +8,16 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class FirstRechargeModel;
|
||||
@interface XPEnterpriseFirstRechargePayView : UIView
|
||||
///充值信息
|
||||
@property (nonatomic,strong) FirstRechargeModel *rechargeInfo;
|
||||
///充值的id
|
||||
@property (nonatomic,copy) NSString *chargeProdId;
|
||||
///充值的金额
|
||||
@property (nonatomic,copy) NSString *chargeMoney;
|
||||
///房主的uid
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
///首充的vc
|
||||
@property (nonatomic,weak) UIViewController *firstrechargeVC;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "EnterpriseRechargeListInfoModel.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "EnterPrieseRechargeTypeItemModel.h"
|
||||
///View
|
||||
#import "XPEnterpriseRechargePayTableViewCell.h"
|
||||
@@ -153,14 +152,21 @@
|
||||
if ([payChannel isEqualToString:@"alipay_v2"]) {
|
||||
if ([infoData isKindOfClass:[NSDictionary class]]) {
|
||||
if ([[infoData objectForKey:@"payType"] isEqualToString:@"h5"]) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:^{
|
||||
if (self.firstrechargeVC) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:^{
|
||||
XPWebViewController *webView = [[XPWebViewController alloc] init];
|
||||
webView.url = [infoData objectForKey:@"orderData"];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webView animated:YES];
|
||||
}];
|
||||
} else {
|
||||
XPWebViewController *webView = [[XPWebViewController alloc] init];
|
||||
webView.url = [infoData objectForKey:@"orderData"];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webView animated:YES];
|
||||
}];
|
||||
|
||||
}
|
||||
}else if ([[infoData objectForKey:@"payType"] isEqualToString:@"native"]) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
if (self.firstrechargeVC) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
NSString * signedStr = [infoData objectForKey:@"orderData"];
|
||||
NSString * scheme = @"daeplayappp";
|
||||
[[AlipaySDK defaultService] payOrder:signedStr fromScheme:scheme callback:^(NSDictionary *resultDic) {
|
||||
@@ -169,7 +175,9 @@
|
||||
}
|
||||
}
|
||||
} else if ([payChannel isEqualToString:@"alipay"]) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
if (self.firstrechargeVC) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
if ([data isKindOfClass:[NSString class]]) {
|
||||
NSString * scheme = @"daeplayappp";
|
||||
NSString * signedStr = [infoData objectForKey:@"orderData"];
|
||||
@@ -179,7 +187,9 @@
|
||||
}
|
||||
}else if ([payChannel isEqualToString:@"wx"]){
|
||||
if ([infoData isKindOfClass:[NSDictionary class]]) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
if (self.firstrechargeVC) {
|
||||
[self.firstrechargeVC dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
PayReq *req = [[PayReq alloc] init];
|
||||
NSDictionary * dict = infoData;
|
||||
NSMutableString *stamp = [dict objectForKey:@"timestamp"];
|
||||
@@ -200,14 +210,14 @@
|
||||
} else {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
}
|
||||
} chargeProdId:self.rechargeInfo.chargeProdId payChannel:payChannel clientIp:clientIp uid:uid ticket:ticket];
|
||||
} chargeProdId:self.chargeProdId payChannel:payChannel clientIp:clientIp uid:uid ticket:ticket roomUid:self.roomUid];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setRechargeInfo:(FirstRechargeModel *)rechargeInfo {
|
||||
_rechargeInfo = rechargeInfo;
|
||||
if (_rechargeInfo) {
|
||||
self.moneyLabel.text = [NSString stringWithFormat:@"¥%ld", rechargeInfo.chargeMoney];
|
||||
- (void)setChargeMoney:(NSString *)chargeMoney {
|
||||
_chargeMoney = chargeMoney;
|
||||
if (_chargeMoney.length > 0) {
|
||||
self.moneyLabel.text = [NSString stringWithFormat:@"¥%@", _chargeMoney];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineRechargeViewController : MvpViewController
|
||||
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -176,7 +176,7 @@
|
||||
self.currentItem = cell.currentItem;
|
||||
}
|
||||
NSString * payType= self.currentItem.type == RechargeType_WX ? @"wx" : @"alipay_v2";
|
||||
[self.presenter requestPay:self.rechargeInfo.chargeProdId payChannel:payType];
|
||||
[self.presenter requestPay:self.rechargeInfo.chargeProdId payChannel:payType roomUid:self.roomUid];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#import "XPNobleSettingViewController.h"
|
||||
#import "XPNobleRankViewController.h"
|
||||
#import "XPNobleDiscountView.h"
|
||||
#import "XPEnterpriseFirstRechargePayView.h"
|
||||
///P
|
||||
#import "XPNobleCenterPresenter.h"
|
||||
///model
|
||||
@@ -173,7 +174,7 @@
|
||||
- (void)requestHttp {
|
||||
[self.presenter getUserInfo];
|
||||
[self checkTranscationIds];
|
||||
[self.presenter getNobleChargeProductListWithChannelType:@"10"];
|
||||
[self.presenter getNobleChargeProductListWithChannelType:@"9"];
|
||||
}
|
||||
|
||||
///批量验证
|
||||
@@ -383,8 +384,11 @@
|
||||
- (void)onOpenNobleButtonClick:(UITapGestureRecognizer *)button {
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventVipOpenClick];
|
||||
RechargeListModel *rechargeModel = [self.rechargeModel.list safeObjectAtIndex1:0];
|
||||
[self showLoading];
|
||||
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
|
||||
XPEnterpriseFirstRechargePayView * rechargetView =[[XPEnterpriseFirstRechargePayView alloc] init];
|
||||
rechargetView.chargeMoney = rechargeModel.money.stringValue;
|
||||
rechargetView.chargeProdId = rechargeModel.chargeProdId;
|
||||
rechargetView.roomUid = [NSString stringWithFormat:@"%ld",self.roomUid];
|
||||
[TTPopup popupView:rechargetView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
- (void)nobleRankButtonAction:(UIButton *)sender {
|
||||
|
@@ -409,6 +409,9 @@
|
||||
- (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view {
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
if (self.delegate.getRoomInfo) {
|
||||
rechargeVC.roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
|
||||
}
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
|
||||
}];
|
||||
}
|
||||
|
@@ -229,7 +229,8 @@
|
||||
|
||||
- (void)rechargeButtonAction:(UIButton *)sender {
|
||||
XPEnterpriseFirstRechargePayView * rechargetView =[[XPEnterpriseFirstRechargePayView alloc] init];
|
||||
rechargetView.rechargeInfo = self.selectRechargeInfo;
|
||||
rechargetView.chargeMoney = [NSString stringWithFormat:@"%ld", self.selectRechargeInfo.chargeMoney];
|
||||
rechargetView.chargeProdId = self.selectRechargeInfo.chargeProdId;
|
||||
rechargetView.firstrechargeVC = self;
|
||||
[TTPopup popupView:rechargetView style:TTPopupStyleActionSheet];
|
||||
|
||||
|
Reference in New Issue
Block a user