chunk-5aeb654c.900eece5.js 8.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5aeb654c"],{"10be":function(t,e,n){"use strict";n("bc1b")},"2bb6":function(t,e,n){"use strict";var i="Material-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(i+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(i+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(i+"_"+t)}}},"5a05":function(t,e,n){"use strict";var i=n("88d4"),s=n("34cd").filter,r=n("3a6d"),a=r("filter");i({target:"Array",proto:!0,forced:!a},{filter:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},b3d9:function(t,e,n){"use strict";var i=n("88d4"),s=n("8735"),r=n("9ad2"),a=n("b595"),o=n("bf1f"),c=n("ac3c"),l=n("126a"),u=n("c40a"),d=n("492f"),h=n("3a6d"),f=n("d0ff"),p=n("0116"),v=f("isConcatSpreadable"),y=9007199254740991,g="Maximum allowed index exceeded",m=s.TypeError,b=p>=51||!r((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),_=h("concat"),w=function(t){if(!o(t))return!1;var e=t[v];return void 0!==e?!!e:a(t)},x=!b||!_;i({target:"Array",proto:!0,forced:x},{concat:function(t){var e,n,i,s,r,a=c(this),o=d(a,0),h=0;for(e=-1,i=arguments.length;e<i;e++)if(r=-1===e?a:arguments[e],w(r)){if(s=l(r),h+s>y)throw m(g);for(n=0;n<s;n++,h++)n in r&&u(o,h,r[n])}else{if(h>=y)throw m(g);u(o,h++,r)}return o.length=h,o}})},bc1b:function(t,e,n){},d8ae:function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return r}));var i=n("0f62");function s(t,e){return Object(i["a"])({url:t,method:"post",data:e})}function r(t,e){return Object(i["a"])({url:t,method:"get",params:e})}},fdc0:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("van-search",{staticClass:"mb-2 shadow",attrs:{placeholder:"请输入搜索关键词"},on:{search:t.refresh,cancel:t.refresh},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),n("van-dropdown-menu",[n("van-dropdown-item",{attrs:{disabled:"",options:[{text:t.type.name,value:t.type_id}]},on:{change:t.refresh},model:{value:t.type_id,callback:function(e){t.type_id=e},expression:"type_id"}})],1),n("van-empty",{directives:[{name:"show",rawName:"v-show",value:t.showEmpty,expression:"showEmpty"}],attrs:{description:"暂无产品"}}),t.type.id?n("van-list",{staticClass:"mt-4",attrs:{finished:t.finished,error:t.error,"error-text":"请求失败,点击重新加载","finished-text":""},on:{"update:error":function(e){t.error=e},load:t.loadProductList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.list,(function(e,i){return n("van-card",{key:i,attrs:{desc:t.type.name,title:e.name,thumb:e.cover},scopedSlots:t._u([{key:"title",fn:function(){return[n("div",{staticClass:"text-sm"},[t._v(t._s(e.name))])]},proxy:!0},{key:"desc",fn:function(){return[n("div",{staticClass:"text-sm"},[t._v(t._s(t.type.name))])]},proxy:!0},{key:"num",fn:function(){return[n("van-button",{attrs:{type:"info",size:"small"},on:{click:function(n){return t.selectItem(e)}}},[t._v("选择")])]},proxy:!0}],null,!0)})})),1):t._e(),t.type.id?n("van-popup",{attrs:{closeable:"",round:"",position:"bottom"},model:{value:t.showSelect,callback:function(e){t.showSelect=e},expression:"showSelect"}},[n("div",{staticClass:"van-sku-header van-hairline--bottom"},[n("div",{staticClass:"van-sku-header__goods-info"},[t._v("规格选择")])]),n("div",{staticClass:"van-sku-body",staticStyle:{"max-height":"440px"}},[n("div",{staticClass:"van-sku-group-container"},[t._l(t.type.spec_type.split(","),(function(e){return[t.jsonObject(t.select.spec)[e]?n("div",{key:e,staticClass:"van-sku-row van-hairline--bottom"},[n("div",{staticClass:"van-sku-row__title"},[t._v(t._s(e))]),t._l(t.jsonObject(t.select.spec)[e].split(","),(function(i){return n("span",{key:i,staticClass:"van-sku-row__item",class:{"van-sku-row__item--active":t.selectSpec[e]==i},on:{click:function(n){return t.$set(t.selectSpec,e,i)}}},[n("div",{staticClass:"van-sku-row__item-name"},[t._v(t._s(i))])])}))],2):t._e()]}))],2),n("div",{staticClass:"van-sku-actions"},[n("van-button",{attrs:{type:"danger",size:"large",disabled:0!=t.type.spec_type.toString().split(",").filter((function(e){return t.jsonObject(t.select.spec)[e]&&!t.selectSpec[e]})).length},on:{click:t.handleSelect}},[t._v("选择")])],1)])]):t._e()],1)},s=[],r=(n("ab96"),n("b3d9"),n("5a05"),n("89a8"),n("4c1e"),n("fee8"),n("6c8f"),n("1a91"),n("d8ae")),a=n("2bb6"),o={data:function(){return{key:"",calc_id:0,type_id:0,order_id:0,index:0,type:{},list:[],loading:!1,error:!1,page:1,finished:!1,showEmpty:!1,name:"",select:{},selectSpec:{},showSelect:!1}},created:function(){this.calc_id=this.$route.query&&this.$route.query.calc_id,this.type_id=this.$route.query&&parseInt(this.$route.query.type),this.order_id=this.$route.query&&this.$route.query.order_id,this.index=this.$route.query&&this.$route.query.index,this.order_id?this.key="calculate_edit_"+this.order_id:this.key="calculate_"+this.calc_id,this.loadTypeInfo()},methods:{loadTypeInfo:function(){var t=this;this.$store.commit("loading/showLoading"),Object(r["b"])("/type/"+this.type_id).then((function(e){console.log(e),t.type=e.data,t.$store.commit("loading/hideLoading")}))},loadProductList:function(){var t=this;Object(r["b"])("/products",{page:this.page++,name:this.name,typeId:this.type_id}).then((function(e){t.loading=!1,e.data.count<=t.list.length&&(t.finished=!0),t.list=t.list.concat(e.data.list),0===t.list.length?t.showEmpty=!0:t.showEmpty=!1})).catch((function(e){console.log(e),t.loading=!1,t.error=!0}))},selectItem:function(t){var e=this;this.selectSpec={},this.select=t,0==this.type.spec_type.split(",").filter((function(n){return e.jsonObject(t.spec)[n]})).length?this.handleSelect():this.showSelect=!0},handleSelect:function(){var t=this,e=a["a"].get(this.key);if(!e)return this.$toast("数据有误"),!1;if(0!=this.type.spec_type.split(",").filter((function(e){return t.jsonObject(t.select.spec)[e]&&!t.selectSpec[e]})).length)return this.$toast("请选择规格"),!1;var n=e.from;e.items.forEach((function(t){n=n.items[t.index]})),n.items[this.index].product={id:this.select.id,name:this.select.name,spec:this.selectSpec},a["a"].set(this.key,e),this.$router.push({path:"/calc/detail",query:{calc_id:this.calc_id,order_id:this.order_id,edit:1}})},refresh:function(){return console.log("ok"),this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.list=[],this.loadProductList(),!0},jsonObject:function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return{}}return t instanceof Object?t:{}}}},c=o,l=(n("10be"),n("cba8")),u=Object(l["a"])(c,i,s,!1,null,"379c0af9",null);e["default"]=u.exports},fee8:function(t,e,n){"use strict";var i=n("e7c5"),s=n("e3f7"),r=n("ce5b"),a=n("9dd2"),o=n("485c"),c=n("25ef"),l=n("8e74"),u=n("f4b4"),d=n("3049"),h=n("ecaa"),f=n("3ffc"),p=n("ecf4"),v=n("d47f"),y=n("bacb"),g=n("9d12"),m=n("fec2"),b=n("9ad2"),_=m.UNSUPPORTED_Y,w=4294967295,x=Math.min,k=[].push,S=r(/./.exec),j=r(k),C=r("".slice),O=!b((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=f(l(this)),a=void 0===n?w:n>>>0;if(0===a)return[];if(void 0===t)return[r];if(!o(t))return s(e,r,t,a);var c,u,d,h=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,m=new RegExp(t.source,p+"g");while(c=s(g,m,r)){if(u=m.lastIndex,u>y&&(j(h,C(r,y,c.index)),c.length>1&&c.index<r.length&&i(k,h,v(c,1)),d=c[0].length,y=u,h.length>=a))break;m.lastIndex===c.index&&m.lastIndex++}return y===r.length?!d&&S(m,"")||j(h,""):j(h,C(r,y)),h.length>a?v(h,0,a):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:s(e,this,t,n)}:e,[function(e,n){var i=l(this),a=void 0==e?void 0:p(e,t);return a?s(a,e,i,n):s(r,f(i),e,n)},function(t,i){var s=c(this),a=f(t),o=n(r,s,a,i,r!==e);if(o.done)return o.value;var l=u(s,RegExp),p=s.unicode,v=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(_?"g":"y"),g=new l(_?"^(?:"+s.source+")":s,v),m=void 0===i?w:i>>>0;if(0===m)return[];if(0===a.length)return null===y(g,a)?[a]:[];var b=0,k=0,S=[];while(k<a.length){g.lastIndex=_?0:k;var O,$=y(g,_?C(a,k):a);if(null===$||(O=x(h(g.lastIndex+(_?k:0)),a.length))===b)k=d(a,k,p);else{if(j(S,C(a,b,k)),S.length===m)return S;for(var I=1;I<=$.length-1;I++)if(j(S,$[I]),S.length===m)return S;k=b=O}}return j(S,C(a,b)),S}]}),!O,_)}}]);