Authored by yyq

safety intreface

@@ -71,6 +71,13 @@ const yoho = { @@ -71,6 +71,13 @@ const yoho = {
71 return callback(); 71 return callback();
72 } 72 }
73 }, 73 },
  74 + safetyInterface(callback) {
  75 + if (this.deviceready) {
  76 + return callback();
  77 + } else {
  78 + this.ready(callback);
  79 + }
  80 + },
74 81
75 /** 82 /**
76 * 跳转至指定index的tab(从0开始) 83 * 跳转至指定index的tab(从0开始)
@@ -700,5 +707,8 @@ const yoho = { @@ -700,5 +707,8 @@ const yoho = {
700 }, 707 },
701 }; 708 };
702 709
  710 +yoho.ready(() => {
  711 + yoho.deviceready = true;
  712 +});
703 713
704 export default yoho; 714 export default yoho;
@@ -67,7 +67,9 @@ export default { @@ -67,7 +67,9 @@ export default {
67 methods: { 67 methods: {
68 onBack() { 68 onBack() {
69 if (this.yoho.homePage) { 69 if (this.yoho.homePage) {
  70 + this.$yoho.safetyInterface(() => {
70 this.$yoho.finishPage({}); 71 this.$yoho.finishPage({});
  72 + });
71 } else { 73 } else {
72 this.$router.go(-1); 74 this.$router.go(-1);
73 } 75 }