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
ce27d3e1
Commit
ce27d3e1
authored
Sep 22, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
阿里登陆功能,三个记录页面
parent
ab4aa5fa
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
678 additions
and
55 deletions
+678
-55
dev/src/lang/zh.json
+14
-4
dev/src/public/public.js
+41
-1
dev/src/view/addDevice/v_wifiAdd.js
+21
-0
dev/src/view/addDevice/v_wifiAddHelp.js
+14
-3
dev/src/view/device/v_alarmInfo.js
+104
-7
dev/src/view/device/v_hijackRecord.js
+123
-6
dev/src/view/device/v_opendoorRecord.js
+152
-12
dev/src/view/doorlockManage/v_editName.js
+6
-3
dev/src/view/doorlockManage/v_index.js
+21
-8
dev/src/view/doorlockManage/v_qrcode.js
+8
-2
dev/src/view/login/v_index.js
+120
-5
dev/src/view/login/v_login.js
+54
-4
No files found.
dev/src/lang/zh.json
View file @
ce27d3e1
...
@@ -54,7 +54,8 @@
...
@@ -54,7 +54,8 @@
"error"
:
{
"error"
:
{
"telNull"
:
"请输入手机号"
,
"telNull"
:
"请输入手机号"
,
"passWordNull"
:
"请输入密码"
"passWordNull"
:
"请输入密码"
}
},
"failure"
:
"登陆失败"
},
},
"register"
:{
"register"
:{
"telInputTip"
:
"请输入手机号"
,
"telInputTip"
:
"请输入手机号"
,
...
@@ -87,10 +88,18 @@
...
@@ -87,10 +88,18 @@
"laterFollow"
:
"稍后关注"
"laterFollow"
:
"稍后关注"
},
},
"opendoorRecord"
:{
"opendoorRecord"
:{
"noRecordTip"
:
"暂无记录"
"noRecordTip"
:
"暂无记录"
,
"mode_0"
:
"APP开门"
,
"mode_1"
:
"指纹开门"
,
"mode_2"
:
"劫持指纹开门"
,
"mode_4"
:
"IC卡开门"
},
},
"alarmInfo"
:{
"alarmInfo"
:{
"noInfoTip"
:
"暂无信息"
"noInfoTip"
:
"暂无信息"
,
"mode_0"
:
"禁示报警"
,
"mode_1"
:
"防撬报警"
,
"mode_2"
:
"欠电报警"
,
"mode_3"
:
"假锁报警"
},
},
"remoteOpendoor"
:{
"remoteOpendoor"
:{
"passwordInputTip"
:
"请输入远程开门密码"
,
"passwordInputTip"
:
"请输入远程开门密码"
,
...
@@ -99,7 +108,8 @@
...
@@ -99,7 +108,8 @@
}
}
},
},
"hijackRecord"
:{
"hijackRecord"
:{
"noRecordTip"
:
"暂无记录"
"noRecordTip"
:
"暂无记录"
,
"mode_0"
:
"劫持指纹开门"
},
},
"doorlockManage"
:{
"doorlockManage"
:{
"noDeviceTip"
:
"暂无设备"
,
"noDeviceTip"
:
"暂无设备"
,
...
...
dev/src/public/public.js
View file @
ce27d3e1
...
@@ -16,7 +16,7 @@ const iot = new UIOT({
...
@@ -16,7 +16,7 @@ const iot = new UIOT({
appId
:
''
appId
:
''
},
},
cloud
:
{
cloud
:
{
url
:
'http://192.168.2.9
7:20007
'
url
:
'http://192.168.2.9
6:20000
'
},
},
plugin
:
{
plugin
:
{
log
:
{
log
:
{
...
@@ -81,6 +81,46 @@ uPublic.checkResponseData = function (data) {
...
@@ -81,6 +81,46 @@ uPublic.checkResponseData = function (data) {
}
}
};
};
iot
.
navigator
.
fire
=
function
(
webview
,
eventType
,
data
)
{
if
(
webview
)
{
if
(
typeof
data
===
'undefined'
)
{
data
=
''
;
}
else
if
(
typeof
data
===
'boolean'
||
typeof
data
===
'number'
)
{
webview
.
evalJS
(
"typeof mui!=='undefined'&&mui.receive('"
+
eventType
+
"',"
+
data
+
")"
);
return
;
}
else
if
(
typeof
data
===
'object'
&&
Object
.
keys
(
data
).
length
==
0
)
{
data
=
JSON
.
stringify
(
data
||
{}).
replace
(
/
\'
/g
,
"
\\
u0027"
).
replace
(
/
\\
/g
,
"
\\
u005c"
);
}
webview
.
evalJS
(
'iot.navigator.receive("'
+
eventType
+
'","'
+
data
+
'")'
);
}
};
window
.
iot
=
iot
;
iot
.
navigator
.
receive
=
function
(
eventType
,
data
)
{
console
.
log
(
"receive。。。"
);
if
(
eventType
)
{
try
{
if
(
data
&&
typeof
data
===
'string'
)
{
data
=
JSON
.
parse
(
data
);
}
}
catch
(
e
)
{
}
iot
.
navigator
.
trigger
(
document
,
eventType
,
data
);
}
};
iot
.
navigator
.
trigger
=
function
(
element
,
eventType
,
eventData
)
{
console
.
log
(
"trigger。。。"
);
console
.
log
(
element
);
console
.
log
(
eventType
);
element
.
dispatchEvent
(
new
CustomEvent
(
eventType
,
{
detail
:
eventData
,
bubbles
:
true
,
cancelable
:
true
}));
return
this
;
};
iot
.
ready
(()
=>
{
iot
.
ready
(()
=>
{
uPublic
.
recalc
();
uPublic
.
recalc
();
});
});
...
...
dev/src/view/addDevice/v_wifiAdd.js
View file @
ce27d3e1
...
@@ -15,6 +15,7 @@ function init() {
...
@@ -15,6 +15,7 @@ function init() {
uPublic
.
componentsInit
([
'u-text'
,
'u-button'
,
'u-commstatus-loading'
,
'u-dialog'
,
'u-loading'
]);
uPublic
.
componentsInit
([
'u-text'
,
'u-button'
,
'u-commstatus-loading'
,
'u-dialog'
,
'u-loading'
]);
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
textWiFiName
:
null
,
textPassword
:
null
,
textPassword
:
null
,
textErrorTip
:
null
,
textErrorTip
:
null
,
textLoading
:
'loading...'
,
textLoading
:
'loading...'
,
...
@@ -23,8 +24,28 @@ function init() {
...
@@ -23,8 +24,28 @@ function init() {
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
()
},
},
mounted
(){
mounted
(){
iot
.
business
.
sds
.
findWifi
({
data
:
{
// model: 'model',
// ssid: 'ssid',
wifiPwd
:
'wifiPwd'
,
timeout
:
20000
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
}
});
},
},
methods
:{
methods
:{
getTextPassword
(){
return
this
.
textPassword
;
},
setTextPassword
(
pwd
){
this
.
textPassword
=
pwd
;
},
getTextLoading
(){
getTextLoading
(){
return
this
.
textLoading
;
return
this
.
textLoading
;
},
},
...
...
dev/src/view/addDevice/v_wifiAddHelp.js
View file @
ce27d3e1
...
@@ -63,8 +63,18 @@ function backTap(){
...
@@ -63,8 +63,18 @@ function backTap(){
//tap 开始配置Wi-Fi
//tap 开始配置Wi-Fi
function
wifiAddButtonTap
(){
function
wifiAddButtonTap
(){
iot
.
navigator
.
openWindow
({
// iot.navigator.openWindow({
url
:
'./wifiAdd.html'
,
// url: './wifiAdd.html',
id
:
'wifiAdd'
// id: 'wifiAdd'
// });
iot
.
business
.
sds
.
wifiDeviceConfig
({
success
:
function
(
response
)
{
console
.
log
(
'wifiDeviceConfig success'
);
console
.
log
(
response
);
},
error
:
function
(
error
)
{
console
.
log
(
'wifiDeviceConfig error'
);
console
.
log
(
error
);
}
});
});
}
}
\ No newline at end of file
dev/src/view/device/v_alarmInfo.js
View file @
ce27d3e1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
* 报警信息页面
* 报警信息页面
*/
*/
import
moment
from
'moment'
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
iot
.
ready
(
init
);
iot
.
ready
(
init
);
...
@@ -16,11 +17,33 @@ function init() {
...
@@ -16,11 +17,33 @@ function init() {
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//配置组件
//配置组件
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
(),
list
:[],
startId
:
0
,
deviceId
:
null
,
},
},
mounted
(){
mounted
(){
resolve
(
this
);
},
},
methods
:{
methods
:{
getList
(){
return
this
.
list
;
},
setList
(
list
){
this
.
list
=
list
;
},
getStartId
(){
return
this
.
startId
;
},
setStartId
(){
this
.
startId
;
},
getDeviceId
(){
return
this
.
deviceId
;
},
setDeviceId
(
id
){
this
.
deviceId
=
id
;
},
//tap <
//tap <
onBackTap
(){
onBackTap
(){
backTap
();
backTap
();
...
@@ -35,12 +58,13 @@ function initComponentsConfig() {
...
@@ -35,12 +58,13 @@ function initComponentsConfig() {
alarmInfoList
:{
alarmInfoList
:{
initParam
:
{
initParam
:
{
class
:
'custom-list'
,
class
:
'custom-list'
,
list
:
[
// list: [
{
value
:
1
,
leftImage
:
'../../resources/image/green_alarmInfo0_icon.png'
,
title
:
''
,
subtitle
:
'禁试报警'
,
rightText
:
'2017.06.2315:56:26'
},
// {value: 1, leftImage: '../../resources/image/green_alarmInfo0_icon.png', title:'', subtitle:'禁试报警', rightText: '2017.06.2315:56:26'},
{
value
:
2
,
leftImage
:
'../../resources/image/green_alarmInfo1_icon.png'
,
title
:
''
,
subtitle
:
'防撬报警'
,
rightText
:
'2017.06.2315:01:01'
},
// {value: 2, leftImage: '../../resources/image/green_alarmInfo1_icon.png', title:'', subtitle:'防撬报警', rightText: '2017.06.2315:01:01'},
{
value
:
3
,
leftImage
:
'../../resources/image/green_alarmInfo2_icon.png'
,
title
:
''
,
subtitle
:
'欠电报警'
,
rightText
:
'2017.05.2315:56:26'
},
// {value: 3, leftImage: '../../resources/image/green_alarmInfo2_icon.png', title:'', subtitle:'欠电报警', rightText: '2017.05.2315:56:26'},
{
value
:
4
,
leftImage
:
'../../resources/image/green_alarmInfo3_icon.png'
,
title
:
''
,
subtitle
:
'假锁报警'
,
rightText
:
'2017.03.2315:01:01'
}
// {value: 4, leftImage: '../../resources/image/green_alarmInfo3_icon.png', title:'', subtitle:'假锁报警', rightText: '2017.03.2315:01:01'}
],
// ],
list
:
[],
tip
:
Vue
.
t
(
'alarmInfo.noInfoTip'
)
tip
:
Vue
.
t
(
'alarmInfo.noInfoTip'
)
}
}
},
},
...
@@ -57,6 +81,79 @@ function initComponentsConfig() {
...
@@ -57,6 +81,79 @@ function initComponentsConfig() {
}
}
}
}
function
resolve
(
self
)
{
// self.setDeviceId(iot.navigator.getExtras().deviceId);
self
.
setDeviceId
(
1
);
let
data
=
{
record
:
[{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
1
,
mode
:
1
,
id
:
1
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
2
,
mode
:
2
,
id
:
2
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
3
,
mode
:
3
,
id
:
3
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
1
,
mode
:
1
,
id
:
1
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
2
,
mode
:
2
,
id
:
2
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
}]};
if
(
data
){
let
list
=
[];
let
record
=
data
.
record
;
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
list
[
i
]
=
{
value
:
record
[
i
].
openId
,
leftImage
:
'../../resources/image/green_alarmInfo'
+
record
[
i
].
mode
+
'_icon.png'
,
subtitle
:
Vue
.
t
(
'alarmInfo.mode_'
+
record
[
i
].
mode
+
''
),
// title: ('ID:'+record[i].id),
rightText
:
moment
(
record
[
i
].
time
).
format
(
"YYYY.MM.DD HH:mm:ss"
)
};
}
self
.
setList
(
self
.
getList
().
concat
(
list
));
if
(
record
.
length
>
0
){
self
.
setStartId
(
record
[
record
.
length
-
1
].
id
);
}
//更新列表数据
uComponents
.
changeList
(
self
,
self
.
getList
());
}
else
{
}
// iot.business.api.getRecorderList(
// {
// data: {
// lock_id: self.getDeviceId(),
// action: 2,
// start_id: self.getStartId(),
// page_size: PAGE_SIZE
// },
// success: (response) => {
// let data = uPublic.checkResponseData(response.data);
// data = [{"openId": 1,mode: 1,id: 1, time: '2017.08.0310:29:53'}];
// if(data){
// let list = [];
// let record = data.record;
// for(let i=0; i<record.length; i++){
// list[i] = {
// value: record[i].openId,
// leftImage: '../../resources/image/green_alarmInfo'+record[i].mode+'_icon.png',
// subtitle: Vue.t('alarmInfo.mode_'+record[i].mode+''),
// title: ('ID:'+record[i].id),
// rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
// };
// }
// self.setList(self.getList().concat(list));
// if(record.length > 0){
// self.setStartId(record[record.length-1].id);
// }
// //更新列表数据
// uComponents.changeList(self, self.getList());
// }else{
// }
// uComponents.hideLoading(self);
// },
// error: (err) => {
// uPublic.openRequestErrorAlert(self);
// console.log(err);
// },
// complete: () => {
//
// }
// });
}
//tap <
//tap <
function
backTap
(){
function
backTap
(){
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/device/v_hijackRecord.js
View file @
ce27d3e1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 劫持记录页面
* 劫持记录页面
*/
*/
import
moment
from
'moment'
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
iot
.
ready
(
init
);
iot
.
ready
(
init
);
...
@@ -16,11 +16,40 @@ function init() {
...
@@ -16,11 +16,40 @@ function init() {
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//配置组件
//配置组件
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
(),
list
:
[],
startId
:
0
,
deviceId
:
null
,
userInfo
:
[]
},
},
mounted
(){
mounted
(){
resolve
(
this
);
},
},
methods
:{
methods
:{
getList
(){
return
this
.
list
;
},
setList
(
list
){
this
.
list
=
list
;
},
getStartId
(){
return
this
.
startId
;
},
setStartId
(){
this
.
startId
;
},
getDeviceId
(){
return
this
.
deviceId
;
},
setDeviceId
(
id
){
this
.
deviceId
=
id
;
},
getUserInfo
(){
return
this
.
userInfo
;
},
setUserInfo
(
info
){
this
.
userInfo
=
info
;
},
//tap <
//tap <
onBackTap
(){
onBackTap
(){
backTap
();
backTap
();
...
@@ -35,10 +64,11 @@ function initComponentsConfig() {
...
@@ -35,10 +64,11 @@ function initComponentsConfig() {
hijackRecordList
:{
hijackRecordList
:{
initParam
:
{
initParam
:
{
class
:
'custom-list'
,
class
:
'custom-list'
,
list
:
[
// list: [
{
value
:
1
,
leftImage
:
'../../resources/image/green_opendoor2_icon.png'
,
title
:
'测试用户02'
,
subtitle
:
'劫持指纹开门'
,
rightText
:
'2017.07.1306:10:10'
},
// {value: 1, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'测试用户02', subtitle: '劫持指纹开门', rightText: '2017.07.1306:10:10'},
{
value
:
2
,
leftImage
:
'../../resources/image/green_opendoor2_icon.png'
,
title
:
'ID:117'
,
subtitle
:
'劫持指纹开门'
,
rightText
:
'2017.07.0322:57:44'
}
// {value: 2, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'ID:117', subtitle: '劫持指纹开门', rightText: '2017.07.0322:57:44'}
],
// ],
list
:
[],
tip
:
Vue
.
t
(
'hijackRecord.noRecordTip'
)
tip
:
Vue
.
t
(
'hijackRecord.noRecordTip'
)
}
}
},
},
...
@@ -55,6 +85,93 @@ function initComponentsConfig() {
...
@@ -55,6 +85,93 @@ function initComponentsConfig() {
}
}
}
}
function
resolve
(
self
)
{
// self.setDeviceId(iot.navigator.getExtras().deviceId);
self
.
setDeviceId
(
1
);
let
data
=
{
record
:
[{
"openId"
:
1
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
2
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
}],
info
:
[{
"openId"
:
1
,
"mode"
:
0
,
"nickname"
:
"测试用户01"
},
{
"openId"
:
2
,
"mode"
:
0
,
"nickname"
:
"测试用户02"
}]
};
if
(
data
){
let
list
=
[];
let
record
=
data
.
record
;
if
(
data
.
hasOwnProperty
(
'info'
)){
self
.
setUserInfo
(
data
.
info
);
}
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
list
[
i
]
=
{
value
:
record
[
i
].
openId
,
leftImage
:
'../../resources/image/green_opendoor2_icon.png'
,
subtitle
:
Vue
.
t
(
'hijackRecord.mode_'
+
record
[
i
].
mode
+
''
),
// title: ('ID:'+record[i].id),
rightText
:
moment
(
record
[
i
].
time
).
format
(
"YYYY.MM.DD HH:mm:ss"
)
};
for
(
let
j
=
0
;
j
<
self
.
getUserInfo
().
length
;
j
++
){
if
(
record
[
i
].
openId
==
self
.
getUserInfo
()[
j
].
openId
&&
record
[
i
].
mode
==
self
.
getUserInfo
()[
j
].
mode
){
list
[
i
].
title
=
self
.
getUserInfo
()[
j
].
nickname
==
null
?
''
:
self
.
getUserInfo
()[
j
].
nickname
;
}
else
{
console
.
log
(
record
[
i
].
id
);
list
[
i
].
title
=
record
[
i
].
id
==
null
?
''
:
"ID:"
+
record
[
i
].
id
;
}
}
}
self
.
setList
(
self
.
getList
().
concat
(
list
));
if
(
record
.
length
>
0
){
self
.
setStartId
(
record
[
record
.
length
-
1
].
id
);
}
//更新列表数据
uComponents
.
changeList
(
self
,
self
.
getList
());
}
else
{
}
// iot.business.api.getRecorderList(
// {
// data: {
// lock_id: self.getDeviceId(),
// action: 2,
// start_id: self.getStartId(),
// page_size: PAGE_SIZE
// },
// success: (response) => {
// let data = uPublic.checkResponseData(response.data);
// data = [{"openId": 1,mode: 1,id: 1, time: '2017.08.0310:29:53'}];
// if(data){
// let list = [];
// let record = data.record;
// for(let i=0; i<record.length; i++){
// list[i] = {
// value: record[i].openId,
// leftImage: '../../resources/image/green_alarmInfo'+record[i].mode+'_icon.png',
// subtitle: Vue.t('alarmInfo.mode_'+record[i].mode+''),
// title: ('ID:'+record[i].id),
// rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
// };
// }
// self.setList(self.getList().concat(list));
// if(record.length > 0){
// self.setStartId(record[record.length-1].id);
// }
// //更新列表数据
// uComponents.changeList(self, self.getList());
// }else{
// }
// uComponents.hideLoading(self);
// },
// error: (err) => {
// uPublic.openRequestErrorAlert(self);
// console.log(err);
// },
// complete: () => {
//
// }
// });
}
//tap <
//tap <
function
backTap
(){
function
backTap
(){
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
...
...
dev/src/view/device/v_opendoorRecord.js
View file @
ce27d3e1
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 开门记录页面
* 开门记录页面
*/
*/
import
moment
from
'moment'
;
const
PAGE_SIZE
=
10
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
import
{
iot
,
uPublic
,
uComponents
}
from
'../../public/public.js'
;
iot
.
ready
(
init
);
iot
.
ready
(
init
);
...
@@ -16,11 +17,40 @@ function init() {
...
@@ -16,11 +17,40 @@ function init() {
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//配置组件
//配置组件
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
(),
list
:
[],
startId
:
0
,
deviceId
:
null
,
userInfo
:
[]
},
},
mounted
(){
mounted
(){
resolve
(
this
);
},
},
methods
:{
methods
:{
getList
(){
return
this
.
list
;
},
setList
(
list
){
this
.
list
=
list
;
},
getStartId
(){
return
this
.
startId
;
},
setStartId
(){
this
.
startId
;
},
getDeviceId
(){
return
this
.
deviceId
;
},
getUserInfo
(){
return
this
.
userInfo
;
},
setUserInfo
(
info
){
this
.
userInfo
=
info
;
},
setDeviceId
(
id
){
this
.
deviceId
=
id
;
},
//tap <
//tap <
onBackTap
(){
onBackTap
(){
backTap
();
backTap
();
...
@@ -35,16 +65,17 @@ function initComponentsConfig() {
...
@@ -35,16 +65,17 @@ function initComponentsConfig() {
opendoorRecordList
:{
opendoorRecordList
:{
initParam
:
{
initParam
:
{
class
:
'custom-list'
,
class
:
'custom-list'
,
list
:
[
// list: [
{
value
:
1
,
leftImage
:
'../../resources/image/green_opendoor0_icon.png'
,
title
:
''
,
subtitle
:
'手机远程开门'
,
rightText
:
'2017.08.0310:29:53'
},
// {value: 1, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.08.0310:29:53'},
{
value
:
2
,
leftImage
:
'../../resources/image/green_opendoor0_icon.png'
,
title
:
''
,
subtitle
:
'手机远程开门'
,
rightText
:
'2017.08.0310:27:56'
},
// {value: 2, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.08.0310:27:56'},
{
value
:
3
,
leftImage
:
'../../resources/image/green_opendoor1_icon.png'
,
title
:
'ID:6'
,
subtitle
:
'指纹开门'
,
rightText
:
'2017.08.0310:25:47'
},
// {value: 3, leftImage: '../../resources/image/green_opendoor1_icon.png', title:'ID:6', subtitle: '指纹开门', rightText: '2017.08.0310:25:47'},
{
value
:
4
,
leftImage
:
'../../resources/image/green_opendoor0_icon.png'
,
title
:
''
,
subtitle
:
'手机远程开门'
,
rightText
:
'2017.07.3117:13:03'
,},
// {value: 4, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.07.3117:13:03',},
{
value
:
5
,
leftImage
:
'../../resources/image/green_opendoor2_icon.png'
,
title
:
'测试用户02'
,
subtitle
:
'劫持指纹开门'
,
rightText
:
'2017.07.3117:10:10'
},
// {value: 5, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'测试用户02', subtitle: '劫持指纹开门', rightText: '2017.07.3117:10:10'},
{
value
:
6
,
leftImage
:
'../../resources/image/green_opendoor3_icon.png'
,
title
:
'测试用户'
,
subtitle
:
'密码开门'
,
rightText
:
'2017.07.3117:09:59'
},
// {value: 6, leftImage: '../../resources/image/green_opendoor3_icon.png', title:'测试用户', subtitle: '密码开门', rightText: '2017.07.3117:09:59'},
{
value
:
7
,
leftImage
:
'../../resources/image/green_opendoor2_icon.png'
,
title
:
'ID:117'
,
subtitle
:
'劫持指纹开门'
,
rightText
:
'2017.07.3117:05:19'
},
// {value: 7, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'ID:117', subtitle: '劫持指纹开门', rightText: '2017.07.3117:05:19'},
{
value
:
8
,
leftImage
:
'../../resources/image/green_opendoor3_icon.png'
,
title
:
'测试用户'
,
subtitle
:
'密码开门'
,
rightText
:
'2017.07.3117:03:50'
,}
// {value: 8, leftImage: '../../resources/image/green_opendoor3_icon.png', title:'测试用户', subtitle: '密码开门', rightText: '2017.07.3117:03:50',}
],
// ],
list
:
[],
tip
:
Vue
.
t
(
'opendoorRecord.noRecordTip'
)
tip
:
Vue
.
t
(
'opendoorRecord.noRecordTip'
)
}
}
},
},
...
@@ -61,7 +92,115 @@ function initComponentsConfig() {
...
@@ -61,7 +92,115 @@ function initComponentsConfig() {
}
}
}
}
//调用接口获取开门记录
function
resolve
(
self
)
{
// self.setDeviceId(iot.navigator.getExtras().deviceId);
self
.
setDeviceId
(
1
);
console
.
log
(
new
Date
());
let
data
=
{
record
:
[{
"openId"
:
0
,
mode
:
0
,
id
:
0
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
1
,
mode
:
1
,
id
:
1
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
2
,
mode
:
2
,
id
:
2
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
4
,
mode
:
4
,
id
:
4
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
0
,
mode
:
0
,
id
:
null
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
1
,
mode
:
1
,
id
:
null
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
},
{
"openId"
:
2
,
mode
:
2
,
id
:
null
,
time
:
'Thu Sep 21 2017 13:58:00 GMT+0800'
}],
info
:
[{
"openId"
:
1
,
"mode"
:
1
,
"nickname"
:
"测试用户01"
},
{
"openId"
:
2
,
"mode"
:
2
,
"nickname"
:
"测试用户02"
}]
};
if
(
data
){
let
list
=
[];
let
record
=
data
.
record
;
if
(
data
.
hasOwnProperty
(
'info'
)){
self
.
setUserInfo
(
data
.
info
);
}
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
list
[
i
]
=
{
value
:
record
[
i
].
openId
,
leftImage
:
'../../resources/image/green_opendoor'
+
record
[
i
].
mode
+
'_icon.png'
,
subtitle
:
Vue
.
t
(
'opendoorRecord.mode_'
+
record
[
i
].
mode
+
''
),
rightText
:
moment
(
record
[
i
].
time
).
format
(
"YYYY.MM.DD HH:mm:ss"
)
};
for
(
let
j
=
0
;
j
<
self
.
getUserInfo
().
length
;
j
++
){
if
(
record
[
i
].
openId
==
self
.
getUserInfo
()[
j
].
openId
&&
record
[
i
].
mode
==
self
.
getUserInfo
()[
j
].
mode
){
list
[
i
].
title
=
self
.
getUserInfo
()[
j
].
nickname
==
null
?
''
:
self
.
getUserInfo
()[
j
].
nickname
;
}
else
{
console
.
log
(
record
[
i
].
id
);
list
[
i
].
title
=
record
[
i
].
id
==
null
?
''
:
"ID:"
+
record
[
i
].
id
;
}
}
}
self
.
setList
(
self
.
getList
().
concat
(
list
));
if
(
record
.
length
>
0
){
self
.
setStartId
(
record
[
record
.
length
-
1
].
id
);
}
//更新列表数据
uComponents
.
changeList
(
self
,
self
.
getList
());
}
else
{
}
// iot.business.api.getRecorderList(
// {
// data: {
// lock_id: self.getDeviceId(),
// action: 2,
// start_id: self.getStartId(),
// page_size: PAGE_SIZE
// },
// success: (response) => {
// let data = uPublic.checkResponseData(response.data);
// data = [{"openId": 1,mode: 1,id: 1, time: '2017.08.0310:29:53'}];
// if(data){
// let list = [];
let
record
=
data
.
record
;
if
(
data
.
hasOwnProperty
(
'info'
)){
self
.
setUserInfo
(
data
.
info
);
}
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
list
[
i
]
=
{
value
:
record
[
i
].
openId
,
leftImage
:
'../../resources/image/green_opendoor'
+
record
[
i
].
mode
+
'_icon.png'
,
subtitle
:
Vue
.
t
(
'opendoorRecord.mode_'
+
record
[
i
].
mode
+
''
),
rightText
:
moment
(
record
[
i
].
time
).
format
(
"YYYY.MM.DD HH:mm:ss"
)
};
for
(
let
j
=
0
;
j
<
self
.
getUserInfo
().
length
;
j
++
){
if
(
record
[
i
].
openId
==
self
.
getUserInfo
()[
j
].
openId
&&
record
[
i
].
mode
==
self
.
getUserInfo
()[
j
].
mode
){
list
[
i
].
title
=
self
.
getUserInfo
()[
j
].
nickname
==
null
?
''
:
self
.
getUserInfo
()[
j
].
nickname
;
}
else
{
console
.
log
(
record
[
i
].
id
);
list
[
i
].
title
=
record
[
i
].
id
==
null
?
''
:
"ID:"
+
record
[
i
].
id
;
}
}
}
self
.
setList
(
self
.
getList
().
concat
(
list
));
if
(
record
.
length
>
0
){
self
.
setStartId
(
record
[
record
.
length
-
1
].
id
);
}
//更新列表数据
uComponents
.
changeList
(
self
,
self
.
getList
());
// }else{
// }
// uComponents.hideLoading(self);
// },
// error: (err) => {
// uPublic.openRequestErrorAlert(self);
// console.log(err);
// },
// complete: () => {
//
// }
// });
}
//tap <
//tap <
function
backTap
(){
function
backTap
(){
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
//tap 点击加载更多
//function loadTap(self) {
// if(!self.getLoadFlag()){
// resolve(self);
// self.setLoadText(Vue.t('scroll.loading'));
// self.setLoadFlag(true);
// }
//}
\ No newline at end of file
dev/src/view/doorlockManage/v_editName.js
View file @
ce27d3e1
...
@@ -104,9 +104,11 @@ function saveButtonTap(self){
...
@@ -104,9 +104,11 @@ function saveButtonTap(self){
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'editName.editNameSuccess'
),
{
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'editName.editNameSuccess'
),
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
var
opener
=
plus
.
webview
.
currentWebview
().
opener
();
let
opener
=
plus
.
webview
.
currentWebview
().
opener
();
var
view
=
plus
.
webview
.
getWebviewById
(
opener
.
id
);
let
view
=
plus
.
webview
.
getWebviewById
(
opener
.
id
);
view
.
reload
();
iot
.
navigator
.
fire
(
view
,
'returnPage'
,{
name
:
'zhu'
});
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
});
});
...
@@ -115,6 +117,7 @@ function saveButtonTap(self){
...
@@ -115,6 +117,7 @@ function saveButtonTap(self){
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'editName.editNameFailue'
),
{
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'editName.editNameFailue'
),
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
let
opener
=
plus
.
webview
.
currentWebview
().
opener
();
iot
.
navigator
.
back
();
iot
.
navigator
.
back
();
}
}
});
});
...
...
dev/src/view/doorlockManage/v_index.js
View file @
ce27d3e1
...
@@ -30,6 +30,8 @@ function init() {
...
@@ -30,6 +30,8 @@ function init() {
iot
.
business
.
user
.
login
({
iot
.
business
.
user
.
login
({
data
:
{
data
:
{
// sds: true,
// sds: true,
//17621209360
//yyl111
username
:
'18679022601'
,
username
:
'18679022601'
,
pwd
:
'123'
pwd
:
'123'
// userinfo: {
// userinfo: {
...
@@ -47,13 +49,18 @@ function init() {
...
@@ -47,13 +49,18 @@ function init() {
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
},
},
complete
:
()
=>
{}
complete
:
()
=>
{}
});
});
console
.
log
(
"in"
);
// getDeviceList(this);
// getDeviceList(this);
// window.addEventListener('alert',function(event){
let
self
=
this
;
// getDeviceList(this);
window
.
addEventListener
(
'returnPage'
,
function
(
event
){
// });
console
.
log
(
"innn"
);
self
.
showDeviceList
=
[];
getDeviceList
(
self
);
});
},
},
methods
:{
methods
:{
getDeviceList
(){
getDeviceList
(){
...
@@ -150,7 +157,7 @@ function getDeviceList(self){
...
@@ -150,7 +157,7 @@ function getDeviceList(self){
projectMethods
.
changeGridList
(
self
,
self
.
getShowDeviceList
());
projectMethods
.
changeGridList
(
self
,
self
.
getShowDeviceList
());
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
}
else
{
}
else
{
uComponents
.
hideLoading
(
self
);
}
}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
...
@@ -239,10 +246,14 @@ function logoutButtonTap(self){
...
@@ -239,10 +246,14 @@ function logoutButtonTap(self){
sds
:
true
sds
:
true
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
// iot.navigator.openWindow({
iot
.
navigator
.
openWindow
({
// url: '../login/login.html',
url
:
'../login/'
,
// id: 'login'
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
)
=>
{},
complete
:
()
=>
{
complete
:
()
=>
{
...
@@ -252,6 +263,8 @@ function logoutButtonTap(self){
...
@@ -252,6 +263,8 @@ function logoutButtonTap(self){
}}
}}
);
);
}
}
//17621209360
//yyl111
function
deleteDoorlook
(
self
,
index
){
function
deleteDoorlook
(
self
,
index
){
// 显示loading
// 显示loading
...
...
dev/src/view/doorlockManage/v_qrcode.js
View file @
ce27d3e1
...
@@ -89,13 +89,19 @@ function qrcodeButtonTap(self){
...
@@ -89,13 +89,19 @@ function qrcodeButtonTap(self){
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
if
(
data
){
let
qrKey
=
response
.
data
.
qrKey
;
let
qrKey
=
response
.
data
.
qrKey
;
var
qr
=
self
.
$refs
.
qrcode
;
let
qr
=
self
.
$refs
.
qrcode
;
QRCode
.
toCanvas
(
qr
,
qrKey
,
(
error
)
=>
{
QRCode
.
toCanvas
(
qr
,
qrKey
,
{
scale
:
5
,
margin
:
2
},(
error
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
else
{
}
else
{
console
.
log
(
'success'
);
console
.
log
(
'success'
);
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
qr
.
style
.
width
=
"5.333rem"
;
qr
.
style
.
height
=
"5.333rem"
;
console
.
log
(
qr
.
style
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
self
.
setQrCodeDisabled
(
true
);
self
.
setQrCodeDisabled
(
true
);
},
1000
*
60
*
10
);
},
1000
*
60
*
10
);
...
...
dev/src/view/login/v_index.js
View file @
ce27d3e1
...
@@ -19,12 +19,46 @@ function init() {
...
@@ -19,12 +19,46 @@ function init() {
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
()
},
},
mounted
(){
mounted
(){
setTimeout
(
function
(){
// setTimeout(function(){
iot
.
navigator
.
openWindow
({
// iot.navigator.openWindow({
url
:
'./login.html'
,
// url: './login.html',
id
:
'login'
// id: 'login'
// });
// },2000)
let
self
=
this
;
iot
.
business
.
sds
.
init
({
data
:
{
oa
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
iot
.
business
.
user
.
login
({
data
:
{
sds
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
cloudsLogin
(
self
,
data
.
UserID
);
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//请求失败
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
()
=>
{}
});
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//请求失败
uPublic
.
openRequestErrorAlert
(
self
);
}
});
});
},
2000
)
},
},
methods
:{
methods
:{
}
}
...
@@ -46,3 +80,84 @@ function initComponentsConfig() {
...
@@ -46,3 +80,84 @@ function initComponentsConfig() {
}
}
}
}
}
}
//云端登陆
function
cloudsLogin
(
self
,
id
){
iot
.
business
.
user
.
autoLogin
({
success
:
(
response
)
=>
{
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
navigator
.
openWindow
({
url
:
'../device/'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
iot
.
business
.
user
.
login
({
data
:
{
username
:
id
,
pwd
:
id
,
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
navigator
.
openWindow
({
url
:
'../device/'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//不存在此用户
// if(code == 10002){
//用户注册
iot
.
business
.
user
.
reg
({
data
:
{
username
:
id
,
pwd
:
id
,
vcode
:
id
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
//注册成功
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
navigator
.
openWindow
({
url
:
'../device/'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//注册失败
uComponents
.
openAlert
(
self
,
'login.failure'
,
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
plus
.
webview
.
currentWebview
().
reload
();
}
});
},
complete
:
()
=>
{}
});
// }
//请求失败
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
()
=>
{}
});
},
complete
:
()
=>
{}
});
//
}
dev/src/view/login/v_login.js
View file @
ce27d3e1
...
@@ -22,6 +22,55 @@ function init() {
...
@@ -22,6 +22,55 @@ function init() {
componentsConfig
:
initComponentsConfig
()
componentsConfig
:
initComponentsConfig
()
},
},
mounted
(){
mounted
(){
iot
.
business
.
sds
.
init
({
data
:
{
oa
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
iot
.
business
.
user
.
login
({
data
:
{
sds
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
business
.
user
.
login
({
data
:
{
username
:
data
.
UserId
,
pwd
:
data
.
UserId
,
},
success
:
(
response
)
=>
{
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
navigator
.
openWindow
({
url
:
'../device/'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
},
complete
:
()
=>
{}
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
},
complete
:
()
=>
{}
});
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
}
});
},
},
methods
:{
methods
:{
onTelChange
(
number
){
onTelChange
(
number
){
...
@@ -106,10 +155,11 @@ function loginButtonTap(){
...
@@ -106,10 +155,11 @@ function loginButtonTap(){
//tap 快速注册
//tap 快速注册
function
registerTap
(){
function
registerTap
(){
iot
.
navigator
.
openWindow
({
url
:
'./register.html'
,
// iot.navigator.openWindow({
id
:
'register'
// url: './register.html',
});
// id: 'register'
// });
}
}
//tap 忘记密码
//tap 忘记密码
...
...
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