<<<<<<<< HEAD:dist/assets/index-legacy-674b0c18.js !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 o};var o={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,o){t[e]=o.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(t,e,o){return Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(I){u=function(t,e,o){return t[e]=o}}function d(t,e,o,r){var n=e&&e.prototype instanceof m?e:m,i=Object.create(n.prototype),c=new C(r||[]);return a(i,"_invoke",{value:k(t,o,c)}),i}function h(t,e,o){try{return{type:"normal",arg:t.call(e,o)}}catch(I){return{type:"throw",arg:I}}}o.wrap=d;var f={};function m(){}function p(){}function g(){}var v={};u(v,c,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(j([])));b&&b!==r&&n.call(b,c)&&(v=b);var y=g.prototype=m.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(e,o){function r(a,i,c,s){var l=h(e[a],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==t(d)&&n.call(d,"__await")?o.resolve(d.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):o.resolve(d).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,e){function n(){return new o((function(o,n){r(t,e,o,n)}))}return i=i?i.then(n,n):n()}})}function k(t,e,o){var r="suspendedStart";return function(n,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw a;return z()}for(o.method=n,o.arg=a;;){var i=o.delegate;if(i){var c=S(i,o);if(c){if(c===f)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var s=h(t,e,o);if("normal"===s.type){if(r=o.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(r="completed",o.method="throw",o.arg=s.arg)}}}function S(t,e){var o=e.method,r=t.iterator[o];if(void 0===r)return e.delegate=null,"throw"===o&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==o&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var a=n.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(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 o=-1,r=function e(){for(;++o=0;--r){var a=this.tryEntries[r],i=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var o=this.tryEntries[e];if(o.finallyLoc===t)return this.complete(o.completion,o.afterLoc),P(o),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc===t){var r=o.completion;if("throw"===r.type){var n=r.arg;P(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,o){return this.delegate={iterator:j(t),resultName:e,nextLoc:o},"next"===this.method&&(this.arg=void 0),f}},o}function o(t,e,o,r,n,a,i){try{var c=t[a](i),s=c.value}catch(l){return void o(l)}c.done?e(s):Promise.resolve(s).then(r,n)}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var r,n,a,i,c=[],s=!0,l=!1;try{if(a=(o=o.call(t)).next,0===e){if(Object(o)!==o)return;s=!1}else for(;!(s=(r=a.call(o)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(u){l=!0,n=u}finally{try{if(!s&&null!=o.return&&(i=o.return(),Object(i)!==i))return}finally{if(l)throw n}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,r=new Array(e);oo})),P=h((function(){var t=x.scale,e=x.moveX,o=x.moveY,r=x.moving,n={transitionDuration:x.zooming||r?"0s":".3s"};if(1!==t){var a=e/t,i=o/t;n.transform="scale(".concat(t,", ").concat(t,") translate(").concat(a,"px, ").concat(i,"px)")}return n})),C=h((function(){if(x.imageRatio){var e=t.rootWidth,o=t.rootHeight,r=L.value?o/x.imageRatio:e;return Math.max(0,(x.scale*r-e)/2)}return 0})),j=h((function(){if(x.imageRatio){var e=t.rootWidth,o=t.rootHeight,r=L.value?o:e*x.imageRatio;return Math.max(0,(x.scale*r-o)/2)}return 0})),z=function(e){(e=v(e,+t.minZoom,+t.maxZoom+1))!==x.scale&&(x.scale=e,y("scale",{scale:e,index:t.active}))},I=function(){z(1),x.moveX=0,x.moveY=0},T=!1,O=function(e){var c=e.touches;if(2!==(o=c.length)||!t.disableZoom){var l=k.offsetX;k.start(e),r=x.moveX,n=x.moveY,s=Date.now(),T=!1,x.moving=1===o&&1!==x.scale,x.zooming=2===o&&!l.value,x.zooming&&(a=x.scale,i=st(e.touches))}},E=function(){if(!(o>1)){var t,e=k.offsetX,r=k.offsetY,n=Date.now()-s;e.value<5&&r.value<5&&(n<250?c?(clearTimeout(c),c=null,t=x.scale>1?1:2,z(t),x.moveX=0,x.moveY=0):c=setTimeout((function(){y("close"),c=null}),250):n>b&&y("longPress"))}},W=function(e){var o=!1;if((x.moving||x.zooming)&&(o=!0,x.moving&&r===x.moveX&&n===x.moveY&&(o=!1),!e.touches.length)){x.zooming&&(x.moveX=v(x.moveX,-C.value,C.value),x.moveY=v(x.moveY,-j.value,j.value),x.zooming=!1),x.moving=!1,r=0,n=0,a=1,x.scale<1&&I();var i=+t.maxZoom;x.scale>i&&(x.scale=i)}g(e,o),E(),k.reset()},G=function(t){var e=t.target,o=e.naturalWidth,r=e.naturalHeight;x.imageRatio=r/o};return f((function(){return t.active}),I),f((function(){return t.show}),(function(t){t||I()})),m("touchmove",(function(t){var e=t.touches;if(k.move(t),x.moving){var o=k.deltaX,c=k.deltaY,s=o.value+r,l=c.value+n;if((s>C.value||s<-C.value)&&!T&&k.isHorizontal())return void(x.moving=!1);T=!0,g(t,!0),x.moveX=v(s,-C.value,C.value),x.moveY=v(l,-j.value,j.value)}if(x.zooming&&(g(t,!0),2===e.length)){var u=st(e);z(a*u/i)}}),{target:h((function(){var t;return null==(t=S.value)?void 0:t.$el}))}),function(){var e={loading:function(){return p(_,{type:"spinner"},null)}};return p(K,{ref:S,class:lt("swipe-item"),onTouchstartPassive:O,onTouchend:W,onTouchcancel:W},{default:function(){return[w.image?p("div",{class:lt("image-wrap")},[w.image({src:t.src})]):p(tt,{src:t.src,fit:"contain",class:lt("image",{vertical:L.value}),style:P.value,onLoad:G},e)]}})}}}),dt=r(a("image-preview"),2),ht=dt[0],ft=dt[1],mt=["show","teleport","transition","overlayStyle","closeOnPopstate"],pt={show:Boolean,loop:y,images:w(),minZoom:x(1/3),maxZoom:x(3),overlay:y,closeable:Boolean,showIndex:y,className:k,closeIcon:S("clear"),transition:String,beforeClose:Function,overlayClass:k,overlayStyle:Object,swipeDuration:x(300),startPosition:x(0),showIndicators:Boolean,closeOnPopstate:y,closeIconPosition:S("top-right"),teleport:[String,Object]},gt=i({name:ht,props:pt,emits:["scale","close","closed","change","longPress","update:show"],setup:function(t,e){var o=e.emit,r=e.slots,n=d(),a=l({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),i=function(){if(n.value){var t=E(n.value.$el);a.rootWidth=t.width,a.rootHeight=t.height,n.value.resize()}},c=function(t){return o("scale",t)},s=function(t){return o("update:show",t)},u=function(){A(t.beforeClose,{args:[a.active],done:function(){return s(!1)}})},h=function(t){t!==a.active&&(a.active=t,o("change",t))},m=function(){if(t.showIndex)return p("div",{class:ft("index")},[r.index?r.index({index:a.active}):"".concat(a.active+1," / ").concat(t.images.length)])},g=function(){if(r.cover)return p("div",{class:ft("cover")},[r.cover()])},v=function(){a.disableZoom=!0},_=function(){a.disableZoom=!1},b=function(){if(t.closeable)return p(G,{role:"button",name:t.closeIcon,class:[ft("close-icon",t.closeIconPosition),W],onClick:u},null)},y=function(){return o("closed")},w=function(t,e){var o;return null==(o=n.value)?void 0:o.swipeTo(t,e)};return L({swipeTo:w}),P(i),f([C,j],i),f((function(){return t.startPosition}),(function(t){return h(+t)})),f((function(){return t.show}),(function(e){var r=t.images,n=t.startPosition;e?(h(+n),z((function(){i(),w(+n,{immediate:!0})}))):o("close",{index:a.active,url:r[a.active]})})),function(){return p(O,I({class:[ft(),t.className],overlayClass:[ft("overlay"),t.overlayClass],onClosed:y,"onUpdate:show":s},T(t,mt)),{default:function(){return[b(),p(Q,{ref:n,lazyRender:!0,loop:t.loop,class:ft("swipe"),duration:t.swipeDuration,initialSwipe:t.startPosition,showIndicators:t.showIndicators,indicatorColor:"white",onChange:h,onDragEnd:_,onDragStart:v},{default:function(){return[t.images.map((function(e,n){return p(ut,{src:e,show:t.show,active:a.active,maxZoom:t.maxZoom,minZoom:t.minZoom,rootWidth:a.rootWidth,rootHeight:a.rootHeight,disableZoom:a.disableZoom,onScale:c,onClose:u,onLongPress:function(){return o("longPress",{index:n})}},{image:r.image})}))]}}),m(),g()]}})}}}),vt={loop:!0,images:[],maxZoom:3,minZoom:1/3,onScale:void 0,onClose:void 0,onChange:void 0,teleport:"body",className:"",showIndex:!0,closeable:!1,closeIcon:"clear",transition:void 0,beforeClose:void 0,overlayStyle:void 0,overlayClass:void 0,startPosition:0,swipeDuration:300,showIndicators:!1,closeOnPopstate:!0,closeIconPosition:"top-right"};var _t=function(t){var e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(N)return n||(e=B({setup:function(){var t=H(),e=t.state,o=t.toggle,r=function(){e.images=[]};return function(){return p(gt,I(e,{onClosed:r,"onUpdate:show":o}),null)}}}),n=e.instance),t=Array.isArray(t)?{images:t,startPosition:o}:t,n.open(D({},vt,t)),n};Z(gt);var bt=r(a("submit-bar"),3),yt=bt[0],wt=bt[1],xt=bt[2],kt={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:S("¥"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:S("danger"),buttonColor:String,suffixLabel:String,placeholder:Boolean,decimalLength:x(2),safeAreaInsetBottom:y},St=i({name:yt,props:kt,emits:["submit"],setup:function(t,e){var o=e.emit,r=e.slots,n=d(),a=F(n,wt),i=function(){var e=t.price,o=t.label,r=t.currency,n=t.textAlign,a=t.suffixLabel,i=t.decimalLength;if("number"==typeof e){var c=(e/100).toFixed(+i).split("."),s=i?".".concat(c[1]):"";return p("div",{class:wt("text"),style:{textAlign:n}},[p("span",null,[o||xt("label")]),p("span",{class:wt("price")},[r,p("span",{class:wt("price-integer")},[c[0]]),s]),a&&p("span",{class:wt("suffix-label")},[a])])}},c=function(){var e,o=t.tip,n=t.tipIcon;if(r.tip||o)return p("div",{class:wt("tip")},[n&&p(G,{class:wt("tip-icon"),name:n},null),o&&p("span",{class:wt("tip-text")},[o]),null==(e=r.tip)?void 0:e.call(r)])},s=function(){return o("submit")},l=function(){var e,o;return p("div",{ref:n,class:[wt(),{"van-safe-area-bottom":t.safeAreaInsetBottom}]},[null==(e=r.top)?void 0:e.call(r),c(),p("div",{class:wt("bar")},[null==(o=r.default)?void 0:o.call(r),i(),r.button?r.button():p(Y,{round:!0,type:t.buttonType,text:t.buttonText,class:wt("button",t.buttonType),color:t.buttonColor,loading:t.loading,disabled:t.disabled,onClick:s},null)])])};return function(){return t.placeholder?a(l):l()}}}),Lt=Z(St),Pt="_swipeItemImg_1ayhb_1",Ct="_swipe_1ayhb_1",jt="_custom-indicator_1ayhb_7",zt="_goodsHead_1ayhb_17",It="_priceGroup_1ayhb_24",Tt="_price_1ayhb_24",Ot="_goodsName_1ayhb_47",Et="_row_1ayhb_53",Wt="_col_1ayhb_57",Gt="_radio-group_1ayhb_61",At="_radio_1ayhb_61",Nt="_badge_1ayhb_102",Dt="_section_1ayhb_106",Bt="_detail_1ayhb_110",Ht="_photoDetail_1ayhb_135",Zt="_goodsDetail_1ayhb_139",Ft="_actionBar_1ayhb_142",Yt="_addCertBtn_1ayhb_169",Xt="_buyGroup_1ayhb_179",Rt="_selectWrap_1ayhb_185",Mt="_imagesOverlayWrap_1ayhb_249";t("default",i({name:"goods-detail",data:function(){return{id:this.$route.query.id,albumPics:[],product:{},radio:0,skuStockListTemp:[],detailMobileHtml:"",loading:!1,addGoodsShow:!1,selectGoodsItem:{},cartCount:0}},computed:{skuStockList:function(){var t=this.product,e=this.skuStockListTemp.length>0?this.skuStockListTemp:[{id:-1,price:t.price,pic:t.pic,stock:t.stock,spData:null}];return e.forEach((function(t){if(t.spData){var e=JSON.parse(t.spData);t.spDataJson=e.reduce((function(t,e){return t+=e.value}),""),t.sku=e.reduce((function(t,e){return t.push("".concat(e.key,": ").concat(e.value)),t}),[]).join(",")}else t.spDataJson="默认"})),e},getPrice:function(){var t=this,e=this.skuStockList.filter((function(e){return e.id==t.radio}));return e&&Array.isArray(e)&&e.length?e[0].price:0}},mounted:function(){var t,r=this;return(t=e().mark((function t(){var o,n,a,i,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r.loading=!0,t.next=4,X.get("/edu-app/open/mall/product/detail/".concat(r.id),{noAuthorization:!0});case 4:if(o=t.sent,r.loading=!1,n=o.data||{},r.albumPics=[n.product.pic].concat(n.product.albumPics.split(",")).filter((function(t){return t})),r.product=n.product,r.skuStockListTemp=n.skuStockList||[],!r.skuStockListTemp.length){t.next=21;break}a=r.skuStockListTemp.length,i=0;case 13:if(!(i=0)){t.next=18;break}return r.radio=c.id,t.abrupt("break",21);case 18:i++,t.next=13;break;case 21:r.detailMobileHtml=n.product.detailMobileHtml,t.next=26;break;case 24:t.prev=24,t.t0=t.catch(0);case 26:case"end":return t.stop()}}),t,null,[[0,24]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,s,"next",t)}function s(t){o(i,n,a,c,s,"throw",t)}c(void 0)}))})()},methods:{onPreview:function(t){_t({images:this.albumPics,startPosition:t,closeable:!0,className:Mt})},onShowImg:function(t){if("img"===t.srcElement.localName){var e=0,o=document.querySelectorAll(".msgWrap img"),r=Array.from(o).map((function(o,r){return t.srcElement==o&&(e=r),o.src}));_t({images:r,startPosition:e,closeable:!0,className:Mt})}},onShowCart:function(){this.selectGoodsItem={price:this.product.price,originalPrice:this.product.originalPrice,pic:this.product.pic,stock:this.product.stock,skuStockList:this.skuStockListTemp.length?this.skuStockListTemp:void 0,brandName:this.product.brandName,productCategoryId:this.product.productCategoryId,name:this.product.name,productSn:this.product.productSn,productSubTitle:this.product.subTitle,id:this.product.id},this.addGoodsShow=!0}},render:function(){var t,e=this,o=this.product,r=this.skuStockList.find((function(t){return t.id===e.radio}));return p("div",{class:Zt},[p(Q,{class:Ct,lazyRender:!0},{default:function(){return[e.albumPics.map((function(t,o){return p(K,null,{default:function(){return[p(tt,{class:Pt,src:t,onClick:function(){return e.onPreview(o)},fit:"cover"},null)]}})}))]},indicator:function(t){return t.total>1&&p("div",{class:jt},[(t.active||0)+1,R(" / "),t.total])}}),p(et,{border:!1,class:[zt,"mb12"]},{default:function(){return[p(ot,{center:!0,border:!1},{title:function(){return p("div",{class:It},[p("span",{class:Tt},[p("i",null,[R("¥")]),M(e.getPrice)])])}}),p(ot,{center:!0,border:!1,title:o.name,titleClass:[Ot,"van-ellipsis"]},null)]}}),p(rt,{class:[Et,"mb12"]},{default:function(){return[p(nt,{span:4,class:Wt},{default:function(){return[R("规格")]}}),p(nt,{span:20},{default:function(){return[r?p("div",{class:Rt},[r.stock<=0?"当前款式暂时缺货":"已选择 ".concat(r.spDataJson)]):p("div",null,[R("请选择 规格")]),p(at,{class:Gt,modelValue:e.radio,"onUpdate:modelValue":function(t){return e.radio=t}},(o=t=e.skuStockList.map((function(t){var o=t.id===e.radio,r=o?"primary":"default";return p(J,{position:"top-right",content:t.stock<=0?"缺货":"",color:"#999999",class:Nt,offset:[-20,0]},{default:function(){return[p(it,{class:At,name:t.id,disabled:t.stock<=0,onClick:function(){t.stock<=0||(e.radio=t.id)}},{default:function(){return[p(ct,{size:"large",plain:o,type:r},{default:function(){return[t.spDataJson]}})]}})]}})})),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!$(o)?t:{default:function(){return[t]}}))];var o}})]}}),this.detailMobileHtml&&p("div",{class:[Dt]},[p("div",{class:Bt},[p("span",null,[R("图文详情")])]),p("div",{class:[Ht,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&p(U,null,[p(Lt,{class:Ft,"safe-area-inset-bottom":!0},{button:function(){return p("div",{class:Xt},[p(V,{type:"primary",class:Yt,text:"添加购买",onClick:function(){return e.onShowCart()}},null)])}})]),p(O,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:function(){e.addGoodsShow=!1}},{default:function(){return[p(q,{show:e.addGoodsShow,item:e.selectGoodsItem,onClose:function(){e.addGoodsShow=!1},defaultRadio:e.radio,showType:"cart"},null)]}})])}}))}}}))}(); ======== !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 o};var o={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,o){t[e]=o.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(t,e,o){return Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(I){u=function(t,e,o){return t[e]=o}}function d(t,e,o,r){var n=e&&e.prototype instanceof m?e:m,i=Object.create(n.prototype),c=new C(r||[]);return a(i,"_invoke",{value:k(t,o,c)}),i}function h(t,e,o){try{return{type:"normal",arg:t.call(e,o)}}catch(I){return{type:"throw",arg:I}}}o.wrap=d;var f={};function m(){}function p(){}function g(){}var v={};u(v,c,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(j([])));b&&b!==r&&n.call(b,c)&&(v=b);var y=g.prototype=m.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(e,o){function r(a,i,c,s){var l=h(e[a],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==t(d)&&n.call(d,"__await")?o.resolve(d.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):o.resolve(d).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,e){function n(){return new o((function(o,n){r(t,e,o,n)}))}return i=i?i.then(n,n):n()}})}function k(t,e,o){var r="suspendedStart";return function(n,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw a;return z()}for(o.method=n,o.arg=a;;){var i=o.delegate;if(i){var c=S(i,o);if(c){if(c===f)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var s=h(t,e,o);if("normal"===s.type){if(r=o.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(r="completed",o.method="throw",o.arg=s.arg)}}}function S(t,e){var o=e.method,r=t.iterator[o];if(void 0===r)return e.delegate=null,"throw"===o&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==o&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var a=n.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(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 o=-1,r=function e(){for(;++o=0;--r){var a=this.tryEntries[r],i=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var o=this.tryEntries[e];if(o.finallyLoc===t)return this.complete(o.completion,o.afterLoc),P(o),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc===t){var r=o.completion;if("throw"===r.type){var n=r.arg;P(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,o){return this.delegate={iterator:j(t),resultName:e,nextLoc:o},"next"===this.method&&(this.arg=void 0),f}},o}function o(t,e,o,r,n,a,i){try{var c=t[a](i),s=c.value}catch(l){return void o(l)}c.done?e(s):Promise.resolve(s).then(r,n)}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var r,n,a,i,c=[],s=!0,l=!1;try{if(a=(o=o.call(t)).next,0===e){if(Object(o)!==o)return;s=!1}else for(;!(s=(r=a.call(o)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(u){l=!0,n=u}finally{try{if(!s&&null!=o.return&&(i=o.return(),Object(i)!==i))return}finally{if(l)throw n}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,r=new Array(e);oo})),P=h((function(){var t=x.scale,e=x.moveX,o=x.moveY,r=x.moving,n={transitionDuration:x.zooming||r?"0s":".3s"};if(1!==t){var a=e/t,i=o/t;n.transform="scale(".concat(t,", ").concat(t,") translate(").concat(a,"px, ").concat(i,"px)")}return n})),C=h((function(){if(x.imageRatio){var e=t.rootWidth,o=t.rootHeight,r=L.value?o/x.imageRatio:e;return Math.max(0,(x.scale*r-e)/2)}return 0})),j=h((function(){if(x.imageRatio){var e=t.rootWidth,o=t.rootHeight,r=L.value?o:e*x.imageRatio;return Math.max(0,(x.scale*r-o)/2)}return 0})),z=function(e){(e=v(e,+t.minZoom,+t.maxZoom+1))!==x.scale&&(x.scale=e,y("scale",{scale:e,index:t.active}))},I=function(){z(1),x.moveX=0,x.moveY=0},T=!1,O=function(e){var c=e.touches;if(2!==(o=c.length)||!t.disableZoom){var l=k.offsetX;k.start(e),r=x.moveX,n=x.moveY,s=Date.now(),T=!1,x.moving=1===o&&1!==x.scale,x.zooming=2===o&&!l.value,x.zooming&&(a=x.scale,i=st(e.touches))}},E=function(){if(!(o>1)){var t,e=k.offsetX,r=k.offsetY,n=Date.now()-s;e.value<5&&r.value<5&&(n<250?c?(clearTimeout(c),c=null,t=x.scale>1?1:2,z(t),x.moveX=0,x.moveY=0):c=setTimeout((function(){y("close"),c=null}),250):n>b&&y("longPress"))}},W=function(e){var o=!1;if((x.moving||x.zooming)&&(o=!0,x.moving&&r===x.moveX&&n===x.moveY&&(o=!1),!e.touches.length)){x.zooming&&(x.moveX=v(x.moveX,-C.value,C.value),x.moveY=v(x.moveY,-j.value,j.value),x.zooming=!1),x.moving=!1,r=0,n=0,a=1,x.scale<1&&I();var i=+t.maxZoom;x.scale>i&&(x.scale=i)}g(e,o),E(),k.reset()},G=function(t){var e=t.target,o=e.naturalWidth,r=e.naturalHeight;x.imageRatio=r/o};return f((function(){return t.active}),I),f((function(){return t.show}),(function(t){t||I()})),m("touchmove",(function(t){var e=t.touches;if(k.move(t),x.moving){var o=k.deltaX,c=k.deltaY,s=o.value+r,l=c.value+n;if((s>C.value||s<-C.value)&&!T&&k.isHorizontal())return void(x.moving=!1);T=!0,g(t,!0),x.moveX=v(s,-C.value,C.value),x.moveY=v(l,-j.value,j.value)}if(x.zooming&&(g(t,!0),2===e.length)){var u=st(e);z(a*u/i)}}),{target:h((function(){var t;return null==(t=S.value)?void 0:t.$el}))}),function(){var e={loading:function(){return p(_,{type:"spinner"},null)}};return p(K,{ref:S,class:lt("swipe-item"),onTouchstartPassive:O,onTouchend:W,onTouchcancel:W},{default:function(){return[w.image?p("div",{class:lt("image-wrap")},[w.image({src:t.src})]):p(tt,{src:t.src,fit:"contain",class:lt("image",{vertical:L.value}),style:P.value,onLoad:G},e)]}})}}}),dt=r(a("image-preview"),2),ht=dt[0],ft=dt[1],mt=["show","teleport","transition","overlayStyle","closeOnPopstate"],pt={show:Boolean,loop:y,images:w(),minZoom:x(1/3),maxZoom:x(3),overlay:y,closeable:Boolean,showIndex:y,className:k,closeIcon:S("clear"),transition:String,beforeClose:Function,overlayClass:k,overlayStyle:Object,swipeDuration:x(300),startPosition:x(0),showIndicators:Boolean,closeOnPopstate:y,closeIconPosition:S("top-right"),teleport:[String,Object]},gt=i({name:ht,props:pt,emits:["scale","close","closed","change","longPress","update:show"],setup:function(t,e){var o=e.emit,r=e.slots,n=d(),a=l({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),i=function(){if(n.value){var t=E(n.value.$el);a.rootWidth=t.width,a.rootHeight=t.height,n.value.resize()}},c=function(t){return o("scale",t)},s=function(t){return o("update:show",t)},u=function(){A(t.beforeClose,{args:[a.active],done:function(){return s(!1)}})},h=function(t){t!==a.active&&(a.active=t,o("change",t))},m=function(){if(t.showIndex)return p("div",{class:ft("index")},[r.index?r.index({index:a.active}):"".concat(a.active+1," / ").concat(t.images.length)])},g=function(){if(r.cover)return p("div",{class:ft("cover")},[r.cover()])},v=function(){a.disableZoom=!0},_=function(){a.disableZoom=!1},b=function(){if(t.closeable)return p(G,{role:"button",name:t.closeIcon,class:[ft("close-icon",t.closeIconPosition),W],onClick:u},null)},y=function(){return o("closed")},w=function(t,e){var o;return null==(o=n.value)?void 0:o.swipeTo(t,e)};return L({swipeTo:w}),P(i),f([C,j],i),f((function(){return t.startPosition}),(function(t){return h(+t)})),f((function(){return t.show}),(function(e){var r=t.images,n=t.startPosition;e?(h(+n),z((function(){i(),w(+n,{immediate:!0})}))):o("close",{index:a.active,url:r[a.active]})})),function(){return p(O,I({class:[ft(),t.className],overlayClass:[ft("overlay"),t.overlayClass],onClosed:y,"onUpdate:show":s},T(t,mt)),{default:function(){return[b(),p(Q,{ref:n,lazyRender:!0,loop:t.loop,class:ft("swipe"),duration:t.swipeDuration,initialSwipe:t.startPosition,showIndicators:t.showIndicators,indicatorColor:"white",onChange:h,onDragEnd:_,onDragStart:v},{default:function(){return[t.images.map((function(e,n){return p(ut,{src:e,show:t.show,active:a.active,maxZoom:t.maxZoom,minZoom:t.minZoom,rootWidth:a.rootWidth,rootHeight:a.rootHeight,disableZoom:a.disableZoom,onScale:c,onClose:u,onLongPress:function(){return o("longPress",{index:n})}},{image:r.image})}))]}}),m(),g()]}})}}}),vt={loop:!0,images:[],maxZoom:3,minZoom:1/3,onScale:void 0,onClose:void 0,onChange:void 0,teleport:"body",className:"",showIndex:!0,closeable:!1,closeIcon:"clear",transition:void 0,beforeClose:void 0,overlayStyle:void 0,overlayClass:void 0,startPosition:0,swipeDuration:300,showIndicators:!1,closeOnPopstate:!0,closeIconPosition:"top-right"};var _t=function(t){var e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(N)return n||(e=B({setup:function(){var t=H(),e=t.state,o=t.toggle,r=function(){e.images=[]};return function(){return p(gt,I(e,{onClosed:r,"onUpdate:show":o}),null)}}}),n=e.instance),t=Array.isArray(t)?{images:t,startPosition:o}:t,n.open(D({},vt,t)),n};Z(gt);var bt=r(a("submit-bar"),3),yt=bt[0],wt=bt[1],xt=bt[2],kt={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:S("¥"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:S("danger"),buttonColor:String,suffixLabel:String,placeholder:Boolean,decimalLength:x(2),safeAreaInsetBottom:y},St=i({name:yt,props:kt,emits:["submit"],setup:function(t,e){var o=e.emit,r=e.slots,n=d(),a=F(n,wt),i=function(){var e=t.price,o=t.label,r=t.currency,n=t.textAlign,a=t.suffixLabel,i=t.decimalLength;if("number"==typeof e){var c=(e/100).toFixed(+i).split("."),s=i?".".concat(c[1]):"";return p("div",{class:wt("text"),style:{textAlign:n}},[p("span",null,[o||xt("label")]),p("span",{class:wt("price")},[r,p("span",{class:wt("price-integer")},[c[0]]),s]),a&&p("span",{class:wt("suffix-label")},[a])])}},c=function(){var e,o=t.tip,n=t.tipIcon;if(r.tip||o)return p("div",{class:wt("tip")},[n&&p(G,{class:wt("tip-icon"),name:n},null),o&&p("span",{class:wt("tip-text")},[o]),null==(e=r.tip)?void 0:e.call(r)])},s=function(){return o("submit")},l=function(){var e,o;return p("div",{ref:n,class:[wt(),{"van-safe-area-bottom":t.safeAreaInsetBottom}]},[null==(e=r.top)?void 0:e.call(r),c(),p("div",{class:wt("bar")},[null==(o=r.default)?void 0:o.call(r),i(),r.button?r.button():p(Y,{round:!0,type:t.buttonType,text:t.buttonText,class:wt("button",t.buttonType),color:t.buttonColor,loading:t.loading,disabled:t.disabled,onClick:s},null)])])};return function(){return t.placeholder?a(l):l()}}}),Lt=Z(St),Pt="_swipeItemImg_1ayhb_1",Ct="_swipe_1ayhb_1",jt="_custom-indicator_1ayhb_7",zt="_goodsHead_1ayhb_17",It="_priceGroup_1ayhb_24",Tt="_price_1ayhb_24",Ot="_goodsName_1ayhb_47",Et="_row_1ayhb_53",Wt="_col_1ayhb_57",Gt="_radio-group_1ayhb_61",At="_radio_1ayhb_61",Nt="_badge_1ayhb_102",Dt="_section_1ayhb_106",Bt="_detail_1ayhb_110",Ht="_photoDetail_1ayhb_135",Zt="_goodsDetail_1ayhb_139",Ft="_actionBar_1ayhb_142",Yt="_addCertBtn_1ayhb_169",Xt="_buyGroup_1ayhb_179",Rt="_selectWrap_1ayhb_185",Mt="_imagesOverlayWrap_1ayhb_249";t("default",i({name:"goods-detail",data:function(){return{id:this.$route.query.id,albumPics:[],product:{},radio:0,skuStockListTemp:[],detailMobileHtml:"",loading:!1,addGoodsShow:!1,selectGoodsItem:{},cartCount:0}},computed:{skuStockList:function(){var t=this.product,e=this.skuStockListTemp.length>0?this.skuStockListTemp:[{id:-1,price:t.price,pic:t.pic,stock:t.stock,spData:null}];return e.forEach((function(t){if(t.spData){var e=JSON.parse(t.spData);t.spDataJson=e.reduce((function(t,e){return t+=e.value}),""),t.sku=e.reduce((function(t,e){return t.push("".concat(e.key,": ").concat(e.value)),t}),[]).join(",")}else t.spDataJson="默认"})),e},getPrice:function(){var t=this,e=this.skuStockList.filter((function(e){return e.id==t.radio}));return e&&Array.isArray(e)&&e.length?e[0].price:0}},mounted:function(){var t,r=this;return(t=e().mark((function t(){var o,n,a,i,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r.loading=!0,t.next=4,X.get("/edu-app/open/mall/product/detail/".concat(r.id),{noAuthorization:!0});case 4:if(o=t.sent,r.loading=!1,n=o.data||{},r.albumPics=[n.product.pic].concat(n.product.albumPics.split(",")).filter((function(t){return t})),r.product=n.product,r.skuStockListTemp=n.skuStockList||[],!r.skuStockListTemp.length){t.next=21;break}a=r.skuStockListTemp.length,i=0;case 13:if(!(i=0)){t.next=18;break}return r.radio=c.id,t.abrupt("break",21);case 18:i++,t.next=13;break;case 21:r.detailMobileHtml=n.product.detailMobileHtml,t.next=26;break;case 24:t.prev=24,t.t0=t.catch(0);case 26:case"end":return t.stop()}}),t,null,[[0,24]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,s,"next",t)}function s(t){o(i,n,a,c,s,"throw",t)}c(void 0)}))})()},methods:{onPreview:function(t){_t({images:this.albumPics,startPosition:t,closeable:!0,className:Mt})},onShowImg:function(t){if("img"===t.srcElement.localName){var e=0,o=document.querySelectorAll(".msgWrap img"),r=Array.from(o).map((function(o,r){return t.srcElement==o&&(e=r),o.src}));_t({images:r,startPosition:e,closeable:!0,className:Mt})}},onShowCart:function(){this.selectGoodsItem={price:this.product.price,originalPrice:this.product.originalPrice,pic:this.product.pic,stock:this.product.stock,skuStockList:this.skuStockListTemp.length?this.skuStockListTemp:void 0,brandName:this.product.brandName,productCategoryId:this.product.productCategoryId,name:this.product.name,productSn:this.product.productSn,productSubTitle:this.product.subTitle,id:this.product.id},this.addGoodsShow=!0}},render:function(){var t,e=this,o=this.product,r=this.skuStockList.find((function(t){return t.id===e.radio}));return p("div",{class:Zt},[p(Q,{class:Ct,lazyRender:!0},{default:function(){return[e.albumPics.map((function(t,o){return p(K,null,{default:function(){return[p(tt,{class:Pt,src:t,onClick:function(){return e.onPreview(o)},fit:"cover"},null)]}})}))]},indicator:function(t){return t.total>1&&p("div",{class:jt},[(t.active||0)+1,R(" / "),t.total])}}),p(et,{border:!1,class:[zt,"mb12"]},{default:function(){return[p(ot,{center:!0,border:!1},{title:function(){return p("div",{class:It},[p("span",{class:Tt},[p("i",null,[R("¥")]),M(e.getPrice)])])}}),p(ot,{center:!0,border:!1,title:o.name,titleClass:[Ot,"van-ellipsis"]},null)]}}),p(rt,{class:[Et,"mb12"]},{default:function(){return[p(nt,{span:4,class:Wt},{default:function(){return[R("规格")]}}),p(nt,{span:20},{default:function(){return[r?p("div",{class:Rt},[r.stock<=0?"当前款式暂时缺货":"已选择 ".concat(r.spDataJson)]):p("div",null,[R("请选择 规格")]),p(at,{class:Gt,modelValue:e.radio,"onUpdate:modelValue":function(t){return e.radio=t}},(o=t=e.skuStockList.map((function(t){var o=t.id===e.radio,r=o?"primary":"default";return p(J,{position:"top-right",content:t.stock<=0?"缺货":"",color:"#999999",class:Nt,offset:[-20,0]},{default:function(){return[p(it,{class:At,name:t.id,disabled:t.stock<=0,onClick:function(){t.stock<=0||(e.radio=t.id)}},{default:function(){return[p(ct,{size:"large",plain:o,type:r},{default:function(){return[t.spDataJson]}})]}})]}})})),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!$(o)?t:{default:function(){return[t]}}))];var o}})]}}),this.detailMobileHtml&&p("div",{class:[Dt]},[p("div",{class:Bt},[p("span",null,[R("图文详情")])]),p("div",{class:[Ht,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&p(U,null,[p(Lt,{class:Ft,"safe-area-inset-bottom":!0},{button:function(){return p("div",{class:Xt},[p(V,{type:"primary",class:Yt,text:"添加购买",onClick:function(){return e.onShowCart()}},null)])}})]),p(O,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:function(){e.addGoodsShow=!1}},{default:function(){return[p(q,{show:e.addGoodsShow,item:e.selectGoodsItem,onClose:function(){e.addGoodsShow=!1},defaultRadio:e.radio,showType:"cart"},null)]}})])}}))}}}))}(); >>>>>>>> master:dist/assets/index-legacy-f32ad9cb.js