1 |
- !function(){function e(e,t,r,a,o,n,i){try{var s=e[n](i),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).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 s(t){e(i,o,n,s,c,"next",t)}function c(t){e(i,o,n,s,c,"throw",t)}s(void 0)}))}}var r=document.createElement("style");r.innerHTML='._swipeItemImg_1q0ve_1,._swipe_1q0ve_1{width:100%;height:10rem;vertical-align:middle}._custom-indicator_1q0ve_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_1q0ve_17{padding:.21333rem 0}._goodsHead_1q0ve_17 .van-cell{padding-top:.13333rem;padding-bottom:.13333rem}._priceGroup_1q0ve_24{display:flex;align-items:center}._priceGroup_1q0ve_24 ._price_1q0ve_24{color:#ff4e19;font-size:.64rem;font-weight:700}._priceGroup_1q0ve_24 ._price_1q0ve_24 i{font-size:.42667rem;font-style:normal}._priceGroup_1q0ve_24 ._delPrice_1q0ve_37{font-size:.37333rem;color:#999;margin-left:.32rem;line-height:.53333rem}._priceGroup_1q0ve_24 ._stock_1q0ve_43{font-size:.37333rem;color:#999}._goodsName_1q0ve_47{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._row_1q0ve_53{background-color:#fff;padding:var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding)}._row_1q0ve_53 ._col_1q0ve_57{font-size:.42667rem;color:#333}._radio-group_1q0ve_61{display:flex;flex-wrap:wrap}._radio_1q0ve_61{margin-right:.21333rem;margin-bottom:.21333rem;min-width:1.6rem}._radio_1q0ve_61 .van-radio__label--disabled{opacity:.5}._radio_1q0ve_61 .van-radio__icon{display:none}._radio_1q0ve_61 .van-tag--large{height:.72rem;font-size:.34667rem;text-align:center;display:flex;align-items:center;justify-content:center}._radio_1q0ve_61 .van-tag{box-sizing:border-box}._radio_1q0ve_61 .van-tag--default{color:#999}._radio_1q0ve_61 .van-tag--primary{background-color:#f7f8f9}._radio_1q0ve_61 .van-radio__label{margin-left:0}._badge_1q0ve_96 .van-badge{border-radius:.16rem 0;font-size:.32rem}._section_1q0ve_100{background:#fff;padding:.32rem 0 0}._detail_1q0ve_104{display:flex;align-items:center;justify-content:center;font-size:.37333rem;color:#999;line-height:.53333rem;margin-bottom:.32rem}._detail_1q0ve_104 span{padding:0 .26667rem}._detail_1q0ve_104:before,._detail_1q0ve_104:after{display:inline-block;content:" ";width:1.06667rem;height:.08rem}._detail_1q0ve_104:before{background:linear-gradient(90deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._detail_1q0ve_104:after{background:linear-gradient(270deg,rgba(238,238,238,0) 0%,#d8d8d8 100%)}._photoDetail_1q0ve_129 img{width:100%;vertical-align:middle}._goodsDetail_1q0ve_133{margin-bottom:var(--van-action-bar-height)}._actionBar_1q0ve_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_1q0ve_136 .van-submit-bar__bar{justify-content:space-between;padding:0}._actionBar_1q0ve_136 .van-action-bar-icon{align-items:center}._actionBar_1q0ve_136 .van-action-bar-icon__icon{margin-bottom:0;line-height:0}._actionBar_1q0ve_136 .van-badge{background:#ff4e19}._addCertBtn_1q0ve_157{background:#fff;color:var(--van-primary)}._buyGroup_1q0ve_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;overflow:hidden;box-sizing:border-box}._selectWrap_1q0ve_170{padding-top:.04rem;font-size:.37333rem;color:#666;padding-bottom:.32rem}._shareBtn_1q0ve_176{display:flex;align-items:center;font-size:.37333rem;color:#666}._shareWrap_1q0ve_182{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_1q0ve_182 ._sharePic_1q0ve_192{width:2.66667rem;height:2.66667rem;border-radius:.21333rem}._shareWrap_1q0ve_182 ._shareLeft_1q0ve_197{margin-right:.26667rem}._shareWrap_1q0ve_182 ._shareRight_1q0ve_200{flex:1;overflow:hidden}._shareWrap_1q0ve_182 ._shareShopTitle_1q0ve_204{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_1q0ve_182 ._shareShopDes_1q0ve_214{font-size:.37333rem;font-weight:400;color:#999;margin:.26667rem 0 .53333rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._shareWrap_1q0ve_182 ._shareShopValue_1q0ve_223{font-size:.42667rem;color:#ff4e19}._shareWrap_1q0ve_182 ._shareShopOldPrice_1q0ve_227{color:#e5e5e5;margin-left:.13333rem}._shareWrap_1q0ve_182 .van-card{background:transparent}._imagesOverlayWrap_1q0ve_234 .van-badge__wrapper,._imagesOverlayWrap_1q0ve_234 .van-image-preview__index{top:1.06667rem}._cartDisabled_1q0ve_240{opacity:.5}\n',document.head.appendChild(r),System.register(["./ResizeObserver.es-legacy.9ef5ac8c.js","./index-legacy.68eb7f39.js","./index-legacy.8802e914.js","./index-legacy.6268a8fe.js","./index-legacy.e9381954.js","./index-legacy.f520e9ae.js","./index-legacy.b0e8bd5d.js","./index-legacy.5893ff71.js","./index-legacy.31c9aada.js","./index-legacy.8b605db5.js","./index-legacy.70e40a8d.js","./index-legacy.e4124495.js","./index-legacy.402479d8.js","./icon-share-legacy.576b0857.js","./index-legacy.7f1bd7d2.js","./hooks-legacy.b4b15558.js","./index-legacy.6faf7cc4.js","./icon-sell-out-legacy.ae9d997a.js","./shop-mall-legacy.756b1ca2.js","./code-down-load-legacy.3bc1f4e9.js","./logo-legacy.cf4b3bd2.js","./browser-legacy.869507ab.js","./html2canvas.esm-legacy.19f9c2b7.js","./icon_teacher-legacy.42ba77b1.js"],(function(e){"use strict";var r,a,o,n,i,s,c,l,d,u,_,p,f,m,v,h,g,b,q,y,w,k,S,A,x,C,j,I,z,D,W;return{setters:[function(e){r=e.d,a=e.f,o=e.g,n=e.y,i=e.T,s=e.j,c=e.N,l=e.A,d=e.bA,u=e.aw,_=e.F,p=e.bD,f=e.aS,m=e.$},function(e){v=e.S,h=e.a},function(e){g=e.I},function(e){b=e.C},function(e){q=e.C},function(e){y=e.I},function(e){w=e.R,k=e.a},function(){},function(e){S=e.T},function(e){A=e.R,x=e.C},function(e){C=e.S},function(e){j=e.A},function(e){I=e.C},function(e){z=e.i},function(e){D=e.C},function(e){W=e.u},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var L={swipeItemImg:"_swipeItemImg_1q0ve_1",swipe:"_swipe_1q0ve_1","custom-indicator":"_custom-indicator_1q0ve_7",goodsHead:"_goodsHead_1q0ve_17",priceGroup:"_priceGroup_1q0ve_24",price:"_price_1q0ve_24",delPrice:"_delPrice_1q0ve_37",stock:"_stock_1q0ve_43",goodsName:"_goodsName_1q0ve_47",row:"_row_1q0ve_53",col:"_col_1q0ve_57","radio-group":"_radio-group_1q0ve_61",radio:"_radio_1q0ve_61",badge:"_badge_1q0ve_96",section:"_section_1q0ve_100",detail:"_detail_1q0ve_104",photoDetail:"_photoDetail_1q0ve_129",goodsDetail:"_goodsDetail_1q0ve_133",actionBar:"_actionBar_1q0ve_136",addCertBtn:"_addCertBtn_1q0ve_157",buyGroup:"_buyGroup_1q0ve_161",selectWrap:"_selectWrap_1q0ve_170",shareBtn:"_shareBtn_1q0ve_176",shareWrap:"_shareWrap_1q0ve_182",sharePic:"_sharePic_1q0ve_192",shareLeft:"_shareLeft_1q0ve_197",shareRight:"_shareRight_1q0ve_200",shareShopTitle:"_shareShopTitle_1q0ve_204",shareShopDes:"_shareShopDes_1q0ve_214",shareShopValue:"_shareShopValue_1q0ve_223",shareShopOldPrice:"_shareShopOldPrice_1q0ve_227",imagesOverlayWrap:"_imagesOverlayWrap_1q0ve_234",cartDisabled:"_cartDisabled_1q0ve_240"};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,"&p=tenant"):"".concat(location.origin,"/teacher.html#/shareMall?bizId=").concat(e,"&userId=").concat(o.user.data.userId,"&userType=").concat(o.platformType,"&p=tenant")},platformStatus:function(){var e=o.user.data,t=this.$route.query;return e.tenantId>0&&"tenant"==t.p}},mounted:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var r,a,o,i,s;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(!((s=e.skuStockListTemp[i]).stock>=0)){t.next=18;break}return e.radio=s.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(),W("商品详情");case 28:case"end":return t.stop()}}),t,null,[[0,24]])})))()},methods:{onPreview:function(e){y({images:this.albumPics,startPosition:e,closeable:!0,className:L.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:L.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 s("div",{class:L.goodsDetail},[s(I,null,{right:function(){return s("div",{class:L.shareBtn,onClick:function(){return t.shareShow=!0}},[s(c,{name:z,size:14,color:"#666"},null),s("span",{style:{marginLeft:"3px"}},[l("分享")])])}}),s(v,{class:L.swipe,lazyRender:!0},{default:function(){return[t.albumPics.map((function(e,r){return s(h,null,{default:function(){return[s(g,{class:L.swipeItemImg,src:e,onClick:function(){return t.onPreview(r)},fit:"cover"},null)]}})}))]},indicator:function(e){return e.total>1&&s("div",{class:L["custom-indicator"]},[(e.active||0)+1,l(" / "),e.total])}}),s(b,{border:!1,class:[L.goodsHead,"mb12"]},{default:function(){return[s(q,{center:!0,border:!1},{title:function(){return s("div",{class:L.priceGroup},[s("span",{class:L.price},[s("i",null,[l("¥")]),d(t.getPrice)])])}}),s(q,{center:!0,border:!1,title:r.name,titleClass:[L.goodsName,"van-ellipsis"]},null)]}}),s(A,{class:[L.row,"mb12"]},{default:function(){return[s(x,{span:4,class:L.col},{default:function(){return[l("规格")]}}),s(x,{span:20},{default:function(){return[a?s("div",{class:L.selectWrap},[a.stock<=0?"当前款式暂时缺货":"已选择 ".concat(a.spDataJson)]):s("div",null,[l("请选择 规格")]),s(w,{class:L["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 s(u,{position:"top-right",content:e.stock<=0?"缺货":"",color:"#999999",class:L.badge,offset:[-20,0]},{default:function(){return[s(k,{class:L.radio,name:e.id,disabled:e.stock<=0,onClick:function(){e.stock<=0||(t.radio=e.id)}},{default:function(){return[s(S,{size:"large",plain:r,type:a},{default:function(){return[e.spDataJson]}})]}})]}})})),"function"==typeof r||"[object Object]"===Object.prototype.toString.call(r)&&!m(r)?e:{default:function(){return[e]}}))];var r}})]}}),this.detailMobileHtml&&s("div",{class:[L.section]},[s("div",{class:L.detail},[s("span",null,[l("图文详情")])]),s("div",{class:[L.photoDetail,"msgWrap"],onClick:this.onShowImg,innerHTML:this.detailMobileHtml},null)]),!this.loading&&s(_,null,[s(C,{class:L.actionBar,"safe-area-inset-bottom":!0},{default:function(){return[s(u,{content:t.cartCount,showZero:!1,onClick:function(){t.platformStatus||t.$router.push("/cart")}},{default:function(){return[s(c,{name:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAABPhJREFUaEPtmVto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HqVTq+lgsZis6ysxrFwQO2G6CtC+l1ACAzZa6u7XWD9UVOJ1Or8jn82abeVyxSuZyubMWugUJuqGoZNfT03NCR0eHOaaeVAQUkYs9z/uirsCFdWwO2nZ1vpWZ7epdLoea3rmuu0lEzPa2+GSZ+exK18ehp7SJ5jjOY0Rk9983mXm2P9dEVOEjpdRrAG6zzJ5nZruWlPQQFfBlRGTvsA4y8+y5tA7A5rR2CMBqy/dGZv6wUqxIgM36LRwXVwRtD5USK/deKbURwH7L5ndmPh3A0Up+owI2/dhc4V5bKWA93hPRq1rr24P4jgy4RE8MEj8SmyCHltmZF0nEGSdmXZk7pSsj9BnEVVUFMjKFTWbJZPLEzs5O0/hvAtADIBYk4xps8gAYwCvM/EyQtVsPhWvIu/GfRKpw49OvPmJkwH19fYlcLrdLRLaZNIjopUQisXN0dDRXfVoLfxE2TmTAruvuFpEH7FSJ6Cmt9YNRAoeNExmwUurPEr8fH2bmVVECh43TBq5VjbBTLWjcsHEiUzhsMQkKHDZOZMBBE262XRu42QrUO35b4XqPcLP9txVutgL1jt9WuN4j3Gz/y07h/wAWOi1b2uyxeAAAAABJRU5ErkJggg==",size:30,class:t.platformStatus&&L.cartDisabled},null)]}})]},button:function(){return s("div",{class:L.buyGroup},[s(p,{type:"primary",class:L.addCertBtn,text:"加入购物车",disabled:t.platformStatus,onClick:function(){return t.onShowCart()}},null),s(p,{type:"primary",text:"立即购买",disabled:t.platformStatus,onClick:function(){return t.onShowCart("cartConfirm")}},null)])}})]),s(f,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:function(){t.addGoodsShow=!1}},{default:function(){return[s(j,{show:t.addGoodsShow,onGetCartCount:function(){return t.getCartCount()},item:t.selectGoodsItem,defaultRadio:t.radio,showType:t.showType},null)]}}),s(f,{style:{background:"transparent"},show:this.shareShow,onClose:function(){return t.shareShow=!1}},{default:function(){return[s(D,{shareUrl:t.shareUrl,teacherId:o.user.data.userId,shareType:"mall"},{default:function(){return[s("div",{class:L.shareWrap},[s("div",{class:L.shareLeft},[s("img",{crossorigin:"anonymous",class:L.sharePic,src:n},null)]),s("div",{class:L.shareRight},[s("div",{class:L.shareShopTitle},[t.product.name]),a?s("div",{class:L.shareShopDes},[a.sku]):null,s("div",{class:L.shareShopValue},[s("span",{class:L.shareShopPrice},[d(t.getPrice)])])])])]}})]}})])}}))}}}))}();
|