(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-79d2b8ec","multiSpecificationPopups","chunk-31e9c332","chunk-2e18f680"],{"003d":function(t,e,s){"use strict";s("f00b")},"0220":function(t,e,s){"use strict";s.r(e),s("433b");var i=s("d399"),o=(s("14d9"),s("d7a6")),a=s("a1c4"),c=s("ae31"),r=s("1f4f"),n=s("e982"),d=s("35e9"),u=s("696e"),l={data:()=>({radio:"1",reserve:!1,inventoryLack:!1,ration:!1,stockout:!1,sop:!1,conversion:!1,paly:!1,multiSpecification:!0,sopPopups:!1,tagList:[],overseas:!1,sopAgain:!1,sopStateData:0,warranty:!1,onlyActivities:{},yuXiangHui:!1,brokeragesStr:"",skuCode:"",showShare:Object(r.v)(),showMultiSelect:!1}),components:{multiSpecificationPopups:a.default,multiSelect:n.default},props:{productData:{type:Object},name:{type:String},landingType:{type:String}},computed:{...Object(o.mapState)("common",{userInfo:t=>t.userInfo,myInformation:t=>t.myInformation,WarehouseCode:t=>t.WarehouseCode,scoreQualification:t=>t.scoreQualification,isFOA:t=>t.isFOA,isLogin:t=>t.isLogin,deliveryMethod:t=>t.deliveryMethod,checkStoreCode:t=>t.checkStoreCode,orderType:t=>t.orderType,authByScoreData:t=>t.authByScoreData,scoreData:t=>t.scoreData})},methods:{isSR:r.v,setTags(t){if(!t)return;this.ration=t.some(t=>"QUOTA"===t.tagCode)&&!this.stockout,this.tagList=t.filter(t=>"PRODUCT_LABELS"===t.type||"A_PLUS"===t.type);const e=t.filter(t=>this.$isAoProduct(t.tagCode)),s=t.filter(t=>"LOW_STOCK"===t.tagCode);0!=e.length&&0!=s.length?e[0].priority>s[0].priority?this.reserve=!0:this.inventoryLack=!0:(this.reserve=0!=e.length,this.inventoryLack=0!=s.length)},setVirtualProductType(t){this.stockout||(this.sop="ARTISTRY_SOP"===t||"NUTRILITE_SOP"===t||"ProbioticSOP"===t,this.conversion="COFFEE_COUPON"===t||"AMPLUS_COUPON"===t||"CHARITY"===t||"2"==this.productData.businessType&&"AC"==this.productData.companyCode)},listHref(t){window.trackZhuge.clickEvent({"事件名称":"云购_点击商品_商品榜单活动页","事件类型":"点击事件","事件详情":"无","活动名称":document.title||this.$parent.$parent.activityName,"商品ID":t.skuCode,"商品名称":t.skuName,"行为类型":"点击","行为对象":"商品","页面名称":document.title}),this.$router.push("/productDetail?skuCode="+t.skuCode)},async addCart({skuCode:t,skuCodes:e,productCode:s,skuName:o,combinedType:a}){if(window.trackZhuge.clickEvent({"事件名称":"云购_点击商品_商品榜单活动页","事件类型":"点击事件","事件详情":"无","活动名称":document.title||this.$parent.$parent.activityName,"商品ID":t,"商品名称":o,"行为类型":"点击","行为对象":"加购按钮","页面名称":document.title}),"MIXOLOGISTIC"===a)return void this.$router.push("/productDetail?skuCode="+t);if(this.stockout)return;if(e&&e.length>1)return this.showMultiSelect=!0,void(this.skuCode=t);const{productDetailDTO:{skuList:n}}=await Object(u.b)({data:{skuCode:t,force2Parent:!0}});if(n&&n.length>1)return this.showMultiSelect=!0,void(this.skuCode=t);if(!this.isLoginFun())return void window.localStorage.setItem("loginBackUrl",this.$route.fullPath);const d=Object(c.b)({skuCode:t,skuList:e,productCode:s,pageType:"榜单"},!0,!0);d&&d.then(t=>{t.success?Object(i.a)("加入购物车成功"):Object(r.D)(t,!1)})},async addSop(){if(this.userInfo.ada!=this.myInformation.ada)return void this.$alert({text:"长客会仅限本人签约，请注意调整为本人。",isCancel:!1,okText:"我知道了"});if(this.AEC&&"homedelivery"!=this.deliveryMethod.type)return void this.$alert({text:"长客会需在非AEC网络下签约，请注意调整网络。",isCancel:!1,okText:"我知道了"});this.$loading.show();const t=await this.getSopActivityCode(),e=await this.getSopCommodity(t);this.sopStateData=await this.sopState(t);let s="";if(this.sopProductData.ruleJson.productLineList[0].productsList.forEach(e=>{t===e.activityCode&&(s=e.skuCode)}),this.onlyActivities={skuCode:s,sopActivityCode:t},"立即签约"===this.sopProductData.ruleJson.button&&0===this.sopStateData)return this.SOPPop=!0,void this.$nextTick(()=>{this.$refs.msp.overseasAndSop=!0});if(0===this.sopStateData){if(!e){const e=[{skuCode:[this.sopProductData.ruleJson.productLineList[0].productsList[0].skuCode][0],quantity:1}];return void this.goCheckout(t,e)}this.SOPPop=!0,this.$nextTick(()=>{this.$refs.msp.sopPop=!0})}1===this.sopStateData&&(this.SOPPop=!0,this.$nextTick(()=>{this.$refs.msp.sopAgain=!0})),2===this.sopStateData&&(this.SOPPop=!0,this.$nextTick(()=>{this.$refs.msp.sopAgain=!0})),this.$loading.hide()},addRation(){this.$router.push("/productDetail?skuCode="+this.productData.skuCode)},addSale(){this.$router.push("/productDetail?skuCode="+this.productData.skuCode)},async goCheckout(t,e,s){const i=await Object(d.a)({data:{loginAda:this.myInformation.ada,loginType:this.myInformation.memberType,loginName:this.myInformation.name,loginMemberType:this.myInformation.memberType,consigneeAda:this.userInfo.ada,consigneeType:this.userInfo.memberType,consigneeMemberType:this.userInfo.memberType,consigneeName:this.userInfo.name,orderBusinessTag:t?1:4,orderType:this.orderType,deliveryType:this.deliveryMethod.type,extendRequestDTO:{activityCode:t},productRequestDTOList:JSON.parse(JSON.stringify(e)),platformSource:0,logicalSortingWarehouseCode:s||this.checkStoreCode}});"0"==i.code&&(t?this.$router.push("/checkout/singlesop?orderCode="+i.data.preOrderCode+"&sopCode="+t+"&sopQualificationCode="+i.data.defaultSopSignQualificationCode):this.$router.push("/checkout/single?orderCode="+i.data.preOrderCode).then())},isLoginFun(){return!!this.isLogin||(this.$router.push("/login"),!1)}},mounted(){const{stockout:t,tagList:e,virtualProductType:s,brokerages:i}=this.productData;if(this.stockout=t,this.setTags(e),this.isLogin&&"ABO"==this.myInformation.memberType){let t,e;i[0]&&(t=i[0].toFixed(2)),i[1]&&(e=i[1].toFixed(2)),i[0]&&i[1]&&t!==e?this.brokeragesStr=`${t}~${e}`:this.brokeragesStr=t}this.setVirtualProductType(s)},watch:{productData:{handler(t,e){t!=e&&(this.setTags(t.tagList),this.setVirtualProductType(t.virtualProductType))}}},filters:{million:function(t){return t>9999?(t/1e3/10).toFixed(1)+"万":t}}},p=(s("d4be"),s("003d"),s("2877")),h=Object(p.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"product"},[e("product-pic",{staticClass:"img",class:{stockout:t.stockout},attrs:{frameUrl:t.productData.productFrameUrl,src:t.productData.picture,"sku-cnt-desc":t.productData.skuCntDescription,"video-url":t.productData.pdpVideoUrl,"frame-url":t.productData.productFrameUrl},on:{click:function(e){return t.listHref(t.productData)}}},[e("product-label",{attrs:{"stock-info":t.productData.stockDTO,topRadius:""}}),t.paly?e("span",{staticClass:"play"}):t._e()],1),e("div",{staticClass:"msg",class:{stockout:t.stockout}},[e("a",{staticClass:"name",on:{click:function(e){return t.listHref(t.productData)}}},[t._v(t._s(t.productData.skuName))]),e("div",{staticClass:"tab"},[t.tagList.length>0?e("p",t._l(t.tagList.slice(0,2),(function(s,i){return e("span",{key:i},[t._v(t._s(s.tagName))])})),0):t._e()]),t.productData&&t.productData.priceDTO?e("p",{staticClass:"price-enjoys",class:{"price-enjoys_much":t.brokeragesStr&&t.brokeragesStr.indexOf("~")>-1||t.productData&&t.productData.priceDTO&&t.productData.priceDTO.price},style:t.brokeragesStr?"":"display: inline-flex"},[t.productData.isVirtualCombined&&t.productData&&t.productData.priceDTO&&t.productData.priceDTO.combinedPrice?e("span",{staticClass:"productPrice"},[e("small",[t._v("组合价 ¥")]),t._v(t._s(parseFloat(t.productData.priceDTO.combinedPrice).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,")))]):t.productData.priceDTO&&t.productData.priceDTO.minPrice&&t.productData.priceDTO.maxPrice?e("span",{staticClass:"productPrice"},[t._v(t._s(`¥${t.$priceFixed(t.productData.priceDTO.minPrice)} ~ ¥${t.$priceFixed(t.productData.priceDTO.maxPrice)}`))]):e("span",{staticClass:"productPrice"},[t._v("¥"+t._s(t.$priceFixed(t.productData.priceDTO.price)))]),t.showShare&&t.brokeragesStr?e("span",{staticClass:"share-price"},[t._v("分享赚 "),e("label",[t._v(t._s(t.brokeragesStr))])]):t._e()]):t._e(),t.productData.isVirtualCombined&&t.productData&&t.productData.priceDTO&&t.productData.priceDTO.combinedPrice?e("span",{staticClass:"original-price"},[t._v("原价 ￥"+t._s(t.$priceFixed(t.productData.priceDTO.price)))]):t._e(),e("p",{staticClass:"sales-num"},[t._v("月销"+t._s(t._f("million")(t.productData.saleCnt)))]),"static"!=t.landingType?e("div",{staticClass:"box"},[t.sop?e("p",{staticClass:"signed",attrs:{id:t.$putAsh(t.productData.stockDTO)},on:{click:t.addSop}},[t._v("去签约")]):t.productData.stockDTO&&5===t.productData.stockDTO.priority?e("p"):e("p",{staticClass:"cart",attrs:{id:t.$putAsh(t.productData.stockDTO)},on:{click:function(e){return t.addCart(t.productData)}}},[e("i",{staticClass:"iconal"},[t._v("")])])]):t._e()]),t.sopPopups?e("multiSpecificationPopups",{ref:"msp"}):t._e(),t.showMultiSelect?e("multiSelect",{attrs:{skuCodeFromParent:t.skuCode}}):t._e()],1)}),[],!1,null,"1448bc54",null);e.default=h.exports},"0f33":function(t,e,s){},"17fc":function(t,e,s){"use strict";s("b325")},5082:function(t,e,s){"use strict";s("0f33")},"70cc9":function(t,e,s){},9585:function(t,e,s){},a1c4:function(t,e,s){"use strict";s.r(e),s("87d0");var i=s("e41f"),o=(s("14d9"),s("d7a6")),a=s("35e9"),c={name:"multiSpecificationPopups",components:{"van-popup":i.a},data(){return{sopStateD:this.sopStateData,show:!1,select:!1,overseasAndSop:!1,sopPop:!1,sopAgain:!1,checkedCode:[],isUsable:!1,checkName:"",ItemPrice:0,isSelected:!1,skuList:[],isoverseas:!0,isActivity:!1,activityName:this.sopProductData.activityName,SOPactivityCode:"",showImg:"",img:!1,activeSignList:{},periods:6}},methods:{closeImg(){this.img=!1},openBigImg(){this.img=!0},activitySchedule(){1===this.sopProductData.ruleJson.productLineList.length&&1===this.sopProductData.ruleJson.productLineList[0].productsList.length&&(this.SOPactivityCode=this.sopProductData.activityCode),this.$router.push("/my-account/activityprogress?sopCode="+(""!=this.SOPactivityCode?this.SOPactivityCode:this.$parent.onlyActivities?this.$parent.onlyActivities.sopActivityCode:this.sopProductData.activityCode))},pushEl:(t,e,s)=>(-1===t.indexOf(e)&&t.push(e),t.length>s&&(t=t.slice(-s)),t),getItem(t,e,s,i,o){const a=this.checkedCode[t].neddToChoose;let c=this.checkedCode[t].checkedCodes;c=this.pushEl(c,e,a),this.$set(this.checkedCode[t],"checkedCodes",c);let r=this.checkedCode[t].checkedName;r=this.pushEl(r,s,a),this.$set(this.checkedCode[t],"checkedName",r);let n=this.checkedCode[t].checkePrice;n=this.pushEl(n,i,a),this.$set(this.checkedCode[t],"checkePrice",n);let d=this.checkedCode[t].skuCodes;d=this.pushEl(d,o,a),this.$set(this.checkedCode[t],"skuCodes",d),this.setNameAndPrice()},closePop(){this.$emit("closeSOP"),this.overseasAndSop=!1},addCheckout(){if(this.isUsable)if(this.isActivity){const t=this.checkedCode[0].checkedCodes[0];this.sopState(t).then(t=>{this.sopStateD=t,this.activityName=this.checkedCode[0].checkedName[0],window.trackZhuge.clickEvent({"事件类型":"点击事件","页面类别":"长客会","行为类型":"点击事件","行为对象":"按钮","活动名称":this.activityName,"事件名称":"无","商品名称":this.activityName,"页面名称":document.title,"事件详情":"长客会点击立即参与"},["用户类型","用户类别","安利号码","店主ID","OpenID","UnionID","页面名称"]),0!=t?this.sopAgain=!0:this.isoverseas&&(this.overseasAndSop=!0)});const e=this.sopProductData.ruleJson.productLineList[0].productsList.filter(e=>e.activityCode===t);this.SOPactivityCode=t,this.skuList=[e[0].skuCode]}else{let t=[];this.checkedCode.forEach(e=>{t=t.concat(e.checkedCodes)}),this.SOPactivityCode=this.sopProductData.activityCode,this.skuList=t,this.goCheckout()}},async sopState(t){if(""!=t&&this.isLogin){const e=await this.$httpUtil.ajax({key:"sopInquire",data:{ada:this.myInformation.ada,activityCode:t},method:"POST",interfaceCore:"new-bff-h5"});let s=0;return e.success&&(this.activeSignList=e.data.activeSignList,s=e.data.activeSignList?e.data.activeSignList.length===e.data.activityQualificationQuantity?2:1:0),s}},goCheckout(){const t=""!=this.SOPactivityCode?this.SOPactivityCode:this.$parent.onlyActivities.sopActivityCode,e=0!=this.skuList.length?this.skuList:[this.$parent.onlyActivities.skuCode],s=[];if(e.forEach(t=>{if(s.length>0){let e=!0;s.forEach(s=>{s.skuCode===t&&(s.quantity+=1,e=!1)}),e&&s.push({skuCode:t,quantity:1})}else s.push({skuCode:t,quantity:1})}),!this.isActivity){const e=this.checkName.substring(this.checkName.length-1),s=this.checkName.substring(0,this.checkName.length-2);let i=[];i="2"===e?[s,s]:this.checkName.split("+"),window.trackZhuge.clickEvent({"事件类型":"点击事件","页面类别":"长客会","页面详情":"无","行为类型":"点击事件","行为对象":"按钮","事件详情":"点击确认选择长客会商品","事件名称":"云购_点击确认选择商品_长客会选择商品页","活动名称":this.activityName,"页面名称":document.title,"产品一":i[0],"产品二":i[1],"商品ID":t,"商品名称":this.activityName})}Object(a.a)({data:{loginAda:this.myInformation.ada,loginType:this.myInformation.memberType,loginName:this.myInformation.name,loginMemberType:this.myInformation.memberType,consigneeAda:this.userInfo.ada,consigneeType:this.userInfo.memberType,consigneeMemberType:this.userInfo.memberType,consigneeName:this.userInfo.name,orderBusinessTag:1,orderType:this.orderType,deliveryType:this.deliveryMethod.type,extendRequestDTO:{activityCode:t},productRequestDTOList:JSON.parse(JSON.stringify(s)),platformSource:0,logicalSortingWarehouseCode:this.checkStoreCode}}).then(e=>{"0"==e.code&&this.$router.push("/checkout/singlesop?orderCode="+e.data.preOrderCode+"&sopCode="+t+"&sopQualificationCode="+e.data.defaultSopSignQualificationCode)})},onClosed(){this.sopPop||this.sopAgain||this.overseasAndSop||this.$emit("closeSOP")},againSign(){if(this.isActivity)this.isoverseas?this.overseasAndSop=!0:this.goCheckout();else{if(1===this.sopProductData.ruleJson.productLineList.length&&1===this.sopProductData.ruleJson.productLineList[0].productsList.length)return this.SOPactivityCode=this.sopProductData.activityCode,this.skuList=[this.sopProductData.ruleJson.productLineList[0].productsList[0].skuCode],void this.goCheckout();this.sopAgain=!1,this.sopPop=!0}},calculateLimit(t){const e=12-(new Date).getMonth();if(t&&t.length>0){const s=6-t[0].number||0;return(s-e>0?e:s)+(6-e>0?e:6)}return 6-e>0?e:6},initializationSelection(){let t=!1;this.$props.sopProductData.ruleJson.productLineList.forEach(e=>{const s={neddToChoose:e.neddToChoose,checkedName:[],checkePrice:[],checkedCodes:[],skuCodes:[],content:e};e.productsList.forEach(e=>{"true"===e.isDefault&&(s.checkedCodes.push(this.isActivity?e.activityCode:e.skuCode),s.checkedName.push(e.productName?e.productName:e.activityName),s.checkePrice.push(e.dp),s.skuCodes.push(e.skuCode),t=!0)}),this.checkedCode.push(JSON.parse(JSON.stringify(s)))}),this.showImg=this.sopProductData.ruleJson.defaultPicturePath,t&&this.setNameAndPrice()},setNameAndPrice(t=this.checkedCode){this.isSelected=!0;const e=[];let s=[],i=0;t.forEach(t=>{t.checkedName.length>0&&t.checkedName.forEach(t=>{e.length>0?e.forEach(s=>{s.itemName&&s.itemName===t?s.num=2:e.push({itemName:t,num:1})}):e.push({itemName:t,num:1})}),t.checkePrice.length>0&&t.checkePrice.forEach(t=>{i+=t}),s=s.concat(t.skuCodes)}),this.ItemPrice=i;let o="";e.forEach((t,s)=>{this.sopProductData.ruleJson.productLineList.length>1?e.length>1&&s!=e.length-1?o+=t.itemName+"x"+t.num+"+":o+=t.itemName+"x"+t.num:o+=t.itemName}),this.checkName=o,this.isUsable=this.checkedCode.every(t=>t.checkedCodes.length===t.neddToChoose);const a=this.sopProductData.ruleJson.groupInfos.filter(t=>t.skuList.sort().toString()===s.sort().toString());a.length>0&&(this.showImg=a[0].picturePath)}},computed:{...Object(o.mapState)("common",{myInformation:t=>t.myInformation,isFOA:t=>t.isFOA,isLogin:t=>t.isLogin,userInfo:t=>t.userInfo,orderType:t=>t.orderType,channel:t=>t.channel,scoreData:t=>t.scoreData,scoreQualification:t=>t.scoreQualification,WarehouseCode:t=>t.WarehouseCode,AEC:t=>t.AEC,deliveryMethod:t=>t.deliveryMethod,checkStoreCode:t=>t.checkStoreCode})},props:{sopStateData:{type:Number,default:0},sopProductData:{type:Object},sopStateList:{type:Array}},mounted(){this.isActivity="立即签约"===this.$props.sopProductData.ruleJson.button,this.initializationSelection()}},r=(s("17fc"),s("2877")),n=Object(r.a)(c,(function(){var t=this,e=t._self._c;return e("div",[e("van-popup",{staticClass:"sopPop",attrs:{closeable:""},on:{closed:t.onClosed},model:{value:t.sopPop,callback:function(e){t.sopPop=e},expression:"sopPop"}},[e("div",{staticClass:"header"}),e("div",{staticClass:"content"},[e("div",{staticClass:"goods"},[e("div",{staticClass:"goods-img",on:{click:t.openBigImg}},[e("img",{attrs:{src:t.$imgDomain+t.showImg,alt:""}})]),e("div",{staticClass:"goods-detail"},[e("p",[e("span",{staticClass:"goods-price"},[t._v("¥"+t._s(t.ItemPrice.toFixed(2)))]),e("span",{staticClass:"text"},[e("em",[t._v("最高")]),t._v(" "+t._s(t.sopProductData.ruleJson.preferentialDesc.substring(2))+" ")])]),t.isSelected?e("p",{staticClass:"type"},[e("span",[t._v("已选:")]),e("span",[t._v(t._s(t.checkName))])]):e("p",{staticClass:"type"},[t._v("请选择")])])]),t.sopProductData.ruleJson.buyTips?e("div",{staticClass:"prompt-text"},[t._v(" "+t._s(t.sopProductData.ruleJson.buyTips)+" ")]):t._e(),e("div",[t._v(t._s(t.sopProductData.ruleJson.operationTips))]),e("div",{staticClass:"ProbioticSOP"},t._l(t.sopProductData.ruleJson.productLineList,(function(s,i){return e("div",{key:i,staticClass:"product-type"},[s.head?e("p",{staticClass:"title"},[t._v(t._s(s.head))]):t._e(),t.checkedCode[i]?e("ul",t._l(s.productsList,(function(s,o){return e("li",{key:o,class:{active:t.checkedCode[i].checkedCodes.includes(t.isActivity?s.activityCode:s.skuCode)},on:{click:function(e){return t.getItem(i,t.isActivity?s.activityCode:s.skuCode,s.productName?s.productName:s.activityName,s.dp,s.skuCode)}}},[t._v(" "+t._s(s.productName?s.productName+"x1":s.activityName)+" "),e("div",{staticClass:"chosen"},[e("i",{staticClass:"iconal"},[t._v("")])])])})),0):t._e()])})),0),e("div",{staticClass:"quantity"},[e("span",[t._v(t._s(t.sopProductData.ruleJson.countBo.head))]),e("span",{staticClass:"max-number"},[t._v(t._s(t.sopProductData.ruleJson.countBo.bodyDesc))])])]),e("div",{staticClass:"but"},[e("span",{class:{select:t.isUsable},on:{click:function(e){return t.addCheckout()}}},[t._v(t._s(t.sopProductData.ruleJson.button))])])]),e("van-popup",{staticClass:"overseasAndSop",attrs:{closeable:""},on:{closed:t.onClosed},model:{value:t.overseasAndSop,callback:function(e){t.overseasAndSop=e},expression:"overseasAndSop"}},[e("div",{staticClass:"content-overseas"},[e("div",{staticClass:"content-title"},[t._v("额度提示")]),e("p",{staticClass:"describtion"},[t._v(" 个人每年度跨境电商交易限额为￥ "),e("span",[t._v("26000")]),t._v("，本期活动至少需预留￥ "),e("span",[t._v(t._s(6*t.ItemPrice))]),t._v("，记得查询您的剩余额度以保证大于￥ "),e("span",[t._v(t._s(6*t.ItemPrice))]),t._v("哦～ ")]),e("span",{staticClass:"query"}),e("div",{staticClass:"footer"},[e("div",{staticClass:"btn-other",on:{click:t.closePop}},[t._v("额度不足，看看其他")]),e("div",{staticClass:"btn-account",on:{click:t.goCheckout}},[t._v("额度充足，立即结算")])])])]),e("van-popup",{staticClass:"sopAgain",attrs:{closeable:""},on:{closed:t.onClosed},model:{value:t.sopAgain,callback:function(e){t.sopAgain=e},expression:"sopAgain"}},[e("div",{staticClass:"content-desc"},[e("p",{staticClass:"content-hint"},[t._v("您已签约过"+t._s(t.activityName)+t._s(t.isActivity?"买7减1优惠活动":"活动"))]),e("p",{staticClass:"purchase-card-number"},[t._v(" 购货卡号:"+t._s(t.myInformation.name)+"("+t._s("FOA"==t.myInformation.memberType?t.myInformation.masterBindPhone:t.myInformation.ada)+") ")]),e("div",{staticClass:"but-box"},[e("span",{staticClass:"cancel",on:{click:t.activitySchedule}},[t._v("查看活动进度")]),2!=t.sopStateD?e("span",{staticClass:"confim",on:{click:t.againSign}},[t._v("再次签约")]):t._e()])])]),e("van-popup",{staticStyle:{"overflow-y":"initial"},attrs:{"overlay-style":{background:"#000"}},on:{closed:t.closeImg},model:{value:t.img,callback:function(e){t.img=e},expression:"img"}},[e("em",{staticClass:"close",on:{click:t.closeImg}},[t._v("X")]),e("img",{staticClass:"big-img",attrs:{src:t.$imgDomain+t.showImg}}),e("p",{staticClass:"big-img-text"},[t._v(t._s(t.checkName))])])],1)}),[],!1,null,"4a7ffdb6",null);e.default=n.exports},a4ed:function(t,e,s){},b325:function(t,e,s){},cd23:function(t,e,s){"use strict";s("a4ed")},d4be:function(t,e,s){"use strict";s("70cc9")},e982:function(t,e,s){"use strict";s.r(e),s("433b");var i=s("d399"),o=(s("8fdb"),s("20fb")),a=(s("87d0"),s("e41f")),c=(s("14d9"),s("ae31")),r=s("d7a6"),n=s("1f4f"),d=s("696e"),u=s("75cc"),l={data:()=>({skuCode:"",show:!0,productDetail:{},newDetail:{},selectedSpecs:{},purchases:null,stockoutList:{},stockoutCurList:[],isInvalidBtn:!1,stepper:{min:1,max:999},btnName:"确定"}),props:{defaultValue:{type:Number,default:1},maxCount:{type:[Number,String],default:999},skuCodeFromParent:{type:[String,Number],default:""},inCart:{type:Boolean,default:!0}},async created(){this.skuCode=this.skuCodeFromParent,await this.getProductDetail()},components:{"van-popup":a.a,"van-stepper":o.a},computed:{...Object(r.mapState)("common",{userInfo:t=>t.userInfo,myInformation:t=>t.myInformation,isFOA:t=>t.isFOA,isLogin:t=>t.isLogin,shopCode:t=>t.shopCode,orderType:t=>t.orderType}),selectedNameDes(){if(0==this.productDetail.newSaleValueResponses.length)return"";let t="";const{values:e,code:s}=this.productDetail.newSaleValueResponses[0],i=e.find(t=>t.value==this.selectedSpecs[s]);return t=i&&i.limitCount&&i.limitCount>=1?this.selectedSpecs[s]:Object.values(this.selectedSpecs).join(","),t},specification(){const t=this.productDetail.commonAttributes.find(t=>{if("SPECIFICATION"==t.key)return!0});return t&&t.value||""},microTip(){const{microNum:t,unitName:e,productCode:s}=this.productDetail,{limitUnit:i}=t||{};return`每人每月限购${i}${e||"件"}(不限包装形式)${"40456_base"==s?",399元任选6盒。":""}`}},methods:{confirmBtnIsInvalid(){const t=this.productDetail.newSaleValueResponses||[];if(t.length>1){const e=t[0].values.find(e=>e.value==this.selectedSpecs[t[0].code]);let{limitCount:s}=e;s||(s=1);let i=this.selectedSpecs[t[1].code];if("string"==typeof i&&(i=[i]),!i||i.length<s)return void(this.isInvalidBtn=!0)}const e=this.productDetail.stockDTO&&this.productDetail.stockDTO.priority;this.btnName=5===e?"即将开售":1===e?"已停售":"确定",this.newDetail.defaultSelected.isOutOfStock||5===e||1===e?this.isInvalidBtn=!0:this.isInvalidBtn=!1},async getProductDetail(){Object(d.b)({data:{skuCode:this.skuCode,force2Parent:!0},additional:!0,loading:!0}).then(t=>{if(t.defaultSelected.skuCode!==this.skuCode)return this.skuCode=t.defaultSelected.skuCode,void this.getProductDetail();this.newDetail=t,this.productDetail=t.productDetailDTO||{},this.getSelectedSpecsBySkuCode(this.skuCode),this.searchStockoutCurList(),this.confirmBtnIsInvalid(),this.getPurchases()})},getPurchases(){this.newDetail.isMicroProduct&&this.productDetail.microNum&&this.productDetail.microNum.limitUnit&&(this.stepper.max=this.productDetail.microNum.limitUnit)},switchSpecs(t,e,s){if(s)return;const o=this.productDetail.newSaleValueResponses,a=o.length,c=o[t],{value:r,limitCount:n}=c.values[e];let d={};if(0==t)d={isCombined:n&&n>=1,limitCount:n||0};else{const t=o[0].values.find(t=>t.value==this.selectedSpecs[o[0].code]),{limitCount:e}=t;d={isCombined:e&&e>=1,limitCount:e||0}}if(console.log("sss",d),1==a)this.selectedSpecs[c.code]=r,this.skuCode=this.getSkuCodeBySelectedSpecs(),this.getProductDetail();else if(a>1&&d.isCombined)if(0==t){this.selectedSpecs={},this.selectedSpecs[c.code]=r;const{limitCount:t}=d,e=o[1].values.slice(0,t),s=[];e.forEach(t=>{s.push(t.value)}),this.selectedSpecs[o[1].code]=s,this.skuCode=this.getSkuCodeBySelectedSpecs(),this.getProductDetail()}else{const{limitCount:t}=d;if(1==t)this.selectedSpecs[c.code]=[r],this.skuCode=this.getSkuCodeBySelectedSpecs(),this.getProductDetail();else{const e=this.selectedSpecs[c.code],s=e.indexOf(r);s>-1?e.splice(s,1):t>e.length?(e.push(r),e.length==t&&(this.skuCode=this.getSkuCodeBySelectedSpecs(),this.getProductDetail())):Object(i.a)("商品选多啦，试试修改产品组合或取消某个产品呢")}}else this.selectedSpecs[c.code]=r,0==t?delete this.selectedSpecs[o[1].code]:(this.skuCode=this.getSkuCodeBySelectedSpecs(),this.getProductDetail());this.searchStockoutCurList(),this.confirmBtnIsInvalid(),this.$forceUpdate()},getSelectedSpecsBySkuCode(t){const{newSaleValueResponses:e,skuList:s}=this.productDetail,i=s.find(e=>e.skuCode==t);e.forEach(t=>{const e=t.code,s=i.saleAttributes.find(t=>t.key==e);this.selectedSpecs[e]="string"==typeof s.value?s.value:Array.from(s.value)})},searchStockoutCurList(){const t=this.productDetail.newSaleValueResponses||[],e=t.length;if(this.stockoutCurList=[],1==e&&t[0].values.forEach(e=>{const{value:s}=e;({})[t[0].code]=s,e.isOutOfStock&&this.stockoutCurList.push(s)}),e>1){const e=t[0].values.find(e=>e.value==this.selectedSpecs[t[0].code]),{limitCount:s,value:i}=e;s&&s>=1||t[1].values.forEach(e=>{const s={},{value:o}=e;s[t[0].code]=i,s[t[1].code]=o,e.isOutOfStock&&this.stockoutCurList.push(o)})}},getSkuCodeBySelectedSpecs(t){const e=t||this.selectedSpecs,s=Object.keys(e);return this.productDetail.skuList.find(t=>{if((t.saleAttributes||[]).filter(t=>{if(s.indexOf(t.key)>-1&&("string"==typeof e[t.key]?e[t.key]:JSON.stringify(e[t.key].sort()))==("string"==typeof t.value?t.value:JSON.stringify(t.value.sort())))return!0}).length==s.length)return!0}).skuCode},async GroupQuery(t){const e=await Object(u.i)({data:{skuCode:[t],role:this.myInformation.memberType,shopCode:this.shopCode,orderType:this.orderType}});if(e&&e.data&&e.data.length)return e.data[0].skuAndSubResponseDTOList},async getOverseasPrice(t){const e=await this.GroupQuery(t);let s=0;return e.map(t=>{t.labels.includes("OVERSEAS_PURCHASE")&&(s+=t.originPrice.price*t.childSkuAmount)}),s},async addCart(){if(this.isInvalidBtn)return;if(!this.isLogin)return window.localStorage.setItem("loginBackUrl",this.$route.fullPath),void this.$router.push("/login").then();const{combinedType:t,microNum:e,price:s,skuCode:o,skuList:a,productCode:r,labels:d}=this.productDetail,u=e&&e.availableQuantity;if(this.newDetail.isMicroProduct&&u&&(this.purchases=Math.min(this.purchases,u)),this.newDetail.isOverseaProduct){let e;if("VIRTUAL"==t){const t=await this.getOverseasPrice(this.skuCode);e=this.purchases*t}else e=this.purchases*s.price;if(e>5e3)return void Object(i.a)("海外购商品，单笔不允许超过5000元")}const l=Object(c.b)({skuCode:o,skuList:a,productCode:r,quantity:this.purchases},!0,!0,!0);l&&l.then(t=>{t.success?(this.myInformation.ada!=this.userInfo.ada&&d&&-1!=d.indexOf("EXCLUSIVE_PRICE")?Object(i.a)("当前购货人将以微购专属价加购哦~"):Object(i.a)("加入购物车成功"),setTimeout(()=>{i.a.clear(),this.close()},1e3)):Object(n.D)(t,!1)})},confirm(){this.$emit("confirm",{quantity:this.purchases})},close(){this.$parent.showMultiSelect=!1},onChange(){},inputChange(){},handle(t){const e={},s=t.labels||[];return e.isCombined=s.indexOf("COMBINED_PRODUCT_TYPE")>-1,e}}},p=(s("f1d8"),s("cd23"),s("2877")),h=Object(p.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"multiPop"},[e("van-popup",{staticStyle:{"border-radius":"8px"},attrs:{closeable:"",overlay:!1},on:{close:t.close},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[e("div",{staticClass:"multiContainer"},[e("div",{staticClass:"multiContent"},[t.productDetail.skuCode?[e("div",{staticClass:"content_top"},[e("product-pic",{staticClass:"left",attrs:{"show-min-height":!1,"frame-url":t.productDetail.productFrameUrl,src:t.productDetail.oldGalleryImagesList&&t.productDetail.oldGalleryImagesList.length&&t.productDetail.oldGalleryImagesList[0]["1200Wx1200H"]||""}}),e("div",{staticClass:"right"},[e("div",{staticClass:"priceArea"},[t.newDetail.isVirtualCombined&&t.productDetail.price.combinedPrice?[e("span",{staticClass:"price"},[t._v("组合价"),e("label",[t._v("￥")]),t._v(t._s(t.productDetail.price?t.$priceFixed(t.productDetail.price.combinedPrice):""))]),e("span",{staticClass:"original-price"},[t._v("原价"),e("label",[t._v("￥")]),t._v("3400")])]:e("span",{staticClass:"price"},[e("label",[t._v("￥")]),t._v(t._s(t.productDetail.price?t.$priceFixed(t.productDetail.price.price):""))]),t.newDetail.isOverseaProduct?e("span",{staticClass:"price_tax"},[t._v("进口税预计￥"+t._s(t.productDetail.tax))]):t._e()],2),t.productDetail.newSaleValueResponses.length?e("div",{staticClass:"selectedProduct"},[t._v("已选："+t._s(t.selectedNameDes))]):t._e(),e("div",{staticClass:"selectedProduct"},[t._v("编号："+t._s(t.newDetail.defaultSelected.skuCode))])])],1),e("div",{staticClass:"content_center"},[t.newDetail.isMicroProduct&&t.productDetail.microNum&&t.productDetail.microNum.limitUnit?e("div",{staticClass:"microTip"},[e("span",[t._v(t._s(t.microTip))]),e("i")]):t._e(),e("div",{staticClass:"netContent",domProps:{innerHTML:t._s(t.specification)}}),t._l(t.productDetail.newSaleValueResponses,(function(s,i){return e("div",{key:i},[e("p",{staticClass:"title"},[t._v(t._s(s.name))]),e("div",{staticClass:"selectList"},t._l(s.values,(function(o,a){return e("span",{key:o.value,staticClass:"selectItem",class:{selected:t.selectedSpecs[s.code]&&t.selectedSpecs[s.code]===o.value&&!o.isOutOfStock,stockout:o.isOutOfStock},on:{click:function(e){return t.switchSpecs(i,a,o.isOutOfStock)}}},[o.image?e("img",{attrs:{src:t.$imgDomain+"/"+o.image,alt:""}}):t._e(),t._v(" "+t._s(o.value)+" ")])})),0)])}))],2),e("div",{staticClass:"content_bottom"},[e("label",{staticClass:"txt"},[t._v("数量")]),e("van-stepper",{attrs:{defaultValue:t.defaultValue,integer:"",min:t.stepper.min,max:t.maxCount,"input-width":"35px","button-size":"30px"},on:{change:t.onChange,input:t.inputChange},model:{value:t.purchases,callback:function(e){t.purchases=e},expression:"purchases"}}),t.isLogin?t._e():e("label",{staticClass:"stepper-tip"},[t._v("登录查看还可购买数量")])],1),t.newDetail.isAlmostOutOfStock?e("div",{staticClass:"LOW_STOCK"},[e("i",{staticClass:"iconal icon-xiaoxin-o"}),t._v("库存紧张，欲购从速")]):t._e()]:t._e()],2),e("div",{staticClass:"confirmBtn"},[t.inCart?e("span",{class:{invalid:this.isInvalidBtn},on:{click:t.addCart}},[t._v(t._s(t.btnName))]):e("span",{class:{invalid:this.isInvalidBtn},on:{click:t.confirm}},[t._v(t._s(t.btnName))])])])])],1)}),[],!1,null,"0fd9f354",null);e.default=h.exports},f00b:function(t,e,s){},f1d8:function(t,e,s){"use strict";s("9585")},fcb5:function(t,e,s){"use strict";s.r(e),s("14d9");var i=s("0220"),o=s("696e"),a={data:()=>({productList:[],sortMap:{"销量":"SALE_COUNT","上架时间":"SALE_TIME"}}),props:["skuCodes","productSort","landingType"],components:{good:i.default},mounted(){this.getProductListDetail()},methods:{async getProductListDetail(){const t=[];this.skuCodes.forEach(e=>{t.push(e.skuCode)});const e=await this.getProduct(t),s=this.getPriceArr(e);this.productList=s},async getProduct(t){const e=this.sortMap[this.productSort]||"",{data:{products:{content:s}}}=await Object(o.d)({data:{skuCodes:t,onlySearchable:!1,defaultSku:!1,sortProperty:e,sortType:e?"desc":void 0,pageSize:100,pageNo:1},loading:!0});if(s)return s},getPriceArr:t=>0!==t.length&&(t.map(t=>{let e;e=t.skuCodes.length>1&&t.loadingPriceList&&t.loadingPriceList.length>0?t.loadingPriceList:t.priceList;const s=e.length;t.priceList=e,t.priceAll={},1===s?(t.priceList[0].price&&!t.priceList[0].giftPoint&&(t.priceAll.type=1,t.priceAll.title="",t.priceAll.value="￥"+Number(t.priceList[0].price).toFixed(2)),!t.priceList[0].price&&t.priceList[0].giftPoint&&(t.priceAll.type=1,t.priceAll.title="悦享分",t.priceAll.value=t.priceList[0].giftPoint),t.priceList[0].price&&t.priceList[0].giftPoint&&(t.priceAll.type=1,t.priceAll.title="悦享分+现金",t.priceAll.value=`${t.priceList[0].giftPoint}+￥${Number(t.priceList[0].price).toFixed(2)}`)):0===s?(t.priceAll.type=1,t.priceAll.title="",t.priceAll.value="￥0.00"):t.priceList[0].giftPoint||t.priceList[t.priceList.length-1].giftPoint?(t.priceAll={type:2,single:{title:"悦享分",value:[]},some:{title:"悦享分+现金",value:[]}},t.priceList.map(e=>{!e.price&&e.giftPoint&&t.priceAll.single.value.push(e.giftPoint),e.price&&e.giftPoint&&t.priceAll.some.value.push(`${e.giftPoint}+￥${Number(e.price).toFixed(2)}`)})):(t.priceAll.type=1,t.priceAll.title="",t.priceList[0].price!=t.priceList[t.priceList.length-1].price?t.priceAll.value=`￥${Number(t.priceList[0].price).toFixed(2)}~￥${Number(t.priceList[t.priceList.length-1].price).toFixed(2)}`:t.priceAll.value="￥"+Number(t.priceList[0].price).toFixed(2));const i=t.priceList.findIndex(t=>t.giftPoint>0);t.priceAll.hasGiftPoint=i}),t)}},c=(s("5082"),s("2877")),r=Object(c.a)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"productList"},t._l(t.productList,(function(s,i){return e("good",{key:`${s.skuCode}-${i}`,attrs:{productData:s,landingType:t.landingType}})})),1)}),[],!1,null,"5362ff95",null);e.default=r.exports}}]);