Commit 6170ebf6 by 朱建香

#9页面返回修改

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