You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
732 B
31 lines
732 B
/**
|
|
* 选择位置
|
|
* @param {*} callbackId
|
|
*/
|
|
export function chooseLocation (options, callbackId) {
|
|
const {
|
|
invokeCallbackHandler: invoke
|
|
} = UniServiceJSBridge
|
|
getApp().$router.push({
|
|
type: 'navigateTo',
|
|
path: '/choose-location'
|
|
}, function () {
|
|
var fn = data => {
|
|
UniServiceJSBridge.unsubscribe('onChooseLocation', fn)
|
|
if (data) {
|
|
invoke(callbackId, Object.assign(data, {
|
|
errMsg: 'chooseLocation:ok'
|
|
}))
|
|
} else {
|
|
invoke(callbackId, {
|
|
errMsg: 'chooseLocation:fail'
|
|
})
|
|
}
|
|
}
|
|
UniServiceJSBridge.subscribe('onChooseLocation', fn)
|
|
}, function () {
|
|
invoke(callbackId, {
|
|
errMsg: 'chooseLocation:fail'
|
|
})
|
|
})
|
|
}
|
|
|