index-legacy.dbc5caef.js 16 KB

1
  1. !function(){function e(e,t,r,a,o,n,i){try{var c=e[n](i),s=c.value}catch(l){return void r(l)}c.done?t(s):Promise.resolve(s).then(a,o)}function t(t){return function(){var r=this,a=arguments;return new Promise((function(o,n){var i=t.apply(r,a);function c(t){e(i,o,n,c,s,"next",t)}function s(t){e(i,o,n,c,s,"throw",t)}c(void 0)}))}}var r=document.createElement("style");r.innerHTML='._swipeItemImg_10kck_1,._swipe_10kck_1{width:100%;height:10rem;vertical-align:middle}._custom-indicator_10kck_7{position:absolute;right:.13333rem;bottom:.13333rem;padding:.10667rem .21333rem;font-size:.37333rem;color:#fff;background:rgba(0,0,0,.5);border-radius:.32rem}._goodsHead_10kck_17{padding:.21333rem 0}._goodsHead_10kck_17 .van-cell{padding-top:.13333rem;padding-bottom:.13333rem}._priceGroup_10kck_24{display:flex;align-items:center}._priceGroup_10kck_24 ._price_10kck_24{color:#ff4e19;font-size:.64rem;font-weight:700}._priceGroup_10kck_24 ._price_10kck_24 i{font-size:.42667rem;font-style:normal}._priceGroup_10kck_24 ._delPrice_10kck_37{font-size:.37333rem;color:#999;margin-left:.32rem;line-height:.53333rem}._priceGroup_10kck_24 ._stock_10kck_43{font-size:.37333rem;color:#999}._goodsName_10kck_47{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._row_10kck_53{background-color:#fff;padding:var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding)}._row_10kck_53 ._col_10kck_57{font-size:.42667rem;color:#333}._radio-group_10kck_61{display:flex;flex-wrap:wrap}._radio_10kck_61{margin-right:.21333rem;margin-bottom:.21333rem;min-width:1.6rem}._radio_10kck_61 .van-radio__label--disabled{opacity:.5}._radio_10kck_61 .van-radio__icon{display:none}._radio_10kck_61 .van-tag--large{height:.72rem;font-size:.34667rem;text-align:center;display:flex;align-items:center;justify-content:center}._radio_10kck_61 .van-tag{box-sizing:border-box}._radio_10kck_61 .van-tag--default{color:#999}._radio_10kck_61 .van-tag--primary{background-color:#f7f8f9}._radio_10kck_61 .van-radio__label{margin-left:0}._badge_10kck_96 .van-badge{border-radius:.16rem 0;font-size:.32rem}._section_10kck_100{background:#fff;padding:.32rem 0 0}._detail_10kck_104{display:flex;align-items:center;justify-content:center;font-size:.37333rem;color:#999;line-height:.53333rem;margin-bottom:.32rem}._detail_10kck_104 span{padding:0 .26667rem}._detail_10kck_104:before,._detail_10kck_104:after{display:inline-block;content:" ";width:1.06667rem;height:.08rem}._detail_10kck_104:before{background:linear-gradient(90deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._detail_10kck_104:after{background:linear-gradient(270deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._photoDetail_10kck_129 img{width:100%;vertical-align:middle}._goodsDetail_10kck_133{margin-bottom:var(--van-action-bar-height)}._actionBar_10kck_136{padding-left:.13333rem;padding-right:.13333rem;justify-content:space-between;box-shadow:0 -.26667rem .26667rem var(--box-shadow-color);box-sizing:border-box}._actionBar_10kck_136 .van-submit-bar__bar{justify-content:space-between;padding:0}._actionBar_10kck_136 .van-action-bar-icon{align-items:center}._actionBar_10kck_136 .van-action-bar-icon__icon{margin-bottom:0;line-height:0}._actionBar_10kck_136 .van-badge{background:#ff4e19}._addCertBtn_10kck_157{background:#fff;color:var(--van-primary)}._buyGroup_10kck_161{flex-basis:60%;display:flex;justify-content:center;border:var(--van-button-border-width) solid var(--van-button-primary-border-color)!important;border-radius:.53333rem;background-color:var(--van-primary);overflow:hidden;box-sizing:border-box}._selectWrap_10kck_171{padding-top:.04rem;font-size:.37333rem;color:#666;padding-bottom:.32rem}._shareBtn_10kck_177{display:flex;align-items:center;font-size:.37333rem;color:#666}._shareWrap_10kck_183{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_10kck_183 ._sharePic_10kck_193{width:2.66667rem;height:2.66667rem;border-radius:.21333rem}._shareWrap_10kck_183 ._shareLeft_10kck_198{margin-right:.26667rem}._shareWrap_10kck_183 ._shareRight_10kck_201{flex:1;overflow:hidden}._shareWrap_10kck_183 ._shareShopTitle_10kck_205{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_10kck_183 ._shareShopDes_10kck_215{font-size:.37333rem;font-weight:400;color:#999;margin:.26667rem 0 .53333rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._shareWrap_10kck_183 ._shareShopValue_10kck_224{font-size:.42667rem;color:#ff4e19}._shareWrap_10kck_183 ._shareShopOldPrice_10kck_228{color:#e5e5e5;margin-left:.13333rem}._shareWrap_10kck_183 .van-card{background:transparent}._imagesOverlayWrap_10kck_235 .van-badge__wrapper,._imagesOverlayWrap_10kck_235 .van-image-preview__index{top:1.06667rem}\n',document.head.appendChild(r),System.register(["./index-legacy.b2528a15.js","./index-legacy.3f4943f0.js","./index-legacy.ca42ae97.js","./index-legacy.a7e74731.js","./index-legacy.207dc8c2.js","./index-legacy.70f6e2fc.js","./index-legacy.5147af42.js","./index-legacy.7d3d7cf1.js","./index-legacy.edff980f.js","./index-legacy.d3645f16.js","./index-legacy.da3785ef.js","./index-legacy.439ea58a.js","./index-legacy.81a64bb6.js","./icon-share-legacy.576b0857.js","./index-legacy.47b1cde1.js","./hooks-legacy.fb8d6c34.js","./index-legacy.7755cfa7.js","./icon-sell-out-legacy.ae9d997a.js","./shop-mall-legacy.cc5cb0f7.js","./index-legacy.f75b8290.js","./use-height-legacy.2a153aaf.js","./code-down-load-legacy.5a78d39b.js","./logo-legacy.cf4b3bd2.js","./browser-legacy.8b7c8200.js","./icon_teacher-legacy.42ba77b1.js"],(function(e){"use strict";var r,a,o,n,i,c,s,l,d,u,_,k,p,f,m,h,g,b,v,y,w,S,x,A,C,j,I,W,z,L,P;return{setters:[function(e){r=e.d,a=e.b,o=e.s,n=e.e,i=e.T,c=e.i,s=e.N,l=e.A,d=e.by,u=e.aw,_=e.F,k=e.bB,p=e.aT,f=e.$},function(e){m=e.S,h=e.a},function(e){g=e.I},function(e){b=e.C},function(e){v=e.C},function(e){y=e.I},function(e){w=e.R,S=e.a},function(){},function(e){x=e.T},function(e){A=e.R,C=e.C},function(e){j=e.S},function(e){I=e.A},function(e){W=e.C},function(e){z=e.i},function(e){L=e.C},function(e){P=e.u},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var D={swipeItemImg:"_swipeItemImg_10kck_1",swipe:"_swipe_10kck_1","custom-indicator":"_custom-indicator_10kck_7",goodsHead:"_goodsHead_10kck_17",priceGroup:"_priceGroup_10kck_24",price:"_price_10kck_24",delPrice:"_delPrice_10kck_37",stock:"_stock_10kck_43",goodsName:"_goodsName_10kck_47",row:"_row_10kck_53",col:"_col_10kck_57","radio-group":"_radio-group_10kck_61",radio:"_radio_10kck_61",badge:"_badge_10kck_96",section:"_section_10kck_100",detail:"_detail_10kck_104",photoDetail:"_photoDetail_10kck_129",goodsDetail:"_goodsDetail_10kck_133",actionBar:"_actionBar_10kck_136",addCertBtn:"_addCertBtn_10kck_157",buyGroup:"_buyGroup_10kck_161",selectWrap:"_selectWrap_10kck_171",shareBtn:"_shareBtn_10kck_177",shareWrap:"_shareWrap_10kck_183",sharePic:"_sharePic_10kck_193",shareLeft:"_shareLeft_10kck_198",shareRight:"_shareRight_10kck_201",shareShopTitle:"_shareShopTitle_10kck_205",shareShopDes:"_shareShopDes_10kck_215",shareShopValue:"_shareShopValue_10kck_224",shareShopOldPrice:"_shareShopOldPrice_10kck_228",imagesOverlayWrap:"_imagesOverlayWrap_10kck_235"};e("default",r({name:"goods-detail",data:function(){return{id:this.$route.query.id,albumPics:[],product:{},radio:0,skuStockListTemp:[],detailMobileHtml:"",loading:!1,addGoodsShow:!1,selectGoodsItem:{},cartCount:0,showType:"cart",shareShow:!1}},computed:{skuStockList:function(){var 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((function(e){if(e.spData){var t=JSON.parse(e.spData);e.spDataJson=t.reduce((function(e,t){return e+=t.value}),""),e.sku=t.reduce((function(e,t){return e.push("".concat(t.key,": ").concat(t.value)),e}),[]).join(",")}else e.spDataJson="默认"})),t},getPrice:function(){var e=this,t=this.skuStockList.filter((function(t){return t.id==e.radio}));return t&&Array.isArray(t)&&t.length?t[0].price:0},shareUrl:function(){var e=this.product.id;return a().isApp?"".concat(location.origin,"/teacher/#/shareMall?bizId=").concat(e,"&userId=").concat(o.user.data.userId,"&userType=").concat(o.platformType):"".concat(location.origin,"/teacher.html#/shareMall?bizId=").concat(e,"&userId=").concat(o.user.data.userId,"&userType=").concat(o.platformType)}},mounted:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var r,a,o,i,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,t.next=4,n.get("/api-mall-portal/product/detail/".concat(e.id));case 4:if(r=t.sent,e.loading=!1,a=r.data||{},e.albumPics=[a.product.pic].concat(a.product.albumPics.split(",")).filter((function(e){return e})),e.product=a.product,e.skuStockListTemp=a.skuStockList||[],!e.skuStockListTemp.length){t.next=21;break}o=e.skuStockListTemp.length,i=0;case 13:if(!(i<o)){t.next=21;break}if(!((c=e.skuStockListTemp[i]).stock>=0)){t.next=18;break}return e.radio=c.id,t.abrupt("break",21);case 18:i++,t.next=13;break;case 21:e.detailMobileHtml=a.product.detailMobileHtml,t.next=26;break;case 24:t.prev=24,t.t0=t.catch(0);case 26:e.getCartCount(),P("商品详情");case 28:case"end":return t.stop()}}),t,null,[[0,24]])})))()},methods:{onPreview:function(e){y({images:this.albumPics,startPosition:e,closeable:!0,className:D.imagesOverlayWrap})},onShowImg:function(e){if("img"===e.srcElement.localName){var t=0,r=document.querySelectorAll(".msgWrap img"),a=Array.from(r).map((function(r,a){return e.srcElement==r&&(t=a),r.src}));y({images:a,startPosition:t,closeable:!0,className:D.imagesOverlayWrap})}},onShowCart:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cart";this.selectGoodsItem={price: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.showType=e,this.addGoodsShow=!0},onBuy:function(){if(!this.radio)return i("请选择规格");console.log(!0)},getCartCount:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var r,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.get("/api-mall-portal/cart/list");case 3:r=t.sent,a=r.code,o=r.data,200===a&&(e.cartCount=o.length),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])})))()}},render:function(){var e,t=this,r=this.product,a=this.skuStockList.find((function(e){return e.id===t.radio})),n=this.product.pic+"?v="+Date.now();return c("div",{class:D.goodsDetail},[c(W,null,{right:function(){return c("div",{class:D.shareBtn,onClick:function(){return t.shareShow=!0}},[c(s,{name:z,size:14,color:"#666"},null),c("span",{style:{marginLeft:"3px"}},[l("分享")])])}}),c(m,{class:D.swipe,lazyRender:!0},{default:function(){return[t.albumPics.map((function(e,r){return c(h,null,{default:function(){return[c(g,{class:D.swipeItemImg,src:e,onClick:function(){return t.onPreview(r)},fit:"cover"},null)]}})}))]},indicator:function(e){return e.total>1&&c("div",{class:D["custom-indicator"]},[(e.active||0)+1,l(" / "),e.total])}}),c(b,{border:!1,class:[D.goodsHead,"mb12"]},{default:function(){return[c(v,{center:!0,border:!1},{title:function(){return c("div",{class:D.priceGroup},[c("span",{class:D.price},[c("i",null,[l("¥")]),d(t.getPrice)])])}}),c(v,{center:!0,border:!1,title:r.name,titleClass:[D.goodsName,"van-ellipsis"]},null)]}}),c(A,{class:[D.row,"mb12"]},{default:function(){return[c(C,{span:4,class:D.col},{default:function(){return[l("规格")]}}),c(C,{span:20},{default:function(){return[a?c("div",{class:D.selectWrap},[a.stock<=0?"当前款式暂时缺货":"已选择 ".concat(a.spDataJson)]):c("div",null,[l("请选择 规格")]),c(w,{class:D["radio-group"],modelValue:t.radio,"onUpdate:modelValue":function(e){return t.radio=e}},(r=e=t.skuStockList.map((function(e){var r=e.id===t.radio,a=r?"primary":"default";return c(u,{position:"top-right",content:e.stock<=0?"缺货":"",color:"#999999",class:D.badge,offset:[-20,0]},{default:function(){return[c(S,{class:D.radio,name:e.id,disabled:e.stock<=0,onClick:function(){e.stock<=0||(t.radio=e.id)}},{default:function(){return[c(x,{size:"large",plain:r,type:a},{default:function(){return[e.spDataJson]}})]}})]}})})),"function"==typeof r||"[object Object]"===Object.prototype.toString.call(r)&&!f(r)?e:{default:function(){return[e]}}))];var r}})]}}),this.detailMobileHtml&&c("div",{class:[D.section]},[c("div",{class:D.detail},[c("span",null,[l("图文详情")])]),c("div",{class:[D.photoDetail,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&c(_,null,[c(j,{class:D.actionBar,"safe-area-inset-bottom":!0},{default:function(){return[c(u,{content:t.cartCount,showZero:!1,onClick:function(){t.$router.push("/cart")}},{default:function(){return[c(s,{name:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAABPhJREFUaEPtmVtoXFUUhv81GUcjtsRWUUdTM2efOJoSUQSxVSvUF6/1QVqo4AWU6otWQVCxVi0K9cVLfRAvKCr6EJ8qluhDEeslgsYLwUBkrzPqxNp4K2KKZjI9S3YzE3biZObMnDOXJHPekrPOWuvb/95r7b2HsMweWma8aAMvdcXbCrcVXmIj0J7SS0zQ/+EsX4WVUlJC3X8B/AZgGMDg5OTkWxMTE0cW8yyYVXgB4DlsInI4Fovt0Fq/AKDUALX8WFQFbNHsnZqa2jo+Pv5PyxPOS7BWYONmkJmvA+Av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dhc4V5bKWA93hPRq1rr24P4jgy4RE8MEj8SmyCHltmZF0nEGSdmXZk7pSsj9BnEVVUFMjKFTWbJZPLEzs5O0/hvAtADIBYk4xps8gAYwCvM/EyQtVsPhWvIu/GfRKpw49OvPmJkwH19fYlcLrdLRLaZNIjopUQisXN0dDRXfVoLfxE2TmTAruvuFpEH7FSJ6Cmt9YNRAoeNExmwUurPEr8fH2bmVVECh43TBq5VjbBTLWjcsHEiUzhsMQkKHDZOZMBBE262XRu42QrUO35b4XqPcLP9txVutgL1jt9WuN4j3Gz/y07h/wAWOi1b2uyxeAAAAABJRU5ErkJggg==",size:30},null)]}})]},button:function(){return c("div",{class:D.buyGroup},[c(k,{type:"primary",class:D.addCertBtn,text:"加入购物车",onClick:function(){return t.onShowCart()}},null),c(k,{type:"primary",text:"立即购买",onClick:function(){return t.onShowCart("cartConfirm")}},null)])}})]),c(p,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:function(){t.addGoodsShow=!1}},{default:function(){return[c(I,{show:t.addGoodsShow,onGetCartCount:function(){return t.getCartCount()},item:t.selectGoodsItem,defaultRadio:t.radio,showType:t.showType},null)]}}),c(p,{style:{background:"transparent"},show:this.shareShow,onClose:function(){return t.shareShow=!1}},{default:function(){return[c(L,{shareUrl:t.shareUrl,teacherId:o.user.data.userId,shareType:"mall"},{default:function(){return[c("div",{class:D.shareWrap},[c("div",{class:D.shareLeft},[c("img",{crossorigin:"anonymous",class:D.sharePic,src:n},null)]),c("div",{class:D.shareRight},[c("div",{class:D.shareShopTitle},[t.product.name]),a?c("div",{class:D.shareShopDes},[a.sku]):null,c("div",{class:D.shareShopValue},[c("span",{class:D.shareShopPrice},[d(t.getPrice)])])])])]}})]}})])}}))}}}))}();