!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={},n=Object.prototype,o=n.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",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(E){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),c=new L(n||[]);return i(a,"_invoke",{value:j(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(E){return{type:"throw",arg:E}}}r.wrap=f;var v={};function p(){}function h(){}function m(){}var g={};s(g,c,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(I([])));b&&b!==n&&o.call(b,c)&&(g=b);var _=m.prototype=p.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(e,r){function n(i,a,c,u){var l=d(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=S(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.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,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function k(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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(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,n=function e(){for(;++r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),v}},r}function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,n=e*N.value;t.loop||(n=Math.min(n,-B.value));var o=r-n;return t.loop||(o=F(o,B.value,0)),o},U=function(e){var r=e.pace,n=void 0===r?0:r,i=e.offset,a=void 0===i?0:i,c=e.emitChange;if(!(D.value<=1)){var l=u.active,s=function(e){var r=u.active;return e?t.loop?F(r+e,-1,D.value):F(r+e,0,J.value):r}(n),f=X(s,a);if(t.loop){if(G[0]&&f!==B.value){var d=f0;G[D.value-1].setOffset(v?-M.value:0)}}u.active=s,u.offset=f,c&&s!==l&&o("change",R.value)}},V=function(){u.swiping=!0,u.active<=-1?U({pace:D.value}):u.active>=D.value&&U({pace:-D.value})},$=function(){V(),s.reset(),E((function(){u.swiping=!1,U({pace:1,emitChange:!0})}))},W=function(){return clearTimeout(r)},K=function e(){W(),+t.autoplay>0&&D.value>1&&(r=setTimeout((function(){$(),e()}),+t.autoplay))},Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:+t.initialSwipe;if(a.value){var r=function(){var r,n;if(!I(a)){var o={width:a.value.offsetWidth,height:a.value.offsetHeight};u.rect=o,u.width=+(null!=(r=t.width)?r:o.width),u.height=+(null!=(n=t.height)?n:o.height)}D.value&&-1===(e=Math.min(D.value-1,e))&&(e=D.value-1),u.active=e,u.swiping=!0,u.offset=X(e),G.forEach((function(t){t.setOffset(0)})),K()};I(a)?C().then(r):r()}},tt=function(){return Z(u.active)},et=function(e){!t.touchable||e.touches.length>1||(s.start(e),l=!1,n=Date.now(),W(),V())},rt=function(){if(t.touchable&&u.swiping){var e=Date.now()-n,r=T.value/e;if((Math.abs(r)>.25||Math.abs(T.value)>N.value/2)&&Y.value){var i=t.vertical?s.offsetY.value:s.offsetX.value,a=0;a=t.loop?i>0?T.value>0?-1:1:0:-Math[T.value>0?"ceil":"floor"](T.value/N.value),U({pace:a,emitChange:!0})}else T.value&&U({pace:0});l=!1,u.swiping=!1,o("dragEnd",{index:R.value}),K()}},nt=function(e,r){var n=r===R.value,o=n?{backgroundColor:t.indicatorColor}:void 0;return L("i",{style:o,class:H("indicator",{active:n})},null)};return m({prev:function(){V(),s.reset(),E((function(){u.swiping=!1,U({pace:-1,emitChange:!0})}))},next:$,state:u,resize:tt,swipeTo:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};V(),s.reset(),E((function(){var n;n=t.loop&&e===D.value?0===u.active?0:e:e%D.value,r.immediate?E((function(){u.swiping=!1})):u.swiping=!1,U({pace:n-u.active,emitChange:!0})}))}}),A({size:N,props:t,count:D,activeIndicator:R}),g((function(){return t.initialSwipe}),(function(t){return Z(+t)})),g(D,(function(){return Z(u.active)})),g((function(){return t.autoplay}),K),g([y,b,function(){return t.width},function(){return t.height}],tt),g(_(),(function(t){"visible"===t?K():W()})),w(Z),x((function(){return Z(u.active)})),j((function(){return Z(u.active)})),S(W),k(W),O("touchmove",(function(e){t.touchable&&u.swiping&&(s.move(e),Y.value&&(!t.loop&&(0===u.active&&T.value>0||u.active===D.value-1&&T.value<0)||(P(e,t.stopPropagation),U({offset:T.value}),l||(o("dragStart",{index:R.value}),l=!0))))}),{target:c}),function(){var e;return L("div",{ref:a,class:H()},[L("div",{ref:c,style:q.value,class:H("track",{vertical:t.vertical}),onTouchstartPassive:et,onTouchend:rt,onTouchcancel:rt},[null==(e=i.default)?void 0:e.call(i)]),i.indicator?i.indicator({active:R.value,total:D.value}):t.showIndicators&&D.value>1?L("div",{class:H("indicators",{vertical:t.vertical})},[Array(D.value).fill("").map(nt)]):void 0])}}}),tt=(t("S",z(Z)),a(i("swipe-item"),2)),et=tt[0],rt=tt[1],nt=s({name:et,setup:function(t,e){var r,n=e.slots,o=d({offset:0,inited:!1,mounted:!1}),i=G(Q),a=i.parent,c=i.index;if(a){var u=h((function(){var t={},e=a.props.vertical;return a.size.value&&(t[e?"height":"width"]="".concat(a.size.value,"px")),o.offset&&(t.transform="translate".concat(e?"Y":"X","(").concat(o.offset,"px)")),t})),l=h((function(){var t=a.props,e=t.loop;if(!t.lazyRender||r)return!0;if(!o.mounted)return!1;var n=a.activeIndicator.value,i=a.count.value-1,u=0===n&&e?i:n-1,l=n===i&&e?0:n+1;return r=c.value===n||c.value===u||c.value===l}));return w((function(){C((function(){o.mounted=!0}))})),m({setOffset:function(t){o.offset=t}}),function(){var t;return L("div",{class:rt(),style:u.value},[l.value?null==(t=n.default)?void 0:t.call(n):null])}}console.error("[Vant] must be a child component of .")}}),ot=(t("a",z(nt)),t("i",""+new URL("icon-sell-out-437e8d6c.png",n.meta.url).href)),it={addGoodsCart:"_addGoodsCart_1x0mj_1",addCartBtn:"_addCartBtn_1x0mj_18",goodsSection:"_goodsSection_1x0mj_26",sellOut:"_sellOut_1x0mj_33",goodsImg:"_goodsImg_1x0mj_45",goodsPrice:"_goodsPrice_1x0mj_51",goodsStore:"_goodsStore_1x0mj_60",title:"_title_1x0mj_65","radio-group":"_radio-group_1x0mj_70",radio:"_radio_1x0mj_70"};var at=J();t("A",s({name:"add-goods-cart",props:{show:{type:Boolean,default:!1},item:{type:Object,default:{}},defaultRadio:{type:Number,default:0},showType:{type:String,default:"cart"},onClose:{type:Function,default:function(){}}},watch:{show:function(t){t&&(this.totalData={},this.total=1,this.radio="",this.setList())}},data:function(){return{radio:"",total:1,totalData:{},skuStockList:[]}},computed:{selectItem:function(){var t=this.radio,e=this.skuStockList.find((function(e){return e.id==t}));if(e){var r=e.stock-e.lockStock;return o(o({},e),{},{stock:r})}return{stock:0}}},mounted:function(){this.setList()},methods:{setList:function(){var t=this,e=[],r=JSON.parse(JSON.stringify(this.item));if(Array.isArray(r.skuStockList)&&(e=r.skuStockList.map((function(t){if(t.pic=t.pic||r.pic,t.cartNum=0,t.spData){var e=JSON.parse(t.spData),n="";e.forEach((function(t){n+="".concat(t.value)})),t.spDataJson=n}else t.spDataJson="默认";return t.lockStock=t.lockStock>0?t.lockStock:0,o({},t)}))),!e.length)return e;var n=0;if(this.defaultRadio){var i=e.findIndex((function(e){return e.id==t.defaultRadio}));n=i>-1?i:0}this.radio=e[n].id,this.skuStockList=e},onAddCart:function(){var t,n=this;return(t=e().mark((function t(){var r,o,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.selectItem,o=n.item,i={pic:o.pic,name:o.name,brandName:o.brandName,productSn:o.productSn,price:r.price,originalPrice:o.originalPrice,productSkuId:r.id,stock:r.stock,quantity:n.total,productId:o.id,spDataJson:r.spDataJson,hidden:"cart"===n.showType?0:1,promoterId:n.$route.query.promoterId?n.$route.query.promoterId:void 0};try{a=!1,at.getGoods.forEach((function(t){t.id===i.productId&&t.productSkuId===i.productSkuId&&(a=!0,t.quantity+=i.quantity)})),a||at.setGoods(i),A("添加成功"),n.onClose()}catch(e){}case 4:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,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)]}}),L("div",{class:["btnGroup"],style:{marginBottom:"8px"}},[L(T,{block:!0,type:"primary",text:"确定",class:it.addCartBtn,disabled:this.selectItem.stock<=0,onClick:function(){return t.onAddCart()}},null)])])}}))}}}))}();