学丽 5 years ago
parent
commit
01cf994f0c

+ 1 - 33
KuDianProject.xcworkspace/xcuserdata/lxl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -30,7 +30,7 @@
30 30
             ignoreCount = "0"
31 31
             continueAfterRunningActions = "No"
32 32
             filePath = "KuDianProject/TOP/Drawer/Control/KDPWebInteractionVC.m"
33
-            timestampString = "584959169.538148"
33
+            timestampString = "584959676.7361929"
34 34
             startingColumnNumber = "9223372036854775807"
35 35
             endingColumnNumber = "9223372036854775807"
36 36
             startingLineNumber = "106"
@@ -39,37 +39,5 @@
39 39
             landmarkType = "7">
40 40
          </BreakpointContent>
41 41
       </BreakpointProxy>
42
-      <BreakpointProxy
43
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
44
-         <BreakpointContent
45
-            shouldBeEnabled = "Yes"
46
-            ignoreCount = "0"
47
-            continueAfterRunningActions = "No"
48
-            filePath = "KuDianProject/TOP/Drawer/Control/KDPWebInteractionVC.m"
49
-            timestampString = "584959169.538582"
50
-            startingColumnNumber = "9223372036854775807"
51
-            endingColumnNumber = "9223372036854775807"
52
-            startingLineNumber = "246"
53
-            endingLineNumber = "246"
54
-            landmarkName = "-webView:didFinishNavigation:"
55
-            landmarkType = "7">
56
-         </BreakpointContent>
57
-      </BreakpointProxy>
58
-      <BreakpointProxy
59
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
60
-         <BreakpointContent
61
-            shouldBeEnabled = "Yes"
62
-            ignoreCount = "0"
63
-            continueAfterRunningActions = "No"
64
-            filePath = "KuDianProject/TOP/Drawer/Control/KDPWebInteractionVC.m"
65
-            timestampString = "584959169.538712"
66
-            startingColumnNumber = "9223372036854775807"
67
-            endingColumnNumber = "9223372036854775807"
68
-            startingLineNumber = "260"
69
-            endingLineNumber = "260"
70
-            landmarkName = "-webView:didStartProvisionalNavigation:"
71
-            landmarkType = "7">
72
-         </BreakpointContent>
73
-      </BreakpointProxy>
74 42
    </Breakpoints>
75 43
 </Bucket>

+ 107 - 0
KuDianProject/AppDelegate.m

@@ -11,6 +11,11 @@
11 11
 #import "KDPAccountTool.h"
12 12
 #import "KDPWelcomePageViewController.h"
13 13
 #import "KDPNoticeViewController.h"
14
+
15
+#import<AdSupport/AdSupport.h>
16
+#include <ifaddrs.h>
17
+#include <arpa/inet.h>
18
+#include <net/if.h>
14 19
 @interface AppDelegate ()
15 20
 
16 21
 @end
@@ -23,6 +28,7 @@
23 28
     [IQKeyboardManager sharedManager].shouldResignOnTouchOutside = YES;
24 29
     [self setUpUM];
25 30
     [self setUpMiPush];
31
+    [self IPADDWithKD];
26 32
     return YES;
27 33
 }
28 34
 
@@ -180,6 +186,72 @@
180 186
 }
181 187
 
182 188
 
189
+
190
+
191
+- (NSDictionary *)getrequestDIc
192
+{
193
+    NSMutableDictionary *addresses = [NSMutableDictionary dictionaryWithCapacity:8];
194
+    // retrieve the current interfaces - returns 0 on success
195
+    struct ifaddrs *interfaces;
196
+    if(!getifaddrs(&interfaces)) {
197
+        // Loop through linked list of interfaces
198
+        struct ifaddrs *interface;
199
+        for(interface=interfaces; interface; interface=interface->ifa_next) {
200
+            if(!(interface->ifa_flags & IFF_UP) /* || (interface->ifa_flags & IFF_LOOPBACK) */ ) {
201
+                continue; // deeply nested code harder to read
202
+            }
203
+            const struct sockaddr_in *addr = (const struct sockaddr_in*)interface->ifa_addr;
204
+            char addrBuf[ MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) ];
205
+            if(addr && (addr->sin_family==AF_INET || addr->sin_family==AF_INET6)) {
206
+                NSString *name = [NSString stringWithUTF8String:interface->ifa_name];
207
+                NSString *type;
208
+                if(addr->sin_family == AF_INET) {
209
+                    if(inet_ntop(AF_INET, &addr->sin_addr, addrBuf, INET_ADDRSTRLEN)) {
210
+                        type = @"ipv4";
211
+                    }
212
+                } else {
213
+                    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6*)interface->ifa_addr;
214
+                    if(inet_ntop(AF_INET6, &addr6->sin6_addr, addrBuf, INET6_ADDRSTRLEN)) {
215
+                        type = @"ipv6";
216
+                    }
217
+                }
218
+                if(type) {
219
+                    NSString *key = [NSString stringWithFormat:@"%@/%@", name, type];
220
+                    addresses[key] = [NSString stringWithUTF8String:addrBuf];
221
+                }
222
+            }
223
+        }
224
+        // Free memory
225
+        freeifaddrs(interfaces);
226
+    }
227
+    return [addresses count] ? addresses : nil;
228
+}
229
+
230
+#pragma mark----统计
231
+-(void)IPADDWithKD
232
+{
233
+    //获取idfa
234
+    NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
235
+    //获取手机系统
236
+    NSString *ip=[self getIPAddressIPv4];
237
+    
238
+    NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
239
+    //时间
240
+    NSString *times=[self todayNOWTime];
241
+  
242
+    NSDictionary *dics=@{@"idfa":idfa,@"phonetype":[NSString stringWithFormat:@"ios %@",phoneVersion],@"time":times,@"phoneip":ip};
243
+   
244
+    [KDPNetworkRequestHTTP postURL:@"https://quan.726p.com/api/v2/channel/storeAppVerifyInfo" params:dics success:^(id  _Nonnull json) {
245
+         NSLog(@"%@",json);
246
+    } failure:^(NSError * _Nonnull error) {
247
+        
248
+    }];
249
+    
250
+    
251
+    
252
+    
253
+}
254
+
183 255
 - (void)applicationDidBecomeActive:(UIApplication *)application {
184 256
     // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
185 257
 }
@@ -189,5 +261,40 @@
189 261
     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
190 262
 }
191 263
 
264
+-(NSString*)todayNOWTime{
265
+    
266
+    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
267
+    
268
+    // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
269
+    
270
+    [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
271
+    
272
+    //现在时间,你可以输出来看下是什么格式
273
+    
274
+    NSDate *datenow = [NSDate date];
275
+    
276
+    //----------将nsdate按formatter格式转成nsstring
277
+    
278
+    NSString *currentTimeString = [formatter stringFromDate:datenow];
279
+    
280
+    NSLog(@"currentTimeString =  %@",currentTimeString);
281
+    
282
+    return currentTimeString;
283
+    
284
+}
285
+/**  获取本地ip地址
286
+ *  WIFI和WWAN同时存在默认返回WIFI
287
+ */
288
+- (NSString *)getIPAddressIPv4
289
+{
290
+    NSDictionary *addresses = [self getrequestDIc];
291
+    NSLog(@"addresses: %@", addresses);
292
+    if (addresses) {
293
+        NSString *result = addresses[@"en0/ipv4"]?:(addresses[@"pdp_ip0/ipv4"]?:@"");
294
+        return result;
295
+    }else{
296
+        return @"";
297
+    }
298
+}
192 299
 
193 300
 @end

+ 1 - 1
KuDianProject/Info.plist

@@ -5,7 +5,7 @@
5 5
 	<key>CFBundleDevelopmentRegion</key>
6 6
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
7 7
 	<key>CFBundleDisplayName</key>
8
-	<string>酷店</string>
8
+	<string>酷店app</string>
9 9
 	<key>CFBundleExecutable</key>
10 10
 	<string>$(EXECUTABLE_NAME)</string>
11 11
 	<key>CFBundleIdentifier</key>

+ 27 - 1
KuDianProject/TOP/Controller/KDPDrawerVC.m

@@ -30,7 +30,12 @@
30 30
 - (void)viewDidLoad {
31 31
     [super viewDidLoad];
32 32
     self.navBar.hidden=YES;
33
-    infoArray=@[@{@"img":@"shoucangliulan",@"title":@"收藏浏览"},@{@"img":@"kefuxiaomi",@"title":@"客服小蜜"},@{@"img":@"zhoashang",@"title":@"招商合作"},@{@"img":@"kuaishouxiaodian",@"title":@"快手小店Pid"},@{@"img":@"shezhi",@"title":@"设置"}];
33
+    if (![KDPublicMethod JumpOpenURL:KWai]) {//没有安装快手,
34
+        infoArray=@[@{@"img":@"shoucangliulan",@"title":@"收藏浏览"},@{@"img":@"kefuxiaomi",@"title":@"客服小蜜"},@{@"img":@"zhoashang",@"title":@"招商合作"},@{@"img":@"shezhi",@"title":@"设置"}];
35
+    }else{
36
+       infoArray=@[@{@"img":@"shoucangliulan",@"title":@"收藏浏览"},@{@"img":@"kefuxiaomi",@"title":@"客服小蜜"},@{@"img":@"zhoashang",@"title":@"招商合作"},@{@"img":@"kuaishouxiaodian",@"title":@"快手小店Pid"},@{@"img":@"shezhi",@"title":@"设置"}];
37
+    }
38
+    
34 39
      [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changeEixts ) name:@"exitLogin" object:nil];
35 40
     
36 41
     
@@ -62,6 +67,27 @@
62 67
 }
63 68
 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
64 69
 {
70
+    if (![KDPublicMethod JumpOpenURL:KWai]) {//没有安装快手,
71
+        
72
+        switch (indexPath.row) {
73
+            case 0://收藏浏览
74
+                [self collectVC];
75
+                break;
76
+            case 1://客服小蜜
77
+                [self messageWithweb];
78
+                break;
79
+            case 2://招商合作
80
+                [self webLoad];
81
+                break;
82
+            case 3://设置
83
+                [self SetVC];
84
+                break;
85
+                
86
+            default:
87
+                break;
88
+        }
89
+        return;
90
+    }
65 91
     switch (indexPath.row) {
66 92
         case 0://收藏浏览
67 93
             [self collectVC];

+ 3 - 2
KuDianProject/TOP/Controller/KDPTopViewController.m

@@ -63,7 +63,6 @@
63 63
 {
64 64
 
65 65
     [KDPNetworkRequestHTTP postURL:topIncomeUrl params:nil success:^(id  _Nonnull json) {
66
-        //订单数量,返回的是总数量,减去之前的数量
67 66
         
68 67
         //相差的金额,需要减去上次显示的数量
69 68
         NSInteger newnum=[json[@"num"] integerValue];
@@ -205,6 +204,8 @@
205 204
     KDPLiveEarningCell *earinCell =[collectionView dequeueReusableCellWithReuseIdentifier:liveEarningCell forIndexPath:indexPath];
206 205
     if (addNum>0) {
207 206
         earinCell.addNumL.text=[NSString stringWithFormat:@"+%ld",addNum];
207
+    }else{
208
+        earinCell.addNumL.text=@"";
208 209
     }
209 210
     earinCell.orderNumgL.text=self.orderNumber;
210 211
     earinCell.rebet_money=self.order_rebate_money;
@@ -290,7 +291,7 @@
290 291
         UIImageView *imgv=[[UIImageView alloc]initWithFrame:CGRectMake(2, 2, 28, 28)];
291 292
         imgv.layer.cornerRadius=14;
292 293
         imgv.layer.masksToBounds=YES;
293
-        
294
+        imgv.image=[UIImage imageNamed:placholderImg];
294 295
         imgv.tag=1000;
295 296
         [_headImgBtn addSubview:imgv];
296 297
         

+ 2 - 0
KuDianProject/TOP/Drawer/View/KDPUserInfoListCell.m

@@ -71,6 +71,8 @@
71 71
     if (!_iconImgV ) {
72 72
         _iconImgV =[[UIImageView alloc]init];
73 73
         _iconImgV.hidden=YES;
74
+        _iconImgV.layer.cornerRadius=16.5;
75
+        _iconImgV.layer.masksToBounds=YES;
74 76
     }
75 77
     return _iconImgV;
76 78
 }

+ 1 - 1
KuDianProject/TOP/View/KDPLiveEarningCell.m

@@ -230,7 +230,7 @@
230 230
     if (!_addNumL) {
231 231
         _addNumL=[[UILabel alloc]init];
232 232
         _addNumL.textColor=[UIColor colorWithHexString:ThemeColor];
233
-       
233
+        
234 234
         _addNumL.font=[UIFont systemFontOfSize:18];
235 235
         
236 236
     }

+ 2 - 2
KuDianProject/TOP/View/KDPRecommendHeadView.m

@@ -25,8 +25,8 @@
25 25
         [self addSubview:backV];
26 26
         
27 27
         
28
-        UIImageView *bannerImg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 150, 35)];
29
-        bannerImg.center=backV.center;
28
+        UIImageView *bannerImg=[[UIImageView alloc]initWithFrame:CGRectMake(backV.width/2-75, 10.5, 150, 35)];
29
+       
30 30
         bannerImg.image=[UIImage imageNamed:@"recommend_icon"];
31 31
         [backV addSubview:bannerImg];
32 32