core
    正在准备搜索索引...

    接口 YmxJump

    跳转

    interface YmxJump {
        close(result?: any): Promise<void>;
        launch(data: LaunchData): Promise<number>;
        open(data: OpenData): Promise<void>;
    }

    层级 (查看层级一览)

    索引

    方法

    • 关闭当前窗口

      参数

      • 可选result: any

        需要返回给父窗口的数据

      返回 Promise<void>

      ymx.close()
      .then(() => {
      console.log('成功');
      })
      .catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
      // 带返回值的关闭,在 ymx.open() 的 onResult 函数中接收处理返回值
      ymx.close({
      hello: 'world 世界',
      year: 2026
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
    • 拉起第三方应用

      参数

      返回 Promise<number>

      成功的 urls 序号

      ymx.launch({
      url: 'https://xw.qq.com/'
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
      ymx.launch({
      url: 'weixin://'
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
      ymx.launch({
      url: 'tel://1801234'
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
    • 在新窗口中打开链接

      参数

      返回 Promise<void>

      ymx.open({
      url: 'https://xw.qq.com/'
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });
      ymx.open({
      url: 'https://xw.qq.com/',
      style: 'dialog',
      onResult: (result) => {
      // 关闭子窗口时返回的结果 ymx.close(result)
      console.log(result);
      }
      }).then(() => {
      console.log('成功');
      }).catch((e) => {
      alert(`失败 ${JSON.stringify(e)}`);
      });