Commit 86aa7ed4 by 朱建香

1012

parent f1de58cb
...@@ -78,7 +78,7 @@ function openScanCode(self){ ...@@ -78,7 +78,7 @@ function openScanCode(self){
uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), { uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} }
......
...@@ -262,7 +262,7 @@ function commLoadingButtonTap(self) { ...@@ -262,7 +262,7 @@ function commLoadingButtonTap(self) {
//绑定成功 //绑定成功
uComponents.hideCommLoading(self); uComponents.hideCommLoading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
}else if(self.getStatus() == 2){ }else if(self.getStatus() == 2){
......
...@@ -438,7 +438,7 @@ function setDevceInfo(self, data) { ...@@ -438,7 +438,7 @@ function setDevceInfo(self, data) {
//tap 个人信息 //tap 个人信息
function myInfoTap(self){ function myInfoTap(self){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../myInfo/', url: '../myInfo/index.html',
id: 'myInfo', id: 'myInfo',
extras: { extras: {
nickname: self.nickname nickname: self.nickname
...@@ -448,7 +448,7 @@ function myInfoTap(self){ ...@@ -448,7 +448,7 @@ function myInfoTap(self){
function bindDoorlockTap(){ function bindDoorlockTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../addDevice/', url: '../addDevice/index.html',
id: 'addDevice' id: 'addDevice'
}); });
} }
...@@ -457,7 +457,7 @@ function bindDoorlockTap(){ ...@@ -457,7 +457,7 @@ function bindDoorlockTap(){
function doorlockManageTap(self){ function doorlockManageTap(self){
if(self.getValueDoorlockManage() == 1){ if(self.getValueDoorlockManage() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockManage/', url: '../doorlockManage/index.html',
id: 'doorlockManage', id: 'doorlockManage',
extras: { extras: {
deviceId: self.deviceId, deviceId: self.deviceId,
...@@ -497,7 +497,7 @@ function securityAlarmTap(self){ ...@@ -497,7 +497,7 @@ function securityAlarmTap(self){
function doorlockUserTap(self){ function doorlockUserTap(self){
// if(self.getValueDoorlockUser() == 1){ // if(self.getValueDoorlockUser() == 1){
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../doorlockUsers/', // url: '../doorlockUsers/index.html',
// id: 'doorlockUsers', // id: 'doorlockUsers',
// extras: { // extras: {
// deviceId: self.deviceId // deviceId: self.deviceId
......
...@@ -219,7 +219,7 @@ function unbindStateDialogTap(self){ ...@@ -219,7 +219,7 @@ function unbindStateDialogTap(self){
self.setStateShowFlag(false); self.setStateShowFlag(false);
if(self.getUnbindSucceess){ if(self.getUnbindSucceess){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} }
......
...@@ -106,15 +106,13 @@ function confirmButtonTap(self){ ...@@ -106,15 +106,13 @@ function confirmButtonTap(self){
uComponents.openAlert(self, Vue.t('addUser.addUserSuccess'), { uComponents.openAlert(self, Vue.t('addUser.addUserSuccess'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
console.log("添加用户成功"); console.log("添加用户成功");
//跳转到门锁用户界面 //跳转到门锁用户界面
iot.storage.setMap('lock_id', data.lock_id, () => {
self.$router.replace({path: '/myDoorlock'});
}, () => {
error();
});
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './doorlockUser.html', url: './doorlockUser.html',
id: 'doorlockUser' id: 'doorlockUser',
extras: {
userId: response.data.id
}
}); });
} }
}); });
...@@ -132,4 +130,4 @@ function confirmButtonTap(self){ ...@@ -132,4 +130,4 @@ function confirmButtonTap(self){
} }
}); });
} }
} }
\ No newline at end of file
...@@ -30,9 +30,14 @@ function init() { ...@@ -30,9 +30,14 @@ function init() {
guideStep3ShowFlag: false, guideStep3ShowFlag: false,
guideStep4ShowFlag: false, guideStep4ShowFlag: false,
//配置组件 //配置组件
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig(),
extras: {}
}, },
mounted(){ mounted(){
this.extras = iot.navigator.getExtras();
console.log(this.extras);
checkFirstAddUser(this);
getUserInfo(this);
}, },
methods:{ methods:{
getBindShowFlag(){ getBindShowFlag(){
...@@ -169,6 +174,65 @@ function initComponentsConfig() { ...@@ -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 < //tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
...@@ -192,10 +256,10 @@ function bindTap(){ ...@@ -192,10 +256,10 @@ function bindTap(){
//tap 解绑 //tap 解绑
function unbindButtonTap(self){ function unbindButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUsers.unbindDialogTip'), uComponents.openConfirm(self, Vue.t('doorlockUsers.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}}, {text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () { {text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true); self.setStateShowFlag(true);
}} }}
); );
} }
......
...@@ -77,7 +77,7 @@ function loginButtonTap(self){ ...@@ -77,7 +77,7 @@ function loginButtonTap(self){
console.log("云端登陆"); console.log("云端登陆");
cloudsLogin(self, data.UserID); cloudsLogin(self, data.UserID);
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../device/', // url: '../device/index.html',
// id: 'device' // id: 'device'
// }); // });
}else{ }else{
...@@ -109,7 +109,7 @@ function cloudsLogin(self, id){ ...@@ -109,7 +109,7 @@ function cloudsLogin(self, id){
if(data){ if(data){
uComponents.hideLoading(self); uComponents.hideLoading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
}else{ }else{
...@@ -129,7 +129,7 @@ function cloudsLogin(self, id){ ...@@ -129,7 +129,7 @@ function cloudsLogin(self, id){
if(data){ if(data){
uComponents.hideLoading(self); uComponents.hideLoading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
}else{ }else{
...@@ -154,7 +154,7 @@ function cloudsLogin(self, id){ ...@@ -154,7 +154,7 @@ function cloudsLogin(self, id){
if(data){ if(data){
uComponents.hideLoading(self); uComponents.hideLoading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
}else{ }else{
......
...@@ -141,7 +141,7 @@ function backTap(){ ...@@ -141,7 +141,7 @@ function backTap(){
//tap 注册 //tap 注册
function registerButtonTap(){ function registerButtonTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} }
\ No newline at end of file
...@@ -86,7 +86,7 @@ function openScanCode(self) { ...@@ -86,7 +86,7 @@ function openScanCode(self) {
_public.uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), { _public.uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
text: Vue.t('btn.confirm'), callback: function callback() { text: Vue.t('btn.confirm'), callback: function callback() {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} }
......
...@@ -271,7 +271,7 @@ function commLoadingButtonTap(self) { ...@@ -271,7 +271,7 @@ function commLoadingButtonTap(self) {
//绑定成功 //绑定成功
_public.uComponents.hideCommLoading(self); _public.uComponents.hideCommLoading(self);
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} else if (self.getStatus() == 2) { } else if (self.getStatus() == 2) {
......
...@@ -16314,7 +16314,7 @@ function setDevceInfo(self, data) { ...@@ -16314,7 +16314,7 @@ function setDevceInfo(self, data) {
//tap 个人信息 //tap 个人信息
function myInfoTap(self) { function myInfoTap(self) {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../myInfo/', url: '../myInfo/index.html',
id: 'myInfo', id: 'myInfo',
extras: { extras: {
nickname: self.nickname nickname: self.nickname
...@@ -16324,7 +16324,7 @@ function myInfoTap(self) { ...@@ -16324,7 +16324,7 @@ function myInfoTap(self) {
function bindDoorlockTap() { function bindDoorlockTap() {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../addDevice/', url: '../addDevice/index.html',
id: 'addDevice' id: 'addDevice'
}); });
} }
...@@ -16333,7 +16333,7 @@ function bindDoorlockTap() { ...@@ -16333,7 +16333,7 @@ function bindDoorlockTap() {
function doorlockManageTap(self) { function doorlockManageTap(self) {
if (self.getValueDoorlockManage() == 1) { if (self.getValueDoorlockManage() == 1) {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../doorlockManage/', url: '../doorlockManage/index.html',
id: 'doorlockManage', id: 'doorlockManage',
extras: { extras: {
deviceId: self.deviceId, deviceId: self.deviceId,
...@@ -16373,7 +16373,7 @@ function securityAlarmTap(self) { ...@@ -16373,7 +16373,7 @@ function securityAlarmTap(self) {
function doorlockUserTap(self) {} function doorlockUserTap(self) {}
// if(self.getValueDoorlockUser() == 1){ // if(self.getValueDoorlockUser() == 1){
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../doorlockUsers/', // url: '../doorlockUsers/index.html',
// id: 'doorlockUsers', // id: 'doorlockUsers',
// extras: { // extras: {
// deviceId: self.deviceId // deviceId: self.deviceId
......
...@@ -229,7 +229,7 @@ function unbindStateDialogTap(self) { ...@@ -229,7 +229,7 @@ function unbindStateDialogTap(self) {
self.setStateShowFlag(false); self.setStateShowFlag(false);
if (self.getUnbindSucceess) { if (self.getUnbindSucceess) {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} }
......
...@@ -85,7 +85,7 @@ function loginButtonTap(self) { ...@@ -85,7 +85,7 @@ function loginButtonTap(self) {
console.log("云端登陆"); console.log("云端登陆");
cloudsLogin(self, data.UserID); cloudsLogin(self, data.UserID);
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../device/', // url: '../device/index.html',
// id: 'device' // id: 'device'
// }); // });
} else {} } else {}
...@@ -115,7 +115,7 @@ function cloudsLogin(self, id) { ...@@ -115,7 +115,7 @@ function cloudsLogin(self, id) {
if (data) { if (data) {
_public.uComponents.hideLoading(self); _public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} else {} } else {}
...@@ -133,7 +133,7 @@ function cloudsLogin(self, id) { ...@@ -133,7 +133,7 @@ function cloudsLogin(self, id) {
if (data) { if (data) {
_public.uComponents.hideLoading(self); _public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} else {} } else {}
...@@ -156,7 +156,7 @@ function cloudsLogin(self, id) { ...@@ -156,7 +156,7 @@ function cloudsLogin(self, id) {
if (data) { if (data) {
_public.uComponents.hideLoading(self); _public.uComponents.hideLoading(self);
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' id: 'device'
}); });
} else {} } else {}
......
...@@ -151,7 +151,7 @@ function backTap() { ...@@ -151,7 +151,7 @@ function backTap() {
//tap 注册 //tap 注册
function registerButtonTap() { function registerButtonTap() {
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../device/', url: '../device/index.html',
id: 'device' 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