|
|
@ -145,7 +145,8 @@ |
|
|
|
getGasDetailByStoreKey, |
|
|
|
getGasDetailByStoreKey, |
|
|
|
addOrder, |
|
|
|
addOrder, |
|
|
|
getDictionaryByCodeTypeOl, |
|
|
|
getDictionaryByCodeTypeOl, |
|
|
|
oilPriceDiscountCompute |
|
|
|
oilPriceDiscountCompute, |
|
|
|
|
|
|
|
recentGasStation |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
@ -215,13 +216,30 @@ |
|
|
|
if (app.globalData.accountId) { |
|
|
|
if (app.globalData.accountId) { |
|
|
|
this.isTyAgent = true; |
|
|
|
this.isTyAgent = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
if (app.globalData.accountType && app.globalData.accountType == '000000#/') { |
|
|
|
|
|
|
|
this.recentGasStation(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.getGasDetailByStoreKey(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
// #ifdef MP |
|
|
|
this.getGasDetailByStoreKey(); |
|
|
|
this.getGasDetailByStoreKey(); |
|
|
|
|
|
|
|
// #endif |
|
|
|
this.getDictionaryByCodeTypeOl(); |
|
|
|
this.getDictionaryByCodeTypeOl(); |
|
|
|
this.getDictionaryByCodeTypeMoney(); |
|
|
|
this.getDictionaryByCodeTypeMoney(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onUnload() { |
|
|
|
|
|
|
|
if (app.globalData.accountType && app.globalData.accountType == '000000#/') { |
|
|
|
|
|
|
|
uni.removeStorage({ |
|
|
|
|
|
|
|
key: 'accountType' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
app.globalData.accountType = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
//前往导航 |
|
|
|
//前往导航 |
|
|
|
seeloaction() { |
|
|
|
seeloaction() { |
|
|
@ -237,8 +255,47 @@ |
|
|
|
this.typeId = item; |
|
|
|
this.typeId = item; |
|
|
|
this.$refs.popup.show(); |
|
|
|
this.$refs.popup.show(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//一键加油 |
|
|
|
|
|
|
|
recentGasStation() { |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '加载中...' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
latitude: app.globalData.latitude, |
|
|
|
|
|
|
|
longitude: app.globalData.longitude, |
|
|
|
|
|
|
|
isTyAgent: this.isTyAgent |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
recentGasStation(params).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.storeList = res.return_data; |
|
|
|
|
|
|
|
if (!this.oilNo) { |
|
|
|
|
|
|
|
this.oilNo = res.return_data.oilPriceList[0].oilNoName; |
|
|
|
|
|
|
|
this.priceVip = res.return_data.oilPriceList[0].priceVip; |
|
|
|
|
|
|
|
this.priceGun = res.return_data.oilPriceList[0].priceGun; |
|
|
|
|
|
|
|
this.priceOfficial = res.return_data.oilPriceList[0].priceOfficial; |
|
|
|
|
|
|
|
this.detailList = res.return_data.oilPriceList; |
|
|
|
|
|
|
|
this.oilType = res.return_data.oilPriceList[0].oilType; |
|
|
|
|
|
|
|
this.gasGunList = res.return_data.gasGunList; |
|
|
|
|
|
|
|
for (var i = 0; i < res.return_data.gasGunList.length; i++) { |
|
|
|
|
|
|
|
if (this.oilNo == res.return_data.gasGunList[i].oilNoName) { |
|
|
|
|
|
|
|
this.gunnumber.push(res.return_data.gasGunList[i]) |
|
|
|
|
|
|
|
this.gunNo = res.return_data.gasGunList[i].gunNo; |
|
|
|
|
|
|
|
this.gasOilNo = res.return_data.gasGunList[i].oilNo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//查询详情 |
|
|
|
//查询详情 |
|
|
|
getGasDetailByStoreKey() { |
|
|
|
getGasDetailByStoreKey() { |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中...' |
|
|
|
title: '加载中...' |
|
|
|
}) |
|
|
|
}) |
|
|
@ -322,26 +379,26 @@ |
|
|
|
this.priceGun = item.priceGun; |
|
|
|
this.priceGun = item.priceGun; |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
this.$refs.popup.hide(); |
|
|
|
this.$refs.popup.hide(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//选择油枪 |
|
|
|
//选择油枪 |
|
|
|
changeValue2(item) { |
|
|
|
changeValue2(item) { |
|
|
|
this.gunNo = item.gunNo; |
|
|
|
this.gunNo = item.gunNo; |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
this.$refs.popup.hide(); |
|
|
|
this.$refs.popup.hide(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -374,12 +431,12 @@ |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.totalPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.discountPrice = '0.00'; |
|
|
|
this.litre = ''; |
|
|
|
this.litre = ''; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.inputMoney = ''; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.oilLiters = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.discount = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.oilSubsidy = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.litersPreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.pricePreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
this.totalPreferences = '0'; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -480,7 +537,16 @@ |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
app.globalData.latitude = res.latitude; |
|
|
|
app.globalData.latitude = res.latitude; |
|
|
|
app.globalData.longitude = res.longitude; |
|
|
|
app.globalData.longitude = res.longitude; |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
if (app.globalData.accountType && app.globalData.accountType == '000000#/') { |
|
|
|
|
|
|
|
that.recentGasStation(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
that.getGasDetailByStoreKey(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
// #ifdef MP |
|
|
|
that.getGasDetailByStoreKey(); |
|
|
|
that.getGasDetailByStoreKey(); |
|
|
|
|
|
|
|
// #endif |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
that.toPay(); |
|
|
|
that.toPay(); |
|
|
|
}, 500); |
|
|
|
}, 500); |
|
|
|