JXInputMoneyVC.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. //
  2. // JXInputMoneyVC.m
  3. // shiku_im
  4. //
  5. // Created by 1 on 2019/3/7.
  6. // Copyright © 2019年 Reese. All rights reserved.
  7. //
  8. #import "JXInputMoneyVC.h"
  9. #import "UIImage+Color.h"
  10. #import "JXVerifyPayVC.h"
  11. #import "JXPayPasswordVC.h"
  12. #define drawMarginX 20
  13. #define bgWidth JX_SCREEN_WIDTH-15*2
  14. #define drawHei 60
  15. @interface JXInputMoneyVC () <UITextFieldDelegate>
  16. @property (nonatomic, strong) UITextField * countTextField;
  17. @property (nonatomic, strong) UIButton *transferBtn;
  18. @property (nonatomic, strong) UILabel *addDscLab;
  19. @property (nonatomic, strong) UILabel *dscLab;
  20. @property (nonatomic, strong) NSString *desContent;
  21. @property (nonatomic, strong) JXVerifyPayVC *verVC;
  22. @property (nonatomic, strong) UILabel *nameLabel;
  23. @property (nonatomic, strong) UIView *bigView;
  24. @property (nonatomic, strong) UIView *baseView;
  25. @property (nonatomic, strong) UIView *topView;
  26. @property (nonatomic, strong) UILabel *replayTitle;
  27. @property (nonatomic, strong) UITextField *replayTextField;
  28. @end
  29. @implementation JXInputMoneyVC
  30. - (void)viewDidLoad {
  31. [super viewDidLoad];
  32. if (self.type == JXInputMoneyTypePayment) {
  33. self.title = Localized(@"JX_Payment");
  34. }else if(self.type == JXInputMoneyTypeCollection) {
  35. self.title = Localized(@"JX_CollectionMoney");
  36. }else {
  37. self.title = Localized(@"JX_SetTheAmount");
  38. }
  39. self.heightHeader = JX_SCREEN_TOP;
  40. self.heightFooter = 0;
  41. self.isGotoBack = YES;
  42. [self createHeadAndFoot];
  43. [self setupViews];
  44. [self setupReplayView];
  45. [g_notify addObserver:self selector:@selector(notifyPaymentGet:) name:kXMPPMessageQrPaymentNotification object:nil];
  46. }
  47. - (void)notifyPaymentGet:(NSNotification *)noti {
  48. JXMessageObject *msg = noti.object;
  49. if ([msg.type intValue] == kWCMessageTypePaymentGet) {
  50. [g_server showMsg:Localized(@"JX_PaymentReceived")];
  51. }else if ([msg.type intValue] == kWCMessageTypeReceiptOut) {
  52. [g_server showMsg:Localized(@"JX_PaymentToFriend")];
  53. }
  54. }
  55. - (void)notifyReceiptOut {
  56. }
  57. - (void)setupViews {
  58. self.tableBody.backgroundColor = HEXCOLOR(0xF2F2F2);
  59. int n = 0;
  60. if (self.type == JXInputMoneyTypePayment) {
  61. UILabel *payTit = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 100, 17)];
  62. payTit.text = Localized(@"JX_PaymentToIndividual");
  63. payTit.font = SYSFONT(16);
  64. [self.tableBody addSubview:payTit];
  65. CGSize size = [_userName sizeWithAttributes:@{NSFontAttributeName:SYSFONT(14)}];
  66. _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(payTit.frame)+5, size.width, size.height)];
  67. _nameLabel.font = SYSFONT(14);
  68. _nameLabel.textColor = [UIColor lightGrayColor];
  69. _nameLabel.text = _userName;
  70. [self.tableBody addSubview:_nameLabel];
  71. UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-20-40, 20, 40, 40)];
  72. icon.layer.masksToBounds = YES;
  73. icon.layer.cornerRadius = icon.frame.size.width/2;
  74. [g_server getHeadImageLarge:_userId userName:_userName imageView:icon];
  75. [self.tableBody addSubview:icon];
  76. n = 10;
  77. }
  78. UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(_nameLabel.frame)+n+15, JX_SCREEN_WIDTH-30, 244)];
  79. baseView.backgroundColor = [UIColor whiteColor];
  80. baseView.layer.masksToBounds = YES;
  81. baseView.layer.cornerRadius = 3.f;
  82. [self.tableBody addSubview:baseView];
  83. UILabel * cashTitle = [UIFactory createLabelWith:CGRectMake(drawMarginX, 0, 120, drawHei) text:self.title];
  84. cashTitle.font = SYSFONT(14);
  85. cashTitle.textColor = HEXCOLOR(0x999999);
  86. if (self.type == JXInputMoneyTypeCollection) {
  87. cashTitle.text = Localized(@"JX_GetMoney");
  88. }else if (self.type == JXInputMoneyTypeSetMoney) {
  89. cashTitle.text = @"收款金额";
  90. }else {
  91. cashTitle.text = self.desStr;
  92. }
  93. //收款时 || 付款中有说明 不隐藏
  94. // cashTitle.hidden = !(self.desStr.length > 0 || self.type == JXInputMoneyTypeCollection);
  95. [baseView addSubview:cashTitle];
  96. UILabel * rmbLabel = [UIFactory createLabelWith:CGRectMake(drawMarginX, CGRectGetMaxY(cashTitle.frame), 35, 35) text:@"¥"];
  97. rmbLabel.font = g_factory.font28b;
  98. rmbLabel.textAlignment = NSTextAlignmentLeft;
  99. [baseView addSubview:rmbLabel];
  100. _countTextField = [UIFactory createTextFieldWithRect:CGRectMake(CGRectGetMaxX(rmbLabel.frame), CGRectGetMinY(rmbLabel.frame), bgWidth-CGRectGetMaxX(rmbLabel.frame)-drawMarginX, drawHei) keyboardType:UIKeyboardTypeDecimalPad secure:NO placeholder:nil font:[UIFont boldSystemFontOfSize:45] color:[UIColor blackColor] delegate:self];
  101. _countTextField.borderStyle = UITextBorderStyleNone;
  102. [baseView addSubview:_countTextField];
  103. [_countTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
  104. if (self.money.length > 0) {
  105. _countTextField.text = self.money;
  106. _countTextField.enabled = NO;
  107. }
  108. UIView * line = [[UIView alloc] init];
  109. line.frame = CGRectMake(drawMarginX, CGRectGetMaxY(_countTextField.frame)+5, bgWidth-drawMarginX*2, LINE_WH);
  110. line.backgroundColor = THE_LINE_COLOR;
  111. [baseView addSubview:line];
  112. //转账说明内容
  113. _dscLab = [[UILabel alloc] initWithFrame:CGRectMake(drawMarginX, CGRectGetMaxY(line.frame)+15, 0, 0)];
  114. _dscLab.font = SYSFONT(14);
  115. [baseView addSubview:_dscLab];
  116. // 添加转账说明
  117. _addDscLab = [[UILabel alloc] initWithFrame:CGRectMake(drawMarginX, CGRectGetMaxY(line.frame)+15, 120, 18)];
  118. _addDscLab.text = Localized(@"JX_AddDescriptions");
  119. _addDscLab.textColor = HEXCOLOR(0x6E7B8F);
  120. _addDscLab.userInteractionEnabled = YES;
  121. _addDscLab.font = SYSFONT(14);
  122. _addDscLab.hidden = self.type == JXInputMoneyTypeCollection;
  123. [baseView addSubview:_addDscLab];
  124. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showSendTransferDsc)];
  125. [_addDscLab addGestureRecognizer:tap];
  126. _transferBtn = [UIFactory createButtonWithRect:CGRectZero title:self.type ==JXInputMoneyTypeSetMoney ? Localized(@"JX_Confirm") : self.title titleFont:g_factory.font17 titleColor:[UIColor whiteColor] normal:nil selected:nil selector:@selector(transferBtnAction:) target:self];
  127. _transferBtn.tag = 1000;
  128. _transferBtn.frame = CGRectMake(drawMarginX, CGRectGetMaxY(_addDscLab.frame)+20, baseView.frame.size.width-drawMarginX*2, 40);
  129. [_transferBtn setBackgroundImage:[UIImage createImageWithColor:THEMECOLOR] forState:UIControlStateNormal];
  130. [_transferBtn setBackgroundImage:[UIImage createImageWithColor:[THEMECOLOR colorWithAlphaComponent:0.5f]] forState:UIControlStateDisabled];
  131. [_transferBtn.titleLabel setFont:SYSFONT(16)];
  132. _transferBtn.layer.cornerRadius = 7;
  133. _transferBtn.clipsToBounds = YES;
  134. _transferBtn.enabled = self.money.length > 0;
  135. [baseView addSubview:_transferBtn];
  136. }
  137. - (void)setupReplayView {
  138. int height = 44;
  139. self.bigView = [[UIView alloc] initWithFrame:self.view.bounds];
  140. self.bigView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
  141. self.bigView.hidden = YES;
  142. [g_App.window addSubview:self.bigView];
  143. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyBoard)];
  144. [self.bigView addGestureRecognizer:tap];
  145. self.baseView = [[UIView alloc] initWithFrame:CGRectMake(40, JX_SCREEN_HEIGHT/4-.5, JX_SCREEN_WIDTH-80, 162.5)];
  146. self.baseView.backgroundColor = [UIColor whiteColor];
  147. self.baseView.layer.masksToBounds = YES;
  148. self. baseView.layer.cornerRadius = 4.0f;
  149. [self.bigView addSubview:self.baseView];
  150. int n = 20;
  151. _replayTitle = [[UILabel alloc] initWithFrame:CGRectMake(INSETS, n, self.baseView.frame.size.width - INSETS*2, 20)];
  152. _replayTitle.lineBreakMode = NSLineBreakByTruncatingTail;
  153. _replayTitle.textAlignment = NSTextAlignmentCenter;
  154. _replayTitle.textColor = HEXCOLOR(0x333333);
  155. _replayTitle.font = [UIFont boldSystemFontOfSize:17];
  156. _replayTitle.text = self.title;
  157. [self.baseView addSubview:_replayTitle];
  158. n = n + height;
  159. self.replayTextField = [self createTextField:self.baseView default:nil hint:nil];
  160. self.replayTextField.backgroundColor = [UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1];
  161. self.replayTextField.frame = CGRectMake(10, n, self.baseView.frame.size.width - INSETS*2, 35.5);
  162. self.replayTextField.delegate = self;
  163. self.replayTextField.textColor = HEXCOLOR(0x595959);
  164. self.replayTextField.placeholder = Localized(@"JX_10WordsAtMost");
  165. [self.replayTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
  166. n = n + INSETS + height;
  167. self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, n, self.baseView.frame.size.width, 44)];
  168. [self.baseView addSubview:self.topView];
  169. // 两条线
  170. UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.baseView.frame.size.width, LINE_WH)];
  171. topLine.backgroundColor = THE_LINE_COLOR;
  172. [self.topView addSubview:topLine];
  173. UIView *botLine = [[UIView alloc] initWithFrame:CGRectMake(self.baseView.frame.size.width/2, 0, LINE_WH, self.topView.frame.size.height)];
  174. botLine.backgroundColor = THE_LINE_COLOR;
  175. [self.topView addSubview:botLine];
  176. // 取消
  177. UIButton *cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(topLine.frame), self.baseView.frame.size.width/2, botLine.frame.size.height)];
  178. [cancelBtn setTitle:Localized(@"JX_Cencal") forState:UIControlStateNormal];
  179. [cancelBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  180. [cancelBtn.titleLabel setFont:SYSFONT(15)];
  181. [cancelBtn addTarget:self action:@selector(hideBigView) forControlEvents:UIControlEventTouchUpInside];
  182. [self.topView addSubview:cancelBtn];
  183. // 确定
  184. UIButton *sureBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.baseView.frame.size.width/2, CGRectGetMaxY(topLine.frame), self.baseView.frame.size.width/2, botLine.frame.size.height)];
  185. [sureBtn setTitle:Localized(@"JX_Confirm") forState:UIControlStateNormal];
  186. [sureBtn setTitleColor:HEXCOLOR(0x55BEB8) forState:UIControlStateNormal];
  187. [sureBtn.titleLabel setFont:SYSFONT(15)];
  188. [sureBtn addTarget:self action:@selector(onRelease) forControlEvents:UIControlEventTouchUpInside];
  189. [self.topView addSubview:sureBtn];
  190. }
  191. - (void)textFieldDidChange:(UITextField *)textField {
  192. if (textField == _countTextField) {
  193. if ([textField.text doubleValue] > 0) {
  194. _transferBtn.enabled = YES;
  195. }else {
  196. _transferBtn.enabled = NO;
  197. }
  198. }
  199. }
  200. #pragma mark - 收付款、设置金额
  201. - (void)transferBtnAction:(UIButton *)button {
  202. //设置金额
  203. if (self.type == JXInputMoneyTypeSetMoney) {
  204. NSMutableDictionary *dict = @{@"type":[NSNumber numberWithInt:self.type]}.mutableCopy;
  205. if (self.countTextField.text.length > 0) {
  206. [dict addEntriesFromDictionary:@{@"money":self.countTextField.text}];
  207. }
  208. if (self.desContent.length > 0) {
  209. [dict addEntriesFromDictionary:@{@"desc":self.desContent}];
  210. }
  211. if (self.delegate && [self.delegate respondsToSelector:self.onInputMoney]) {
  212. [self.delegate performSelectorOnMainThread:self.onInputMoney withObject:dict waitUntilDone:NO];
  213. [self actionQuit];
  214. }
  215. }else if (self.type == JXInputMoneyTypeCollection) {
  216. // 扫码收款,二维码付款
  217. long time = (long)[[NSDate date] timeIntervalSince1970];
  218. time = (time *1000 + g_server.timeDifference)/1000;
  219. NSString *secret = [self getSecretWithPaymentCode:self.paymentCode time:time];
  220. // [g_server codePayment:self.paymentCode money:self.countTextField.text time:time desc:self.desContent secret:secret toView:self];
  221. [g_server codePaymentV1:self.paymentCode money:self.countTextField.text desc:self.desContent toView:self];
  222. }
  223. else {
  224. // 扫码付款,二维码收款
  225. // if ([_countTextField.text doubleValue] > g_App.myMoney) {
  226. // [g_App showAlert:Localized(@"CREDIT_LOW")];
  227. // return;
  228. // }
  229. if ([g_server.myself.isPayPassword boolValue]) {
  230. self.verVC = [JXVerifyPayVC alloc];
  231. self.verVC.type = JXVerifyTypeQr;
  232. self.verVC.RMB = self.countTextField.text;
  233. self.verVC.delegate = self;
  234. self.verVC.didDismissVC = @selector(dismissVerifyPayVC);
  235. self.verVC.didVerifyPay = @selector(didVerifyPay:);
  236. self.verVC = [self.verVC init];
  237. [self.view addSubview:self.verVC.view];
  238. } else {
  239. JXPayPasswordVC *payPswVC = [JXPayPasswordVC alloc];
  240. payPswVC.type = JXPayTypeSetupPassword;
  241. payPswVC.enterType = JXEnterTypeQr;
  242. payPswVC = [payPswVC init];
  243. [g_navigation pushViewController:payPswVC animated:YES];
  244. }
  245. }
  246. }
  247. - (void)didVerifyPay:(NSString *)sender {
  248. long time = (long)[[NSDate date] timeIntervalSince1970];
  249. time = (time *1000 + g_server.timeDifference)/1000;
  250. NSString *secret = [self getSecretWithtime:time];
  251. // 参数顺序不能变,先放key再放value
  252. NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"toUserId",self.userId,@"money",self.countTextField.text,@"desc",self.desContent, nil];
  253. [g_payServer payServerWithAction:act_codeReceiptV1 param:arr payPassword:sender time:time toView:self];
  254. // [g_server codeReceipt:self.userId money:self.countTextField.text time:time desc:self.desContent secret:secret toView:self];
  255. }
  256. - (void)dismissVerifyPayVC {
  257. [self.verVC.view removeFromSuperview];
  258. }
  259. - (void)showSendTransferDsc{
  260. self.bigView.hidden = NO;
  261. [self.replayTextField becomeFirstResponder];
  262. }
  263. - (void)hideBigView {
  264. [self resignKeyBoard];
  265. }
  266. - (void)onRelease {
  267. [self resignKeyBoard];
  268. self.desContent = _replayTextField.text;
  269. _dscLab.text = self.desContent;
  270. _addDscLab.text = self.desContent.length > 0 ? Localized(@"JX_Modify") : Localized(@"JX_AddDescriptions");
  271. CGSize size = [self.desContent sizeWithAttributes:@{NSFontAttributeName:SYSFONT(17)}];
  272. _dscLab.frame = CGRectMake(drawMarginX, _dscLab.frame.origin.y, size.width, 18);
  273. _addDscLab.frame = CGRectMake(CGRectGetMaxX(_dscLab.frame)+5, _addDscLab.frame.origin.y, 120, 18);
  274. }
  275. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
  276. NSString * toBeString = [textField.text stringByReplacingCharactersInRange:range withString:string];
  277. if (textField == _countTextField) {
  278. // 首位不能输入 .
  279. if (IsStringNull(textField.text) && [string isEqualToString:@"."]) {
  280. return NO;
  281. }
  282. //限制.后面最多有两位,且不能再输入.
  283. if ([textField.text rangeOfString:@"."].location != NSNotFound) {
  284. //有.了 且.后面输入了两位 停止输入
  285. if (toBeString.length > [toBeString rangeOfString:@"."].location+3) {
  286. return NO;
  287. }
  288. //有.了,不允许再输入.
  289. if ([string isEqualToString:@"."]) {
  290. return NO;
  291. }
  292. }
  293. //限制首位0,后面只能输入. 和 删除
  294. if ([textField.text isEqualToString:@"0"]) {
  295. if (![string isEqualToString:@"."] && ![string isEqualToString:@""]) {
  296. return NO;
  297. }
  298. }
  299. //限制只能输入:1234567890.
  300. NSCharacterSet * characterSet = [[NSCharacterSet characterSetWithCharactersInString:@"1234567890."] invertedSet];
  301. NSString * filtered = [[string componentsSeparatedByCharactersInSet:characterSet] componentsJoinedByString:@""];
  302. return [string isEqualToString:filtered];
  303. }
  304. if (textField == self.replayTextField) {
  305. if (toBeString.length > 10) {
  306. return NO;
  307. }
  308. }
  309. return YES;
  310. }
  311. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  312. [_wait stop];
  313. if( [aDownload.action isEqualToString:act_codeReceipt] || [aDownload.action isEqualToString:act_codeReceiptV1]){
  314. [self dismissVerifyPayVC]; // 销毁支付密码界面
  315. //成功创建红包,发送一条含红包Id的消息
  316. // if (self.delegate && [self.delegate respondsToSelector:@selector(transferToUser:)]) {
  317. // [self.delegate performSelector:@selector(transferToUser:) withObject:dict];
  318. // }
  319. [self actionQuit];
  320. }
  321. if( [aDownload.action isEqualToString:act_codePayment] || [aDownload.action isEqualToString:act_codePaymentV1]){
  322. [self actionQuit];
  323. }
  324. }
  325. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  326. [_wait stop];
  327. if ([aDownload.action isEqualToString:act_codeReceipt] || [aDownload.action isEqualToString:act_codeReceiptV1]) {
  328. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  329. [self.verVC clearUpPassword];
  330. });
  331. }
  332. return show_error;
  333. }
  334. -(int) didServerConnectError:(JXConnection*)aDownload error:(NSError *)error{//error为空时,代表超时
  335. [_wait stop];
  336. return show_error;
  337. }
  338. -(void) didServerConnectStart:(JXConnection*)aDownload{
  339. [_wait start];
  340. }
  341. -(UITextField*)createTextField:(UIView*)parent default:(NSString*)s hint:(NSString*)hint{
  342. UITextField* p = [[UITextField alloc] initWithFrame:CGRectMake(0,INSETS,JX_SCREEN_WIDTH,54)];
  343. p.delegate = self;
  344. p.autocorrectionType = UITextAutocorrectionTypeNo;
  345. p.autocapitalizationType = UITextAutocapitalizationTypeNone;
  346. p.enablesReturnKeyAutomatically = YES;
  347. p.textAlignment = NSTextAlignmentLeft;
  348. p.userInteractionEnabled = YES;
  349. p.backgroundColor = [UIColor whiteColor];
  350. p.text = s;
  351. p.font = g_factory.font16;
  352. [parent addSubview:p];
  353. return p;
  354. }
  355. - (void)resignKeyBoard {
  356. self.bigView.hidden = YES;
  357. [self hideKeyBoard];
  358. [self resetBigView];
  359. }
  360. - (void)resetBigView {
  361. self.replayTextField.frame = CGRectMake(10, 64, self.baseView.frame.size.width - INSETS*2, 35.5);
  362. self.baseView.frame = CGRectMake(40, JX_SCREEN_HEIGHT/4-.5, JX_SCREEN_WIDTH-80, 162.5);
  363. self.topView.frame = CGRectMake(0, 118, self.baseView.frame.size.width, 40);
  364. }
  365. - (void)hideKeyBoard {
  366. if (self.replayTextField.isFirstResponder) {
  367. [self.replayTextField resignFirstResponder];
  368. }
  369. }
  370. // 付款码付款加密规则
  371. - (NSString *)getSecretWithPaymentCode:(NSString *)paymentCode time:(long)time {
  372. NSMutableString *str1 = [NSMutableString string];
  373. [str1 appendString:APIKEY];
  374. [str1 appendString:[NSString stringWithFormat:@"%ld",time]];
  375. [str1 appendString:[NSString stringWithFormat:@"%@",[NSNumber numberWithDouble:[_countTextField.text doubleValue]]]];
  376. [str1 appendString:paymentCode];
  377. str1 = [[g_server getMD5String:str1] mutableCopy];
  378. [str1 appendString:g_myself.userId];
  379. [str1 appendString:g_server.access_token];
  380. str1 = [[g_server getMD5String:str1] mutableCopy];
  381. return [str1 copy];
  382. }
  383. // 二维码收款加密规则
  384. - (NSString *)getSecretWithtime:(long)time {
  385. NSMutableString *str1 = [NSMutableString string];
  386. [str1 appendString:APIKEY];
  387. [str1 appendString:[NSString stringWithFormat:@"%ld",time]];
  388. [str1 appendString:[NSString stringWithFormat:@"%@",[NSNumber numberWithDouble:[_countTextField.text doubleValue]]]];
  389. [str1 appendString:[self.verVC getMD5Password]];
  390. str1 = [[g_server getMD5String:str1] mutableCopy];
  391. [str1 appendString:g_myself.userId];
  392. [str1 appendString:g_server.access_token];
  393. str1 = [[g_server getMD5String:str1] mutableCopy];
  394. return [str1 copy];
  395. }
  396. @end