open-location-weex.js 641 字节
Newer Older
1 2 3
import {
  invoke
} from '../../bridge'
Q
qiang 已提交
4

5 6
import {
  showPage
Q
qiang 已提交
7
} from '../../../helpers/page.js'
8

9 10
import { getLocale } from 'uni-core/helpers/i18n'

11
export function openLocation (data, callbackId) {
12 13
  showPage({
    url: '__uniappopenlocation',
14 15 16
    data: Object.assign({}, data, {
      locale: getLocale()
    }),
17 18 19
    style: {
      titleNView: {
        type: 'transparent'
20 21 22
      },
      popGesture: 'close',
      backButtonAutoControl: 'close'
Q
qiang 已提交
23 24 25 26 27
    },
    onClose () {
      invoke(callbackId, {
        errMsg: 'openLocation:fail cancel'
      })
28 29 30 31 32 33
    }
  })
  return {
    errMsg: 'openLocation:ok'
  }
}