affirm.js 8.0 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["admin/billing/affirm"],{"013a":function(t,e,n){"use strict";n.r(e);var o=n("9c6c"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},"022d":function(t,e,n){"use strict";var o=n("47c4"),i=n.n(o);i.a},1846:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.isBilling&&1==t.form.sendType?(t.allPrice+Number(t.form.sendCost)).toFixed(2):null),o=t.isBilling&&1!=t.form.sendType?t.allPrice.toFixed(2):null;t._isMounted||(t.e0=function(e){t.form.debt=1},t.e1=function(e){t.form.debt=0}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:o}})},r=[]},"1d6d":function(t,e,n){"use strict";n.r(e);var o=n("1846"),i=n("013a");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("022d");var c,s=n("0095"),a=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"3afd228e",null,!1,o["a"],c);e["default"]=a.exports},4570:function(t,e,n){"use strict";(function(t){n("6cdc");o(n("4a15"));var e=o(n("1d6d"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("f3be")["createPage"])},"47c4":function(t,e,n){},"9c6c":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("4838")),i=a(n("e350")),r=n("3a10"),c=n("7736"),s=n("5315");function a(t){return t&&t.__esModule?t:{default:t}}function u(t,e,n,o,i,r,c){try{var s=t[r](c),a=s.value}catch(u){return void n(u)}s.done?e(a):Promise.resolve(a).then(o,i)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var r=t.apply(e,n);function c(t){u(r,o,i,c,s,"next",t)}function s(t){u(r,o,i,c,s,"throw",t)}c(void 0)}))}}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function(){n.e("components/plugin/list-cell").then(function(){return resolve(n("1861"))}.bind(null,n)).catch(n.oe)},p=function(){Promise.all([n.e("common/vendor"),n.e("components/module/app-avatar")]).then(function(){return resolve(n("d84d"))}.bind(null,n)).catch(n.oe)},v=function(){Promise.all([n.e("common/vendor"),n.e("components/plugin/simple-address")]).then(function(){return resolve(n("618a"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/app-area-sel").then(function(){return resolve(n("62ec"))}.bind(null,n)).catch(n.oe)},b=function(){n.e("components/app-formRadio-btn").then(function(){return resolve(n("c6ee"))}.bind(null,n)).catch(n.oe)},g=function(){Promise.all([n.e("common/vendor"),n.e("components/app-address-group")]).then(function(){return resolve(n("cdfa"))}.bind(null,n)).catch(n.oe)},I=function(){n.e("components/app-send-time").then(function(){return resolve(n("0a72"))}.bind(null,n)).catch(n.oe)},P=function(){n.e("components/app-form-send").then(function(){return resolve(n("a5ce"))}.bind(null,n)).catch(n.oe)},O=n("90f4"),S={name:"BillingAffirm",components:{TuiListCell:h,AppAvatarModule:p,SimpleAddress:v,AppAreaSel:y,appFormRadioBtn:b,appAddressGroup:g,appSendTime:I,appFormSend:P},mixins:[i.default],data:function(){return{autoLoad:!1,isBilling:!0,payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],payWayindex:0,form:{debt:1,shopId:"",shopName:"",receiveProvince:"",receiveCity:"",receiveFloor:"",receiveAddress:"",receiveLong:"",receiveLat:"",sendType:2,sendSide:"2",sendDate:"",sendTimeWant:"",sendCost:"",customId:"",product:"",remark:"",payWay:0,needPrint:1},money:"",modifyPrice:0,showCustomer:!1,customInfo:{discount:1},discountAmount:0}},onLoad:function(e){if(this.getMerchantInfo?t.setNavigationBarTitle({title:this.getMerchantInfo.name}):this.initMerchantInfo().then((function(e){t.setNavigationBarTitle({title:e.name})})),this.modifyPrice=this.allPrice.toFixed(2),this.courier(2),e.customId){this.form.customId=e.customId;var n=this;(0,s.getUserDet)({id:e.customId}).then((function(t){n.form.customName=t.data.name,n.customInfo=t.data,t.data.discount&&t.data.discount<1&&n.calcPrice()}))}},onShow:function(){this.$util.isEmpty(t.getStorageSync("newClient"))||(this.showCustomer=!0)},onUnload:function(){t.removeStorageSync("newClient")},computed:m({},(0,c.mapGetters)(["getMerchantInfo","getLoginInfo"])),methods:m(m({},(0,c.mapActions)(["initMerchantInfo"])),{},{init:function(){this._getDet()},selectCustom:function(){},payWayChange:function(t){var e=t.detail.value;this.payWayindex=e,this.form.payWay=this.payWayList[e].id},calcPrice:function(){var t=this.allPrice.toFixed(2);this.customInfo.discount&&this.customInfo.discount<1&&(this.discountAmount=((1-Number(this.customInfo.discount))*t).toFixed(2),this.discountAmount=parseFloat(this.discountAmount)),this.modifyPrice=(Number(t)+Number(this.form.sendCost)-Number(this.discountAmount)).toFixed(2),this.modifyPrice=parseFloat(this.modifyPrice)},setPayWay:function(t){this.form.payWay=t},courier:function(t){this.form.sendType=t,2===t?this.form.sendCost="":1==t&&(this.form.sendCost=this.money)},sendCostBlur:function(){1===this.form.sendType&&(this.money=this.form.sendCost)},_getDet:function(){var e=this,n=t.getStorageSync("modifyShopB");this.$util.isEmpty(n)||Object.keys(this.form).forEach((function(t,o){e.form[t]=n[t]}))},changeCustomerFn:function(t){var e=this.selectList.map((function(t){return{productId:t.id,bigNum:t.bigCount,smallNum:t.smallCount,classId:t.classId,itemId:t.itemId}}));t.id,JSON.stringify(e),t.province,t.city,t.address,t.floor,t.long,t.lat;this.form.sendCost="",this.form.customId=t.id,this.form.customName=t.name},confirmFn:function(e){var n=this,o=this;2==e.sendType&&(e.sendCost="");var i=r.createOrder,c=m(m({},e),{},{modifyPrice:this.modifyPrice,newVersion:1});this.option.orderId&&this.option.orderId>0&&(i=r.updateOrder,c=m(m({},c),{},{id:this.option.orderId}));var s=t.getStorageSync("xj"+this.option.customId);c=m(m({},c),{},{xj:JSON.stringify(s)}),i(c).then((function(e){if(1==e.code){n.removeMemory(o.option.customId),t.removeStorageSync("xj"+c.customId);var i=e.data,r=i.id,s=i.orderSn;n.$util.pageTo({url:"/admin/billing/result",type:2,query:{orderId:r,orderSn:s}})}}))},affirmFormSubmit:function(){var e=this,n=[{name:"customId",rule:["required"],msg:["请选择客户"]}],o=O.validation(this.form,n);if(o)return this.$msg(o),!1;t.showModal({title:"提示",content:"确认打印订单?",cancelText:"不需要",confirmText:"打印",confirmColor:"#39B54A",cancelColor:"#777777",success:function(t){t.confirm?(e.form.needPrint=1,e.formSubmit()):(e.form.needPrint=2,e.formSubmit())}})},formSubmit:function(){var t=d(o.default.mark((function t(){var e,n,i,r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,this.form,e=this.form,n=0,i=this.selectList.map((function(t){return n+=t.bigCount*Number(t.bigPrice),n+=t.smallCount*Number(t.smallPrice),{productId:t.id,bigNum:t.bigCount,smallNum:t.smallCount,classId:t.classId,itemId:t.itemId,price:t.userPrice>0?t.userPrice:n}})),e.product=JSON.stringify(i),this.getMerchantInfo){t.next=9;break}return t.next=9,this.initMerchantInfo();case 9:e.shopId=this.getMerchantInfo.id,r=O.validation(e,[]),r?this.$msg(r):this.confirmFn(e),t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](0),console.log(999999,t.t0);case 17:case"end":return t.stop()}}),t,this,[[0,14]])})));function e(){return t.apply(this,arguments)}return e}(),gobackEvent:function(){t.navigateBack({delta:1})}})};e.default=S}).call(this,n("f3be")["default"])}},[["4570","common/runtime","common/vendor"]]]);