11
This commit is contained in:
@@ -123,7 +123,18 @@ export default {
|
||||
update(e) {
|
||||
this.payRealAmount = e
|
||||
},
|
||||
positionChenk(position) {
|
||||
return !position?.latitude && !position?.longitude ? true : false
|
||||
},
|
||||
gopaly() {
|
||||
let position = this.$pinia.state.value.user.position;
|
||||
if (this.positionChenk(position)) {
|
||||
position = JSON.parse(localStorage.getItem("position"))
|
||||
if (this.positionChenk(position)) {
|
||||
console.log(position, this.$pinia.state.value.user.position, '地理位置错误');
|
||||
return
|
||||
}
|
||||
}
|
||||
let page = {
|
||||
shareCompanyQuota: 0, // 共享标识
|
||||
priceId: this.seleOil.priceId, //类型:String 必有字段 备注:油价主键
|
||||
@@ -140,18 +151,22 @@ export default {
|
||||
// "networkIp": "mock" //类型:String 可有字段 备注:ip地址
|
||||
kaliState: 1,
|
||||
'version': 1,
|
||||
'xoilAmountGun': Number( Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)) ,
|
||||
latitude: 31.82057,
|
||||
longitude: 117.22901
|
||||
'xoilAmountGun': Number(Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)),
|
||||
latitude: position.latitude,
|
||||
longitude: position.longitude
|
||||
}
|
||||
if (!page.plateNumber || !page.volume || !page.realPrice) {
|
||||
this.$notify('请检查提交的数据哦')
|
||||
return
|
||||
}
|
||||
oilOrderApi.createOrder(page).then(res => {
|
||||
if(res.code==20000){
|
||||
this.$router.push({
|
||||
name:'cashier',
|
||||
params:{
|
||||
order:res.data
|
||||
}
|
||||
})
|
||||
if (res.code == 20000) {
|
||||
this.$router.push({
|
||||
'path': '/cashier',
|
||||
query: {
|
||||
order: JSON.stringify(res.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(res, '创建订单')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user