order.js 5.1 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/book/order/order"],{5766:function(t,e,n){"use strict";n.r(e);var i=n("8344"),r=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=r.a},8344:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("4795"));function r(t){return t&&t.__esModule?t:{default:t}}function a(t){return c(t)||u(t)||o(t)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function u(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function c(t){if(Array.isArray(t))return d(t)}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(t,e,n,i,r,a,s){try{var o=t[a](s),u=o.value}catch(c){return void n(c)}o.done?e(u):Promise.resolve(u).then(i,r)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function s(t){l(a,i,r,s,o,"next",t)}function o(t){l(a,i,r,s,o,"throw",t)}s(void 0)}))}}var h={name:"order",data:function(){return{status:0,list:[],page:1,over:!1,model:!1,modelType:0,setItem:{},writeOffChart:""}},onLoad:function(){var t=this;this.request({status:this.status,page:this.page}).then((function(e){e&&(t.list=e.list)}))},onReachBottom:function(){this.over||(this.page+=1,this.pagingRequest({status:this.status,page:this.page}))},methods:{setActiveHeader:function(t){var e=this;this.page=1,this.status=t,this.over=!1,this.list=[],this.request({status:this.status,page:this.page}).then((function(t){t&&(e.list=t.list)}))},request:function(t){var e=this;return f(i.default.mark((function n(){var r,a,s;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.status,a=t.page,n.next=3,e.$request({url:e.$api.book.order_list,data:{status:r,page:a}});case 3:if(s=n.sent,0!==s.code){n.next=8;break}return n.abrupt("return",s.data);case 8:return n.abrupt("return",!1);case 9:case"end":return n.stop()}}),n)})))()},operationOrder:function(e,n){var i=this;switch(this.model=!0,this.setItem=n,e){case 1:this.modelType=1;break;case 2:t.showLoading({mask:!0,title:"加载中"}),this.modelType=2,this.$request({url:this.$api.book.clerk_code,data:{id:n.id}}).then((function(e){t.hideLoading(),0===e.code?i.writeOffChart=e.data.file_path:1===e.code&&(i.model=!1,t.showModal({title:"提示",content:e.msg}))}));break;case 3:this.modelType=3;break;case 4:this.modelType=4;break}},pagingRequest:function(t){var e=this,n=t.status,i=t.page;this.request({status:n,page:i}).then((function(t){t&&(t.list.length>0?e.list=[].concat(a(e.list),a(t.list)):e.over=!0)}))},cancle:function(){this.modelType=0,this.model=!1},determine:function(){var e=this;switch(t.showLoading({mask:!0,title:"加载中"}),this.modelType){case 1:this.$request({url:this.$api.order.cancel,data:{id:this.setItem.id}}).then((function(n){if(0===n.code){t.hideLoading(),e.model=!1;for(var i=0;i<e.list.length;i++)e.setItem.id===e.list[i].id&&(e.list[i].cancel_status="2",2===e.status&&e.$delete(e.list,i))}}));break;case 3:this.$request({url:this.$api.order.cancel,data:{id:this.setItem.id}}).then((function(n){if(0===n.code){t.hideLoading(),e.model=!1;for(var i=0;i<e.list.length;i++)e.setItem.id===e.list[i].id&&(e.list[i].cancel_status="1",e.list[i].is_pay="0",1===e.status&&e.$delete(e.list,i))}}));break;case 4:this.$request({url:this.$api.order.list_pay_data,data:{id:this.setItem.id}}).then((function(n){0===n.code&&(t.hideLoading(),e.model=!1,e.$payment.pay(n.data.id).then((function(){for(var t=0;t<e.list.length;t++)e.setItem.id===e.list[t].id&&(e.list[t].is_pay="1",1===e.status&&e.$delete(e.list,t))})).catch((function(){})))}));break}},jump:function(t){this.$jump({open_type:"navigate",url:"/plugins/book/orderDetails/orderDetails?id=".concat(t.id)})}}};e.default=h}).call(this,n("543d")["default"])},"93e6":function(t,e,n){"use strict";var i=n("f7f0"),r=n.n(i);r.a},b54c:function(t,e,n){"use strict";n.r(e);var i=n("c6f7"),r=n("5766");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("93e6");var s,o=n("f0c5"),u=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,"06d7ff35",null,!1,i["a"],s);e["default"]=u.exports},c6f7:function(t,e,n){"use strict";var i,r=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){e.stopPropagation(),t.model=!1},t.e1=function(e){e.stopPropagation(),t.model=!1})},a=[];n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}))},db45:function(t,e,n){"use strict";(function(t){n("8748");i(n("66fd"));var e=i(n("b54c"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},f7f0:function(t,e,n){}},[["db45","common/runtime","common/vendor"]]]);