酷店

KDPGoodDetailVC.m 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. //
  2. // KDPGoodDetailVC.m
  3. // KuDianProject
  4. //
  5. // Created by 学丽 on 2019/7/9.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPGoodDetailVC.h"
  9. #import "KDPDetailGoodInformationView.h"
  10. #import "KDPSellingPointView.h"
  11. #import "KDPShopView.h"
  12. #import <WebKit/WebKit.h>
  13. #import "KDPCollectHistoryPageVC.h"
  14. #import "KDPPasteView.h"
  15. #import <AlibcTradeSDK/AlibcTradeSDK.h>
  16. #define goodHeight 496+KDStatusHeight
  17. @interface KDPGoodDetailVC ()<UIScrollViewDelegate,UIWebViewDelegate,WKNavigationDelegate>
  18. {
  19. UIView *bottomView;
  20. UIButton *collectButton;
  21. }
  22. //淘口令页面
  23. @property(nonatomic,strong)KDPPasteView *pasteView;
  24. @property(nonatomic,strong)KDPIDTipView *tipView;
  25. @property(nonatomic,strong)UIScrollView *detailBottonView;
  26. @property(nonatomic,strong)KDPDetailGoodInformationView *infoView;
  27. @property(nonatomic,strong)KDPSellingPointView *pointView;
  28. @property(nonatomic,strong)KDPShopView *shopView;
  29. @property(nonatomic,strong)KDPGoodsModel *detailModel;
  30. @property(nonatomic,strong)WKWebView *detaiWebV;
  31. @end
  32. @implementation KDPGoodDetailVC
  33. - (void)viewDidLoad {
  34. [super viewDidLoad];
  35. [self addDetailUI];
  36. [self addbottomView];
  37. self.infoView.model=self.model;
  38. @try {
  39. [self.detaiWebV removeObserver:self forKeyPath:@"scrollView.contentSize"];
  40. } @catch (NSException *exception) {
  41. }
  42. [self.detaiWebV addObserver:self forKeyPath:@"scrollView.contentSize" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
  43. [self.detailBottonView addSubview:self.detaiWebV];
  44. [self.detaiWebV mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.top.mas_equalTo(self.shopView.mas_bottom).offset(40);
  46. make.width.mas_equalTo(SCREEN_WIDTH);
  47. make.left.mas_equalTo(0);
  48. }];
  49. [self getGoodDetail];
  50. [self.view addSubview:self.pasteView];
  51. [self.view addSubview:self.tipView];
  52. [self.tipView mas_makeConstraints:^(MASConstraintMaker *make) {
  53. make.left.top.mas_equalTo(0);
  54. make.width.mas_equalTo(SCREEN_WIDTH);
  55. make.height.mas_equalTo(SCREEN_HEIGHT);
  56. }];
  57. }
  58. - (void)dealloc {
  59. @try{
  60. [self.detaiWebV removeObserver:self forKeyPath:@"scrollView.contentSize"];
  61. }@catch (NSException *exception) {
  62. }
  63. }
  64. #pragma mark---商品详情
  65. -(void)getGoodDetail
  66. {
  67. if (self.model.goods_id.length<=0) {
  68. return;
  69. }
  70. [LoadingView show];
  71. [KDPNetworkRequestHTTP postURL:goodDetailURL params:@{@"goods_id":self.model.goods_id} success:^(id _Nonnull json) {
  72. [self saveHistoryModel:self.detailModel];
  73. self.detailModel=[KDPGoodsModel yy_modelWithJSON:json[@"data"]];
  74. if (self.detailModel.goods_point.length>0) {
  75. [self good_points];
  76. }
  77. if (self.model.commission_rate.floatValue>0) {
  78. self.detailModel.commission_rate = self.model.commission_rate;
  79. }
  80. self.infoView.model=self.detailModel;
  81. self.shopView.shopDic=self.detailModel.shop;
  82. [self loadRequestWeb];
  83. [LoadingView dismiss];
  84. [self isCollect];
  85. } failure:^(NSError * _Nonnull error) {
  86. [LoadingView dismiss];
  87. }];
  88. }
  89. #pragma mark----Web详情
  90. -(void)loadRequestWeb
  91. {
  92. NSURL *url=[NSURL URLWithString:self.detailModel.detail_url];
  93. NSURLRequest *requests=[NSURLRequest requestWithURL:url];
  94. [self.detaiWebV loadRequest:requests];
  95. }
  96. -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context
  97. {
  98. CGFloat heights =[KDPublicMethod getHeightByWidth:SCREEN_WIDTH-40 title:self.detailModel.goods_point font:[UIFont systemFontOfSize:13]];
  99. if ([keyPath isEqualToString:@"scrollView.contentSize"]) {
  100. id height =[change valueForKey:NSKeyValueChangeNewKey];
  101. CGSize size;
  102. [(NSValue *)height getValue:&size];
  103. [self.detaiWebV mas_updateConstraints:^(MASConstraintMaker *make) {
  104. make.height.mas_equalTo(size.height);
  105. }];
  106. self.detailBottonView.contentSize=CGSizeMake(0, size.height+goodHeight+115+heights);
  107. }
  108. }
  109. #pragma mark---赋值。卖点
  110. -(void)good_points
  111. {
  112. CGFloat height =[KDPublicMethod getHeightByWidth:SCREEN_WIDTH-40 title:self.detailModel.goods_point font:[UIFont systemFontOfSize:13]];
  113. self.pointView.point_good =self.detailModel.goods_point;
  114. [self.pointView mas_updateConstraints:^(MASConstraintMaker *make) {
  115. make.top.mas_equalTo(goodHeight);
  116. make.height.mas_equalTo(height+50);
  117. }];
  118. [self.shopView mas_updateConstraints:^(MASConstraintMaker *make) {
  119. make.top.mas_equalTo(self.pointView.mas_bottom);
  120. }];
  121. }
  122. -(void)addbottomView
  123. {
  124. bottomView =[[UIView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT-KDTabBarHeight, SCREEN_WIDTH, KDTabBarHeight)];
  125. bottomView.backgroundColor=[UIColor whiteColor];
  126. [self.view addSubview:bottomView];
  127. collectButton=[[UIButton alloc]initWithFrame:CGRectMake(0, 3, 86, 33)];
  128. collectButton.titleLabel.font=[UIFont systemFontOfSize:10];
  129. [collectButton setTitle:@"收藏" forState:UIControlStateNormal];
  130. [collectButton setImage:[UIImage imageNamed:@"collection_select"] forState:UIControlStateSelected];
  131. [collectButton setTitleColor:[UIColor colorWithHexString:@"#828282"] forState:UIControlStateNormal];
  132. [collectButton setImage:[UIImage imageNamed:@"collection_un"] forState:UIControlStateNormal];
  133. collectButton.adjustsImageWhenHighlighted=NO;
  134. [collectButton setButtonImageTitleStyle:ButtonImageTitleStyleCenterDown padding:3];
  135. [collectButton addTarget:self action:@selector(detailCollectClickButton) forControlEvents:UIControlEventTouchUpInside];
  136. [bottomView addSubview:collectButton];
  137. UIButton *buybutton =[[UIButton alloc]initWithFrame:CGRectMake(collectButton.right, 3, (SCREEN_WIDTH-96)/2, 39)];
  138. [buybutton setTitle:@"购买样品" forState:UIControlStateNormal];
  139. [bottomView addSubview:buybutton];
  140. buybutton.titleLabel.font=[UIFont systemFontOfSize:14];
  141. buybutton.backgroundColor=[UIColor gradientOneColor:[UIColor colorWithHexString:@"#FF235F"] toColor:[UIColor colorWithHexString:@"#FF7676"] Width:(SCREEN_WIDTH-96)/2];
  142. [buybutton addTarget:self action:@selector(clickBuyButton) forControlEvents:UIControlEventTouchUpInside];
  143. UIButton *getKwaiButton =[[UIButton alloc]initWithFrame:CGRectMake(buybutton.right, 3, (SCREEN_WIDTH-96)/2, 39)];
  144. getKwaiButton.backgroundColor=[UIColor colorWithHexString:ThemeColor];
  145. [getKwaiButton setTitle:@"推广到快手" forState:UIControlStateNormal];
  146. getKwaiButton.titleLabel.font=[UIFont systemFontOfSize:14];
  147. [getKwaiButton addTarget:self action:@selector(kwaiClickButton) forControlEvents:UIControlEventTouchUpInside];
  148. UIBezierPath *maskPaths= [UIBezierPath bezierPathWithRoundedRect:getKwaiButton.bounds byRoundingCorners:UIRectCornerTopRight| UIRectCornerBottomRight cornerRadii:CGSizeMake(19.5, 19.5)];
  149. CAShapeLayer *maskLayers = [[CAShapeLayer alloc] init];
  150. maskLayers.frame = buybutton.bounds;
  151. maskLayers.path = maskPaths.CGPath;
  152. getKwaiButton.layer.mask = maskLayers;
  153. if (![KDPublicMethod JumpOpenURL:KWai]) {//没有安装快手,过审用
  154. buybutton.frame=CGRectMake(collectButton.right, 3, SCREEN_WIDTH-96, 39);
  155. buybutton.backgroundColor=[UIColor colorWithHexString:ThemeColor];
  156. buybutton.layer.cornerRadius=19.5;
  157. buybutton.layer.masksToBounds=YES;
  158. }else{
  159. [bottomView addSubview:getKwaiButton];
  160. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:buybutton.bounds byRoundingCorners:UIRectCornerTopLeft| UIRectCornerBottomLeft cornerRadii:CGSizeMake(19.5, 19.5)];
  161. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  162. maskLayer.frame = buybutton.bounds;
  163. maskLayer.path = maskPath.CGPath;
  164. buybutton.layer.mask = maskLayer;
  165. }
  166. }
  167. -(void)returnClickBtn
  168. {
  169. [self.navigationController popViewControllerAnimated:YES];
  170. }
  171. -(void)viewWillAppear:(BOOL)animated
  172. {
  173. [super viewWillAppear:animated];
  174. self.navBar.hidden=YES;
  175. [UIApplication sharedApplication].statusBarStyle=UIStatusBarStyleDefault;
  176. self.navigationController.navigationBar.hidden=YES;
  177. self.tabBarController.tabBar.hidden=YES;
  178. }
  179. -(void)viewWillDisappear:(BOOL)animated
  180. {
  181. [super viewWillDisappear:animated];
  182. // self.navBar.hidden=NO;
  183. [LoadingView dismiss];
  184. [UIApplication sharedApplication].statusBarStyle=UIStatusBarStyleLightContent;
  185. self.tabBarController.tabBar.hidden=NO;
  186. }
  187. -(KDPDetailGoodInformationView *)infoView
  188. {
  189. if (!_infoView) {
  190. _infoView=[[KDPDetailGoodInformationView alloc]init];
  191. __weak KDPGoodDetailVC *weakself=self;
  192. _infoView.returnBlock = ^{
  193. [weakself.navigationController popViewControllerAnimated:YES];
  194. };
  195. }
  196. return _infoView;
  197. }
  198. -(KDPShopView *)shopView
  199. {
  200. if (!_shopView) {
  201. _shopView=[[KDPShopView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 70)];
  202. }
  203. return _shopView;
  204. }
  205. -(KDPSellingPointView *)pointView
  206. {
  207. if (!_pointView) {
  208. _pointView=[[KDPSellingPointView alloc]init];
  209. }
  210. return _pointView;
  211. }
  212. -(KDPPasteView *)pasteView
  213. {
  214. if (!_pasteView) {
  215. _pasteView=[[KDPPasteView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  216. _pasteView.hidden=YES;
  217. }
  218. return _pasteView;
  219. }
  220. -(KDPIDTipView *)tipView
  221. {
  222. if (!_tipView) {
  223. _tipView =[[KDPIDTipView alloc]init];
  224. _tipView.hidden=YES;
  225. }
  226. return _tipView;
  227. }
  228. -(void)addDetailUI
  229. {
  230. self.view.backgroundColor=[UIColor whiteColor];
  231. [self.view addSubview:self.detailBottonView];
  232. [self.detailBottonView addSubview:self.infoView];
  233. [self.detailBottonView addSubview:self.pointView];
  234. [self.detailBottonView addSubview:self.shopView];
  235. [self.detailBottonView mas_makeConstraints:^(MASConstraintMaker *make) {
  236. make.left.right.top.mas_equalTo(0);
  237. make.bottom.mas_equalTo(self.view.mas_bottom).offset(-KDTabBarHeight);
  238. }];
  239. [self.infoView mas_makeConstraints:^(MASConstraintMaker *make) {
  240. make.left.top.mas_equalTo(0);
  241. make.width.mas_equalTo(SCREEN_WIDTH);
  242. make.height.mas_equalTo(goodHeight);
  243. }];
  244. [self.pointView mas_makeConstraints:^(MASConstraintMaker *make) {
  245. make.top.mas_equalTo(self.infoView.mas_bottom);
  246. make.left.mas_equalTo(0);
  247. make.width.mas_equalTo(SCREEN_WIDTH);
  248. make.height.mas_equalTo(0);
  249. }];
  250. [self.shopView mas_makeConstraints:^(MASConstraintMaker *make) {
  251. make.left.mas_equalTo(0);
  252. make.width.mas_equalTo(SCREEN_WIDTH);
  253. make.height.mas_equalTo(75);
  254. make.top.mas_equalTo(self.pointView.mas_bottom);
  255. }];
  256. [self addDetailTitle];
  257. UIButton *returnBtn =[[UIButton alloc]initWithFrame:CGRectMake(15, KDStatusHeight+10, 30, 30)];
  258. returnBtn.layer.cornerRadius=15;
  259. returnBtn.layer.masksToBounds=YES;
  260. [self.view addSubview:returnBtn];
  261. returnBtn.backgroundColor=[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.4];
  262. [returnBtn setImage:[UIImage imageNamed:@"return_white"] forState:UIControlStateNormal];
  263. [returnBtn addTarget:self action:@selector(exitclickButton) forControlEvents:UIControlEventTouchUpInside];
  264. UIButton * collectBtn=[[UIButton alloc]initWithFrame:CGRectMake(self.view.width-47, KDStatusHeight+10, 30, 30)];
  265. [collectBtn setImage:[UIImage imageNamed:@"detail_collection"] forState:UIControlStateNormal];
  266. collectBtn.adjustsImageWhenHighlighted=NO;
  267. [collectBtn addTarget:self action:@selector(collectPageClickSel) forControlEvents:UIControlEventTouchUpInside];
  268. [self.view addSubview:collectBtn];
  269. }
  270. -(void)addDetailTitle
  271. {
  272. UILabel *titleL=[[UILabel alloc]init];
  273. titleL.textColor=[UIColor colorWithHexString:fontColor];
  274. titleL.text=@"———— 商品详情 ————";
  275. titleL.font=[UIFont systemFontOfSize:14];
  276. titleL.textAlignment=NSTextAlignmentCenter;
  277. [self.detailBottonView addSubview:titleL];
  278. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  279. make.top.mas_equalTo(self.shopView.mas_bottom);
  280. make.height.mas_equalTo(40);
  281. make.width.mas_equalTo(SCREEN_WIDTH);
  282. make.left.mas_equalTo(0);
  283. }];
  284. }
  285. -(void)exitclickButton
  286. {
  287. [self.navigationController popViewControllerAnimated:YES];
  288. }
  289. -(WKWebView *)detaiWebV
  290. {
  291. if (!_detaiWebV) {
  292. _detaiWebV= [[WKWebView alloc]init];
  293. _detaiWebV.navigationDelegate=self;
  294. _detaiWebV.scrollView.scrollEnabled=NO;
  295. }
  296. return _detaiWebV;
  297. }
  298. -(UIScrollView *)detailBottonView
  299. {
  300. if (!_detailBottonView) {
  301. _detailBottonView=[[UIScrollView alloc]init];
  302. _detailBottonView.delegate=self;
  303. _detailBottonView.backgroundColor=[UIColor whiteColor];
  304. _detailBottonView.showsVerticalScrollIndicator=NO;
  305. if (@available(iOS 11.0, *)) {
  306. _detailBottonView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  307. } else {
  308. self.automaticallyAdjustsScrollViewInsets = NO;
  309. }
  310. _detailBottonView.showsHorizontalScrollIndicator=NO;
  311. _detailBottonView.contentSize=CGSizeMake(0, SCREEN_HEIGHT*2);
  312. }
  313. return _detailBottonView;
  314. }
  315. #pragma mark----收藏
  316. -(void)detailCollectClickButton
  317. {
  318. if (self.detailModel.goods_id.length<=0) {
  319. return;
  320. }
  321. [LoadingView show];
  322. NSString *collect=self.detailModel.is_collect;
  323. if (collect.integerValue == 0) {//收藏
  324. collect=@"1";
  325. }else{
  326. collect=@"0";
  327. }
  328. NSDictionary *param=@{@"is_add":collect,@"goods_id":self.detailModel.goods_id};
  329. [KDPNetworkRequestHTTP postURL:collectURL params:param success:^(id _Nonnull json) {
  330. [LoadingView dismiss];
  331. if ([json[@"flag"] integerValue] == 1) {
  332. [MBProgressHUD showSuccess:@"收藏成功"];
  333. }
  334. self.detailModel.is_collect=collect;
  335. [self isCollect];
  336. } failure:^(NSError * _Nonnull error) {
  337. [LoadingView dismiss];
  338. }];
  339. }
  340. #pragma mark---判断是否收藏
  341. -(void)isCollect
  342. {
  343. if (self.detailModel.is_collect.integerValue == 1) {
  344. collectButton.selected = YES;
  345. }else{
  346. collectButton.selected=NO;
  347. }
  348. }
  349. -(void)collectPageClickSel
  350. {
  351. KDPCollectHistoryPageVC *histT=[[KDPCollectHistoryPageVC alloc]init];
  352. [self.navigationController pushViewController:histT animated:YES];
  353. }
  354. #pragma mark---推广到快手
  355. -(void)kwaiClickButton
  356. {
  357. if (self.detailModel.goods_id.length<=0) {
  358. return;
  359. }
  360. [LoadingView show];
  361. NSDictionary *dics=@{@"goods_id":self.detailModel.goods_id};
  362. if (self.detailModel.coupon_price.length>0) {
  363. dics=@{@"goods_id":self.detailModel.goods_id,@"coupon_price":self.detailModel.coupon_price};
  364. }
  365. [KDPNetworkRequestHTTP postURL:KwaiJumpURL params:dics success:^(id _Nonnull json) {
  366. [LoadingView dismiss];
  367. /**
  368. 弹框状态 1:用户没有快手Pid
  369. 2:用户有Pid,首次提示
  370. 3:用户有Pid,二次提示
  371. */
  372. NSDictionary *resultDic=(NSDictionary *)json;
  373. if ([resultDic.allKeys containsObject:@"alert_info"]) {//包括alert_info说明需要提示
  374. [UIView animateWithDuration:1 animations:^{
  375. self.tipView.hidden=NO;
  376. self.tipView.resultDic=json[@"alert_info"];
  377. }];
  378. }else{//直接跳转到快手推广
  379. [KDPublicMethod jumpKwaiWithURL:json[@"data"][@"kwai_url_prime"]];
  380. }
  381. } failure:^(NSError * _Nonnull error) {
  382. [LoadingView dismiss];
  383. }];
  384. }
  385. #pragma mark---购买样品
  386. -(void)clickBuyButton
  387. {
  388. [LoadingView show];
  389. if (self.detailModel.goods_id.length<=0) {
  390. return;
  391. }
  392. NSDictionary *dics=@{@"goods_id":self.detailModel.goods_id};
  393. if (self.detailModel.coupon_price.length>0) {
  394. dics=@{@"goods_id":self.detailModel.goods_id,@"coupon_price":self.detailModel.coupon_price};
  395. }
  396. [KDPNetworkRequestHTTP postURL:KwaiJumpURL params:dics success:^(id _Nonnull json) {
  397. UIPasteboard * pastboard = [UIPasteboard generalPasteboard];
  398. pastboard.string=json[@"data"][@"tkl"];
  399. if (![KDPublicMethod JumpOpenURL:KWai]) {//没有安装快手,过审用
  400. [self jumpTbWithURL:json[@"data"][@"url"]];
  401. }else{
  402. self.pasteView.pasteLabel.attributedText=[KDPublicMethod sethanggaoWithStr:[NSString stringWithFormat:@"淘口令%@已复制你可以用来分享、购买或推广",json[@"data"][@"tkl"]] linSpacing:5];
  403. self.pasteView.tkl=json[@"data"][@"tkl"];
  404. self.pasteView.hidden=NO;
  405. }
  406. [LoadingView dismiss];
  407. } failure:^(NSError * _Nonnull error) {
  408. [LoadingView dismiss];
  409. }];
  410. }
  411. #pragma mark---跳转淘宝购买
  412. -(void)jumpTbWithURL:(NSString*)url
  413. {
  414. id<AlibcTradePage> page =[AlibcTradePageFactory page:url];
  415. //打开方式
  416. AlibcTradeShowParams* showParam = [[AlibcTradeShowParams alloc] init];
  417. showParam.openType = AlibcOpenTypeAuto;
  418. [[AlibcTradeSDK sharedInstance].tradeService show:self.navigationController page:page showParams:showParam taoKeParams:nil trackParam:nil tradeProcessSuccessCallback:^(AlibcTradeResult * _Nullable result) {
  419. } tradeProcessFailedCallback:^(NSError * _Nullable error) {
  420. }];
  421. }
  422. #pragma mark---添加历史记录
  423. -(void)saveHistoryModel:(KDPGoodsModel *)model
  424. {
  425. NSString *goods_id=@"";
  426. if (model.goods_id.length>0) {
  427. goods_id= model.goods_id;
  428. }
  429. NSString *price=@"";
  430. if (model.price.length>0) {
  431. price = model.price;
  432. }
  433. NSString *img=@"";
  434. if (model.img.length>0) {
  435. img =model.img;
  436. }
  437. NSString *commission_rate=@"";
  438. if (model.commission_rate.length>0) {
  439. commission_rate = model.commission_rate;
  440. }
  441. NSString *commission_price=@"";
  442. if (model.commission_price.length>0) {
  443. commission_price = model.commission_price;
  444. }
  445. NSString *shop_title=@"";
  446. if ([model.shop[@"title"] length]>0) {
  447. shop_title = model.shop[@"title"];
  448. }
  449. NSString *title=@"";
  450. if (model.title.length>0) {
  451. title = model.title;
  452. }
  453. NSString *volume=@"";
  454. if (model.volume.length>0) {
  455. volume = model.volume;
  456. }
  457. NSString *live_price=@"";
  458. if (model.discount_price.length>0) {
  459. live_price = model.discount_price;
  460. }
  461. NSString *shop_type=@"";
  462. if (model.shop_type.length>0) {
  463. shop_type= model.shop_type;
  464. }
  465. NSDictionary *paramDic =@{@"title":title,@"img":img,@"goods_id":goods_id,@"volume":volume,@"shop_type":shop_type,@"shop_title":shop_title,@"price":price,@"commission_rate":commission_rate,@"discount_price":live_price,@"commission_price":commission_price};
  466. [KDPNetworkRequestHTTP postURL:historyURL params:paramDic success:^(id _Nonnull json) {
  467. NSLog(@"%@",json);
  468. } failure:^(NSError * _Nonnull error) {
  469. }];
  470. }
  471. @end