Commit bafa1fc042b8b1f1bfbc4f4a8d51707657739514

Authored by vking
1 parent a14015b6

切出后重新定位

1 var mta=require('mta-wechat-analysis') 1 var mta=require('mta-wechat-analysis')
2 var uri_dc = require('utils/uri.js') 2 var uri_dc = require('utils/uri.js')
  3 +import PubSub from 'utils/PubSub'
3 global.regeneratorRuntime = require('lib/regenerator/runtime-module') 4 global.regeneratorRuntime = require('lib/regenerator/runtime-module')
4 5
5 const { regeneratorRuntime } = global 6 const { regeneratorRuntime } = global
@@ -172,7 +173,8 @@ App({ @@ -172,7 +173,8 @@ App({
172 }) 173 })
173 }, 174 },
174 onHide(){ 175 onHide(){
175 - console.log('obHide'); 176 + console.log('onHide');
  177 + PubSub.emit('appHide')
176 let time=new Date()/1000; 178 let time=new Date()/1000;
177 wx.getStorageInfo({ 179 wx.getStorageInfo({
178 success:(res)=>{ 180 success:(res)=>{
@@ -78,6 +78,7 @@ Component({ @@ -78,6 +78,7 @@ Component({
78 }).show(); 78 }).show();
79 } else { 79 } else {
80 failCount=failCount+1; 80 failCount=failCount+1;
  81 +
81 setTimeout(() => { 82 setTimeout(() => {
82 this.getPos() 83 this.getPos()
83 }, 500) 84 }, 500)
@@ -67,6 +67,7 @@ Page({ @@ -67,6 +67,7 @@ Page({
67 */ 67 */
68 hasOnLoad:false, 68 hasOnLoad:false,
69 hasGetLocation:false,//定位信息 69 hasGetLocation:false,//定位信息
  70 + hasAppHide:false,//app切至后台
70 onLoad: async function (options) { 71 onLoad: async function (options) {
71 this.hasOnLoad=true; 72 this.hasOnLoad=true;
72 // this.qqmapsdk=new QQMapWX({ 73 // this.qqmapsdk=new QQMapWX({
@@ -95,6 +96,15 @@ Page({ @@ -95,6 +96,15 @@ Page({
95 } 96 }
96 } 97 }
97 ) 98 )
  99 + PubSub.on(
  100 + 'appHide',
  101 + data=>{
  102 + console.log('appHide');
  103 + this.hasGetLocation=false
  104 + this.hasClickMoveToLocation=false
  105 + this.hasAppHide=true
  106 + }
  107 + )
98 reddot.init() 108 reddot.init()
99 }, 109 },
100 110
@@ -179,14 +189,12 @@ Page({ @@ -179,14 +189,12 @@ Page({
179 * 生命周期函数--监听页面隐藏 189 * 生命周期函数--监听页面隐藏
180 */ 190 */
181 onHide: function () { 191 onHide: function () {
182 -  
183 }, 192 },
184 193
185 /** 194 /**
186 * 生命周期函数--监听页面卸载 195 * 生命周期函数--监听页面卸载
187 */ 196 */
188 onUnload: function () { 197 onUnload: function () {
189 -  
190 }, 198 },
191 199
192 /** 200 /**