add.js 7.0 KB

1
  1. require('common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesPurchase/add"],{"0f9a":function(t,e,n){},2033:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=s(n("e350")),i=n("7736");function s(t){return t&&t.__esModule?t:{default:t}}function l(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 a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=function(){n.e("components/module/app-search").then(function(){return resolve(n("80f2"))}.bind(null,n)).catch(n.oe)},r=function(){n.e("components/plugin/tabs").then(function(){return resolve(n("f58d"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("components/app-wrapper-empty").then(function(){return resolve(n("c078"))}.bind(null,n)).catch(n.oe)},m=function(){Promise.all([n.e("common/vendor"),n.e("pagesPurchase/components/CommodityPurchase")]).then(function(){return resolve(n("0d71"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/plugin/modal").then(function(){return resolve(n("3a8f"))}.bind(null,n)).catch(n.oe)},h=function(){n.e("components/module/app-footer-cart").then(function(){return resolve(n("a9f2"))}.bind(null,n)).catch(n.oe)},p={name:"purchase",components:{AppTabs:r,AppSearchModule:u,AppWrapperEmpty:f,CommodityPurchase:m,ModalModule:d,FooterCart:h},mixins:[o.default],data:function(){return{pageType:"purchase",isFocus:!1,isReserve:!0,isAloneAllActive:!1,isAloneAllFocus:!1,isWeightActive:!1,isWeightFocus:!1,isModel:!1,showSubmitModel:!1,customData:{bigCount:null,smallCount:null,itemPrice:null,weight:null},autoLoad:!1,showButton:[{text:"删除花材",plain:!0},{text:"确定",plain:!1}]}},computed:a({},(0,i.mapGetters)(["getMyShopInfo","getLoginInfo"])),onShow:function(){t.getStorageSync("selectList"+this.pageType)&&this.setSelectInfoByType({type:this.pageType,info:t.getStorageSync("selectList"+this.pageType)})},onLoad:function(){this.shopId=this.getMyShopInfo.id;var t="";this.initData({type:t,shopId:this.shopId,status:0})},methods:{moveAloneAllInput:function(t){this.isAloneAllActive=!1,this.isAloneAllFocus=!1,""!=t&&(this.customData.itemPrice=t)},deleteAloneInputVal:function(){this.isAloneAllActive=!1,this.customData.itemPrice=""},deleteWeightInputVal:function(){this.isWeightActive=!1},customNum:function(t){var e=this;this.isModel=!0,this.customData=t,this.isFocus=!1,this.$nextTick((function(){e.customData.itemPrice=0==e.customData.itemPrice?null:e.customData.itemPrice,e.customData.smallCount=0==e.customData.smallCount?null:e.customData.smallCount,e.customData.bigCount=0==e.customData.bigCount?null:e.customData.bigCount,e.isFocus=!0}))},modalCancel:function(){this.isModel=!1,this.customData={}},affirm:function(e){var n=this;this.$nextTick((function(){return 0===e.index||3===e.index?(n.delAllEvent(n.customData),void n.modalCancel()):void(n.customData.itemPrice<=0?t.showToast({title:"请输入总价格",icon:"none"}):0!=/(^[1-9]\d*$)/.test(n.customData.bigCount)||0!=/(^[1-9]\d*$)/.test(n.customData.smallCount)?/(^[1-9]\d*$)/.test(n.customData.bigCount)&&n.customData.bigCount<=0||/(^[1-9]\d*$)/.test(n.customData.smallCount)&&n.customData.smallCount<=0?t.showToast({title:"数量要大于0",icon:"none"}):(n.updateItemEvent(n.customData),n.modalCancel()):t.showToast({title:"请输入数量",icon:"none"}))}))},cancelEvent:function(){},submitEvent:function(e){0===e.index||(console.log(444,this.selectList),t.navigateTo({url:"/pagesPurchase/details"})),this.cancelEvent()},confirmSelectEvent:function(){if(this.selectList.length>0){var e=this.selectList,n=[];console.log("过滤前",e);for(var o=0;o<e.length;o++)0==/(^[1-9]\d*$)/.test(e[o].bigCount)&&0==/(^[1-9]\d*$)/.test(e[o].smallCount)||n.push(e[o]);if(n.length<=0)return void this.$msg("请选择花材");console.log("过滤后",n),this.setSelectInfoByType({type:this.pageType,info:n}),t.navigateTo({url:"/pagesPurchase/details?ghsId="+this.option.ghsId+"&ghsName="+this.option.ghsName}),this.cancelEvent()}},changePriceEvent:function(t){var e=t.detail.value,n=Number(e);if(this.customData.itemPrice=n,n>0){var o=this.customData,i=o.smallPrice,s=o.ratio,l=Number(s),a=Math.floor(n/Number(i));this.customData.bigCount=Math.floor(a/l),this.customData.smallCount=Math.floor(a%l)}},scrollTop:function(){}}};e.default=p}).call(this,n("f3be")["default"])},"31e1":function(t,e,n){"use strict";(function(t){n("6cdc");o(n("4a15"));var e=o(n("4dfc"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("f3be")["createPage"])},"4dfc":function(t,e,n){"use strict";n.r(e);var o=n("5bff"),i=n("4f4a");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("ec58"),n("dff4");var l,a=n("0095"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"6ee59528",null,!1,o["a"],l);e["default"]=c.exports},"4f4a":function(t,e,n){"use strict";n.r(e);var o=n("2033"),i=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a},"5bff":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.filterProductInfo,(function(e,n){var o=t.__get_orig(e),i=t.getSelectClassById(e.classId),s=t.getSelectClassById(e.classId),l=i.bigCount>0||s.smallCount>0?t.getSelectClassById(e.classId):null,a=i.bigCount>0||s.smallCount>0?t.getSelectClassById(e.classId):null,c=(i.bigCount>0||s.smallCount>0)&&(l.bigCount>0||a.smallCount>0)?t.getSelectClassById(e.classId):null,u=i.bigCount>0||s.smallCount>0?t.getSelectClassById(e.classId):null,r=i.bigCount>0||s.smallCount>0?t.getSelectClassById(e.classId):null,f=(i.bigCount>0||s.smallCount>0)&&r.smallCount>0?t.getSelectClassById(e.classId):null;return{$orig:o,m0:i,m1:s,m2:l,m3:a,m4:c,m5:u,m6:r,m7:f}}))),o=t.$util.isEmpty(t.filterProductInfo),i=o?null:t.__map(t.filterProductInfo,(function(e,n){var o=t.__get_orig(e),i=t.__map(e.child,(function(n,o){var i=t.__get_orig(n),s=e.isActive?t.getSelectItemById(n.id,e.classId):null,l=e.isActive?t.getSelectItemById(n.id,e.classId):null,a=e.isActive?t.getSelectItemById(n.id,e.classId):null;return{$orig:i,m8:s,m9:l,m10:a}}));return{$orig:o,l1:i}})),s=o?t.$util.isEmpty(t.filterProductInfo):null;t._isMounted||(t.e0=function(e){t.customData.itemPrice=null}),t.$mp.data=Object.assign({},{$root:{l0:n,g0:o,l2:i,g1:s}})},s=[]},ab7b:function(t,e,n){},dff4:function(t,e,n){"use strict";var o=n("0f9a"),i=n.n(o);i.a},ec58:function(t,e,n){"use strict";var o=n("ab7b"),i=n.n(o);i.a}},[["31e1","common/runtime","common/vendor"]]]);