1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/refuel/refuel"],{"22bd":function(t,e,n){"use strict";var o=n("9c7d"),i=n.n(o);i.a},"65c4":function(t,e,n){"use strict";n.r(e);var o=n("c8c4"),i=n("fa3e");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("22bd");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"3ba2bfd2",null,!1,o["a"],void 0);e["default"]=r.exports},"8ab2":function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("3cca");o(n("3240"));var i=o(n("65c4"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"914f":function(t,e,n){"use strict";(function(t,o){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("7eb4")),s=i(n("ee10")),r=(i(n("b530")),i(n("7073"))),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("45e5"))}.bind(null,n)).catch(n.oe)}},onLoad:function(e){if("WECHAT"==t.getStorageSync("appltType")){var n=decodeURIComponent(e.q);if(e.q){var o=n.split("?")[1],i="19",a="",s="";if(o.includes("&")){var r=o.split("&");r.forEach((function(t){t.includes("storeId")?i=t.split("=")[1]:t.includes("staffId")?a=t.split("=")[1]:s=t.split("=")[1]}))}else o.includes("storeId")?i=o.split("=")[1]:(s=o.split("=")[1],this.getStoreIdBySn(s));t.setStorageSync("storeId",i),t.setStorageSync("sn",s),t.setStorageSync("inviteStaffId",a),this.storeId=t.getStorageSync("storeId"),this.staffId=t.getStorageSync("inviteStaffId"),t.getStorageSync("storeId")&&this.getStore(t.getStorageSync("storeId"))}}else t.getStorageSync("storeId")?this.getStore(t.getStorageSync("storeId")):this.getStoreIdBySn(t.getStorageSync("sn"))},onShow:function(){this.getStore(t.getStorageSync("storeId")),this.getTheJudgmentIsTheSame()},methods:{getAddress:function(e){var n=this;t.getLocation({type:"gcj02",success:function(o){""==n.longitude&&""==n.latitude&&(n.longitude=o.longitude,n.latitude=o.latitude),console.log("经度: "+n.longitude),console.log("纬度: "+n.latitude),(0,r.default)({url:"business/storeInformation/store/recentlyStore",method:"post",data:{lon:n.longitude,lat:n.latitude,storeId:e,isLogin:n.AppToken?"0":"1"}}).then((function(e){console.log(e,"2154"),e.data.store?(n.store=e.data.store,t.setStorageSync("storeId",e.data.store.id),t.setStorageSync("chainStoreId",e.data.store.chainStoreId),n.getOilNumber(e.data.store.id)):t.showToast({title:"当前店铺已关闭!!!",icon:"none"})})).catch((function(t){}))},fail:function(t){n.getStore(2),console.log("获取位置信息失败: "+t.errMsg)}})},getUserAuthority:function(){var e=this;t.getSetting({success:function(n){return(0,s.default)(a.default.mark((function o(){return a.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(n.authSetting["scope.userLocation"]){o.next=5;break}return o.next=3,e.getAddress(t.getStorageSync("storeId"));case 3:o.next=7;break;case 5:return o.next=7,e.getAddress(t.getStorageSync("storeId"));case 7:case"end":return o.stop()}}),o)})))()},fail:function(t){}})},getStoreIdBySn:function(e){var n=this;(0,r.default)({url:"business/tag/oilTag/getSn/"+e,method:"get"}).then((function(e){t.setStorageSync("storeId",e.data.storeId),e.data.storeId?n.getStore(t.getStorageSync("storeId")):n.getAddress(t.getStorageSync("storeId"))}))},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){if(e){var n=this;(0,r.default)({url:"business/storeInformation/store/queryStoreById",method:"post",data:{storeId:e}}).then((function(o){n.getOilNumber(e),n.store=o.data,n.storeId=o.data.id,t.setStorageSync("storeId",n.store.id),t.setStorageSync("chainStoreId",n.store.chainStoreId)})).catch((function(t){}))}},getAddress1:function(){var e=this;t.getLocation({type:"gcj02",success:function(t){(0,r.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),t.data.store.welfare&&(t.data.store.welfare.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,r.default)({url:"business/petrolStationManagement/oilGun/selectByNumber/"+e,method:"get"}).then((function(e){n.oilNumberList=e.data,e.data.length>0&&(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,r.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){if(t){var e=this;(0,r.default)({url:"business/member/staff/queryList1/"+t,method:"get"}).then((function(t){e.staffList=t.data}))}},getSIndex:function(e,n){var o=this;this.sindex=e,(0,r.default)({url:"business/petrolStationManagement/oilTank/"+t.getStorageSync("tankId"),method:"get"}).then((function(e){e.data.storedQuantity-o.liters<0?t.showToast({title:"所加油的升数大于油罐内的升数,请重新选择加油升数",icon:"none"}):o.toPayment(n)}))},toPayment:function(e){this.oilOrder.orderAmount=this.value,this.oilOrder.storeId=this.storeId,this.oilOrder.staffId=e,this.oilOrder.oilNum=(this.value/this.oilPrice).toFixed(2),this.oilOrder.tankId=t.getStorageSync("tankId"),this.oilOrder.oilTagSn=t.getStorageSync("sn");(0,r.default)({url:"business/oilOrder/addOilOrder",method:"post",data:this.oilOrder}).then((function(e){t.navigateTo({url:"/pagesRefuel/orderDetail/index?orderNo="+e.data})}))},getAIndex:function(t,e){this.value=e+"",this.aindex=t,this.liters=(e/this.oilPrice).toFixed(2)},getHIndex:function(e,n){this.hindex=e,this.oilGunList=n.oilGunList,this.oilOrder.oilGunNum=n.oilGunList[0].id,this.oilPrice=n.oilPrice,this.oilUnit=n.unit,this.oilOrder.oils=n.oilNameId,t.setStorageSync("tankId",n.oilGunList[0].tankId)},getQIndex:function(e,n){this.qindex=e,this.oilOrder.oilGunNum=n.id,t.setStorageSync("tankId",n.tankId)},goRefuel:function(){t.navigateTo({url:"/pagesRefuel/pagesRefuel/index"})},change:function(){},closeStaff:function(){this.$refs.popup.close()},submitAmount:function(){var e=this;(0,r.default)({url:"business/petrolStationManagement/oilTank/"+t.getStorageSync("tankId"),method:"get"}).then((function(n){n.data.storedQuantity-e.liters<0?t.showToast({title:"所加油的升数大于油罐内的升数,请重新选择加油升数",icon:"none"}):""!=e.value&&null!=e.qindex?(e.show=!1,t.getStorageSync("inviteStaffId")||e.staffList.length,e.toPayment(t.getStorageSync("inviteStaffId"))):""==e.value?t.showToast({title:"请输入加油金额",icon:"error"}):t.showToast({title:"请选择油枪号",icon:"error"})}))},changeVal:function(t){this.value=t,this.liters=(this.value/this.oilPrice).toFixed(2)},backspaceVal:function(t){this.value=t,""==t?(this.amount=0,this.liters=0):(this.amount=t,this.liters=(this.value/this.oilPrice).toFixed(2))},valChange:function(e){t.vibrateShort({success:function(){}});var n=this.value.indexOf(".");if(-1!=n){if(this.value.length-n>=3)return}else if(this.value.length>=7&&"."!=e)return;this.value+=e,this.liters=(this.value/this.oilPrice).toFixed(2)},getTheJudgmentIsTheSame:function(){var e=this;return(0,s.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!e.AppToken){n.next=3;break}return n.next=3,(0,r.default)({url:"chainStoreInfo/theJudgmentIsTheSame",method:"get",data:{chainStoreId:t.getStorageSync("chainStoreId")}}).then((function(e){e.data||t.removeStorageSync("App-Token")}));case 3:"WECHAT"==t.getStorageSync("appltType")&&o.login({success:function(e){console.log(e),e.code?(0,r.default)({url:"clientApi/sign/mpWxLogin2",method:"POST",data:{code:e.code,isRefuel:!0}}).then((function(e){e.data||t.removeStorageSync("App-Token")})):console.log("登录失败!"+e.errMsg)}}),"ALIPAY"==t.getStorageSync("appltType")&&my.getAuthCode({scopes:"auth_base",success:function(e){var n=e.authCode;console.log(e),(0,r.default)({url:"clientApi/sign/alipayLogin/getUserid2",method:"post",data:{authCode:n,storeId:t.getStorageSync("storeId"),isRefuel:!0}}).then((function(e){e.data||t.removeStorageSync("App-Token")}))},fail:function(t){console.log("my.getAuthCode 调用失败",t)}});case 5:case"end":return n.stop()}}),n)})))()},backspace:function(){t.vibrateShort({success:function(){}}),this.value.length&&(this.value=this.value.substr(0,this.value.length-1),this.liters=(this.value/this.oilPrice).toFixed(2))}}};e.default=u}).call(this,n("df3c")["default"],n("3223")["default"])},"9c7d":function(t,e,n){},c8c4:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var o={uniIcons:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons")]).then(n.bind(null,"069f"))},uniPopup:function(){return n.e("node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup").then(n.bind(null,"f90e"))},keyboard:function(){return n.e("components/keyboard/keyboard").then(n.bind(null,"4250"))},tabbar:function(){return n.e("components/tabbar/tabbar").then(n.bind(null,"45e5"))}},i=function(){var t=this.$createElement;this._self._c},a=[]},fa3e:function(t,e,n){"use strict";n.r(e);var o=n("914f"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a}},[["8ab2","common/runtime","common/vendor"]]]); |