Commit 86aa7ed4 by 朱建香

1012

parent f1de58cb
......@@ -78,7 +78,7 @@ function openScanCode(self){
uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
......
......@@ -262,7 +262,7 @@ function commLoadingButtonTap(self) {
//绑定成功
uComponents.hideCommLoading(self);
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}else if(self.getStatus() == 2){
......
......@@ -438,7 +438,7 @@ function setDevceInfo(self, data) {
//tap 个人信息
function myInfoTap(self){
iot.navigator.openWindow({
url: '../myInfo/',
url: '../myInfo/index.html',
id: 'myInfo',
extras: {
nickname: self.nickname
......@@ -448,7 +448,7 @@ function myInfoTap(self){
function bindDoorlockTap(){
iot.navigator.openWindow({
url: '../addDevice/',
url: '../addDevice/index.html',
id: 'addDevice'
});
}
......@@ -457,7 +457,7 @@ function bindDoorlockTap(){
function doorlockManageTap(self){
if(self.getValueDoorlockManage() == 1){
iot.navigator.openWindow({
url: '../doorlockManage/',
url: '../doorlockManage/index.html',
id: 'doorlockManage',
extras: {
deviceId: self.deviceId,
......@@ -497,7 +497,7 @@ function securityAlarmTap(self){
function doorlockUserTap(self){
// if(self.getValueDoorlockUser() == 1){
// iot.navigator.openWindow({
// url: '../doorlockUsers/',
// url: '../doorlockUsers/index.html',
// id: 'doorlockUsers',
// extras: {
// deviceId: self.deviceId
......
......@@ -219,7 +219,7 @@ function unbindStateDialogTap(self){
self.setStateShowFlag(false);
if(self.getUnbindSucceess){
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
......
......@@ -106,15 +106,13 @@ function confirmButtonTap(self){
uComponents.openAlert(self, Vue.t('addUser.addUserSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
console.log("添加用户成功");
//跳转到门锁用户界面
iot.storage.setMap('lock_id', data.lock_id, () => {
self.$router.replace({path: '/myDoorlock'});
}, () => {
error();
});
//跳转到门锁用户界面
iot.navigator.openWindow({
url: './doorlockUser.html',
id: 'doorlockUser'
id: 'doorlockUser',
extras: {
userId: response.data.id
}
});
}
});
......@@ -132,4 +130,4 @@ function confirmButtonTap(self){
}
});
}
}
\ No newline at end of file
}
......@@ -30,9 +30,14 @@ function init() {
guideStep3ShowFlag: false,
guideStep4ShowFlag: false,
//配置组件
componentsConfig: initComponentsConfig()
componentsConfig: initComponentsConfig(),
extras: {}
},
mounted(){
mounted(){
this.extras = iot.navigator.getExtras();
console.log(this.extras);
checkFirstAddUser(this);
getUserInfo(this);
},
methods:{
getBindShowFlag(){
......@@ -169,6 +174,65 @@ function initComponentsConfig() {
}
}
//判断是否第一次添加用户
function checkFirstAddUser(){
iot.storage.getMap('isFirstAddUser', (res) => {
if (res) {
} else {
//显示引导动画
showGuide();
}
}, () => {
//显示 引导动画
showGuide();
});
}
//显示动画
async function showGuide(){
try{
let time =await sleep(1000);
self.setGuideStep1ShowFlag(true);
time = await sleep(1000);
self.setGuideStep2ShowFlag(true);
time = await sleep(1000);
self.setGuideStep3ShowFlag(true),
time = await sleep(1000);
self.setGuideStep4ShowFlag(true);
}
catch (err){
console.log(err);
}
}
function sleep(time){
return new Promise(function(resolve, reject){
setTimeout(()=>{
resolve(time);
},time);
})
}
function getUserInfo(self){
iot.business.api.sendCustom('user/getUserInfo',{
data: {
id: self.extras.userId
},
success: (response) => {
console.log(response);
},
error: (error) => {
console.log(error);
},
complete: () => {}
})
}
//tap <
function backTap(){
iot.navigator.back();
......@@ -192,10 +256,10 @@ function bindTap(){
//tap 解绑
function unbindButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUsers.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true);
}}
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true);
}}
);
}
......
......@@ -77,7 +77,7 @@ function loginButtonTap(self){
console.log("云端登陆");
cloudsLogin(self, data.UserID);
// iot.navigator.openWindow({
// url: '../device/',
// url: '../device/index.html',
// id: 'device'
// });
}else{
......@@ -109,7 +109,7 @@ function cloudsLogin(self, id){
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}else{
......@@ -129,7 +129,7 @@ function cloudsLogin(self, id){
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}else{
......@@ -154,7 +154,7 @@ function cloudsLogin(self, id){
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}else{
......
......@@ -141,7 +141,7 @@ function backTap(){
//tap 注册
function registerButtonTap(){
iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
\ No newline at end of file
......@@ -86,7 +86,7 @@ function openScanCode(self) {
_public.uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
text: Vue.t('btn.confirm'), callback: function callback() {
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
......
......@@ -271,7 +271,7 @@ function commLoadingButtonTap(self) {
//绑定成功
_public.uComponents.hideCommLoading(self);
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
} else if (self.getStatus() == 2) {
......
......@@ -16314,7 +16314,7 @@ function setDevceInfo(self, data) {
//tap 个人信息
function myInfoTap(self) {
_public.iot.navigator.openWindow({
url: '../myInfo/',
url: '../myInfo/index.html',
id: 'myInfo',
extras: {
nickname: self.nickname
......@@ -16324,7 +16324,7 @@ function myInfoTap(self) {
function bindDoorlockTap() {
_public.iot.navigator.openWindow({
url: '../addDevice/',
url: '../addDevice/index.html',
id: 'addDevice'
});
}
......@@ -16333,7 +16333,7 @@ function bindDoorlockTap() {
function doorlockManageTap(self) {
if (self.getValueDoorlockManage() == 1) {
_public.iot.navigator.openWindow({
url: '../doorlockManage/',
url: '../doorlockManage/index.html',
id: 'doorlockManage',
extras: {
deviceId: self.deviceId,
......@@ -16373,7 +16373,7 @@ function securityAlarmTap(self) {
function doorlockUserTap(self) {}
// if(self.getValueDoorlockUser() == 1){
// iot.navigator.openWindow({
// url: '../doorlockUsers/',
// url: '../doorlockUsers/index.html',
// id: 'doorlockUsers',
// extras: {
// deviceId: self.deviceId
......
......@@ -229,7 +229,7 @@ function unbindStateDialogTap(self) {
self.setStateShowFlag(false);
if (self.getUnbindSucceess) {
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
......
......@@ -85,7 +85,7 @@ function loginButtonTap(self) {
console.log("云端登陆");
cloudsLogin(self, data.UserID);
// iot.navigator.openWindow({
// url: '../device/',
// url: '../device/index.html',
// id: 'device'
// });
} else {}
......@@ -115,7 +115,7 @@ function cloudsLogin(self, id) {
if (data) {
_public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
} else {}
......@@ -133,7 +133,7 @@ function cloudsLogin(self, id) {
if (data) {
_public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
} else {}
......@@ -156,7 +156,7 @@ function cloudsLogin(self, id) {
if (data) {
_public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
} else {}
......
......@@ -151,7 +151,7 @@ function backTap() {
//tap 注册
function registerButtonTap() {
_public.iot.navigator.openWindow({
url: '../device/',
url: '../device/index.html',
id: 'device'
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment