BuyerRefundDetailVC.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. //
  2. // BuyerRefundDetailVC.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/3/19.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "BuyerRefundDetailVC.h"
  9. #import "BuyerRefundModel.h"
  10. #import "BuyerRefundHeadView.h"
  11. #import "PlatformInterventionVC.h"
  12. #import "JCHATConversationViewController.h"
  13. @interface BuyerRefundDetailVC (){
  14. UIScrollView *backScroll;
  15. }
  16. @property (nonatomic, strong)UIView *historyView;
  17. @property(nonatomic, strong)BuyerRefundHeadView *headView;
  18. @property(nonatomic, strong)BuyerRefundModel *model;
  19. @property (nonatomic, strong)UIView *infoView;
  20. @property (nonatomic, strong)UIImageView *orderImg;
  21. @property (nonatomic, strong)UILabel *orderTitleLb;
  22. @property (nonatomic, strong)UILabel *orderContentLb;
  23. @property (nonatomic, strong)UILabel *orderPriceLb;
  24. @property (nonatomic, strong)UILabel *orderCountLb;
  25. @end
  26. @implementation BuyerRefundDetailVC
  27. #pragma mark------买家获取退款详情----------
  28. -(void)requestGoodsOrderRefundInfo{
  29. NSDictionary *signdic = @{@"uid":[Config getOwnID],@"token":[Config getOwnToken],@"orderid":self.orderId,@"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]]};
  30. NSString *sign = [PublicObj sortString:signdic];
  31. NSDictionary *dic = @{
  32. @"uid":[Config getOwnID],
  33. @"token":[Config getOwnToken],
  34. @"orderid":self.orderId,
  35. @"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]],
  36. @"sign":sign
  37. };
  38. [YBNetworking postWithUrl:@"Buyer.getGoodsOrderRefundInfo" Dic:dic Suc:^(int code, id info, NSString *msg) {
  39. if (code ==0) {
  40. NSDictionary *infos = [info firstObject];
  41. self.model = [BuyerRefundModel modelWithDic:infos];
  42. [backScroll addSubview:self.headView];
  43. [backScroll addSubview:self.historyView];
  44. [backScroll addSubview:self.infoView];
  45. backScroll.contentSize = CGSizeMake(_window_width, self.headView.height+self.historyView.height+self.infoView.height);
  46. }else{
  47. [MBProgressHUD showError:msg];
  48. }
  49. } Fail:^(id fail) {
  50. }];
  51. }
  52. - (UIStatusBarStyle)preferredStatusBarStyle {
  53. if (@available(iOS 13.0,*)) {
  54. return UIStatusBarStyleDarkContent;
  55. }
  56. return UIStatusBarStyleDefault;
  57. }
  58. - (void)viewDidLoad {
  59. [super viewDidLoad];
  60. self.titleL.text = YZMsg(@"退款详情");
  61. self.subNavi.backgroundColor = UIColor.whiteColor;
  62. self.titleL.textColor = UIColor.blackColor;
  63. [self.leftBtn setImage:[UIImage imageNamed:@"pub_back_black"] forState:0];
  64. self.naviLine.hidden = NO;
  65. self.naviLine.backgroundColor = RGB(245, 245, 245);
  66. backScroll = [[UIScrollView alloc]init];
  67. backScroll.frame = CGRectMake(0, 64+statusbarHeight, _window_width, _window_height-64-statusbarHeight);
  68. backScroll.backgroundColor = UIColor.whiteColor;
  69. [self.view addSubview:backScroll];
  70. [self requestGoodsOrderRefundInfo];
  71. }
  72. -(BuyerRefundHeadView *)headView{
  73. YBWeakSelf;
  74. if (!_headView) {
  75. _headView = [[BuyerRefundHeadView alloc]initWithFrame:CGRectMake(0, 0, _window_width, 120)];
  76. [_headView setRefundData:self.model];
  77. _headView.clickEvent = ^(NSString * _Nonnull btnTitle) {
  78. if ([btnTitle isEqual:YZMsg(@"取消申请")]) {
  79. [weakSelf cancelRefundGoodsOrder];
  80. }else if ([btnTitle isEqual:YZMsg(@"重新申请")]){
  81. [weakSelf reapplyRefundGoodsOrder];
  82. }else if ([btnTitle isEqual:YZMsg(@"平台介入")]){
  83. [weakSelf applyPlatformInterpose];
  84. }
  85. };
  86. }
  87. return _headView;
  88. }
  89. -(UIView *)historyView{
  90. if (!_historyView) {
  91. _historyView = [[UIView alloc]init];
  92. _historyView.backgroundColor = UIColor.whiteColor;
  93. _historyView.frame = CGRectMake(0, _headView.bottom+5, _window_width, 50);
  94. [backScroll addSubview:_historyView];
  95. UILabel *titlelb = [[UILabel alloc]init];
  96. titlelb.frame = CGRectMake(12, 50/2-10, 180, 20);
  97. titlelb.text = YZMsg(@"协商历史");
  98. titlelb.font = [UIFont systemFontOfSize:14];
  99. titlelb.textColor = [UIColor blackColor];
  100. [_historyView addSubview:titlelb];
  101. UIImageView *rightImg = [[UIImageView alloc]init];
  102. rightImg.frame =CGRectMake(_window_width-30, 50/2-8, 16, 16);
  103. rightImg.image = [UIImage imageNamed:@"shop_right"];
  104. [_historyView addSubview:rightImg];
  105. UIButton *historyBtn = [UIButton buttonWithType:0];
  106. historyBtn.frame = CGRectMake(0, 0, _historyView.width, _historyView.height);
  107. [historyBtn addTarget:self action:@selector(historyRefundClick) forControlEvents:UIControlEventTouchUpInside];
  108. [_historyView addSubview:historyBtn];
  109. }
  110. return _historyView;
  111. }
  112. -(UIView *)infoView{
  113. if (!_infoView) {
  114. _infoView = [[UIView alloc]initWithFrame:CGRectMake(0, _historyView.bottom+5, _window_width, 450)];
  115. _infoView.backgroundColor = UIColor.whiteColor;
  116. UILabel *lb = [[UILabel alloc]initWithFrame:CGRectMake(12, 10, 80, 20)];
  117. lb.text = YZMsg(@"退款信息");
  118. lb.font = [UIFont systemFontOfSize:14];
  119. lb.textColor = [UIColor blackColor];
  120. [_infoView addSubview:lb];
  121. _orderImg = [[UIImageView alloc]init];
  122. _orderImg.frame = CGRectMake(12, lb.bottom+5, 90, 90);
  123. _orderImg.backgroundColor = [UIColor lightGrayColor];
  124. _orderImg.layer.cornerRadius = 5;
  125. _orderImg.layer.masksToBounds = YES;
  126. [_orderImg sd_setImageWithURL:[NSURL URLWithString:self.model.spec_thumb_format]];
  127. [_infoView addSubview:_orderImg];
  128. _orderTitleLb = [[UILabel alloc]init];
  129. _orderTitleLb.textColor = [UIColor blackColor];
  130. _orderTitleLb.font = [UIFont systemFontOfSize:14];
  131. _orderTitleLb.text = self.model.goods_name;
  132. [_infoView addSubview:_orderTitleLb];
  133. [_orderTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
  134. make.left.equalTo(_orderImg.mas_right).offset(5);
  135. make.top.equalTo(_orderImg).offset(8);
  136. make.height.mas_equalTo(18);
  137. }];
  138. _orderPriceLb = [[UILabel alloc]init];
  139. _orderPriceLb.textColor = [UIColor blackColor];
  140. _orderPriceLb.font = [UIFont systemFontOfSize:14];
  141. _orderPriceLb.text =[NSString stringWithFormat:@"%@%@",YZMsg(@"¥"), self.model.price];
  142. _orderPriceLb.textAlignment = NSTextAlignmentRight;
  143. [_infoView addSubview:_orderPriceLb];
  144. [_orderPriceLb mas_makeConstraints:^(MASConstraintMaker *make) {
  145. make.right.equalTo(_infoView).offset(-10);
  146. make.centerY.height.equalTo(_orderTitleLb);
  147. }];
  148. _orderContentLb = [[UILabel alloc]init];
  149. _orderContentLb.textColor =Normal_TextColor;
  150. _orderContentLb.font = [UIFont systemFontOfSize:14];
  151. _orderContentLb.text =self.model.spec_name;// @"麻辣鲜香味";
  152. [_infoView addSubview:_orderContentLb];
  153. [_orderContentLb mas_makeConstraints:^(MASConstraintMaker *make) {
  154. make.left.equalTo(_orderTitleLb);
  155. make.top.equalTo(_orderTitleLb.mas_bottom).offset(5);
  156. make.height.equalTo(_orderTitleLb);
  157. }];
  158. _orderCountLb = [[UILabel alloc]init];
  159. _orderCountLb.textColor = Normal_TextColor;
  160. _orderCountLb.font = [UIFont systemFontOfSize:14];
  161. _orderCountLb.text =[NSString stringWithFormat:@"x%@",self.model.nums];// @"x1";
  162. _orderCountLb.textAlignment = NSTextAlignmentRight;
  163. [_infoView addSubview:_orderCountLb];
  164. [_orderCountLb mas_makeConstraints:^(MASConstraintMaker *make) {
  165. make.right.equalTo(_infoView).offset(-10);
  166. make.centerY.height.equalTo(_orderContentLb);
  167. }];
  168. [PublicObj lineViewWithFrame:CGRectMake(0, _orderImg.bottom+5, _window_width, 5) andColor:RGB(245, 245, 245) andView:_infoView];
  169. NSArray *arr;
  170. if ([self.model.refund_shop_result isEqual:@"-1"] && [self.model.is_platform_interpose isEqual:@"0"]) {
  171. arr= @[YZMsg(@"退款方式:"),YZMsg(@"退款金额:"),YZMsg(@"退款原因:"),YZMsg(@"申请时间:"),YZMsg(@"问题描述:"),YZMsg(@"拒绝原因:"),YZMsg(@"拒绝描述:")];
  172. }else{
  173. arr= @[YZMsg(@"退款方式:"),YZMsg(@"退款金额:"),YZMsg(@"退款原因:"),YZMsg(@"申请时间:"),YZMsg(@"问题描述:")];
  174. }
  175. for (int i = 0;i < arr.count ; i++) {
  176. UILabel *lb = [[UILabel alloc]init];
  177. lb.font = [UIFont systemFontOfSize:14];
  178. lb.textColor = Normal_TextColor;
  179. lb.text = arr[i];
  180. [_infoView addSubview:lb];
  181. if (i == 4) {
  182. CGFloat textHeight = [PublicObj heightOfString:self.model.refund_content andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  183. if (self.model.refund_content.length > 0) {
  184. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  185. make.left.equalTo(_infoView).offset(12);
  186. // make.top.equalTo(_orderImg.mas_bottom).offset((i-1)*30+textHeight);
  187. make.top.equalTo(_orderImg.mas_bottom).offset(15+i*30);
  188. make.height.mas_equalTo(20);
  189. }];
  190. }else{
  191. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  192. make.left.equalTo(_infoView).offset(12);
  193. make.top.equalTo(_orderImg.mas_bottom).offset(15+i*30);
  194. make.height.mas_equalTo(20);
  195. }];
  196. }
  197. }else if(i == 5){
  198. CGFloat textHeight = [PublicObj heightOfString:self.model.refund_content andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  199. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  200. make.left.equalTo(_infoView).offset(12);
  201. make.top.equalTo(_orderImg.mas_bottom).offset(15+i*30+textHeight);
  202. make.height.mas_equalTo(20);
  203. }];
  204. } else if(i == 6){
  205. CGFloat descHeight = [PublicObj heightOfString:self.model.shop_handle_desc andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  206. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  207. make.left.equalTo(_infoView).offset(12);
  208. make.top.equalTo(_orderImg.mas_bottom).offset(15+i*30+descHeight);
  209. make.height.mas_equalTo(20);
  210. }];
  211. }else{
  212. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  213. make.left.equalTo(_infoView).offset(12);
  214. make.top.equalTo(_orderImg.mas_bottom).offset(15+i*30);
  215. make.height.mas_equalTo(20);
  216. }];
  217. }
  218. UILabel *infoLb = [[UILabel alloc]init];
  219. infoLb.font = [UIFont systemFontOfSize:14];
  220. if (i < 2) {
  221. infoLb.textColor = Pink_Cor;
  222. }else if(i > 4){
  223. lb.textColor =RGB(239, 224, 49);// [UIColor redColor];
  224. infoLb.textColor =RGB(239, 224, 49);// [UIColor redColor];
  225. }else{
  226. infoLb.textColor = [UIColor grayColor];
  227. }
  228. [_infoView addSubview:infoLb];
  229. if (i == 4 || i == 6) {
  230. [infoLb mas_makeConstraints:^(MASConstraintMaker *make) {
  231. make.left.equalTo(lb.mas_right).offset(5);
  232. make.top.equalTo(lb.mas_top);
  233. make.width.mas_equalTo(_window_width-100);
  234. }];
  235. }else{
  236. [infoLb mas_makeConstraints:^(MASConstraintMaker *make) {
  237. make.left.equalTo(lb.mas_right).offset(5);
  238. make.centerY.equalTo(lb.mas_centerY);
  239. make.height.equalTo(lb);
  240. }];
  241. }
  242. switch (i) {
  243. case 0:{
  244. //(退款类型 0 仅退款 1 退货退款)
  245. NSString *typeStr;
  246. if ([self.model.type isEqual:@"0"]) {
  247. typeStr =YZMsg(@"仅退款");
  248. }else{
  249. typeStr =YZMsg(@"退货退款");
  250. }
  251. infoLb.text = typeStr;
  252. }
  253. break;
  254. case 1:
  255. infoLb.text =[NSString stringWithFormat:@"¥%@", self.model.total];
  256. break;
  257. case 2:
  258. infoLb.text = self.model.refund_reason;
  259. break;
  260. case 3:
  261. infoLb.text = self.model.addtime;
  262. break;
  263. case 4:
  264. infoLb.text = self.model.refund_content;
  265. infoLb.lineBreakMode = NSLineBreakByWordWrapping;
  266. infoLb.numberOfLines = 0;
  267. CGFloat textHeight = [PublicObj heightOfString:self.model.refund_content andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  268. infoLb.size = CGSizeMake(_window_width-100, textHeight);
  269. _infoView.size = CGSizeMake(_window_width, 450+textHeight);
  270. [_infoView layoutIfNeeded];
  271. break;
  272. case 5:
  273. infoLb.text = self.model.shop_refuse_reason;
  274. break;
  275. case 6:
  276. infoLb.text = self.model.shop_handle_desc;
  277. infoLb.lineBreakMode = NSLineBreakByWordWrapping;
  278. infoLb.numberOfLines = 0;
  279. CGFloat descHeight = [PublicObj heightOfString:self.model.shop_handle_desc andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  280. infoLb.size = CGSizeMake(_window_width-100, descHeight);
  281. [_infoView layoutIfNeeded];
  282. break;
  283. default:
  284. break;
  285. }
  286. }
  287. CGFloat textHeight = [PublicObj heightOfString:self.model.refund_content andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  288. CGFloat descHeight = [PublicObj heightOfString:self.model.shop_handle_desc andFont:[UIFont systemFontOfSize:14] andWidth:_window_width-100];
  289. _infoView.size = CGSizeMake(_window_width, 450+descHeight+textHeight);
  290. [PublicObj lineViewWithFrame:CGRectMake(0, (_orderImg.bottom+25)+arr.count*30+textHeight+descHeight, _window_width, 1) andColor:RGB(245, 245, 245) andView:_infoView];
  291. UIButton *kefuBtn = [UIButton buttonWithType:0];
  292. [kefuBtn setBackgroundColor: UIColor.whiteColor];
  293. [kefuBtn setImage:[UIImage imageNamed:@"联系客服"] forState:0];
  294. [kefuBtn setTitle:YZMsg(@"联系客服") forState:0];
  295. [kefuBtn setTitleColor:[UIColor blackColor] forState:0];
  296. kefuBtn.titleLabel.font = [UIFont systemFontOfSize:14];
  297. [kefuBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0 )];
  298. [kefuBtn addTarget:self action:@selector(kefuBtnClick) forControlEvents:UIControlEventTouchUpInside];
  299. [_infoView addSubview:kefuBtn];
  300. [kefuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  301. make.left.equalTo(_infoView);
  302. make.top.equalTo(_orderImg.mas_bottom).offset(30+arr.count*30+textHeight+descHeight);
  303. make.width.equalTo(_infoView).multipliedBy(0.5);
  304. make.height.mas_equalTo(40);
  305. }];
  306. UIButton *callBtn = [UIButton buttonWithType:0];
  307. [callBtn setBackgroundColor: UIColor.whiteColor];
  308. [callBtn setImage:[UIImage imageNamed:@"拨打电话"] forState:0];
  309. [callBtn setTitle:YZMsg(@"拨打电话") forState:0];
  310. [callBtn setTitleColor:[UIColor blackColor] forState:0];
  311. callBtn.titleLabel.font = [UIFont systemFontOfSize:14];
  312. [callBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0 )];
  313. [callBtn addTarget:self action:@selector(callBtnClick) forControlEvents:UIControlEventTouchUpInside];
  314. [_infoView addSubview:callBtn];
  315. [callBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  316. make.left.equalTo(kefuBtn.mas_right);
  317. make.top.equalTo(kefuBtn);
  318. make.width.equalTo(_infoView).multipliedBy(0.5);
  319. make.height.mas_equalTo(40);
  320. }];
  321. [PublicObj lineViewWithFrame:CGRectMake(_window_width/2, (_orderImg.bottom+25)+arr.count*30+textHeight+descHeight, 1, 50) andColor:RGB(245, 245, 245) andView:_infoView];
  322. }
  323. return _infoView;
  324. }
  325. //买家取消退款申请
  326. -(void)cancelRefundGoodsOrder{
  327. UIAlertController *cancelAlert = [UIAlertController alertControllerWithTitle:YZMsg(@"取消退款申请后,该订单无法再次申请退款,确定取消?") message:nil preferredStyle:UIAlertControllerStyleAlert];
  328. UIAlertAction *sure = [UIAlertAction actionWithTitle:YZMsg(@"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  329. NSDictionary *signdic = @{@"uid":[Config getOwnID],@"token":[Config getOwnToken],@"orderid":self.orderId,@"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]]};
  330. NSString *sign = [PublicObj sortString:signdic];
  331. NSDictionary *dic = @{
  332. @"uid":[Config getOwnID],
  333. @"token":[Config getOwnToken],
  334. @"orderid":self.orderId,
  335. @"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]],
  336. @"sign":sign
  337. };
  338. [YBNetworking postWithUrl:@"Buyer.cancelRefundGoodsOrder" Dic:dic Suc:^(int code, id info, NSString *msg) {
  339. if (code ==0) {
  340. [MBProgressHUD showError:msg];
  341. [[YBBaseAppDelegate sharedAppDelegate]popViewController:YES];
  342. }else{
  343. [MBProgressHUD showError:msg];
  344. }
  345. } Fail:^(id fail) {
  346. }];
  347. }];
  348. UIAlertAction *cacel = [UIAlertAction actionWithTitle:YZMsg(@"取消") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  349. }];
  350. [sure setValue:Normal_Color forKey:@"_titleTextColor"];
  351. [cacel setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
  352. [cancelAlert addAction:sure];
  353. [cancelAlert addAction:cacel];
  354. [self presentViewController:cancelAlert animated:YES completion:nil];
  355. }
  356. //重新申请
  357. -(void)reapplyRefundGoodsOrder{
  358. NSString *url = [purl stringByAppendingFormat:@"?service="];
  359. NSDictionary *signdic = @{@"uid":[Config getOwnID],@"token":[Config getOwnToken],@"orderid":self.orderId,@"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]]};
  360. NSString *sign = [PublicObj sortString:signdic];
  361. NSDictionary *dic = @{
  362. @"uid":[Config getOwnID],
  363. @"token":[Config getOwnToken],
  364. @"orderid":self.orderId,
  365. @"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]],
  366. @"sign":sign
  367. };
  368. [YBNetworking postWithUrl:@"Buyer.reapplyRefundGoodsOrder" Dic:dic Suc:^(int code, id info, NSString *msg) {
  369. if (code ==0) {
  370. [MBProgressHUD showError:msg];
  371. [[YBBaseAppDelegate sharedAppDelegate]popViewController:YES];
  372. }else{
  373. [MBProgressHUD showError:msg];
  374. }
  375. } Fail:^(id fail) {
  376. }];
  377. }
  378. //平台介入
  379. -(void)applyPlatformInterpose{
  380. YBWeakSelf;
  381. PlatformInterventionVC *platform = [[PlatformInterventionVC alloc]init];
  382. platform.orderIDStr = self.orderId;
  383. platform.reloadEvent = ^{
  384. [weakSelf requestGoodsOrderRefundInfo];
  385. };
  386. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:platform animated:YES];
  387. }
  388. //查看协商历史
  389. -(void)historyRefundClick{
  390. PubH5 *h5VC = [[PubH5 alloc]init];
  391. NSString *url =[NSString stringWithFormat:@"%@/appapi/goodsorderrefund/index",h5url];
  392. h5VC.url = [self addurl:url];
  393. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:h5VC animated:YES];
  394. }
  395. //所有h5需要拼接uid和token
  396. -(NSString *)addurl:(NSString *)url{
  397. return [url stringByAppendingFormat:@"&uid=%@&token=%@&orderid=%@&user_type=buyer",[Config getOwnID],[Config getOwnToken],self.orderId];
  398. }
  399. //联系买家
  400. -(void)kefuBtnClick{
  401. if ([self.model.service_uid isEqual:@"1"]) {
  402. UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:nil message:YZMsg(@"请到个性设置-关于我们中联系客服") preferredStyle:UIAlertControllerStyleAlert];
  403. UIAlertAction *sureAction = [UIAlertAction actionWithTitle:YZMsg(@"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  404. }];
  405. [sureAction setValue:Normal_Color forKey:@"_titleTextColor"];
  406. [alertControl addAction:sureAction];
  407. [[[YBBaseAppDelegate sharedAppDelegate] topViewController]presentViewController:alertControl animated:YES completion:nil];
  408. }else{
  409. //创建会话
  410. NSDictionary *userDic = @{
  411. @"id":self.model.service_uid,
  412. @"user_nickname":self.model.service_name,
  413. @"avatar":self.model.service_avatar,
  414. };
  415. [[YBMessageManager shareManager] chatWithUser:userDic];
  416. }
  417. }
  418. -(void)callBtnClick{
  419. NSString *phone =[NSString stringWithFormat:@"tel://%@",self.model.service_phone] ;
  420. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phone]];
  421. }
  422. @end