oil-station/gasStation-uni/unpackage/dist/build/mp-alipay/pages/refuel/refuel.js

1 line
8.3 KiB
JavaScript
Raw Normal View History

2024-08-16 18:26:19 +08:00
(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["pages/refuel/refuel"],{3323:function(t,e,n){"use strict";var i=n("947c"),o=n.n(i);o.a},"71c4":function(t,e,n){"use strict";(function(t,i){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n("2eee")),r=o(n("c973")),s=(o(n("2594")),o(n("648b"))),u={data:function(){return{appltType:t.getStorageSync("appltType"),value:"",liters:0,show:!1,pic:0,hindex:0,qindex:0,aindex:null,sindex:null,store:{name:"测试油站",description:"济南分店",address:"济南槐荫区"},welfare:[],distance:"",storeId:"",oilNumberList:[],oilGunList:[],staffList:[],amountList:[100,200,300],baseUrl:this.$baseUrl,oilPrice:0,oilUnit:"",AppToken:t.getStorageSync("App-Token"),oilOrder:{storeId:"",couponId:"",commissionAmount:0,staffId:"",terminal:"applet",oils:"",oilGunNum:"",oilNum:"",orderAmount:0,discountAmount:0,payAmount:0,payType:t.getStorageSync("appltType")}}},components:{tabbar:function(){n.e("components/tabbar/tabbar").then(function(){return resolve(n("9924"))}.bind(null,n)).catch(n.oe)}},onLoad:function(e){if("WECHAT"==t.getStorageSync("appltType")){var n=decodeURIComponent(e.q);if(e.q){var i=n.split("?")[1],o="19",a="";if(i.includes("&")){var r=i.split("&");r.forEach((function(t){t.includes("storeId")?o=t.split("=")[1]:a=t.split("=")[1]}))}else o=i.split("=")[1];t.setStorageSync("storeId",o),t.setStorageSync("inviteStaffId",a),this.storeId=t.getStorageSync("storeId"),this.staffId=t.getStorageSync("inviteStaffId"),this.getStore(t.getStorageSync("storeId"))}}else t.getStorageSync("storeId")&&this.getStore(t.getStorageSync("storeId"))},onShow:function(){this.getStore(t.getStorageSync("storeId")),this.getTheJudgmentIsTheSame()},methods:{openKey:function(){this.show=!0,this.$refs.popup1.open("bottom")},isExistStoreId:function(){""!=t.getStorageSync("storeId")?this.getStore(t.getStorageSync("storeId")):this.getAddress()},getStore:function(e){var n=this;(0,s.default)({url:"business/storeInformation/store/queryStoreById",method:"post",data:{storeId:e}}).then((function(i){n.getOilNumber(e),n.getStaffList(e),n.store=i.data,n.storeId=i.data.id,t.setStorageSync("storeId",n.store.id),t.setStorageSync("chainStoreId",n.store.chainStoreId);var o=i.data.welfare;o&&(o.includes(",")?n.welfare=i.data.welfare.split(","):n.welfare.push(i.data.welfare))})).catch((function(e){t.showLoading({title:JSON.stringify(e)+222})}))},getAddress:function(){var e=this;t.getLocation({type:"gcj02",success:function(t){(0,s.default)({url:"business/storeInformation/store/recentlyStore",method:"post",data:{lon:t.longitude,lat:t.latitude}}).then((function(t){e.distance=t.data.distance.toFixed(1),e.store=t.data.store,e.storeId=t.data.store.id,e.getOilNumber(e.storeId),e.getStaffList(e.storeId);var n=t.data.store.welfare;void 0!=n&&null!=n&&""!=n&&(n.includes(",")?e.welfare=t.data.store.welfare.split(","):e.welfare.push(t.data.store.welfare))}))},fail:function(t){e.getStore(0)}})},getOilNumber:function(e){var n=this;(0,s.default)({url:"business/petrolStationManagement/oilGun/selectByNumber/"+e,method:"get"}).then((function(e){n.oilNumberList=e.data,e.data&&(n.oilPrice=e.data[0].oilPrice,n.oilUnit=e.data[0].unit,n.oilOrder.oils=e.data[0].oilNameId,e.data[0].oilGunList&&(n.oilGunList=e.data[0].oilGunList,n.oilOrder.oilGunNum=e.data[0].oilGunList[0].id,t.setStorageSync("tankId",e.data[0].oilGunList[0].tankId)))}))},getOilGun:function(t){var e=this;(0,s.default)({url:"business/petrolStationManagement/oilGun/queryGunList/"+t,method:"get"}).then((function(t){e.oilGunList=t.data,e.oilOrder.oilGunNum=t.data[0].id}))},getStaffList:function(t){var e=this;(0,s.default)({url:"business/member/staff/queryStaffList/"+t,method:"get"}).then((function(t){e.staffList=t.data}))},getSIndex:function(e,n){var i=this;this.sindex=e,(0,s.default)({url:"business/petrolStationManagement/oilTank/"+t.getStorageSync("tankId"),method:"get"}).then((function(e){e.data.storedQuantity-i.liters<0?t.showToast({title:"所加油的升数大于油罐内的升数,请重新选择加油升数",icon:"none"}):i.toPayment(n)}))},toPayment: