index-legacy-c6393fb8.js 12 KB

1
  1. !function(){function e(e,t,r,o,i,a,s){try{var n=e[a](s),u=n.value}catch(l){return void r(l)}n.done?t(u):Promise.resolve(u).then(o,i)}System.register(["./index-legacy-e6be1dcb.js","./index-legacy-2ac0d79a.js","./index-legacy-f654be9a.js","./index-legacy-c97c0453.js","./index-legacy-d3534fc9.js","./index-legacy-fc299f0c.js","./index-legacy-72ad1f03.js","./index-legacy-4e3eaaa9.js","./index-legacy-b6d273d9.js","./index-legacy-f9bb7174.js","./student-register-store-legacy-9e94918b.js","./Checker-legacy-f8a8311d.js"],(function(t,r){"use strict";var o,i,a,s,n,u,l,d,c,_,b,p,m,g,h,f,v,k,y,w,x,S,C,z,L,j,T,P,W,G,I;return{setters:[e=>{o=e.c,i=e.m,a=e.b,s=e.t,n=e.d,u=e.r,l=e.bW,d=e.a,c=e.I,_=e.C,b=e.k,p=e.D,m=e.A,g=e.W,h=e.b8,f=e.F,v=e.bX,k=e.R,y=e.a3},e=>{w=e.A},e=>{x=e.s},e=>{S=e.S,C=e.a},e=>{z=e.I},e=>{L=e.C},e=>{j=e.C},e=>{T=e.R,P=e.C},e=>{W=e.R,G=e.a},e=>{I=e.T},null,null],execute:function(){var r=document.createElement("style");r.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(r);const[B,D,A]=o("submit-bar"),F={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:i("¥"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:i("danger"),buttonColor:String,suffixLabel:String,placeholder:Boolean,decimalLength:a(2),safeAreaInsetBottom:s};var H=n({name:B,props:F,emits:["submit"],setup(e,{emit:t,slots:r}){const o=u(),i=l(o,D),a=()=>{const{price:t,label:r,currency:o,textAlign:i,suffixLabel:a,decimalLength:s}=e;if("number"==typeof t){const e=(t/100).toFixed(+s).split("."),n=s?`.${e[1]}`:"";return d("div",{class:D("text"),style:{textAlign:i}},[d("span",null,[r||A("label")]),d("span",{class:D("price")},[o,d("span",{class:D("price-integer")},[e[0]]),n]),a&&d("span",{class:D("suffix-label")},[a])])}},s=()=>{var t;const{tip:o,tipIcon:i}=e;if(r.tip||o)return d("div",{class:D("tip")},[i&&d(c,{class:D("tip-icon"),name:i},null),o&&d("span",{class:D("tip-text")},[o]),null==(t=r.tip)?void 0:t.call(r)])},n=()=>t("submit"),b=()=>{var t,i;return d("div",{ref:o,class:[D(),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[null==(t=r.top)?void 0:t.call(r),s(),d("div",{class:D("bar")},[null==(i=r.default)?void 0:i.call(r),a(),r.button?r.button():d(_,{round:!0,type:e.buttonType,text:e.buttonText,class:D("button",e.buttonType),color:e.buttonColor,loading:e.loading,disabled:e.disabled,onClick:n},null)])])};return()=>e.placeholder?i(b):b()}});const N=b(H),O="_arrowLeft_ub7u2_1",$="_swipeItemImg_ub7u2_12",M="_swipe_ub7u2_12",R="_custom-indicator_ub7u2_18",J="_goodsHead_ub7u2_28",E="_priceGroup_ub7u2_35",V="_price_ub7u2_35",q="_goodsName_ub7u2_58",U="_row_ub7u2_64",X="_col_ub7u2_68",Y="_radio-group_ub7u2_72",K="_radio_ub7u2_72",Q="_badge_ub7u2_113",Z="_section_ub7u2_117",ee="_detail_ub7u2_121",te="_photoDetail_ub7u2_146",re="_goodsDetail_ub7u2_150",oe="_actionBar_ub7u2_153",ie="_addCertBtn_ub7u2_180",ae="_buyGroup_ub7u2_190",se="_selectWrap_ub7u2_196",ne="_imagesOverlayWrap_ub7u2_260";t("default",n({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,t=this.skuStockListTemp.length>0?this.skuStockListTemp:[{id:-1,price:e.price,pic:e.pic,stock:e.stock,spData:null}];return t.forEach((e=>{if(e.spData){const t=JSON.parse(e.spData);e.spDataJson=t.reduce(((e,t)=>e+=t.value),""),e.sku=t.reduce(((e,t)=>(e.push(`${t.key}: ${t.value}`),e)),[]).join(",")}else e.spDataJson="默认"})),t},getPrice(){let e=this.skuStockList.filter((e=>e.id==this.radio));return e&&Array.isArray(e)&&e.length?e[0].price:0}},mounted(){var t,r=this;return(t=function*(){try{r.loading=!0;const e=yield p.get(`/edu-app/open/mall/product/detail/${r.id}`,{noAuthorization:!0});r.loading=!1;const t=e.data||{};if(r.albumPics=[t.product.pic].concat(t.product.albumPics.split(",")).filter((e=>e)),r.product=t.product,r.skuStockListTemp=t.skuStockList||[],r.skuStockListTemp.length){let e=r.skuStockListTemp.length;for(let t=0;t<e;t++){let e=r.skuStockListTemp[t];if(e.stock>=0){r.radio=e.id;break}}}r.detailMobileHtml=t.product.detailMobileHtml}catch(e){}},function(){var r=this,o=arguments;return new Promise((function(i,a){var s=t.apply(r,o);function n(t){e(s,i,a,n,u,"next",t)}function u(t){e(s,i,a,n,u,"throw",t)}n(void 0)}))})()},methods:{onPreview(e){x({images:this.albumPics,startPosition:e,closeable:!0,className:ne})},onShowImg(e){const{localName:t}=e.srcElement;if("img"!==t)return;let r=0;const o=document.querySelectorAll(".msgWrap img");let i=Array.from(o).map(((t,o)=>(e.srcElement==t&&(r=o),t.src)));x({images:i,startPosition:r,closeable:!0,className:ne})},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 t=this.product,r=this.skuStockList.find((e=>e.id===this.radio));return d("div",{class:re},[d(c,{class:O,name:"arrow-left",onClick:e=>{e.stopPropagation(),this.$router.back()}},null),d(S,{class:M,lazyRender:!0},{default:()=>[this.albumPics.map(((e,t)=>d(C,null,{default:()=>[d(z,{class:$,src:e,onClick:()=>this.onPreview(t),fit:"cover"},null)]})))],indicator:e=>e.total>1&&d("div",{class:R},[(e.active||0)+1,m(" / "),e.total])}),d(L,{border:!1,class:[J,"mb12"]},{default:()=>[d(j,{center:!0,border:!1},{title:()=>d("div",{class:E},[d("span",{class:V},[d("i",null,[m("¥")]),g(this.getPrice)])])}),d(j,{center:!0,border:!1,title:t.name,titleClass:[q,"van-ellipsis"]},null)]}),d(T,{class:[U,"mb12"]},{default:()=>[d(P,{span:4,class:X},{default:()=>[m("规格")]}),d(P,{span:20},{default:()=>{return[r?d("div",{class:se},[r.stock<=0?"当前款式暂时缺货":`已选择 ${r.spDataJson}`]):d("div",null,[m("请选择 规格")]),d(W,{class:Y,modelValue:this.radio,"onUpdate:modelValue":e=>this.radio=e},(t=e=this.skuStockList.map((e=>{const t=e.id===this.radio,r=t?"primary":"default";return d(h,{position:"top-right",content:e.stock<=0?"缺货":"",color:"#999999",class:Q,offset:[-20,0]},{default:()=>[d(G,{class:K,name:e.id,disabled:e.stock<=0,onClick:()=>{e.stock<=0||(this.radio=e.id)}},{default:()=>[d(I,{size:"large",plain:t,type:r},{default:()=>[e.spDataJson]})]})]})})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!y(t)?e:{default:()=>[e]}))];var t}})]}),this.detailMobileHtml&&d("div",{class:[Z]},[d("div",{class:ee},[d("span",null,[m("图文详情")])]),d("div",{class:[te,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&d(f,null,[d(N,{class:oe,"safe-area-inset-bottom":!0},{button:()=>d("div",{class:ae},[d(v,{type:"primary",class:ie,text:"添加购买",onClick:()=>this.onShowCart()},null)])})]),d(k,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.addGoodsShow=!1}},{default:()=>[d(w,{show:this.addGoodsShow,item:this.selectGoodsItem,onClose:()=>{this.addGoodsShow=!1},defaultRadio:this.radio,showType:"cart"},null)]})])}}))}}}))}();