Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoorLock
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
felix
DoorLock
Commits
29132d8d
Commit
29132d8d
authored
Dec 19, 2017
by
felix
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zjx'
parents
669e0628
57788686
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
3 deletions
+51
-3
dev/src/public/public.js
+51
-3
No files found.
dev/src/public/public.js
View file @
29132d8d
...
...
@@ -209,7 +209,7 @@ iot.navigator.closeAll = function (){
}
iot
.
ready
(
function
(){
plus
.
key
.
addEventListener
(
'backbutton'
,
iot
.
navigator
.
aback
,
false
);
//
plus.key.addEventListener('backbutton',iot.navigator.aback,false);
})
iot
.
navigator
.
aback
=
function
(){
...
...
@@ -287,6 +287,45 @@ iot.navigator.getCurrentWebView = function (){
// window.clearTimeout(timeout);
//}
//
//function sendRequest(url, params, canSend){
// var opts = {
// type: 'post',
// data: params.data,
// success: params.success,
// error: params.error,
// complete: params.complete
// };
// canSend = false;
// requestsend(url, {
// type: 'post',
// data: {
// params.data
// },
// success: (response) => {
// intervalcb.success(response);
// if(stopcondition(response)){
// params.success(response);
// clearTime(handle, time);
// canSend = false;
// }else{
// canSend = true;
// }
// },
// error: (error) => {
// intervalcb.error(error);
// //在intervalcb.error(error)中返回的如果是true则继续执行,否则结束轮询
// if(intervalcb.error(error)){
// canSend = true;
// }else{
// params.error(error);
// clearTime(handle, time);
// }
// },
// complete: {}
// }, true, false);
// return canSend;
//}
//
//uComponents.loop = function(request, timeout, interval, fincb, stopcondition){
// var handle = null;
// var time = null;
...
...
@@ -295,12 +334,18 @@ iot.navigator.getCurrentWebView = function (){
// var intervalTime = interval.delay;
// var intervalcb = interval.opts;
// var flag = true;
// var canSend = true;
// var canDo = true;
// var i = 0;
// time = setTimeout(function(){
// clearTime(handle, time);
// intervalcb.error('timeout');
// fincb.error('timeout');
// },timeout);
// var watcher = setInterval(function(){
// if(canSend && canDo){
// var send = sendRequest(url, opts, canSend, canDo);
// }
// },1000);
// //一开始执行一次,发送一次请求
// requestsend(url, {
// data: {},
...
...
@@ -328,9 +373,12 @@ iot.navigator.getCurrentWebView = function (){
// flag = true;
// },
// error: (error) => {
// intervalcb.error(error);
// if(intervalcb.error(error)){
// flag = false;
// }else{
// fincb.error(error);
// clearTime(handle, time);
// }
// },
// complete: {}
// }, i);
...
...
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