Skip to content
This repository was archived by the owner on Dec 9, 2019. It is now read-only.
This repository was archived by the owner on Dec 9, 2019. It is now read-only.

插件定位之后,切换页面,切换两次之后就回调函数一直没有返回值,也没有报错 #86

@naixin-coder

Description

@naixin-coder

`

ionic 环境如下

@ionic/app-scripts : 3.2.0
Cordova Platforms  : android 6.4.0 ios 4.5.5
Ionic Framework    : ionic-angular 3.9.2

代码如下

方法如下 baiduLocation() {

    return new Promise((resolve) => {
        console.log('进入定位')
        baidumap_location.getCurrentPosition(result => {
            console.log(result);
            this.address = result;
            resolve(result);
            // const { latitude, longitude } = result
            this.common.setStorage('result', result)
            // this.common.setStorage('longitude', longitude)
        }, async (error: any) => {
            const result = await this.common.getStorage('result')
            this.address = result;
            // const longitude = await this.common.getStorage('longitude')
            resolve(result);
            console.log(11111111, error);
            // this.common.showToast('定位失败');
        })
    })
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions