index-legacy-b963c8fc.js 18 KB

1
  1. !function(){function e(e,o,t,i,a,r,s){try{var n=e[r](s),l=n.value}catch(u){return void t(u)}n.done?o(l):Promise.resolve(l).then(i,a)}System.register(["./index-legacy-d8f4e5dc.js","./index-legacy-b6530059.js","./index-legacy-9d3c0f7d.js","./index-legacy-e6913c80.js","./index-legacy-32f47b30.js","./index-legacy-3e258c26.js","./index-legacy-4ab35741.js","./index-legacy-8996229f.js","./index-legacy-fdfbcb5f.js","./student-register-store-legacy-19b905f8.js","./index-legacy-38c98207.js","./Checker-legacy-1f9d8de7.js"],(function(o,t){"use strict";var i,a,r,s,n,l,u,c,d,m,_,p,b,g,h,v,f,w,y,x,k,S,C,P,z,I,T,L,W,j,D,B,H,Z,G,X,$,A,N,F,Y,R,O,M,E,J,V,q,U,Q,K,ee,oe,te,ie,ae,re,se=document.createElement("style");return se.textContent='._arrowLeft_ub7u2_1{position:fixed;top:calc(.53333rem + env(safe-area-inset-top));left:.53333rem;z-index:999;font-size:.58667rem;background-color:rgba(0,0,0,.5);color:#fff;padding:.10667rem .10667rem .05333rem .05333rem;border-radius:50%}._swipeItemImg_ub7u2_12,._swipe_ub7u2_12{width:100%;height:10rem;vertical-align:middle}._custom-indicator_ub7u2_18{position:absolute;right:.13333rem;bottom:.13333rem;padding:.10667rem .21333rem;font-size:.37333rem;color:#fff;background:rgba(0,0,0,.5);border-radius:.32rem}._goodsHead_ub7u2_28{padding:.21333rem 0}._goodsHead_ub7u2_28 .van-cell{padding-top:.13333rem;padding-bottom:.13333rem}._priceGroup_ub7u2_35{display:flex;align-items:center}._priceGroup_ub7u2_35 ._price_ub7u2_35{color:#ff4e19;font-size:.64rem;font-weight:700}._priceGroup_ub7u2_35 ._price_ub7u2_35 i{font-size:.42667rem;font-style:normal}._priceGroup_ub7u2_35 ._delPrice_ub7u2_48{font-size:.37333rem;color:#999;margin-left:.32rem;line-height:.53333rem}._priceGroup_ub7u2_35 ._stock_ub7u2_54{font-size:.37333rem;color:#999}._goodsName_ub7u2_58{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._row_ub7u2_64{background-color:#fff;padding:var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding)}._row_ub7u2_64 ._col_ub7u2_68{font-size:.42667rem;color:#333}._radio-group_ub7u2_72{display:flex;flex-wrap:wrap}._radio_ub7u2_72{margin-right:.21333rem;margin-bottom:.21333rem;min-width:1.6rem}._radio_ub7u2_72 .van-radio__label--disabled{opacity:.5}._radio_ub7u2_72 .van-radio__icon{display:none}._radio_ub7u2_72 .van-tag--large{height:.72rem;font-size:.34667rem;text-align:center;display:flex;align-items:center;justify-content:center}._radio_ub7u2_72 .van-tag{box-sizing:border-box}._radio_ub7u2_72 .van-tag--default{color:#999;background-color:#f7f8f9}._radio_ub7u2_72 .van-tag--primary{background-color:#fffaf4;background:#FFFAF4;border-radius:.16rem;border:.02667rem solid #FFCF7C;color:#f39f11}._radio_ub7u2_72 .van-radio__label{margin-left:0;width:100%}._badge_ub7u2_113 .van-badge{border-radius:.16rem 0;font-size:.32rem}._section_ub7u2_117{background:#fff;padding:.32rem 0 0}._detail_ub7u2_121{display:flex;align-items:center;justify-content:center;font-size:.37333rem;color:#999;line-height:.53333rem;margin-bottom:.32rem}._detail_ub7u2_121 span{padding:0 .26667rem}._detail_ub7u2_121:before,._detail_ub7u2_121:after{display:inline-block;content:" ";width:1.06667rem;height:.08rem}._detail_ub7u2_121:before{background:linear-gradient(90deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._detail_ub7u2_121:after{background:linear-gradient(270deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._photoDetail_ub7u2_146 img{width:100%;vertical-align:middle}._goodsDetail_ub7u2_150{margin-bottom:var(--van-action-bar-height)}._actionBar_ub7u2_153{padding-left:.42667rem;padding-right:.42667rem;justify-content:space-between;box-shadow:0 -.26667rem .26667rem var(--box-shadow-color);box-sizing:border-box}._actionBar_ub7u2_153 .van-submit-bar__bar{justify-content:center;padding:0;height:1.81333rem}._actionBar_ub7u2_153 .van-action-bar-icon{align-items:center}._actionBar_ub7u2_153 .van-action-bar-icon__icon{margin-bottom:0;line-height:0}._actionBar_ub7u2_153 .van-badge{background:#ff4e19}._actionBar_ub7u2_153 ._text_ub7u2_175{font-size:.32rem;color:#333;text-align:center}._addCertBtn_ub7u2_180{background:linear-gradient(121deg,#FFD892 0%,#FFCB75 100%);border-radius:.32rem;font-size:.42667rem;font-weight:600;color:#5b2c03;width:3.94667rem;height:1.06667rem;border:0}._buyGroup_ub7u2_190{display:flex;justify-content:center;overflow:hidden;box-sizing:border-box}._selectWrap_ub7u2_196{padding-top:.04rem;font-size:.37333rem;color:#666;padding-bottom:.32rem}._shareBtn_ub7u2_202{display:flex;align-items:center;font-size:.37333rem;color:#666}._shareWrap_ub7u2_208{display:flex;border-radius:.26667rem;border:.02667rem solid var(--van-primary);overflow:hidden;padding:.37333rem;align-items:center;background-color:#fff;margin-top:.42667rem}._shareWrap_ub7u2_208 ._sharePic_ub7u2_218{width:2.66667rem;height:2.66667rem;border-radius:.21333rem}._shareWrap_ub7u2_208 ._shareLeft_ub7u2_223{margin-right:.26667rem}._shareWrap_ub7u2_208 ._shareRight_ub7u2_226{flex:1;overflow:hidden}._shareWrap_ub7u2_208 ._shareShopTitle_ub7u2_230{font-size:.42667rem;font-weight:400;color:#333;display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}._shareWrap_ub7u2_208 ._shareShopDes_ub7u2_240{font-size:.37333rem;font-weight:400;color:#999;margin:.26667rem 0 .53333rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._shareWrap_ub7u2_208 ._shareShopValue_ub7u2_249{font-size:.42667rem;color:#ff4e19}._shareWrap_ub7u2_208 ._shareShopOldPrice_ub7u2_253{color:#e5e5e5;margin-left:.13333rem}._shareWrap_ub7u2_208 .van-card{background:transparent}._imagesOverlayWrap_ub7u2_260 .van-badge__wrapper,._imagesOverlayWrap_ub7u2_260 .van-image-preview__index{top:1.06667rem}\n',document.head.appendChild(se),{setters:[e=>{i=e.c,a=e.d,r=e.b4,s=e.n,n=e.x,l=e.u,u=e.r,c=e.e,d=e.w,m=e.Y,_=e.a,p=e.p,b=e._,g=e.L,h=e.b5,v=e.t,f=e.aa,w=e.b,y=e.a3,x=e.m,k=e.X,S=e.y,C=e.b6,P=e.b7,z=e.z,I=e.h,T=e.ad,L=e.V,W=e.Z,j=e.H,D=e.I,B=e.$,H=e.aM,Z=e.ab,G=e.b8,X=e.b9,$=e.k,A=e.ba,N=e.C,F=e.D,Y=e.A,R=e.P,O=e.as,M=e.F,E=e.bb,J=e.a1},e=>{V=e.A},e=>{q=e.a,U=e.S},e=>{Q=e.I},e=>{K=e.C},e=>{ee=e.C},e=>{oe=e.R,te=e.C},e=>{ie=e.R,ae=e.a},e=>{re=e.T},null,null,null],execute:function(){const t=e=>Math.sqrt((e[0].clientX-e[1].clientX)**2+(e[0].clientY-e[1].clientY)**2),se=i("image-preview")[1];var ne=a({props:{src:String,show:Boolean,active:Number,minZoom:r(s),maxZoom:r(s),rootWidth:r(Number),rootHeight:r(Number),disableZoom:Boolean},emits:["scale","close","longPress"],setup(e,{emit:o,slots:i}){const a=n({scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,imageRatio:0,displayWidth:0,displayHeight:0}),r=l(),s=u(),v=c((()=>{const{rootWidth:o,rootHeight:t}=e,i=t/o;return a.imageRatio>i})),f=c((()=>{const{scale:e,moveX:o,moveY:t,moving:i,zooming:r}=a,s={transitionDuration:r||i?"0s":".3s"};if(1!==e){const i=o/e,a=t/e;s.transform=`scale(${e}, ${e}) translate(${i}px, ${a}px)`}return s})),w=c((()=>{if(a.imageRatio){const{rootWidth:o,rootHeight:t}=e,i=v.value?t/a.imageRatio:o;return Math.max(0,(a.scale*i-o)/2)}return 0})),y=c((()=>{if(a.imageRatio){const{rootWidth:o,rootHeight:t}=e,i=v.value?t:o*a.imageRatio;return Math.max(0,(a.scale*i-t)/2)}return 0})),x=t=>{(t=b(t,+e.minZoom,+e.maxZoom+1))!==a.scale&&(a.scale=t,o("scale",{scale:t,index:e.active}))},k=()=>{x(1),a.moveX=0,a.moveY=0};let S,C,P,z,I,T,L,W=!1;const j=o=>{const{touches:i}=o;if(S=i.length,2===S&&e.disableZoom)return;const{offsetX:s}=r;r.start(o),C=a.moveX,P=a.moveY,L=Date.now(),W=!1,a.moving=1===S&&1!==a.scale,a.zooming=2===S&&!s.value,a.zooming&&(z=a.scale,I=t(o.touches))},D=()=>{if(S>1)return;const{offsetX:e,offsetY:t}=r,i=Date.now()-L;e.value<5&&t.value<5&&(i<250?T?(clearTimeout(T),T=null,(()=>{const e=a.scale>1?1:2;x(e),a.moveX=0,a.moveY=0})()):T=setTimeout((()=>{o("close"),T=null}),250):i>h&&o("longPress"))},B=o=>{let t=!1;if((a.moving||a.zooming)&&(t=!0,a.moving&&C===a.moveX&&P===a.moveY&&(t=!1),!o.touches.length)){a.zooming&&(a.moveX=b(a.moveX,-w.value,w.value),a.moveY=b(a.moveY,-y.value,y.value),a.zooming=!1),a.moving=!1,C=0,P=0,z=1,a.scale<1&&k();const o=+e.maxZoom;a.scale>o&&(a.scale=o)}p(o,t),D(),r.reset()},H=e=>{const{naturalWidth:o,naturalHeight:t}=e.target;a.imageRatio=t/o};return d((()=>e.active),k),d((()=>e.show),(e=>{e||k()})),m("touchmove",(e=>{const{touches:o}=e;if(r.move(e),a.moving){const{deltaX:o,deltaY:t}=r,i=o.value+C,s=t.value+P;if((i>w.value||i<-w.value)&&!W&&r.isHorizontal())return void(a.moving=!1);W=!0,p(e,!0),a.moveX=b(i,-w.value,w.value),a.moveY=b(s,-y.value,y.value)}if(a.zooming&&(p(e,!0),2===o.length)){const e=t(o);x(z*e/I)}}),{target:c((()=>{var e;return null==(e=s.value)?void 0:e.$el}))}),()=>{const o={loading:()=>_(g,{type:"spinner"},null)};return _(q,{ref:s,class:se("swipe-item"),onTouchstartPassive:j,onTouchend:B,onTouchcancel:B},{default:()=>[i.image?_("div",{class:se("image-wrap")},[i.image({src:e.src})]):_(Q,{src:e.src,fit:"contain",class:se("image",{vertical:v.value}),style:f.value,onLoad:H},o)]})}}});const[le,ue]=i("image-preview"),ce=["show","teleport","transition","overlayStyle","closeOnPopstate"],de={show:Boolean,loop:v,images:f(),minZoom:w(1/3),maxZoom:w(3),overlay:v,closeable:Boolean,showIndex:v,className:y,closeIcon:x("clear"),transition:String,beforeClose:Function,overlayClass:y,overlayStyle:Object,swipeDuration:w(300),startPosition:w(0),showIndicators:Boolean,closeOnPopstate:v,closeIconPosition:x("top-right"),teleport:[String,Object]};var me=a({name:le,props:de,emits:["scale","close","closed","change","longPress","update:show"],setup(e,{emit:o,slots:t}){const i=u(),a=n({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),r=()=>{if(i.value){const e=W(i.value.$el);a.rootWidth=e.width,a.rootHeight=e.height,i.value.resize()}},s=e=>o("scale",e),l=e=>o("update:show",e),c=()=>{B(e.beforeClose,{args:[a.active],done:()=>l(!1)})},m=e=>{e!==a.active&&(a.active=e,o("change",e))},p=()=>{if(e.showIndex)return _("div",{class:ue("index")},[t.index?t.index({index:a.active}):`${a.active+1} / ${e.images.length}`])},b=()=>{if(t.cover)return _("div",{class:ue("cover")},[t.cover()])},g=()=>{a.disableZoom=!0},h=()=>{a.disableZoom=!1},v=()=>{if(e.closeable)return _(D,{role:"button",name:e.closeIcon,class:[ue("close-icon",e.closeIconPosition),j],onClick:c},null)},f=()=>o("closed"),w=(e,o)=>{var t;return null==(t=i.value)?void 0:t.swipeTo(e,o)};return k({swipeTo:w}),S(r),d([C,P],r),d((()=>e.startPosition),(e=>m(+e))),d((()=>e.show),(t=>{const{images:i,startPosition:s}=e;t?(m(+s),z((()=>{r(),w(+s,{immediate:!0})}))):o("close",{index:a.active,url:i[a.active]})})),()=>_(L,I({class:[ue(),e.className],overlayClass:[ue("overlay"),e.overlayClass],onClosed:f,"onUpdate:show":l},T(e,ce)),{default:()=>[v(),_(U,{ref:i,lazyRender:!0,loop:e.loop,class:ue("swipe"),duration:e.swipeDuration,initialSwipe:e.startPosition,showIndicators:e.showIndicators,indicatorColor:"white",onChange:m,onDragEnd:h,onDragStart:g},{default:()=>[e.images.map(((i,r)=>_(ne,{src:i,show:e.show,active:a.active,maxZoom:e.maxZoom,minZoom:e.minZoom,rootWidth:a.rootWidth,rootHeight:a.rootHeight,disableZoom:a.disableZoom,onScale:s,onClose:c,onLongPress:()=>o("longPress",{index:r})},{image:t.image})))]}),p(),b()]})}});let _e;const pe={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"};const be=(e,o=0)=>{if(H)return _e||({instance:_e}=G({setup(){const{state:e,toggle:o}=X(),t=()=>{e.images=[]};return()=>_(me,I(e,{onClosed:t,"onUpdate:show":o}),null)}})),e=Array.isArray(e)?{images:e,startPosition:o}:e,_e.open(Z({},pe,e)),_e};$(me);const[ge,he,ve]=i("submit-bar"),fe={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:x("¥"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:x("danger"),buttonColor:String,suffixLabel:String,placeholder:Boolean,decimalLength:w(2),safeAreaInsetBottom:v};var we=a({name:ge,props:fe,emits:["submit"],setup(e,{emit:o,slots:t}){const i=u(),a=A(i,he),r=()=>{const{price:o,label:t,currency:i,textAlign:a,suffixLabel:r,decimalLength:s}=e;if("number"==typeof o){const e=(o/100).toFixed(+s).split("."),n=s?`.${e[1]}`:"";return _("div",{class:he("text"),style:{textAlign:a}},[_("span",null,[t||ve("label")]),_("span",{class:he("price")},[i,_("span",{class:he("price-integer")},[e[0]]),n]),r&&_("span",{class:he("suffix-label")},[r])])}},s=()=>{var o;const{tip:i,tipIcon:a}=e;if(t.tip||i)return _("div",{class:he("tip")},[a&&_(D,{class:he("tip-icon"),name:a},null),i&&_("span",{class:he("tip-text")},[i]),null==(o=t.tip)?void 0:o.call(t)])},n=()=>o("submit"),l=()=>{var o,a;return _("div",{ref:i,class:[he(),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[null==(o=t.top)?void 0:o.call(t),s(),_("div",{class:he("bar")},[null==(a=t.default)?void 0:a.call(t),r(),t.button?t.button():_(N,{round:!0,type:e.buttonType,text:e.buttonText,class:he("button",e.buttonType),color:e.buttonColor,loading:e.loading,disabled:e.disabled,onClick:n},null)])])};return()=>e.placeholder?a(l):l()}});const ye=$(we),xe="_arrowLeft_ub7u2_1",ke="_swipeItemImg_ub7u2_12",Se="_swipe_ub7u2_12",Ce="_custom-indicator_ub7u2_18",Pe="_goodsHead_ub7u2_28",ze="_priceGroup_ub7u2_35",Ie="_price_ub7u2_35",Te="_goodsName_ub7u2_58",Le="_row_ub7u2_64",We="_col_ub7u2_68",je="_radio-group_ub7u2_72",De="_radio_ub7u2_72",Be="_badge_ub7u2_113",He="_section_ub7u2_117",Ze="_detail_ub7u2_121",Ge="_photoDetail_ub7u2_146",Xe="_goodsDetail_ub7u2_150",$e="_actionBar_ub7u2_153",Ae="_addCertBtn_ub7u2_180",Ne="_buyGroup_ub7u2_190",Fe="_selectWrap_ub7u2_196",Ye="_imagesOverlayWrap_ub7u2_260";o("default",a({name:"goods-detail",data(){return{id:this.$route.query.id,albumPics:[],product:{},radio:0,skuStockListTemp:[],detailMobileHtml:"",loading:!1,addGoodsShow:!1,selectGoodsItem:{},cartCount:0}},computed:{skuStockList(){const e=this.product,o=this.skuStockListTemp.length>0?this.skuStockListTemp:[{id:-1,price:e.price,pic:e.pic,stock:e.stock,spData:null}];return o.forEach((e=>{if(e.spData){const o=JSON.parse(e.spData);e.spDataJson=o.reduce(((e,o)=>e+=o.value),""),e.sku=o.reduce(((e,o)=>(e.push(`${o.key}: ${o.value}`),e)),[]).join(",")}else e.spDataJson="默认"})),o},getPrice(){let e=this.skuStockList.filter((e=>e.id==this.radio));return e&&Array.isArray(e)&&e.length?e[0].price:0}},mounted(){var o,t=this;return(o=function*(){try{t.loading=!0;const e=yield F.get(`/edu-app/open/mall/product/detail/${t.id}`,{noAuthorization:!0});t.loading=!1;const o=e.data||{};if(t.albumPics=[o.product.pic].concat(o.product.albumPics.split(",")).filter((e=>e)),t.product=o.product,t.skuStockListTemp=o.skuStockList||[],t.skuStockListTemp.length){let e=t.skuStockListTemp.length;for(let o=0;o<e;o++){let e=t.skuStockListTemp[o];if(e.stock>=0){t.radio=e.id;break}}}t.detailMobileHtml=o.product.detailMobileHtml}catch(e){}},function(){var t=this,i=arguments;return new Promise((function(a,r){var s=o.apply(t,i);function n(o){e(s,a,r,n,l,"next",o)}function l(o){e(s,a,r,n,l,"throw",o)}n(void 0)}))})()},methods:{onPreview(e){be({images:this.albumPics,startPosition:e,closeable:!0,className:Ye})},onShowImg(e){const{localName:o}=e.srcElement;if("img"!==o)return;let t=0;const i=document.querySelectorAll(".msgWrap img");let a=Array.from(i).map(((o,i)=>(e.srcElement==o&&(t=i),o.src)));be({images:a,startPosition:t,closeable:!0,className:Ye})},onShowCart(){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(){let e;const o=this.product,t=this.skuStockList.find((e=>e.id===this.radio));return _("div",{class:Xe},[_(D,{class:xe,name:"arrow-left",onClick:e=>{e.stopPropagation(),this.$router.back()}},null),_(U,{class:Se,lazyRender:!0},{default:()=>[this.albumPics.map(((e,o)=>_(q,null,{default:()=>[_(Q,{class:ke,src:e,onClick:()=>this.onPreview(o),fit:"cover"},null)]})))],indicator:e=>e.total>1&&_("div",{class:Ce},[(e.active||0)+1,Y(" / "),e.total])}),_(K,{border:!1,class:[Pe,"mb12"]},{default:()=>[_(ee,{center:!0,border:!1},{title:()=>_("div",{class:ze},[_("span",{class:Ie},[_("i",null,[Y("¥")]),R(this.getPrice)])])}),_(ee,{center:!0,border:!1,title:o.name,titleClass:[Te,"van-ellipsis"]},null)]}),_(oe,{class:[Le,"mb12"]},{default:()=>[_(te,{span:4,class:We},{default:()=>[Y("规格")]}),_(te,{span:20},{default:()=>{return[t?_("div",{class:Fe},[t.stock<=0?"当前款式暂时缺货":`已选择 ${t.spDataJson}`]):_("div",null,[Y("请选择 规格")]),_(ie,{class:je,modelValue:this.radio,"onUpdate:modelValue":e=>this.radio=e},(o=e=this.skuStockList.map((e=>{const o=e.id===this.radio,t=o?"primary":"default";return _(O,{position:"top-right",content:e.stock<=0?"缺货":"",color:"#999999",class:Be,offset:[-20,0]},{default:()=>[_(ae,{class:De,name:e.id,disabled:e.stock<=0,onClick:()=>{e.stock<=0||(this.radio=e.id)}},{default:()=>[_(re,{size:"large",plain:o,type:t},{default:()=>[e.spDataJson]})]})]})})),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!J(o)?e:{default:()=>[e]}))];var o}})]}),this.detailMobileHtml&&_("div",{class:[He]},[_("div",{class:Ze},[_("span",null,[Y("图文详情")])]),_("div",{class:[Ge,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&_(M,null,[_(ye,{class:$e,"safe-area-inset-bottom":!0},{button:()=>_("div",{class:Ne},[_(E,{type:"primary",class:Ae,text:"添加购买",onClick:()=>this.onShowCart()},null)])})]),_(L,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.addGoodsShow=!1}},{default:()=>[_(V,{show:this.addGoodsShow,item:this.selectGoodsItem,onClose:()=>{this.addGoodsShow=!1},defaultRadio:this.radio,showType:"cart"},null)]})])}}))}}}))}();