1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{b397:function(e,t,n){"use strict";n.r(t);var i=n("f992"),o=n.n(i);for(var r in i)"default"!==r&&function(e){n.d(t,e,(function(){return i[e]}))}(r);t["default"]=o.a},c304:function(e,t,n){},c5a9:function(e,t,n){"use strict";(function(e){n("a134"),n("921b");i(n("66fd"));var t=i(n("f755"));function i(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},e1f3:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i}));var i={uniNoticeBar:function(){return n.e("uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar").then(n.bind(null,"2d8d"))},uniPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-popup/components/uni-popup/uni-popup")]).then(n.bind(null,"5e61"))}},o=function(){var e=this,t=e.$createElement;e._self._c},r=[]},f755:function(e,t,n){"use strict";n.r(t);var i=n("e1f3"),o=n("b397");for(var r in o)"default"!==r&&function(e){n.d(t,e,(function(){return o[e]}))}(r);n("ff5a");var a,c=n("f0c5"),u=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],a);t["default"]=u.exports},f992:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n("a34a")),o=n("2f62"),r=c(n("3e34")),a=c(n("0261"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t,n,i,o,r,a){try{var c=e[r](a),u=c.value}catch(s){return void n(s)}c.done?t(u):Promise.resolve(u).then(i,o)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var r=e.apply(t,n);function a(e){d(r,i,o,a,c,"next",e)}function c(e){d(r,i,o,a,c,"throw",e)}a(void 0)}))}}var p={data:function(){return{stationPicList:[],notice:"",gasList:[],selectedGas:void 0,accountList:[100,200,300,400],account:"",loading:!1,inputFocusFlag:!1,employeeList:[]}},created:function(){this.init()},mounted:function(){return f(i.default.mark((function e(){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},computed:{cutGasList:function(){return this.gasList.length>6?this.gasList.slice(0,5):this.gasList.slice(0,6)},showMoreGasSelected:function(){var e=this;if(!this.selectedGas)return!1;var t=this.cutGasList.filter((function(t){return t.oilGunId==e.selectedGas.oilGunId}));return 0===t.length},avalibleSettle:function(){return!!this.account&&this.account>0&&!!this.selectedGas}},methods:s(s({},(0,o.mapMutations)(["updateOrderInfo","updateSelectedGas","resetApplet"])),{},{init:function(){var t=this;return f(i.default.mark((function n(){var o,r,c;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.stationId){n.next=3;break}return o=a.default.getInstance(),n.abrupt("return",o.scanCode(!0,{showCancel:!1,content:"亲,请扫码进入~"}).then((function(){t.init()})).catch((function(e){})));case 3:return n.prev=3,e.showLoading({title:"加载中~",mask:!0}),n.next=7,t.$Request({url:"/stationOilGunListNew",method:"GET",data:{stationId:t.stationId,personnelId:t.employeeId}});case 7:if(r=n.sent,0==r.retCode){n.next=10;break}throw new Error("油站初始化失败");case 10:t.stationPicList=r.data.listPic,t.notice=r.data.notice,t.gasList=r.data.stationOilGunList,t.employeeList=r.data.personnalList,!t.employeeId&&t.employeeList.length>1&&(e.hideLoading(),c=a.default.getInstance(),c.scanCode(!0,{showCancel:!0,content:"此站点只能扫码进入~"}).then((function(){t.init()})).catch((function(e){}))),1==t.gasList.length&&(t.selectedGas=t.gasList[0],t.updateSelectedGas(t.gasList[0])),e.hideLoading(),n.next=23;break;case 19:n.prev=19,n.t0=n["catch"](3),e.hideLoading(),e.showModal({title:"≧▽≦*",content:"矮油,初始化失败",confirmText:"重新进入",showCancel:!1,success:function(t){t.confirm&&e.redirectTo({url:"/pages/index/index"})}});case 23:case"end":return n.stop()}}),n,null,[[3,19]])})))()},change:function(e){this.current=e.detail.current},changeInputFocus:function(){this.inputFocusFlag=!0},openMoreGun:function(){this.$refs.popup.open()},closeMoreGun:function(){this.$refs.popup.close()},selectGas:function(e){this.selectedGas=e,this.updateSelectedGas(e)},selectGasPopup:function(e){this.updateSelectedGas(e),this.selectedGas=e,this.$refs.popup.close()},selectAccount:function(e){this.account=e},creatOrder:function(){var t=this;return f(i.default.mark((function n(){var o;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if((0,r.default)()){n.next=2;break}return n.abrupt("return");case 2:return t.loading=!0,e.showLoading({title:"订单创建中...",mask:!0}),n.prev=4,n.next=7,t.$Request({url:"/AddPayOrderInfoNew",method:"POST",data:{userType:"1",openId:t.openId,stationId:t.stationId,receivableAmt:t.account,oilName:t.selectedGas.oilName,oilGun:t.selectedGas.oilGunNo,labelId:t.labelId,personnelId:t.employeeId}});case 7:if(o=n.sent,0==o.retCode){n.next=11;break}throw new Error("创建失败~");case 11:t.loading=!1,e.hideLoading(),t.updateOrderInfo(o.data),e.navigateTo({url:"/pages/confirm/confirm"}),n.next=23;break;case 17:n.prev=17,n.t0=n["catch"](4),t.loading=!1,e.hideLoading(),e.showToast({icon:"error",title:"请重试~"}),t.resetApplet();case 23:case"end":return n.stop()}}),n,null,[[4,17]])})))()},inputAccount:function(e){this.inputFocusFlag=!1,isNaN(+e.detail.value)?this.account="":this.account=(+e.detail.value).toFixed(2).toString()}})};t.default=p}).call(this,n("543d")["default"])},ff5a:function(e,t,n){"use strict";var i=n("c304"),o=n.n(i);o.a}},[["c5a9","common/runtime","common/vendor"]]]);
|