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
朱建香
DoorLock
Commits
98765389
Commit
98765389
authored
Dec 19, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2017/12/18
1.修改退出登陆时关闭页面动画闪动bug 2.重写需要刷新页面的mui.back方法 3.cid的条件之中增加不等于‘null’
parent
95faa338
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
274 additions
and
216 deletions
+274
-216
dev/src/public/public.js
+165
-115
dev/src/public/unotify.js
+34
-44
dev/src/view/addDevice/v_wifiAdd.js
+1
-1
dev/src/view/device/v_alarmInfo.js
+1
-1
dev/src/view/device/v_hijackRecord.js
+1
-1
dev/src/view/device/v_index.js
+8
-2
dev/src/view/device/v_opendoorRecord.js
+1
-1
dev/src/view/doorlockManage/v_index.js
+1
-1
dev/src/view/doorlockUsers/v_addUnlockInfo.js
+1
-1
dev/src/view/doorlockUsers/v_doorlockUser.js
+1
-1
dev/src/view/doorlockUsers/v_index.js
+1
-1
dev/src/view/doorlockUsers/v_inviteBind.js
+7
-3
dev/src/view/login/v_index.js
+8
-1
dev/src/view/myInfo/v_editNickname.js
+1
-1
dev/src/view/myInfo/v_index.js
+43
-42
No files found.
dev/src/public/public.js
View file @
98765389
...
@@ -108,6 +108,45 @@ uPublic.closeSlideBack = function (){
...
@@ -108,6 +108,45 @@ uPublic.closeSlideBack = function (){
});
});
}
}
//logout退出
uPublic
.
logout
=
function
(
opts
){
iot
.
business
.
user
.
logout
({
data
:
opts
.
data
,
success
:
(
response
)
=>
{
console
.
log
(
"sdsLogout:"
+
response
);
var
sdsResponse
=
response
;
iot
.
business
.
api
.
send
(
'user/logout'
,{
data
:
{
key
:
[
'clienId'
]
},
success
:
(
response
)
=>
{
console
.
log
(
"logout"
+
response
)
iot
.
business
.
websql
.
delMaps
([
'utoken'
,
'userinfo'
],
(
response
)
=>
{
iot
.
storage
.
delMaps
([
'notifyTime'
,
'alarmTime'
,
'openTime'
],
(
response
)
=>
{
console
.
log
(
"clearMap"
+
response
);
opts
.
success
(
sdsResponse
);
},
(
error
)
=>
{
opts
.
error
(
error
);
});
},
(
error
)
=>
{
opts
.
error
(
error
);
});
},
error
:
(
error
)
=>
{
opts
.
error
(
error
);
},
complete
:
()
=>
{
opts
.
complete
();
}
},
true
,
false
);
},
error
:
(
error
)
=>
{
opts
.
error
(
error
);
},
complete
:
()
=>
{}
});
}
iot
.
ready
(()
=>
{
iot
.
ready
(()
=>
{
uPublic
.
recalc
();
uPublic
.
recalc
();
});
});
...
@@ -147,15 +186,20 @@ iot.navigator.trigger = function (element, eventType, eventData) {
...
@@ -147,15 +186,20 @@ iot.navigator.trigger = function (element, eventType, eventData) {
};
};
iot
.
navigator
.
closeAllBesidesItself
=
function
()
{
iot
.
navigator
.
closeAllBesidesItself
=
function
()
{
var
wvs
=
plus
.
webview
.
all
();
setTimeout
(
function
()
{
var
curWb
=
plus
.
webview
.
currentWebview
();
var
wvs
=
plus
.
webview
.
all
();
for
(
var
i
=
0
;
i
<
wvs
.
length
-
1
;
i
++
)
{
var
page
=
plus
.
webview
.
currentWebview
();
if
(
wvs
[
i
].
id
!=
curWb
.
id
)
{
for
(
var
i
=
0
;
i
<
wvs
.
length
;
i
++
)
{
wvs
[
i
].
close
();
if
(
wvs
[
i
].
id
!=
page
.
id
&&
wvs
[
i
])
{
}
// wvs[i].close();
}
plus
.
webview
.
close
(
wvs
[
i
],
"none"
,
0
,{});
}
}
var
wvs
=
plus
.
webview
.
all
();
},
500
);
}
}
iot
.
navigator
.
closeAll
=
function
(){
iot
.
navigator
.
closeAll
=
function
(){
var
wvs
=
plus
.
webview
.
all
();
var
wvs
=
plus
.
webview
.
all
();
var
curWb
=
plus
.
webview
.
currentWebview
();
var
curWb
=
plus
.
webview
.
currentWebview
();
...
@@ -165,9 +209,13 @@ iot.navigator.closeAll = function (){
...
@@ -165,9 +209,13 @@ iot.navigator.closeAll = function (){
}
}
iot
.
ready
(
function
(){
iot
.
ready
(
function
(){
//
plus.key.addEventListener('backbutton',iot.navigator.aback,false);
plus
.
key
.
addEventListener
(
'backbutton'
,
iot
.
navigator
.
aback
,
false
);
})
})
iot
.
navigator
.
aback
=
function
(){
mui
.
back
();
}
var
__back__first
=
null
;
var
__back__first
=
null
;
mui
.
back
=
function
(){
mui
.
back
=
function
(){
...
@@ -223,118 +271,119 @@ mui.back = function(){
...
@@ -223,118 +271,119 @@ mui.back = function(){
}
}
}
}
iot
.
navigator
.
getCurrentWebView
=
function
(){
iot
.
navigator
.
getCurrentWebView
=
function
(){
return
plus
.
webview
.
currentWebview
();
return
plus
.
webview
.
currentWebview
();
}
}
function
requestsend
(
url
,
opts
,
i
){
let
data
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
];
opts
.
success
(
data
[
i
]);
}
function
clearTime
(
interval
,
timeout
){
window
.
clearInterval
(
interval
);
window
.
clearTimeout
(
timeout
);
}
uComponents
.
loop
=
function
(
request
,
timeout
,
interval
,
fincb
,
stopcondition
){
var
handle
=
null
;
var
time
=
null
;
var
url
=
request
.
url
;
var
opts
=
request
.
opts
;
var
intervalTime
=
interval
.
delay
;
var
intervalcb
=
interval
.
opts
;
var
flag
=
true
;
var
i
=
0
;
time
=
setTimeout
(
function
(){
clearTime
(
handle
,
time
);
intervalcb
.
error
(
'timeout'
);
fincb
.
error
(
'timeout'
);
},
timeout
);
//一开始执行一次,发送一次请求
requestsend
(
url
,
{
data
:
{},
success
:
(
response
)
=>
{
intervalcb
.
success
(
response
);
if
(
stopcondition
(
response
)){
//首次请求结果符合条件的话,结束整个方法
fincb
.
success
(
response
);
clearTime
(
handle
,
time
);
}
else
{
//首次请求结果不符合条件的话,每隔intervalTime时间发送请求
handle
=
setInterval
(()
=>
{
i
++
;
console
.
log
(
i
);
if
(
flag
){
flag
=
false
;
requestsend
(
url
,
{
data
:
{},
success
:
(
response
)
=>
{
intervalcb
.
success
(
response
);
if
(
stopcondition
(
response
)){
fincb
.
success
(
response
);
clearTime
(
handle
,
time
);
}
flag
=
true
;
},
error
:
(
error
)
=>
{
intervalcb
.
error
(
error
);
fincb
.
error
(
error
);
clearTime
(
handle
,
time
);
},
complete
:
{}
},
i
);
}
},
intervalTime
);
}
},
error
:
(
error
)
=>
{
intervalcb
.
error
(
error
);
fincb
.
error
(
error
);
clearTime
(
handle
,
time
);
},
complete
:
{}
},
0
);
}
//传递的参数依次是:
//function requestsend(url, opts, i){
//1.request: 请求参数(数据类型: map,包括:url、header等);
// let data = [0,0,0,0,0,0,0,1,0,0,0];
//2.timeout: 整个方法的超时时间;
// opts.success(data[i]);
//3.interval: 发送请求的间隔时间、callback;
//}
//4.fincb: 整个方法的callback;
//
//5.stopcondition: 请求停止所要符合的条件
//function clearTime(interval, timeout){
uComponents
.
loop
({
url
:
'getLockInfo'
,
opts
:
{
// window.clearInterval(interval);
success
:
(
response
)
=>
{
// window.clearTimeout(timeout);
console
.
log
(
response
);
//}
},
//
error
:
(
error
)
=>
{
//uComponents.loop = function(request, timeout, interval, fincb, stopcondition){
console
.
log
(
error
);
// var handle = null;
}
// var time = null;
}},
8000
,
{
// var url = request.url;
delay
:
1000
,
// var opts = request.opts;
opts
:
{
// var intervalTime = interval.delay;
success
:
(
response
)
=>
{
// var intervalcb = interval.opts;
console
.
log
(
'intervalcbSuccess:'
+
response
);
// var flag = true;
},
// var i = 0;
error
:
(
error
)
=>
{
// time = setTimeout(function(){
console
.
log
(
'intervalcbSuccess:'
+
error
);
// clearTime(handle, time);
}
// intervalcb.error('timeout');
}
// fincb.error('timeout');
},
{
// },timeout);
success
:
(
response
)
=>
{
// //一开始执行一次,发送一次请求
console
.
log
(
'fincbSuccess:'
+
response
);
// requestsend(url, {
},
// data: {},
error
:
(
error
)
=>
{
// success: (response) => {
console
.
log
(
'fincbError'
+
error
);
// intervalcb.success(response);
}
// if(stopcondition(response)){
},
(
response
)
=>
{
// //首次请求结果符合条件的话,结束整个方法
if
(
response
==
1
){
// fincb.success(response);
return
true
;
// clearTime(handle, time);
}
else
{
// }else{
return
false
;
// //首次请求结果不符合条件的话,每隔intervalTime时间发送请求
}
// handle = setInterval(() => {
});
// i++;
// console.log(i);
// if(flag){
// flag = false;
// requestsend(url, {
// data: {},
// success: (response) => {
// intervalcb.success(response);
// if(stopcondition(response)){
// fincb.success(response);
// clearTime(handle, time);
// }
// flag = true;
// },
// error: (error) => {
// intervalcb.error(error);
// fincb.error(error);
// clearTime(handle, time);
// },
// complete: {}
// }, i);
// }
// },intervalTime);
// }
// },
// error: (error) => {
// intervalcb.error(error);
// fincb.error(error);
// clearTime(handle, time);
// },
// complete: {}
// }, 0);
//
//}
//
////传递的参数依次是:
////1.request: 请求参数(数据类型: map,包括:url、header等);
////2.timeout: 整个方法的超时时间;
////3.interval: 发送请求的间隔时间、callback;
////4.fincb: 整个方法的callback;
////5.stopcondition: 请求停止所要符合的条件
//uComponents.loop({url:'getLockInfo',opts: {
// success: (response) => {
// console.log(response);
// },
// error: (error) => {
// console.log(error);
// }
//}}, 8000, {
// delay: 1000,
// opts: {
// success: (response) => {
// console.log('intervalcbSuccess:'+response);
// },
// error: (error) => {
// console.log('intervalcbSuccess:'+error);
// }
// }
//}, {
// success: (response) => {
// console.log('fincbSuccess:'+response);
// },
// error: (error) => {
// console.log('fincbError'+error);
// }
//}, (response) => {
// if(response == 1){
// return true;
// }else{
// return false;
// }
//});
export
{
iot
,
uPublic
,
uComponents
}
export
{
iot
,
uPublic
,
uComponents
}
\ No newline at end of file
dev/src/public/unotify.js
View file @
98765389
...
@@ -35,7 +35,7 @@ class unotify{
...
@@ -35,7 +35,7 @@ class unotify{
i
++
;
i
++
;
cid
=
self
.
getCidOnce
(
i
);
cid
=
self
.
getCidOnce
(
i
);
console
.
log
(
"第"
+
i
+
"次"
+
"获取的cid为"
+
cid
);
console
.
log
(
"第"
+
i
+
"次"
+
"获取的cid为"
+
cid
);
if
(
cid
!=
null
||
i
>=
times
){
if
(
cid
!=
null
&&
cid
!=
'null'
||
i
>=
times
){
window
.
clearInterval
(
handle
);
window
.
clearInterval
(
handle
);
resolve
(
cid
);
resolve
(
cid
);
}
else
{
}
else
{
...
@@ -43,7 +43,7 @@ class unotify{
...
@@ -43,7 +43,7 @@ class unotify{
i
++
;
i
++
;
cid
=
self
.
getCidOnce
(
i
);
cid
=
self
.
getCidOnce
(
i
);
console
.
log
(
"第"
+
i
+
"次"
+
"获取的cid为"
+
cid
);
console
.
log
(
"第"
+
i
+
"次"
+
"获取的cid为"
+
cid
);
if
(
cid
!=
null
||
i
>=
times
){
if
(
cid
!=
null
&&
cid
!=
'null'
||
i
>=
times
){
window
.
clearInterval
(
handle
);
window
.
clearInterval
(
handle
);
resolve
(
cid
);
resolve
(
cid
);
}
}
...
@@ -65,48 +65,37 @@ class unotify{
...
@@ -65,48 +65,37 @@ class unotify{
}
}
}
}
//长期不断循环获取cid,并更新cid
//长期不断循环获取cid,并更新cid
static
updateCid
(
successCallback
,
errorCallback
){
// static async getCid(successCallback, errorCallback){
var
cid
=
null
;
// var cid = null;
var
oldCid
=
null
;
// var oldCid = null;
iot
.
storage
.
getMap
(
'clientId'
,
async
(
res
)
=>
{
// try{
oldCid
=
res
;
// cid = await this.getCidPeriotic(9);
console
.
log
(
"原来的cid为"
+
oldCid
);
// if(cid != null && cid != oldCid){
try
{
// successCallback('cid updateSuccess');
cid
=
await
this
.
getCidPeriotic
(
9
);
// iot.business.api.send('user/updateCid',{
if
(
cid
!=
null
&&
cid
!=
oldCid
){
// data: {
//更新缓存并发送请求更新clientId
// clienId: cid
if
(
typeof
successCallback
==
'function'
){
// },
iot
.
storage
.
setMap
(
'clientId'
,
cid
,
(
res
)
=>
{
// success: (response) => {
console
.
log
(
"更新后的cid为"
+
cid
);
// if(typeof successCallback == 'function'){
successCallback
(
'cid updateSuccess'
);
// uccessCallback('cid updateSuccess');
// iot.business.api.send('user/updateCid',{
// data: {
// clientId: cid
// },
// success: (response) => {
// console.log(response);
// },
// error: (error) => {
// console.log(error);
// }
// }
// }, false);
// },
},
()
=>
{
// error: (error) => {
});
// console.log(error);
}
// errorCallback(error);
}
else
{
// }
successCallback
(
'cid未更新'
);
// }, true, false);
}
// }else{
}
// successCallback('cid not updated');
catch
(
err
){
// }
console
.
log
(
err
);
// }
if
(
typeof
errorCallback
==
'function'
){
// catch (err){
errorCallback
(
a
);
// console.log(err);
}
// if(typeof errorCallback == 'function'){
}
// errorCallback(err);
},
(
err
)
=>
{
// }
console
.
log
(
err
);
// }
});
// }
}
}
}
export
default
unotify
;
export
default
unotify
;
\ No newline at end of file
dev/src/view/addDevice/v_wifiAdd.js
View file @
98765389
...
@@ -135,7 +135,7 @@ function passwordChange(self,text){
...
@@ -135,7 +135,7 @@ function passwordChange(self,text){
console
.
log
(
'passwordChange: '
+
self
.
textPassword
);
console
.
log
(
'passwordChange: '
+
self
.
textPassword
);
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{
});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{
});
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
...
...
dev/src/view/device/v_alarmInfo.js
View file @
98765389
...
@@ -149,7 +149,7 @@ function backTap(){
...
@@ -149,7 +149,7 @@ function backTap(){
iot
.
navigator
.
aback
();
iot
.
navigator
.
aback
();
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/device/v_hijackRecord.js
View file @
98765389
...
@@ -170,7 +170,7 @@ function backTap(){
...
@@ -170,7 +170,7 @@ function backTap(){
iot
.
navigator
.
aback
();
iot
.
navigator
.
aback
();
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/device/v_index.js
View file @
98765389
...
@@ -18,6 +18,9 @@ function init() {
...
@@ -18,6 +18,9 @@ function init() {
uPublic
.
closeSlideBack
();
uPublic
.
closeSlideBack
();
//通用 图片轮播、跑马灯、开关、按钮、dialog、loading组件
//通用 图片轮播、跑马灯、开关、按钮、dialog、loading组件
uPublic
.
componentsInit
([
'u-carousel'
,
'u-marquee'
,
'u-switch'
,
'u-button'
,
'u-dialog'
,
'u-loading'
,
'u-text'
,
'u-comm-loading'
]);
uPublic
.
componentsInit
([
'u-carousel'
,
'u-marquee'
,
'u-switch'
,
'u-button'
,
'u-dialog'
,
'u-loading'
,
'u-text'
,
'u-comm-loading'
]);
if
(
iot
.
navigator
.
getExtras
().
needClose
){
iot
.
navigator
.
closeAllBesidesItself
();
}
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//开门记录
//开门记录
...
@@ -101,9 +104,9 @@ function init() {
...
@@ -101,9 +104,9 @@ function init() {
remoteTime
:
null
remoteTime
:
null
},
},
mounted
(){
mounted
(){
uComponents
.
showLoading
(
this
);
notificationListener
(
this
);
notificationListener
(
this
);
let
self
=
this
;
let
self
=
this
;
iot
.
navigator
.
closeAllBesidesItself
();
//获取设备信息
//获取设备信息
getDevices
(
this
);
getDevices
(
this
);
//注册监听上报
//注册监听上报
...
@@ -482,6 +485,7 @@ function getDevices(self){
...
@@ -482,6 +485,7 @@ function getDevices(self){
self
.
hijackAlarmFlag
=
false
;
self
.
hijackAlarmFlag
=
false
;
self
.
setRemoteOpendoorDisabledFlag
(
true
);
self
.
setRemoteOpendoorDisabledFlag
(
true
);
self
.
setValueRemoteOpendoor
(
0
);
self
.
setValueRemoteOpendoor
(
0
);
uComponents
.
hideLoading
(
self
);
}
}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
...
@@ -493,7 +497,8 @@ function getDevices(self){
...
@@ -493,7 +497,8 @@ function getDevices(self){
iotDebug
.
upload
(
iot
,
'获取设备信息'
);
iotDebug
.
upload
(
iot
,
'获取设备信息'
);
}
}
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
}
},
complete
:
()
=>
{}
});
});
}
}
...
@@ -714,6 +719,7 @@ function getLockInfo(self){
...
@@ -714,6 +719,7 @@ function getLockInfo(self){
console
.
log
(
error
);
console
.
log
(
error
);
},
},
complete
:
()
=>
{
complete
:
()
=>
{
uComponents
.
hideLoading
(
self
);
}
}
});
});
}
}
...
...
dev/src/view/device/v_opendoorRecord.js
View file @
98765389
...
@@ -107,7 +107,7 @@ function backTap(){
...
@@ -107,7 +107,7 @@ function backTap(){
iot
.
navigator
.
aback
();
iot
.
navigator
.
aback
();
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/doorlockManage/v_index.js
View file @
98765389
...
@@ -262,7 +262,7 @@ function backTap(){
...
@@ -262,7 +262,7 @@ function backTap(){
iot
.
navigator
.
aback
();
iot
.
navigator
.
aback
();
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/doorlockUsers/v_addUnlockInfo.js
View file @
98765389
...
@@ -290,7 +290,7 @@ function sleep(time){
...
@@ -290,7 +290,7 @@ function sleep(time){
})
})
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
...
...
dev/src/view/doorlockUsers/v_doorlockUser.js
View file @
98765389
...
@@ -292,7 +292,7 @@ function setUserInfo(self, data){
...
@@ -292,7 +292,7 @@ function setUserInfo(self, data){
self
.
setUnbindShowFlag
(
data
.
user_id
?
true
:
false
);
self
.
setUnbindShowFlag
(
data
.
user_id
?
true
:
false
);
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
let
opener
=
plus
.
webview
.
currentWebview
().
opener
();
let
opener
=
plus
.
webview
.
currentWebview
().
opener
();
if
(
opener
.
id
==
'addUser'
){
if
(
opener
.
id
==
'addUser'
){
opener
.
close
();
opener
.
close
();
...
...
dev/src/view/doorlockUsers/v_index.js
View file @
98765389
...
@@ -209,7 +209,7 @@ function backTap(){
...
@@ -209,7 +209,7 @@ function backTap(){
iot
.
navigator
.
aback
();
iot
.
navigator
.
aback
();
}
}
iot
.
navigator
.
a
back
=
function
(){
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/doorlockUsers/v_inviteBind.js
View file @
98765389
...
@@ -77,9 +77,13 @@ function initComponentsConfig() {
...
@@ -77,9 +77,13 @@ function initComponentsConfig() {
//tap <
//tap <
function
backTap
(){
function
backTap
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
aback
();
console
.
log
(
'returnPage'
);
}
iot
.
navigator
.
back
();
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
}
}
//tap 重新生成二维码
//tap 重新生成二维码
...
...
dev/src/view/login/v_index.js
View file @
98765389
...
@@ -15,6 +15,10 @@ function init() {
...
@@ -15,6 +15,10 @@ function init() {
//通用 dialog、loading组件
//通用 dialog、loading组件
uPublic
.
componentsInit
([
'u-dialog'
,
'u-loading'
,
'u-button'
]);
uPublic
.
componentsInit
([
'u-dialog'
,
'u-loading'
,
'u-button'
]);
uPublic
.
closeSlideBack
();
uPublic
.
closeSlideBack
();
//是否需要关闭其他页面
if
(
iot
.
navigator
.
getExtras
().
needClose
){
iot
.
navigator
.
closeAllBesidesItself
();
}
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//配置组件
//配置组件
...
@@ -193,7 +197,10 @@ function cloudsLogin(self, id){
...
@@ -193,7 +197,10 @@ function cloudsLogin(self, id){
iot
.
business
.
websql
.
setMaps
(
infoArray
,
()
=>
{
iot
.
business
.
websql
.
setMaps
(
infoArray
,
()
=>
{
iot
.
navigator
.
openWindow
({
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
url
:
'../device/index.html'
,
id
:
'device'
id
:
'device'
,
extras
:
{
needClose
:
true
}
});
});
},
(
error
)
=>
{
},
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
...
dev/src/view/myInfo/v_editNickname.js
View file @
98765389
...
@@ -108,7 +108,7 @@ function saveTap(self){
...
@@ -108,7 +108,7 @@ function saveTap(self){
}
}
}
}
iot
.
navigator
.
aback
=
function
(){
mui
.
back
()
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{
});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{
});
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
...
...
dev/src/view/myInfo/v_index.js
View file @
98765389
...
@@ -108,12 +108,6 @@ function getInfo(self){
...
@@ -108,12 +108,6 @@ function getInfo(self){
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
// if(window.iotDebug){
// iotDebug.push('end: 获取用户信息'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取用户信息');
// }
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
},
},
complete
:
()
=>
{}
complete
:
()
=>
{}
...
@@ -125,50 +119,56 @@ function logoutButtonTap(self){
...
@@ -125,50 +119,56 @@ function logoutButtonTap(self){
uComponents
.
openConfirm
(
self
,
Vue
.
t
(
'myInfo.logoutDialogTip'
),
uComponents
.
openConfirm
(
self
,
Vue
.
t
(
'myInfo.logoutDialogTip'
),
{
text
:
Vue
.
t
(
'dialog.cancel'
),
callback
:
function
()
{}},
{
text
:
Vue
.
t
(
'dialog.cancel'
),
callback
:
function
()
{}},
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
iot
.
business
.
user
.
logout
({
// uPublic.logout({
data
:
{
// data: {
sds
:
true
// sds: true
},
// },
// success: (response) => {
// console.log(response);
// iot.navigator.openWindow({
// url: '../login/index.html',
// id: 'login',
// extras: {
// needClose: true
// }
// });
// },
// error: (error) => {
// console.log(error);
// },
// complete: () => {}
// });
iot
.
business
.
user
.
logout
({
data
:
{},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
iot
.
business
.
websql
.
delMaps
([
'utoken'
,
'userinfo'
],
(
response
)
=>
{
console
.
log
(
"sdsLogout:"
+
response
);
console
.
log
(
response
);
let
sdsResponse
=
response
;
},
(
error
)
=>
{
iot
.
business
.
websql
.
delMaps
([
'utoken'
,
'userinfo'
],
(
response
)
=>
{
console
.
log
(
error
);
iot
.
storage
.
delMaps
([
'notifyTime'
,
'alarmTime'
,
'openTime'
],
(
response
)
=>
{
// if(window.iotDebug){
console
.
log
(
"clearMap"
+
response
);
// iotDebug.push('end: 清除tocken失败'+JSON.stringify(error));
//打开首页
// }
iot
.
navigator
.
openWindow
({
// if (window.iotDebug) {
url
:
'../login/index.html'
,
// iotDebug.upload(iot,'清除tocken失败');
id
:
'login'
,
// }
extras
:
{
needClose
:
true
}
});
},
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
});
},
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
});
iot
.
storage
.
delMaps
([
'notifyTime'
,
'alarmTime'
,
'openTime'
],
(
response
)
=>
{
console
.
log
(
response
);
},
()
=>
{
});
iot
.
navigator
.
openWindow
({
url
:
'../login/index.html'
,
id
:
'login'
});
});
let
wvs
=
plus
.
webview
.
all
();
for
(
var
i
=
0
;
i
<
wvs
.
length
-
1
;
i
++
)
{
plus
.
webview
.
close
(
wvs
[
i
]);
}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 退出登陆失败'
+
JSON
.
stringify
(
error
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'退出登陆失败'
);
}
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
},
},
complete
:
()
=>
{
complete
:
()
=>
{}
console
.
log
(
"complete"
);
});
}
});
}}
}}
);
);
}
}
\ No newline at end of file
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