//设置围栏监听事件
fence.setGeoFenceListener(function(res){
if(res.type == 'onGeoFenceStatus'){
let data = res.data
if(data.event == 1){ // 进入地理围栏事件
}else if(data.event == 2){ // 离开地理围栏事件
// 调用上传数据跳转事件
const innerAudio = uni.createInnerAudioContext();
innerAudio.src = path['L1']
innerAudio.play()
innerAudio.onEnded(res => {
if(that.option.pid == data.customId && that.option.multiple_address[that.option.point-1].fence_enable){
that.to(false)
}
})
}else{
if(that.option.pid == data.customId && that.option.multiple_address[that.option.point-1].fence_enable){
that.to(false)
}
}
}
})
....................
to: debounce(function(data){
let that = this
uni.getLocation({
type: 'gcj02',
geocode: true,
success: (res) => {
that.form.longitude = res.longitude
that.form.latitude = res.latitude
that.form.address = res.address.province+res.address.city+res.address.district+res.address.street+res.address.streetNum+res.address.poiName
that.form.short_address = res.address.street+res.address.streetNum+res.address.poiName
detail({
pid: that.form.pid
}).then(res => {
if(res.data.abnormal_info.ab_type != 0 && res.data.abnormal_info.ab_type != 1 && res.data.abnormal_info.ab_type != 2 && res.data.abnormal_info.ab_type != 10){
that.form.fee_list = that.costList
arriveTake(that.form).then(res => {
console.log(res)
if(res.code == 1){
uni.reLaunch({
url: `/pages/transition/being-pickUp?pid=${that.form.pid}`
})
}else{
uni.showToast({
title: res.msg,
duration: 3000,
icon: 'none'
})
}
})
}else{
uni.showToast({
title: that.$t('warn.order_abnormal'),
duration: 3000,
icon: 'none'
})
}
})
},
fail(e){
uni.showToast({
title: e.errMsg,
icon: 'none',
duration: 3000
})
}
})
}),
Burger (作者)
methods中的to方法调用后,ios闪退
2024-04-22 11:51