!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},o=Object.prototype,n=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(P){l=function(t,e,r){return t[e]=r}}function d(t,e,r,o){var n=e&&e.prototype instanceof h?e:h,a=Object.create(n.prototype),c=new j(o||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(P){return{type:"throw",arg:P}}}r.wrap=d;var p={};function h(){}function m(){}function g(){}var y={};l(y,c,(function(){return this}));var v=Object.getPrototypeOf,_=v&&v(v(C([])));_&&_!==o&&n.call(_,c)&&(y=_);var b=g.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function o(i,a,c,u){var s=f(e[i],e,a);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==t(d)&&n.call(d,"__await")?r.resolve(d.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):r.resolve(d).then((function(t){l.value=t,c(l)}),(function(t){return o("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){o(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function S(t,e,r){var o="suspendedStart";return function(n,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===n)throw i;return I()}for(r.method=n,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var u=f(t,e,r);if("normal"===u.type){if(o=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,o=t.iterator[r];if(void 0===o)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var n=f(o,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;O(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},r}function r(t,e,r,o,n,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(o,n)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function n(t){for(var e=1;e0?t.lockStock:0,n({},t)}))),!e.length)return e;var o=0;if(this.defaultRadio){var i=e.findIndex((function(e){return e.id==t.defaultRadio}));o=i>-1?i:0}this.radio=e[o].id,this.skuStockList=e},onAddCart:function(){var t,o=this;return(t=e().mark((function t(){var r,n,i,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=o.selectItem,n=o.item,i={pic:n.pic,name:n.name,brandName:n.brandName,productSn:n.productSn,price:r.price,originalPrice:n.originalPrice,productSkuId:r.id,stock:r.stock,quantity:o.total,productId:n.id,spDataJson:r.spDataJson,hidden:"cart"===o.showType?0:1,promoterId:o.$route.query.promoterId?o.$route.query.promoterId:void 0};try{c=!1,k.getGoods.forEach((function(t){t.productId===i.productId&&t.productSkuId===i.productSkuId&&(c=!0,t.quantity+=i.quantity)})),c||k.setGoods(i),a("添加成功"),o.onClose()}catch(e){}case 4:case"end":return t.stop()}}),t)})),function(){var e=this,o=arguments;return new Promise((function(n,i){var a=t.apply(e,o);function c(t){r(a,n,i,c,u,"next",t)}function u(t){r(a,n,i,c,u,"throw",t)}c(void 0)}))})()},setProductStock:function(t){for(var e=0;e200?200:t.selectItem.stock,min:1,disabled:t.selectItem.stock<=0,integer:!0},null)]}}),c("div",{class:["btnGroup"],style:{marginBottom:"8px"}},[c(l,{block:!0,type:"primary",text:"确定",class:w.addCartBtn,disabled:this.selectItem.stock<=0,onClick:function(){return t.onAddCart()}},null)])])}}))}}}))}();