Commit 6170ebf6 by 朱建香

#9页面返回修改

parent ffe01157
...@@ -96,13 +96,6 @@ function backTap(){ ...@@ -96,13 +96,6 @@ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
////重写mui.back
//mui.back = function(){
// iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
// console.log("fire");
// iot.navigator.back();
//}
//tap 保存 //tap 保存
function saveTap(self){ function saveTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){ if(self.getTextName() == null || self.getTextName().trim() == ''){
...@@ -121,7 +114,6 @@ function saveTap(self){ ...@@ -121,7 +114,6 @@ function saveTap(self){
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
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 () {
iot.navigator.back(); iot.navigator.back();
......
...@@ -44,19 +44,11 @@ function init() { ...@@ -44,19 +44,11 @@ function init() {
unbindShowDialog: false unbindShowDialog: false
}, },
mounted(){ mounted(){
// uComponents.openAlert(this, Vue.t('doorlockManage.unbindSuccess'), {
// text: Vue.t('dialog.confirm'), callback: function () {
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }
// });
this.extras = iot.navigator.getExtras(); this.extras = iot.navigator.getExtras();
console.log(this.extras); console.log(this.extras);
this.role = this.extras.lockInfo.role; this.role = this.extras.lockInfo.role;
//获取门锁 //获取门锁
// getDoorlockInfo(this); getDoorlockInfo(this);
//监听returnPage返回事件,重新获取最新数据 //监听returnPage返回事件,重新获取最新数据
let self = this; let self = this;
window.addEventListener('returnPage',function(event){ window.addEventListener('returnPage',function(event){
......
...@@ -86,12 +86,6 @@ function initComponentsConfig() { ...@@ -86,12 +86,6 @@ function initComponentsConfig() {
} }
} }
mui.back = function() {
iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
console.log("returnPage");
iot.navigator.back();
}
//tap < //tap <
function backTap() { function backTap() {
iot.navigator.aback(); iot.navigator.aback();
...@@ -119,6 +113,7 @@ function confirmButtonTap(self){ ...@@ -119,6 +113,7 @@ function confirmButtonTap(self){
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(response.data.id){ if(response.data.id){
iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
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("添加用户成功");
......
...@@ -13,7 +13,12 @@ iot.ready(init); ...@@ -13,7 +13,12 @@ iot.ready(init);
function init() { function init() {
//通用 按钮、dialog、loading组件 //通用 按钮、dialog、loading组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']); uPublic.componentsInit(['u-button','u-dialog','u-loading']);
uPublic.closeSlideBack(); let opener = plus.webview.currentWebview().opener();
if(opener.id == 'addUser'){
setTimeout(function () {
opener.close();
}, 500);
}
const app = new Vue({ const app = new Vue({
data:{ data:{
userInfo: {}, userInfo: {},
...@@ -40,6 +45,7 @@ function init() { ...@@ -40,6 +45,7 @@ function init() {
let self = this; let self = this;
window.addEventListener('returnPage',function(event){ window.addEventListener('returnPage',function(event){
console.log("returnPage"); console.log("returnPage");
iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'),'returnPage',{});
getUserInfo(self); getUserInfo(self);
}); });
getUserInfo(this); getUserInfo(this);
...@@ -332,19 +338,6 @@ function setUserInfo(self, data){ ...@@ -332,19 +338,6 @@ function setUserInfo(self, data){
self.setUnbindShowFlag(data.user_id ? true : false); self.setUnbindShowFlag(data.user_id ? true : false);
} }
mui.back = function(){
let opener = plus.webview.currentWebview().opener();
if(opener.id == 'addUser'){
opener.close();
iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'),'returnPage',{});
iot.navigator.back();
}else{
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
iot.navigator.back();
}
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
...@@ -411,6 +404,7 @@ function unbindButtonTap(self){ ...@@ -411,6 +404,7 @@ function unbindButtonTap(self){
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'),'returnPage',{});
// self.setStateShowFlag(true); // self.setStateShowFlag(true);
uComponents.openAlert(self, Vue.t('doorlockUser.unbindSuccess'), { uComponents.openAlert(self, Vue.t('doorlockUser.unbindSuccess'), {
text: Vue.t('dialog.confirm'), callback: function () { text: Vue.t('dialog.confirm'), callback: function () {
...@@ -578,6 +572,7 @@ function deleteCloudeUser(self){ ...@@ -578,6 +572,7 @@ function deleteCloudeUser(self){
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(response.data.success){ if(response.data.success){
iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'),'returnPage',{});
uComponents.openAlert(self, Vue.t('doorlockUser.deleteSuccess'), { uComponents.openAlert(self, Vue.t('doorlockUser.deleteSuccess'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
iot.navigator.aback(); iot.navigator.aback();
......
...@@ -78,11 +78,6 @@ function initComponentsConfig() { ...@@ -78,11 +78,6 @@ function initComponentsConfig() {
} }
} }
iot.navigator.aback = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
iot.navigator.back();
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
...@@ -105,6 +100,7 @@ function saveTap(self){ ...@@ -105,6 +100,7 @@ function saveTap(self){
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(response.data.success){ if(response.data.success){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
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 () {
let opener = plus.webview.currentWebview().opener(); let opener = plus.webview.currentWebview().opener();
......
...@@ -80,12 +80,6 @@ function backTap(){ ...@@ -80,12 +80,6 @@ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
} }
mui.back = function(){
// iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
// console.log("fire");
iot.navigator.back();
}
//tap 重新生成二维码 //tap 重新生成二维码
function qrcodeButtonTap(self){ function qrcodeButtonTap(self){
self.setQrCodeDisabled(false); self.setQrCodeDisabled(false);
......
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