我正在使用一个名为“ trip”的组件,该组件试图恢复一些信息,例如驾驶员和骑手之间的“驾驶员ID”,“税”和“距离”。
将地理定位功能传递给组件时,它不会恢复所有对象。我认为Cordova插件无法正常运行。
我尝试将位置设置提高到“高精度”,并且设置了权限来尝试解决此问题。
Runtime Error
Firebase.set failed: First argument contains undefined in property 'deals.xk7ePu6qC8ZrPeJ0jPxZ7K9kBw33.fee'
种族申请:
makeDeal(driverId, origin, destination, distance, fee, currency, note, paymentMethod, promocode, discount) {
let user = this.authService.getUserData();
return this.db.object('deals/' + driverId).set({
passengerId: user.uid,
currency: currency,
origin: origin,
destination: destination,
distance: distance,
fee: fee,
note: note,
paymentMethod: paymentMethod,
status: DEAL_STATUS_PENDING,
createdAt: Date.now(),
promocode: promocode,
discount: discount
});
}
在API中搜索附近驾驶员的位置,id,然后计算距离:
getDriver(id) {
return this.db.object('drivers/' + id);
}
// get driver position
getDriverPosition(locality, vehicleType, id) {
return this.db.object('localities/' + locality + '/' + vehicleType + '/' + id);
}
getActiveDriver(locality, vehicleType) {
return this.db.list('localities/' + locality + '/' + vehicleType);
}
有人可以帮助我吗?