Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DrWater
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
路少雄
DrWater
Commits
639593b5
Commit
639593b5
authored
May 13, 2024
by
路少雄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增H5配置
parent
53ecd4ee
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
502 additions
and
112 deletions
+502
-112
DJMHomeTY.xcworkspace/xcuserdata/lushaoxiong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
DJMHomeTY.xcworkspace/xcuserdata/lushaoxiong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+149
-39
DJMHomeTY/AppDelegate/AppDelegate.m
+33
-5
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/Contents.json
+22
-0
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/DR_gift_Normal@2x.png
+0
-0
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/DR_gift_Normal@3x.png
+0
-0
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/Contents.json
+22
-0
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/DR_gift_Sel@2x.png
+0
-0
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/DR_gift_Sel@3x.png
+0
-0
DJMHomeTY/Global/Base/Controller/XHCustomTabBarController.m
+14
-3
DJMHomeTY/Global/Base/Controller/XHParentVC.m
+2
-2
DJMHomeTY/Global/Base/View/XHTabBar.m
+7
-1
DJMHomeTY/Global/Define/XHURL.h
+56
-50
DJMHomeTY/Global/Manager/XHDataManager.h
+2
-0
DJMHomeTY/Global/Manager/XHHttpRequestManager.m
+1
-1
DJMHomeTY/Page/DeviceListPage/Controller/DXBannerVC.m
+182
-7
DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m
+11
-3
DJMHomeTY/Page/DeviceListPage/Model/XHDeviceListModel.h
+1
-1
No files found.
DJMHomeTY.xcworkspace/xcuserdata/lushaoxiong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
639593b5
No preview for this file type
DJMHomeTY.xcworkspace/xcuserdata/lushaoxiong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
639593b5
...
@@ -77,13 +77,13 @@
...
@@ -77,13 +77,13 @@
filePath =
"DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
filePath =
"DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"3
16
"
startingLineNumber =
"3
24
"
endingLineNumber =
"3
16
"
endingLineNumber =
"3
24
"
landmarkName =
"-machineButton:button:"
landmarkName =
"-machineButton:button:"
landmarkType =
"7"
>
landmarkType =
"7"
>
<Locations>
<Locations>
<Location
<Location
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337
de
3"
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337
bd
3"
shouldBeEnabled =
"Yes"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
continueAfterRunningActions =
"No"
...
@@ -93,12 +93,12 @@
...
@@ -93,12 +93,12 @@
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"3
08
"
startingLineNumber =
"3
24
"
endingLineNumber =
"3
08
"
endingLineNumber =
"3
24
"
offsetFromSymbolStart =
"
560
"
>
offsetFromSymbolStart =
"
484
"
>
</Location>
</Location>
<Location
<Location
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337
de
3"
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337
bd
3"
shouldBeEnabled =
"Yes"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
continueAfterRunningActions =
"No"
...
@@ -108,38 +108,8 @@
...
@@ -108,38 +108,8 @@
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"308"
startingLineNumber =
"324"
endingLineNumber =
"308"
endingLineNumber =
"324"
offsetFromSymbolStart =
"100"
>
</Location>
<Location
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337d00"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"-[DXDeviceListVC machineButton:button:]"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"311"
endingLineNumber =
"311"
offsetFromSymbolStart =
"100"
>
</Location>
<Location
uuid =
"E359E523-3519-496C-8634-30B842625020 - 972ab115af337cdb"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"-[DXDeviceListVC machineButton:button:]"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"316"
endingLineNumber =
"316"
offsetFromSymbolStart =
"100"
>
offsetFromSymbolStart =
"100"
>
</Location>
</Location>
</Locations>
</Locations>
...
@@ -208,5 +178,145 @@
...
@@ -208,5 +178,145 @@
</Locations>
</Locations>
</BreakpointContent>
</BreakpointContent>
</BreakpointProxy>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.ExceptionBreakpoint"
>
<BreakpointContent
uuid =
"9B88ED19-3F85-4A90-AAB6-DC4D211C19D4"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
breakpointStackSelectionBehavior =
"1"
scope =
"1"
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"206E05D5-BECB-4FF3-8127-15C7E2245ECF"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"DJMHomeTY/Page/HomePage/Controller/XHMainVC1.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"1487"
endingLineNumber =
"1487"
landmarkName =
"-setGestationRecordId:"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"6E1E1A56-5D97-418B-8D8A-D348300D29CC"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"238"
endingLineNumber =
"238"
landmarkName =
"-saveRecord:"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"E8BF8F50-9FFE-4F6A-AC94-B3D28C372550"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"247"
endingLineNumber =
"247"
landmarkName =
"-saveRecord:"
landmarkType =
"7"
>
<Locations>
<Location
uuid =
"E8BF8F50-9FFE-4F6A-AC94-B3D28C372550 - c3b76f265bff27c5"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"__25-[XHParentVC saveRecord:]_block_invoke.116"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"247"
endingLineNumber =
"247"
offsetFromSymbolStart =
"100"
>
</Location>
<Location
uuid =
"E8BF8F50-9FFE-4F6A-AC94-B3D28C372550 - d8f31718eb018d9d"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"__25-[XHParentVC saveRecord:]_block_invoke_2"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"248"
endingLineNumber =
"248"
offsetFromSymbolStart =
"28"
>
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"606EE620-8EB7-41B4-9247-C0DF004BE693"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"234"
endingLineNumber =
"234"
landmarkName =
"-saveRecord:"
landmarkType =
"7"
>
<Locations>
<Location
uuid =
"606EE620-8EB7-41B4-9247-C0DF004BE693 - b459135280a193fd"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"-[XHParentVC saveRecord:]"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"234"
endingLineNumber =
"234"
offsetFromSymbolStart =
"2716"
>
</Location>
<Location
uuid =
"606EE620-8EB7-41B4-9247-C0DF004BE693 - 34b9e1ee23678e83"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
symbolName =
"__25-[XHParentVC saveRecord:]_block_invoke"
moduleName =
"HJMDrWarter"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/lushaoxiong/Desktop/%E5%85%AC%E5%8F%B8%E9%A1%B9%E7%9B%AE/DrWater/DJMHomeTY/Global/Base/Controller/XHParentVC.m"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"235"
endingLineNumber =
"235"
offsetFromSymbolStart =
"60"
>
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Breakpoints>
</Bucket>
</Bucket>
DJMHomeTY/AppDelegate/AppDelegate.m
View file @
639593b5
...
@@ -140,6 +140,7 @@
...
@@ -140,6 +140,7 @@
XHDataModel
*
model
=
[
XHDataModel
mj_objectWithKeyValues
:
responseObject
[
@"data"
]];
XHDataModel
*
model
=
[
XHDataModel
mj_objectWithKeyValues
:
responseObject
[
@"data"
]];
XHGetDataManager
.
customerModel
=
model
;
XHGetDataManager
.
customerModel
=
model
;
dispatch_async
(
self
.
main_queue_t
,
^
{
dispatch_async
(
self
.
main_queue_t
,
^
{
[
weakSelf
LoginSuccess
];
[
weakSelf
LoginSuccess
];
});
});
}
fail
:^
(
id
failMessage
)
{
}
fail
:^
(
id
failMessage
)
{
...
@@ -157,18 +158,45 @@
...
@@ -157,18 +158,45 @@
});
});
}];
}];
}
}
// 请求h5链接
-
(
void
)
requestGiftLink
{
HJSelfWeak
;
[[
XHHttpRequestManager
shareManager
]
getHttpRequestURL
:
HFXGetGiftLink
isJson
:
NO
parameters
:
@{}
success
:^
(
id
responseObject
)
{
[
SVProgressHUD
dismiss
];
NSLog
(
@"responseObject:
\n
%@===%@"
,
responseObject
,
responseObject
[
@"msg"
]);
XHGetDataManager
.
giftLink
=
responseObject
[
@"data"
];
dispatch_async
(
self
.
main_queue_t
,
^
{
[
weakSelf
setAppWindows
];
[
weakSelf
setRootViewController
];
});
}
fail
:^
(
id
failMessage
)
{
}
networkRequestsFail
:^
(
id
networkFail
)
{
}];
}
-
(
void
)
LoginSuccess
{
-
(
void
)
LoginSuccess
{
HJSelfWeak
;
dispatch_async
(
self
.
main_queue_t
,
^
{
dispatch_async
(
self
.
main_queue_t
,
^
{
[
s
elf
setAppWindows
];
[
weakS
elf
setAppWindows
];
[
s
elf
setRootViewController
];
[
weakS
elf
setRootViewController
];
});
});
}
// [self requestGiftLink];
}
//
-
(
void
)
LoginAgain
{
-
(
void
)
LoginAgain
{
//断开蓝牙
//断开蓝牙
HJGetBluetoothManager
.
noReconnect
=
true
;
HJGetBluetoothManager
.
noReconnect
=
true
;
[
HJGetBluetoothManager
stopConnect
];
[
HJGetBluetoothManager
stopConnect
];
[
HJGetBluetoothManager
stopScanning
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
HJGetBluetoothManager
stopScanning
];
});
// [HJGetBluetoothManager.delegate removeBluetoothDelegate:self];
// [HJGetBluetoothManager.delegate removeBluetoothDelegate:self];
[
self
resetDefaults
];
[
self
resetDefaults
];
[
self
setAppWindows
];
[
self
setAppWindows
];
...
...
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/Contents.json
0 → 100644
View file @
639593b5
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"DR_gift_Normal@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"DR_gift_Normal@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/DR_gift_Normal@2x.png
0 → 100644
View file @
639593b5
838 Bytes
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Normal.imageset/DR_gift_Normal@3x.png
0 → 100644
View file @
639593b5
1.55 KB
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/Contents.json
0 → 100644
View file @
639593b5
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"DR_gift_Sel@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"DR_gift_Sel@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/DR_gift_Sel@2x.png
0 → 100644
View file @
639593b5
896 Bytes
DJMHomeTY/Assets.xcassets/HFX/DR_gift_Sel.imageset/DR_gift_Sel@3x.png
0 → 100644
View file @
639593b5
1.67 KB
DJMHomeTY/Global/Base/Controller/XHCustomTabBarController.m
View file @
639593b5
...
@@ -168,9 +168,20 @@
...
@@ -168,9 +168,20 @@
self
.
tabBar
.
translucent
=
NO
;
self
.
tabBar
.
translucent
=
NO
;
NSArray
*
normalItems
=
@[
@"DR_Home_home-Normal"
,
@"DR_Mine_Normal"
];
NSArray
*
normalItems
;
NSArray
*
selectItmes
=
@[
@"DR_Home_home-sel"
,
@"DR_Mine_Sel"
];
NSArray
*
selectItmes
;
NSArray
*
controllClass
=
@[
@"DXDeviceListVC"
,
@"XHMineVC"
];
NSArray
*
controllClass
;
if
([
XHDataManager
sharedManager
].
simparlanguage
==
0
)
{
normalItems
=
@[
@"DR_Home_home-Normal"
,
@"DR_gift_Normal"
,
@"DR_Mine_Normal"
];
selectItmes
=
@[
@"DR_Home_home-sel"
,
@"DR_gift_Sel"
,
@"DR_Mine_Sel"
];
controllClass
=
@[
@"DXDeviceListVC"
,
@"DXBannerVC"
,
@"XHMineVC"
];
}
else
{
normalItems
=
@[
@"DR_Home_home-Normal"
,
@"DR_Mine_Normal"
];
selectItmes
=
@[
@"DR_Home_home-sel"
,
@"DR_Mine_Sel"
];
controllClass
=
@[
@"DXDeviceListVC"
,
@"XHMineVC"
];
}
self
.
delegate
=
self
;
self
.
delegate
=
self
;
NSMutableArray
*
controllers
=
[[
NSMutableArray
alloc
]
init
];
NSMutableArray
*
controllers
=
[[
NSMutableArray
alloc
]
init
];
for
(
int
i
=
0
;
i
<
normalItems
.
count
;
i
++
)
for
(
int
i
=
0
;
i
<
normalItems
.
count
;
i
++
)
...
...
DJMHomeTY/Global/Base/Controller/XHParentVC.m
View file @
639593b5
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
NO
;
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
NO
;
}
}
[
self
setNavigationState
];
[
self
setNavigationState
];
[
self
addNotification
];
[
self
addNotification
Super
];
[
self
initNavView
];
[
self
initNavView
];
[
self
startLocation1
];
[
self
startLocation1
];
self
.
centralManager
=
[[
CBCentralManager
alloc
]
initWithDelegate
:
self
queue
:
nil
];
self
.
centralManager
=
[[
CBCentralManager
alloc
]
initWithDelegate
:
self
queue
:
nil
];
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
}
}
//添加通知
//添加通知
-
(
void
)
addNotification
{
-
(
void
)
addNotification
Super
{
[
HJNotificationCenter
addObserver
:
self
selector
:
@selector
(
popVcAction
)
name
:
@"popVC"
object
:
nil
];
[
HJNotificationCenter
addObserver
:
self
selector
:
@selector
(
popVcAction
)
name
:
@"popVC"
object
:
nil
];
}
}
...
...
DJMHomeTY/Global/Base/View/XHTabBar.m
View file @
639593b5
...
@@ -32,7 +32,13 @@
...
@@ -32,7 +32,13 @@
// [self bringSubviewToFront:self.scanBtn];
// [self bringSubviewToFront:self.scanBtn];
// 2.设置其它UITabBarButton的位置和尺寸//self.frame.size.width / 3;
// 2.设置其它UITabBarButton的位置和尺寸//self.frame.size.width / 3;
CGFloat
tabbarButtonW
=
HJScreenWidth
/
2
;
CGFloat
tabbarButtonW
;
if
([
XHDataManager
sharedManager
].
simparlanguage
==
0
&&
TargetType
==
5
){
tabbarButtonW
=
HJScreenWidth
/
3
;
}
else
{
tabbarButtonW
=
HJScreenWidth
/
2
;
}
CGFloat
tabbarButtonIndex
=
0
;
CGFloat
tabbarButtonIndex
=
0
;
for
(
UIView
*
child
in
self
.
subviews
)
{
for
(
UIView
*
child
in
self
.
subviews
)
{
Class
class
=
NSClassFromString
(
@"UITabBarButton"
);
Class
class
=
NSClassFromString
(
@"UITabBarButton"
);
...
...
DJMHomeTY/Global/Define/XHURL.h
View file @
639593b5
...
@@ -8,107 +8,109 @@
...
@@ -8,107 +8,109 @@
#ifndef XHURL_h
#ifndef XHURL_h
#define XHURL_h
#define XHURL_h
//#define URL @"https://testdjm.imoreme.com"//测试
//#define
DR
URL @"https://testdjm.imoreme.com"//测试
#define
URL @"http
://djm.imoreme.com"//正式
#define
DRURL @"https
://djm.imoreme.com"//正式
//#define URL @"http://192.168.1.168:8080"//luocong
//#define URL @"http://192.168.1.168:8080"//luocong
//#define URL @"http://192.168.1.66:9012"//luocong
/** 发送验证码 **/
/** 发送验证码 **/
#define VerifyCodeURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getVerifyCode"]
#define VerifyCodeURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getVerifyCode"]
/** 首页登陆(返回 token) **/
/** 首页登陆(返回 token) **/
#define MSPageLoginURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/emp/login"]
#define MSPageLoginURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/emp/login"]
/** 注册**/
/** 注册**/
#define RegistURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/emp/register"]
#define RegistURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/emp/register"]
/** 获取用户信息**/
/** 获取用户信息**/
#define HeaderGetCustomMsgURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getEmpInfo"]
#define HeaderGetCustomMsgURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getEmpInfo"]
/** 修改用户信息 **/
/** 修改用户信息 **/
#define UpdatePersonalInfoURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/updateEmpInfo"]
#define UpdatePersonalInfoURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/updateEmpInfo"]
/** 账号注销 **/
/** 账号注销 **/
#define DestroyPersonalPhoneURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/emp/destroy"]
#define DestroyPersonalPhoneURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/emp/destroy"]
/** 连接时校验设备归属 **/
/** 连接时校验设备归属 **/
#define VerificationEquipmentOwnerURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/connectCheckDev"]
#define VerificationEquipmentOwnerURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/connectCheckDev"]
/** 获取设备类型集合 **/
/** 获取设备类型集合 **/
#define GetEquipmentListURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getDeviceTypeList"]
#define GetEquipmentListURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getDeviceTypeList"]
/** 获取设备集合 **/
/** 获取设备集合 **/
#define GetDeviceListURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getDeviceList"]
#define GetDeviceListURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getDeviceList"]
/** 添加设备 **/
/** 添加设备 **/
#define AddDeviceURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/addDevice"]
#define AddDeviceURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/addDevice"]
/** 获取操作日志 **/
/** 获取操作日志 **/
#define GetCommandRecordURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getOperateRecord"]
#define GetCommandRecordURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getOperateRecord"]
/** 手机密码登录 **/
/** 手机密码登录 **/
#define PhoneNumLoginURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/loginByCodeOrPwd"]
#define PhoneNumLoginURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/loginByCodeOrPwd"]
/** 手机验证码登录 **/
/** 手机验证码登录 **/
#define PhoneVerifyCodeLoginURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/loginByCodeOrPwd"]
#define PhoneVerifyCodeLoginURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/loginByCodeOrPwd"]
/** 修改密码 **/
/** 修改密码 **/
#define ChangePsdURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/updatePwd"]
#define ChangePsdURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/updatePwd"]
/** 获取微信绑定信息 **/
/** 获取微信绑定信息 **/
#define WXBindURL [NSString stringWithFormat:@"%@%@",URL,@"/Facility/login"]
#define WXBindURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/Facility/login"]
/** 保存或修改用户信息 **/
/** 保存或修改用户信息 **/
#define SaveOrUpdateURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/updateUserInfo"]
#define SaveOrUpdateURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/updateUserInfo"]
/** 保存图片 **/
/** 保存图片 **/
#define UploadImgURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/uploadImg"]
#define UploadImgURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/uploadImg"]
/** 验证仪器 **/
/** 验证仪器 **/
#define ConfirmDeviceURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/validateDevice"]
#define ConfirmDeviceURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/validateDevice"]
/** 绑定仪器 **/
/** 绑定仪器 **/
#define BindDeviceURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/bindDeviceById"]
#define BindDeviceURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/bindDeviceById"]
/** 获取使用次数 **/
/** 获取使用次数 **/
#define GetUsedTimesURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/gainUserNum"]
#define GetUsedTimesURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/gainUserNum"]
/** 保存操作记录 **/
/** 保存操作记录 **/
#define SaveRecordURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/saveTherapyNoOrder"]
#define SaveRecordURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/saveTherapyNoOrder"]
/** 获取操作记录 **/
/** 获取操作记录 **/
#define GetRecordPageURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/findTherapyNoOrder"]
#define GetRecordPageURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/findTherapyNoOrder"]
/* 改变用户是否正在使用仪器 的状态 */
/* 改变用户是否正在使用仪器 的状态 */
#define GetUserStatusURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/userUseDeviceStatus"]
#define GetUserStatusURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/userUseDeviceStatus"]
/** 绑定新手机 **/
/** 绑定新手机 **/
#define BindNewPhoneURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/bindNewPhone"]
#define BindNewPhoneURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/bindNewPhone"]
/** 完善userInfo **/
/** 完善userInfo **/
#define PerfectWXURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/saveWeChatUserInfo"]
#define PerfectWXURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/saveWeChatUserInfo"]
/** 获取订单记录 **/
/** 获取订单记录 **/
#define OrderRecordURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/findOrderRecord"]
#define OrderRecordURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/findOrderRecord"]
/** 取消订单订单 **/
/** 取消订单订单 **/
#define CancelOrderURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/cancelOrder"]
#define CancelOrderURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/cancelOrder"]
/** 获取价格 **/
/** 获取价格 **/
#define GetPriceURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/resDevicePrice"]
#define GetPriceURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/resDevicePrice"]
/** 生成订单信息 **/
/** 生成订单信息 **/
#define MadeOrderURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/saveOrderInfo"]
#define MadeOrderURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/saveOrderInfo"]
/** 订单支付 **/
/** 订单支付 **/
#define OrderPayURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/payOrderMoney"]
#define OrderPayURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/payOrderMoney"]
/** 获取订单详情 **/
/** 获取订单详情 **/
#define GetOrderDetailURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/findOrderInfo"]
#define GetOrderDetailURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/findOrderInfo"]
/** 退出登录 **/
/** 退出登录 **/
#define LogoutURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/exitLogin"]
#define LogoutURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/exitLogin"]
/** 验证登录是否过期 **/
/** 验证登录是否过期 **/
#define LoginOutDateURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/loginStatus"]
#define LoginOutDateURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/loginStatus"]
/** 微信登录 **/
/** 微信登录 **/
#define WeiXinLoginURL [NSString stringWithFormat:@"%@%@",URL,@"/api/user/weChatLogin"]
#define WeiXinLoginURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/api/user/weChatLogin"]
/** 微信登录 **/
/** 微信登录 **/
#define WXURL @"https://api.weixin.qq.com"
#define WXURL @"https://api.weixin.qq.com"
...
@@ -118,47 +120,51 @@
...
@@ -118,47 +120,51 @@
#define WXPayURL [NSString stringWithFormat:@"%@%@",WXURL,@"/cgi-bin/token"]
#define WXPayURL [NSString stringWithFormat:@"%@%@",WXURL,@"/cgi-bin/token"]
/** 绑定 **/
/** 绑定 **/
#define BindDeviceURL [NSString stringWithFormat:@"%@%@",URL,@"/Power/newBindDevice"]
#define BindDeviceURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/Power/newBindDevice"]
/** 管控 **/
/** 管控 **/
#define CommandURL [NSString stringWithFormat:@"%@%@",URL,@"/record/queryVerifyByDeviceCode"]
#define CommandURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/record/queryVerifyByDeviceCode"]
/** 全款/租赁 **/
/** 全款/租赁 **/
#define DeviceValidTimeURL [NSString stringWithFormat:@"%@%@",URL,@"/Facility/getDeviceValidtime"]
#define DeviceValidTimeURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/Facility/getDeviceValidtime"]
/** 验证 **/
/** 验证 **/
#define VerifyURL [NSString stringWithFormat:@"%@%@",URL,@"/Facility/newPhoneVerification"]
#define VerifyURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/Facility/newPhoneVerification"]
/** 保存操作记录 **/
/** 保存操作记录 **/
#define SaveRecordURL [NSString stringWithFormat:@"%@%@",URL,@"/record/newSaveGestationRecord"]
#define SaveRecordURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/record/newSaveGestationRecord"]
/** 更新操作记录 **/
/** 更新操作记录 **/
#define UpdateRecordURL [NSString stringWithFormat:@"%@%@",URL,@"/record/newUpdateRecordById"]
#define UpdateRecordURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/record/newUpdateRecordById"]
/** 获取操作记录 **/
/** 获取操作记录 **/
#define GetRecordPageURL [NSString stringWithFormat:@"%@%@",URL,@"/record/getGestationRecordByDeviceid"]
#define GetRecordPageURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/record/getGestationRecordByDeviceid"]
/*获取使用剩余次数*/
/*获取使用剩余次数*/
//#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getConLimitNum"]
//#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getConLimitNum"]
/*获取使用剩余次数*/
/*获取使用剩余次数*/
#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",URL,@"/ldm/api/getConLimitNum"]
#define GetConLimitNumURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/ldm/api/getConLimitNum"]
/*获取设备状态Dr-02-1 获取设备模单机或蓝牙*/
/*获取设备状态Dr-02-1 获取设备模单机或蓝牙*/
#define GetDeviceStausURL [NSString stringWithFormat:@"%@%@",URL,@"/openapi/device/getSpecialConf"]
#define GetDeviceStausURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/openapi/device/getSpecialConf"]
/*海菲秀获取设备是否保养*/
/*海菲秀获取设备是否保养*/
#define HFXGetDeviceUpkeep [NSString stringWithFormat:@"%@%@",URL,@"/hfx/shouldClean"]
#define HFXGetDeviceUpkeep [NSString stringWithFormat:@"%@%@",
DR
URL,@"/hfx/shouldClean"]
/*海菲秀更新保养状态*/
/*海菲秀更新保养状态*/
#define HFXUpdateUpkeep [NSString stringWithFormat:@"%@%@",URL,@"/hfx/updateLastCleanTime"]
#define HFXUpdateUpkeep [NSString stringWithFormat:@"%@%@",
DR
URL,@"/hfx/updateLastCleanTime"]
/*海菲秀获取视频列表*/
/*海菲秀获取视频列表*/
#define HFXGetVideoList [NSString stringWithFormat:@"%@%@",URL,@"/hfx/getVideo"]
#define HFXGetVideoList [NSString stringWithFormat:@"%@%@",
DR
URL,@"/hfx/getVideo"]
/** 固件url获取 **/
/** 固件url获取 **/
#define UpdateDeviceVersionURL [NSString stringWithFormat:@"%@%@",URL,@"/Facility/getUpdateMCUURL"]
#define UpdateDeviceVersionURL [NSString stringWithFormat:@"%@%@",
DR
URL,@"/Facility/getUpdateMCUURL"]
/*海菲秀获取BANNER列表*/
/*海菲秀获取BANNER列表*/
#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",URL,@"/hfx/getBanner"]
#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",DRURL,@"/hfx/banner"]
/*海菲秀获取BANNER列表*/
#define HFXGetGiftLink [NSString stringWithFormat:@"%@%@",DRURL,@"/ldm/api/openurl/faceAgeH5"]
#endif
/* XHURL_h */
#endif
/* XHURL_h */
DJMHomeTY/Global/Manager/XHDataManager.h
View file @
639593b5
...
@@ -123,6 +123,8 @@
...
@@ -123,6 +123,8 @@
///// 个人模型
///// 个人模型
@property
(
nonatomic
,
strong
)
XHDataModel
*
customerModel
;
@property
(
nonatomic
,
strong
)
XHDataModel
*
customerModel
;
@property
(
nonatomic
,
copy
)
NSString
*
giftLink
;
+
(
XHDataManager
*
)
sharedManager
;
+
(
XHDataManager
*
)
sharedManager
;
+
(
void
)
saveValue
:(
id
)
value
forKey
:
(
NSString
*
)
key
;
+
(
void
)
saveValue
:(
id
)
value
forKey
:
(
NSString
*
)
key
;
...
...
DJMHomeTY/Global/Manager/XHHttpRequestManager.m
View file @
639593b5
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
}
}
manager
.
requestSerializer
.
timeoutInterval
=
50
;
manager
.
requestSerializer
.
timeoutInterval
=
50
;
[
manager
.
requestSerializer
setValue
:[
NSString
stringWithFormat
:
@"%d"
,
XHGetDataManager
.
simparlanguage
]
forHTTPHeaderField
:
@"Accept-Language"
];
[
manager
.
requestSerializer
setValue
:[
NSString
stringWithFormat
:
@"%d"
,
XHGetDataManager
.
simparlanguage
]
forHTTPHeaderField
:
@"Accept-Language"
];
[
manager
.
requestSerializer
setValue
:
XHGetDataManager
.
token
forHTTPHeaderField
:
@"token"
];
NSLog
(
@"%d"
,
XHGetDataManager
.
simparlanguage
);
NSLog
(
@"%d"
,
XHGetDataManager
.
simparlanguage
);
[
manager
GET
:
url
parameters
:
updateDic
headers
:
nil
progress
:^
(
NSProgress
*
_Nonnull
downloadProgress
)
{
[
manager
GET
:
url
parameters
:
updateDic
headers
:
nil
progress
:^
(
NSProgress
*
_Nonnull
downloadProgress
)
{
...
...
DJMHomeTY/Page/DeviceListPage/Controller/DXBannerVC.m
View file @
639593b5
...
@@ -7,8 +7,18 @@
...
@@ -7,8 +7,18 @@
#import "DXBannerVC.h"
#import "DXBannerVC.h"
#import <WebKit/WebKit.h>
#import <WebKit/WebKit.h>
#import <CoreLocation/CoreLocation.h>
#import "MapKit/MapKit.h"
@interface
DXBannerVC
()
<
WKNavigationDelegate
,
WKUIDelegate
,
CLLocationManagerDelegate
>
{
CLLocationManager
*
locationmanager
;
//定位服务
NSString
*
strlatitude
;
//经度
NSString
*
strlongitude
;
//纬度
UIAlertController
*
alert
;
}
@interface
DXBannerVC
()
<
WKNavigationDelegate
,
WKUIDelegate
>
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
...
@@ -23,41 +33,155 @@
...
@@ -23,41 +33,155 @@
[
self
initData
];
[
self
initData
];
[
self
initUI
];
[
self
initUI
];
[
self
requestData
];
[
self
requestData
];
// [self startLocation];
}
}
#pragma mark --初始化UI
#pragma mark --初始化UI
-
(
void
)
initUI
-
(
void
)
initUI
{
{
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
// self.navigationController.navigationBar.hidden = YES;
[
self
.
view
addSubview
:
self
.
webView
];
[
self
.
view
addSubview
:
self
.
webView
];
[
self
.
webView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
webView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
equalTo
(
self
.
view
);
make
.
left
.
right
.
equalTo
(
self
.
view
);
make
.
top
.
mas_equalTo
(
HJNavHeight
);
make
.
top
.
mas_equalTo
(
0
);
make
.
bottom
.
mas_equalTo
(
self
.
view
).
offset
(
0
);
make
.
bottom
.
mas_equalTo
(
self
.
view
).
offset
(
0
);
}];
}];
}
}
//
#pragma mark --初始化数据
#pragma mark --初始化数据
-
(
void
)
initData
-
(
void
)
initData
{
{
[
self
.
webView
addObserver
:
self
forKeyPath
:
@"title"
options
:
NSKeyValueObservingOptionNew
context
:
NULL
];
[
self
.
webView
addObserver
:
self
forKeyPath
:
@"title"
options
:
NSKeyValueObservingOptionNew
context
:
NULL
];
[
self
.
webView
addObserver
:
self
forKeyPath
:
@"URL"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
}
}
#pragma mark --网络请求
#pragma mark --网络请求
-
(
void
)
requestData
-
(
void
)
requestData
{
{
if
(
!
self
.
url
||
[
self
.
url
isEqualToString
:
@""
])
{
// self.url = XHGetDataManager.giftLink;
self
.
url
=
[
NSString
stringWithFormat
:
@"%@?token=%@"
,
XHGetDataManager
.
giftLink
,
XHGetDataManager
.
token
];
self
.
navigationController
.
navigationBar
.
hidden
=
YES
;
}
else
{
self
.
navigationController
.
navigationBar
.
hidden
=
NO
;
}
//http://djmfa.imoreme.com/#/pages/goshop/goshop?token=
NSURL
*
url
=
[
NSURL
URLWithString
:
self
.
url
];
NSURL
*
url
=
[
NSURL
URLWithString
:
self
.
url
];
// 根据URL创建请求
// 根据URL创建请求
NSURLRequest
*
request
=
[
NSURLRequest
requestWithURL
:
url
];
// NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSMutableURLRequest
*
request
=
[
NSMutableURLRequest
requestWithURL
:
url
];
[
request
setValue
:
@"no-cache"
forHTTPHeaderField
:
@"Cache-Control"
];
// WKWebView加载请求
// WKWebView加载请求
[
self
.
webView
loadRequest
:
request
];
[
self
.
webView
loadRequest
:
request
];
}
}
#pragma mark --交互方法
#pragma mark --交互方法
-
(
void
)
setUrl
:
(
NSString
*
)
url
{
// url = @"https://www.baidu.com";
_url
=
url
;
NSURL
*
url1
=
[
NSURL
URLWithString
:
url
];
// 根据URL创建请求
NSMutableURLRequest
*
request
=
[
NSMutableURLRequest
requestWithURL
:
url1
];
[
request
setValue
:
@"no-cache"
forHTTPHeaderField
:
@"Cache-Control"
];
// NSURLRequest *request = [NSURLRequest requestWithURL:url1];
// WKWebView加载请求
[
self
.
webView
loadRequest
:
request
];
}
#pragma mark --委托代理
#pragma mark --委托代理
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
([
keyPath
isEqualToString
:
@"title"
])
{
if
([
keyPath
isEqualToString
:
@"title"
])
{
NSString
*
title
=
(
NSString
*
)
change
[
NSKeyValueChangeNewKey
];
// NSString *title = (NSString *)change[NSKeyValueChangeNewKey];
self
.
title
=
title
;
// self.title = title;
}
else
if
([
keyPath
isEqualToString
:
@"URL"
]){
NSURL
*
url
=
(
NSURL
*
)
change
[
NSKeyValueChangeNewKey
];
// https://map.qq.com/nav/drive#routes/page?eword=%E6%B5%8B&epointx=113.93041&epointy=22.53332&noback=&referer=groupActivity&ch=mc_h5marker
// dispatch_async(dispatch_get_main_queue(), ^{
if
([
url
.
absoluteString
rangeOfString
:
@"map.qq.com/m/mqq/nav/"
].
location
!=
NSNotFound
)
{
NSString
*
pattern
=
@"eword=([^&]+).*?epointx=([^&]+).*?epointy=([^&]+)"
;
NSRegularExpression
*
regex
=
[
NSRegularExpression
regularExpressionWithPattern
:
pattern
options
:
0
error
:
nil
];
// 在 URL 字符串中搜索匹配的内容
NSTextCheckingResult
*
result
=
[
regex
firstMatchInString
:
url
.
absoluteString
options
:
0
range
:
NSMakeRange
(
0
,
url
.
absoluteString
.
length
)];
// 如果找到匹配项,则提取相应的值
NSString
*
eword
=
[
url
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
1
]];
NSString
*
epointx
=
[
url
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
2
]];
NSString
*
epointy
=
[
url
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
3
]];
// 打印提取到的值
NSLog
(
@"eword: %@"
,
eword
);
NSLog
(
@"epointx: %@"
,
epointx
);
NSLog
(
@"epointy: %@"
,
epointy
);
// 创建一个MKPlacemark对象,表示目标位置的地标
MKPlacemark
*
placemark
=
[[
MKPlacemark
alloc
]
initWithCoordinate
:
CLLocationCoordinate2DMake
([
epointy
doubleValue
],
[
epointx
doubleValue
])];
// 创建一个MKMapItem对象,表示要在地图中显示的位置
MKMapItem
*
mapItem
=
[[
MKMapItem
alloc
]
initWithPlacemark
:
placemark
];
[
mapItem
setName
:[
eword
stringByRemovingPercentEncoding
]];
// 设置地点的名称,可选
[
mapItem
openInMapsWithLaunchOptions
:@{
MKLaunchOptionsDirectionsModeKey
:
MKLaunchOptionsDirectionsModeDriving
,
MKLaunchOptionsShowsTrafficKey
:
[
NSNumber
numberWithBool
:
YES
]}];
// 使用mapItem打开苹果地图应用
// [mapItem openInMapsWithLaunchOptions:nil];
}
// });
// https://mapapi.qq.com/web/mapComponents/locationMarker/v/index.html?marker=coord:22.53332,113.93041;title:测;addr:给对方Fghh
}
}
// [_webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}
}
-
(
void
)
webView
:
(
WKWebView
*
)
webView
decidePolicyForNavigationAction
:
(
WKNavigationAction
*
)
navigationAction
decisionHandler
:
(
void
(
^
)(
WKNavigationActionPolicy
))
decisionHandler
{
// decisionHandler(WKNavigationActionPolicyAllow);
// 允许链接跳转
if
([
navigationAction
.
request
.
URL
.
absoluteString
rangeOfString
:
@"map.qq.com/m/mqq/nav/"
].
location
!=
NSNotFound
)
{
NSString
*
pattern
=
@"eword=([^&]+).*?epointx=([^&]+).*?epointy=([^&]+)"
;
NSRegularExpression
*
regex
=
[
NSRegularExpression
regularExpressionWithPattern
:
pattern
options
:
0
error
:
nil
];
// 在 URL 字符串中搜索匹配的内容
NSTextCheckingResult
*
result
=
[
regex
firstMatchInString
:
navigationAction
.
request
.
URL
.
absoluteString
options
:
0
range
:
NSMakeRange
(
0
,
navigationAction
.
request
.
URL
.
absoluteString
.
length
)];
// 如果找到匹配项,则提取相应的值
if
(
result
)
{
NSString
*
eword
=
[
navigationAction
.
request
.
URL
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
1
]];
NSString
*
epointx
=
[
navigationAction
.
request
.
URL
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
2
]];
NSString
*
epointy
=
[
navigationAction
.
request
.
URL
.
absoluteString
substringWithRange
:[
result
rangeAtIndex
:
3
]];
// 打印提取到的值
NSLog
(
@"eword: %@"
,
eword
);
NSLog
(
@"epointx: %@"
,
epointx
);
NSLog
(
@"epointy: %@"
,
epointy
);
// 创建一个MKPlacemark对象,表示目标位置的地标
MKPlacemark
*
placemark
=
[[
MKPlacemark
alloc
]
initWithCoordinate
:
CLLocationCoordinate2DMake
([
epointy
doubleValue
],
[
epointx
doubleValue
])];
// 创建一个MKMapItem对象,表示要在地图中显示的位置
MKMapItem
*
mapItem
=
[[
MKMapItem
alloc
]
initWithPlacemark
:
placemark
];
[
mapItem
setName
:[
eword
stringByRemovingPercentEncoding
]];
// 设置地点的名称,可选
// 设置地图选项
// NSDictionary *options = @{
// MKLaunchOptionsMapCenterKey: [NSValue valueWithMKCoordinate:placemark.coordinate],
// MKLaunchOptionsMapSpanKey: [NSValue valueWithMKCoordinateSpan:MKCoordinateSpanMake(0.01, 0.01)]
// };
[
mapItem
openInMapsWithLaunchOptions
:@{
MKLaunchOptionsDirectionsModeKey
:
MKLaunchOptionsDirectionsModeDriving
,
MKLaunchOptionsShowsTrafficKey
:
[
NSNumber
numberWithBool
:
YES
]}];
// 使用mapItem打开苹果地图应用,并指定选项
// [mapItem openInMapsWithLaunchOptions:options];
}
decisionHandler
(
WKNavigationActionPolicyCancel
);
}
else
{
decisionHandler
(
WKNavigationActionPolicyAllow
);
}
}
#pragma mark --懒加载
#pragma mark --懒加载
-
(
WKWebView
*
)
webView
-
(
WKWebView
*
)
webView
{
{
...
@@ -76,12 +200,63 @@
...
@@ -76,12 +200,63 @@
// 初始化WKWebView
// 初始化WKWebView
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
configuration
:
configuration
];
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
configuration
:
configuration
];
// self.edgesForExtendedLayout = false;
// 有两种代理,UIDelegate负责界面弹窗,navigationDelegate负责加载、跳转等
// 有两种代理,UIDelegate负责界面弹窗,navigationDelegate负责加载、跳转等
_webView
.
UIDelegate
=
self
;
_webView
.
UIDelegate
=
self
;
_webView
.
navigationDelegate
=
self
;
_webView
.
navigationDelegate
=
self
;
}
}
return
_webView
;
return
_webView
;
}
}
-
(
void
)
startLocation
{
//判断定位功能是否打开
if
([
CLLocationManager
locationServicesEnabled
])
{
locationmanager
=
[[
CLLocationManager
alloc
]
init
];
locationmanager
.
delegate
=
self
;
[
locationmanager
requestAlwaysAuthorization
];
[
locationmanager
requestWhenInUseAuthorization
];
//设置寻址精度
locationmanager
.
distanceFilter
=
kCLDistanceFilterNone
;
//实时更新定位位置
locationmanager
.
pausesLocationUpdatesAutomatically
=
NO
;
locationmanager
.
desiredAccuracy
=
kCLLocationAccuracyBest
;
locationmanager
.
distanceFilter
=
5
.
0
;
[
locationmanager
startUpdatingLocation
];
}
else
{
// WFUserInfo *info = [WFUserInfo share];
//
// [self checkAuth:@"定位服务已关闭 您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【洗脸猫】的定位服务"];
}
}
//开始定位
-
(
void
)
startLocations
{
//判断定位功能是否打开
if
([
CLLocationManager
authorizationStatus
]
==
kCLAuthorizationStatusDenied
)
{
// locationmanager = [[CLLocationManager alloc]init];
// locationmanager.delegate = self;
// [locationmanager requestAlwaysAuthorization];
// [locationmanager requestWhenInUseAuthorization];
//
// //设置寻址精度
// locationmanager.desiredAccuracy = kCLLocationAccuracyBest;
// locationmanager.distanceFilter = 5.0;
// [locationmanager startUpdatingLocation];
return
;
}
else
{
// WFUserInfo *info = [WFUserInfo share];
// [self checkAuth:@"定位服务已关闭 您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【】的定位服务"];
// [SVProgressHUD dismiss];
return
;
}
}
@end
@end
DJMHomeTY/Page/DeviceListPage/Controller/DXDeviceListVC.m
View file @
639593b5
...
@@ -114,8 +114,16 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
...
@@ -114,8 +114,16 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
DXBannerVC
*
banner
=
[
DXBannerVC
new
];
DXBannerVC
*
banner
=
[
DXBannerVC
new
];
banner
.
url
=
weakSelf
.
linkArray
[
index
];
banner
.
url
=
weakSelf
.
linkArray
[
index
];
if
(
banner
.
url
&&
!
[
banner
.
url
isEqualToString
:
@""
]){
if
(
banner
.
url
&&
!
[
banner
.
url
isEqualToString
:
@""
]){
banner
.
hidesBottomBarWhenPushed
=
YES
;
[
weakSelf
.
navigationController
pushViewController
:
banner
animated
:
YES
];
if
([
banner
.
url
containsString
:
@"http://djmfa.imoreme.com"
])
{
banner
.
hidesBottomBarWhenPushed
=
YES
;
[
weakSelf
.
tabBarController
setSelectedIndex
:
1
];
}
else
{
[
weakSelf
.
navigationController
pushViewController
:
banner
animated
:
YES
];
}
//
}
else
{
}
else
{
}
}
...
@@ -140,7 +148,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
...
@@ -140,7 +148,7 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
weakSelf
.
linkArray
=
[
NSMutableArray
array
];
weakSelf
.
linkArray
=
[
NSMutableArray
array
];
for
(
XHBannerModel
*
model
in
weakSelf
.
bannerArray
)
{
for
(
XHBannerModel
*
model
in
weakSelf
.
bannerArray
)
{
[
urlArray
addObject
:
model
.
imgUrl
];
[
urlArray
addObject
:
model
.
imgUrl
];
[
weakSelf
.
linkArray
addObject
:
model
.
l
ink
];
[
weakSelf
.
linkArray
addObject
:
model
.
imgL
ink
];
}
}
if
(
TargetType
==
5
&&
weakSelf
.
bannerArray
.
count
>
0
)
{
if
(
TargetType
==
5
&&
weakSelf
.
bannerArray
.
count
>
0
)
{
...
...
DJMHomeTY/Page/DeviceListPage/Model/XHDeviceListModel.h
View file @
639593b5
...
@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
)
NSString
*
imgUrl
;
@property
(
nonatomic
,
copy
)
NSString
*
imgUrl
;
@property
(
nonatomic
,
copy
)
NSString
*
l
ink
;
@property
(
nonatomic
,
copy
)
NSString
*
imgL
ink
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment