(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_details/index"],{"5b92":function(t,e,i){"use strict";var o=i("7672"),s=i.n(o);s.a},7672:function(t,e,i){},8418:function(t,e,i){"use strict";i.r(e);var o=i("85fb"),s=i("ed23");for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);i("5b92");var r=i("f0c5"),c=Object(r["a"])(s["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=c.exports},"85fb":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return o}));var o={jyfParser:function(){return Promise.all([i.e("common/vendor"),i.e("components/jyf-parser/jyf-parser")]).then(i.bind(null,"22ab"))}},s=function(){var t=this,e=t.$createElement,i=(t._self._c,1==t.promotions_type?t.limitInfo.discount_price.toString().split("."):null),o=1==t.promotions_type?t.limitInfo.discount_price.toString().split(".").length:null,s=1==t.promotions_type&&o>1?t.limitInfo.discount_price.toString().split("."):null,n=1!=t.promotions_type&&t.activityBg?t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&(1==t.storeInfo.is_vip&&"member"==t.storeInfo.price_type||"level"==t.storeInfo.price_type):null,r=1!=t.promotions_type&&t.activityBg?t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&1==t.storeInfo.is_vip&&"member"==t.storeInfo.price_type&&-1!=t.diyProduct.price_type.indexOf("1"):null,c=1!=t.promotions_type&&t.activityBg?t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&"level"==t.storeInfo.price_type&&-1!=t.diyProduct.price_type.indexOf("2"):null,a=1==t.promotions_type||t.activityBg?null:t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&(1==t.storeInfo.is_vip&&"member"==t.storeInfo.price_type||"level"==t.storeInfo.price_type),u=1==t.promotions_type||t.activityBg?null:t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&1==t.storeInfo.is_vip&&"member"==t.storeInfo.price_type&&-1!=t.diyProduct.price_type.indexOf("1"),d=1==t.promotions_type||t.activityBg?null:t.storeInfo.vip_price&&parseFloat(t.storeInfo.vip_price)>0&&"level"==t.storeInfo.price_type&&-1!=t.diyProduct.price_type.indexOf("2"),l=t.diyProduct.is_name?t.storeInfo.brand_name&&t.storeInfo.brand_name.trim()&&t.diyProduct.is_brand:null,h=t.couponList.length&&t.diyProduct.is_coupon,p=h?t.__map(t.couponList,(function(e,i){var o=t.__get_orig(e),s=i<2&&2==e.coupon_type?parseFloat(e.coupon_price):null;return{$orig:o,m6:s}})):null,f=t.activity.length&&t.diyProduct.is_activity,g=t.discountInfo.discount.length&&t.diyProduct.is_promotions,m=t.attr.productAttr.length&&t.diyProduct.is_sku,_=m?t.skuArr.length>1&&2==t.diyProduct.sku_style:null,v=m&&_?t.skuArr.slice(0,4):null,y=m&&_?t.skuArr.length:null,$=t.storeInfo.specs&&t.storeInfo.specs.length&&t.diyProduct.is_specs,I=$?t.storeInfo.specs.length:null,S=t.storeInfo.ensure&&t.storeInfo.ensure.length&&t.diyProduct.is_ensure,C=t.isMention&&t.storeLen&&t.diyProduct.is_store&&Object.keys(t.storeList).length>0,b=C?parseInt(t.id):null,P=t.discountsData.length&&t.diyProduct.is_discounts,w=t.good_list.length&&t.diyProduct.is_recommend,k=w?t.good_list.length:null,T=w?t.good_list.length:null,x=parseFloat(t.CartCount),A=parseInt(t.id);t._isMounted||(t.e0=function(e){t.H5ShareBox=!1}),t.$mp.data=Object.assign({},{$root:{g0:i,g1:o,g2:s,m0:n,m1:r,m2:c,m3:a,m4:u,m5:d,g3:l,g4:h,l0:p,g5:f,g6:g,g7:m,g8:_,l1:v,g9:y,g10:$,g11:I,g12:S,g13:C,m7:b,g14:P,g15:w,g16:k,g17:T,m8:x,m9:A}})},n=[]},9172:function(t,e,i){"use strict";(function(t,e){var o=i("4ea4");i("59a4");o(i("66fd"));var s=o(i("8418"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(s.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},9400:function(t,e,i){"use strict";(function(t,o){var s=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(i("448a")),r=i("f8b7"),c=i("4818"),a=i("3c98"),u=i("bcf5"),d=i("8e8a"),l=i("26cb"),h=i("5679"),p=(i("328e"),s(i("61e9")),i("865e")),f=i("93b0"),g=s(i("5c3b")),m=t.getSystemInfoSync().statusBarHeight,_=getApp(),v={components:{zbCode:function(){Promise.all([i.e("common/vendor"),i.e("components/zb-code/zb-code")]).then(function(){return resolve(i("d87d"))}.bind(null,i)).catch(i.oe)},productConSwiper:function(){i.e("components/productConSwiper/index").then(function(){return resolve(i("9248"))}.bind(null,i)).catch(i.oe)},couponListWindow:function(){Promise.all([i.e("common/vendor"),i.e("components/couponListWindow/index")]).then(function(){return resolve(i("3274"))}.bind(null,i)).catch(i.oe)},productWindow:function(){Promise.all([i.e("common/vendor"),i.e("components/productWindow/index")]).then(function(){return resolve(i("c8cb"))}.bind(null,i)).catch(i.oe)},userEvaluation:function(){i.e("components/userEvaluation/index").then(function(){return resolve(i("edfa"))}.bind(null,i)).catch(i.oe)},shareRedPackets:function(){i.e("pages/goods_details/components/shareRedPackets/index").then(function(){return resolve(i("1123"))}.bind(null,i)).catch(i.oe)},kefuIcon:function(){i.e("components/kefuIcon/index").then(function(){return resolve(i("c4c6"))}.bind(null,i)).catch(i.oe)},storeLis:function(){Promise.all([i.e("common/vendor"),i.e("components/storeLis/index")]).then(function(){return resolve(i("b2ad"))}.bind(null,i)).catch(i.oe)},discountsList:function(){i.e("pages/goods_details/components/discountsList/index").then(function(){return resolve(i("0d59"))}.bind(null,i)).catch(i.oe)},cusPreviewImg:function(){i.e("components/cusPreviewImg/index").then(function(){return resolve(i("d256"))}.bind(null,i)).catch(i.oe)},ensure:function(){i.e("pages/goods_details/components/ensure/index").then(function(){return resolve(i("2f69"))}.bind(null,i)).catch(i.oe)},specs:function(){i.e("pages/goods_details/components/specs/index").then(function(){return resolve(i("6e9e"))}.bind(null,i)).catch(i.oe)},discount:function(){i.e("pages/goods_details/components/discount/index").then(function(){return resolve(i("655b"))}.bind(null,i)).catch(i.oe)},countDown:function(){i.e("components/countDown/index").then(function(){return resolve(i("8030"))}.bind(null,i)).catch(i.oe)},homeList:function(){i.e("components/homeList/index").then(function(){return resolve(i("0af2"))}.bind(null,i)).catch(i.oe)}},directives:{trigger:{inserted:function(t,e){t.click()}}},mixins:[g.default],data:function(){return{showSkeleton:!0,isNodes:0,coupon:{coupon:!1,type:-1,list:[],count:[]},attrTxt:"请选择",attrValue:"",animated:!1,id:0,replyCount:0,reply:[],storeInfo:{brand_name:""},productValue:[],couponList:[],cart_num:1,isAuto:!1,isShowAuth:!1,isOpen:!1,actionSheetHidden:!0,posterImageStatus:!1,storeImage:"",PromotionCode:"",canvasStatus:!1,posterImage:"",posterbackgd:"/static/images/posterbackgd.png",sharePacket:{isState:!0},uid:0,circular:!1,autoplay:!1,interval:3e3,duration:500,clientHeight:"",systemStore:{},good_list:[],replyChance:0,CartCount:0,isDown:!0,storeSelfMention:!0,posters:!1,weixinStatus:!1,ensureInfo:{show:!1,ensure:[],ensureTitle:""},specsInfo:{show:!1,specs:[]},discountInfo:{show:!1,discount:[]},attr:{cartAttr:!1,productAttr:[],productSelect:{},deliveryType:[],isType:0,relation_id:0,store_self_mention:0},limitInfo:{discount_price:0,price:0,discount:1,datatime:0},promotions_type:0,description:"",navActive:0,H5ShareBox:!1,activity:[],navH:"",navList:[],opacity:0,scrollY:0,topArr:[],height:0,heightArr:[],lock:!1,scrollTop:0,tagStyle:{img:"width:100%;display:block;",table:"width:100%",video:"width:100%"},returnShow:!0,diff:"",is_money_level:1,is_vip:0,navbarRight:0,homeTop:20,routineContact:0,discountsData:[],siteName:"",themeColor:"",fontColor:"",isMention:!1,showAnimate:!0,skuArr:[],codeShow:!1,cid:"1",codeVal:"",size:200,unit:"upx",background:"#FFF",foreground:"#000",pdground:"#000",codeIcon:"",iconsize:40,lv:3,onval:!0,loadMake:!0,base64Show:0,shareQrcode:0,followCode:"",selectSku:{},currentPage:!1,sysHeight:m,isShow:0,storeLen:1,imgHost:p.HTTP_REQUEST_URL,fromType:0,cartNum:0,fromPage:"",diyProduct:{price_type:[]},addressId:"",store_id:"",store_name:"",delivery_type:0,activityBg:"",posterTitle:"",is_store_buy:1,storeList:{}}},computed:(0,l.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){1==t&&(this.getCouponList(),this.getCartCount())},deep:!0},storeInfo:{handler:function(){this.$nextTick((function(){}))},immediate:!0}},onLoad:function(e){var i=this,o=null;try{o=JSON.parse(t.getStorageSync("diyProduct"))}catch(a){}o?this.diyProduct=o:this.getdiyProduct();var s=this,n=getCurrentPages();if(s.returnShow=1!==n.length,s.navH=_.globalData.navHeight,s.id=e.id,s.isShow=e.isShow,s.promotions_type=e.promotions_type||0,s.fromType=e.fromType,s.fromPage=e.fromPage,t.getSystemInfo({success:function(e){s.height=e.windowHeight,s.navbarRight=e.windowWidth-t.getMenuButtonBoundingClientRect().left}}),e.scene){var r=s.$util.getUrlParams(decodeURIComponent(e.scene));r.id&&(e.id=r.id),r.spid&&(_.globalData.spid=r.spid)}if(!e.id)return this.showSkeleton=!1,s.$util.Tips({title:"缺少参数无法查看商品"},{tab:3,url:1});s.id=e.id,s.isLogin&&e.id&&s.downloadFilePromotionCode(),e.spid&&(_.globalData.spid=e.spid),s.getGoodsDetails(),this.colorData();var c=[{themeColor:"#1DB0FC",fontColor:"#FD502F"},{themeColor:"#42CA4D",fontColor:"#FF7600"},{themeColor:"#e93323",fontColor:"#e93323"},{themeColor:"#FF448F",fontColor:"#FF448F"},{themeColor:"#FE5C2D",fontColor:"#FE5C2D"},{themeColor:"#E0A558",fontColor:"#DA8C18"}];setTimeout((function(){switch(i.colorNum){case 1:i.themeColor=c[0].themeColor,i.fontColor=c[0].fontColor;break;case 2:i.themeColor=c[1].themeColor,i.fontColor=c[1].fontColor;break;case 3:i.themeColor=c[2].themeColor,i.fontColor=c[2].fontColor;break;case 4:i.themeColor=c[3].themeColor,i.fontColor=c[3].fontColor;break;case 5:i.themeColor=c[4].themeColor,i.fontColor=c[4].fontColor;break;case 6:i.themeColor=c[5].themeColor,i.fontColor=c[5].fontColor;break;default:i.themeColor=c[2].themeColor,i.fontColor=c[2].fontColor;break}}),1)},onReady:function(){this.isNodes++,this.$nextTick((function(){var e=this,i=t.getMenuButtonBoundingClientRect(),o=t.createSelectorQuery().in(this);o.select("#home").boundingClientRect((function(t){e.homeTop=2*i.top+i.height-t.height})).exec()}))},onShow:function(){t.removeStorageSync("form_type_cart")},mounted:function(){var e=this;t.$on("activeFn",(function(t){var i=t.id;e.store_id=i,e.$refs.productWindow.getList(i)}))},onShareAppMessage:function(){return this.$set(this,"actionSheetHidden",!this.actionSheetHidden),(0,c.userShare)(),{title:this.storeInfo.store_name||"",imageUrl:this.storeInfo.image||"",path:"/pages/goods_details/index?id="+this.id+"&spid="+this.uid}},onShareTimeline:function(){return this.$set(this,"actionSheetHidden",!this.actionSheetHidden),(0,c.userShare)(),{title:this.storeInfo.store_name||"",imageUrl:this.storeInfo.image||"",path:"/pages/goods_details/index?id="+this.id+"&spid="+this.uid}},methods:{changeLogin:function(){this.getIsLogin()},getIsLogin:function(){(0,d.toLogin)()},getdiyProduct:function(){var e=this;(0,r.diyProduct)().then((function(i){e.diyProduct=i.data.product_detail,t.setStorageSync("diyProduct",JSON.stringify(i.data.product_detail))}))},deliveryFun:function(t){this.delivery_type=t},onAddressId:function(t){this.addressId=t.id},getStoreDetail:function(t,e){var i=this;(0,r.getProductStoreDetail)(e||this.id,{store_id:t}).then((function(t){var e=t.data.storeInfo;i.$set(i,"storeInfo",e),i.$set(i,"productValue",t.data.productValue),i.DefaultSelect()})).catch((function(t){return i.$util.Tips({title:t})}))},onstoreId:function(t,e){this.storeList=t,this.fromPage?(this.store_id=t.id,this.store_name=t.name):2==e||3==e?(this.store_id=t.id,this.store_name=t.name,this.getStoreDetail(t.id)):this.getStoreDetail(0,this.storeInfo.pid)},getStoreList:function(t){this.storeLen=t},seeEnsure:function(){this.ensureInfo.show=!0},seeSpecs:function(){this.specsInfo.show=!0},seeDiscount:function(){this.discountInfo.show=!0},moreNav:function(){this.currentPage=!this.currentPage},showImg:function(t){this.$refs.cusPreviewImg.open(this.selectSku.suk)},changeSwitch:function(t){var e=this,i=this.skuArr[t];this.$set(this,"selectSku",i);var o=i.suk.split(",");o.forEach((function(t,i){e.$set(e.attr.productAttr[i],"index",o[i])})),i&&(this.$set(this.attr.productSelect,"image",i.image),this.$set(this.attr.productSelect,"price",i.price),this.$set(this.attr.productSelect,"stock",i.stock),this.$set(this.attr.productSelect,"unique",i.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",i.vip_price),this.$set(this,"attrValue",i.suk),this.$set(this,"attrTxt","已选择"))},qrR:function(t){},boxStatus:function(t){this.showAnimate=t},followWX:function(){var t=this;(0,r.getProductCode)(this.id).then((function(e){t.followCode=e.data.code,t.getImageBase64(1)})).catch((function(e){t.$util.Tips({title:e})}))},getpreviewImage:function(){if(this.posterImage){var e=[];e.push(this.posterImage),t.previewImage({urls:e,current:this.posterImage})}else this.$util.Tips({title:"您的海报尚未生成"})},showStoreList:function(){t.navigateTo({url:"/pages/store/store_list/index?productId="+this.id+"&type=1&isCollage=1"})},videoPause:function(){this.$nextTick((function(){that.infoScroll()}))},closeChange:function(){this.$set(this.sharePacket,"isState",!0)},goActivity:function(e){var i=e;"1"===i.type?t.navigateTo({url:"/pages/activity/goods_seckill_details/index?id=".concat(i.id,"&time=").concat(i.time,"&status=1")}):"2"===i.type?t.navigateTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(i.id,"&spid=").concat(this.uid)}):t.navigateTo({url:"/pages/activity/goods_combination_details/index?id=".concat(i.id)})},iptCartNum:function(t){this.$set(this.attr.productSelect,"cart_num",t)},returns:function(){if(this.isShow)t.reLaunch({url:"/pages/index/index"});else if(this.fromType){var e={id:this.id,cartNum:this.cartNum},i=getCurrentPages(),o=i[i.length-2];if(i.length>1)return o.$vm.otherFun(e),t.navigateBack();this.backTap()}else this.backTap()},backTap:function(){return t.navigateBack({delta:1})},tap:function(t){this.$set(this,"navActive",t),this.$set(this,"lock",!0),this.$set(this,"scrollTop",t>0?this.topArr[t]-_.globalData.navHeight/2:this.topArr[t])},scroll:function(t){var e=t.detail.scrollTop,i=e/200;i=i>1?1:i;var o=!(e>0);if(this.$set(this,"opacity",i),this.$set(this,"scrollY",e),this.$set(this,"showAnimate",o),this.$set(this,"currentPage",!1),this.lock)this.$set(this,"lock",!1);else for(var s=0;si&&(this.$set(this.attr.productSelect,"cart_num",i||1),this.$set(this,"cart_num",i||1))):(o.cart_num--,o.cart_num<1&&(this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"cart_num",1)))}},attrVal:function(t){this.$set(this.attr.productAttr[t.indexw],"index",this.attr.productAttr[t.indexw].attr_values[t.indexn])},ChangeAttr:function(t){var e=this.productValue[t];this.$set(this,"selectSku",e),e&&e.stock>=0?(this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.price),this.$set(this.attr.productSelect,"stock",e.stock),this.$set(this.attr.productSelect,"unique",e.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",e.vip_price),this.$set(this,"attrValue",t),this.$set(this,"attrTxt","已选择")):(this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this.attr.productSelect,"vip_price",this.storeInfo.vip_price),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择"))},ChangCoupons:function(t){var e=t,i=this.$util.ArrayRemove(this.couponList,"id",e.id);this.$set(this,"couponList",i),this.getCouponList()},setClientHeight:function(){var e=this;if(e.good_list.length){var i=t.createSelectorQuery().in(this).select("#list0");i.fields({size:!0},(function(t){e.$set(e,"clientHeight",t.height+20),e.$nextTick((function(){e.infoScroll()}))})).exec()}},getGoodsList:function(){var t=this,e=this;(0,r.getProductRecommend)(e.id).then((function(i){for(var o=i.data||[],s=Math.ceil(o.length/6),n=new Array,r=0;r0){e=this.attr.productAttr.length?o.split(","):[];break}i=!e.length&&this.attr.productAttr.length?Object.keys(this.productValue)[0].split(","):e;for(var s=0;s-1?t:t.replace("http://","https://")},downloadFilestoreImage:function(){var e=this;t.downloadFile({url:e.setDomain(e.storeInfo.image),success:function(t){e.storeImage=t.tempFilePath,e.base64Show=1},fail:function(){return e.$util.Tips({title:""})}})},downloadFilePromotionCode:function(e){var i=this;(0,r.getProductCode)(i.id).then((function(o){t.downloadFile({url:i.setDomain(o.data.code),success:function(t){i.$set(i,"isDown",!1),"function"==typeof e?e&&e(t.tempFilePath):i.$set(i,"PromotionCode",t.tempFilePath)},fail:function(){i.$set(i,"isDown",!1),i.$set(i,"PromotionCode","")}})})).catch((function(t){i.$set(i,"isDown",!1),i.$set(i,"PromotionCode","")}))},getImageBase64:function(t){var e=this;(0,h.imageBase64)(e.storeImage,e.followCode).then((function(i){e.storeImage=i.data.image,t&&(e.PromotionCode=i.data.code),e.base64Show=1})).catch((function(){}))},goPoster:function(){var e=this;e.$set(e,"canvasStatus",!0);var i=[e.posterbackgd,e.storeImage,e.PromotionCode];return""!=e.PromotionCode||e.isDown?e.isDown?e.$util.Tips({title:"正在下载海报,请稍后再试!"},(function(){e.posters=!1})):void t.getImageInfo({src:e.PromotionCode,fail:function(t){return e.$util.Tips({title:"小程序二维码需要发布正式版后才能获取到"})},success:function(){""==i[2]?e.downloadFilePromotionCode((function(t){if(i[2]=t,""==i[2])return e.$util.Tips({title:"海报二维码生成失败!"});e.$nextTick((function(){e.$util.PosterCanvas(e.fontColor,e.themeColor,e.siteName,i,e.storeInfo.store_name,e.storeInfo.price,e.storeInfo.ot_price,e.posterTitle,(function(t){e.$set(e,"posterImage",t),e.$set(e,"posterImageStatus",!0),e.$set(e,"canvasStatus",!1),e.$set(e,"actionSheetHidden",!e.actionSheetHidden)}))}))})):e.$nextTick((function(){e.$util.PosterCanvas(e.fontColor,e.themeColor,e.siteName,i,e.storeInfo.store_name,e.storeInfo.price,e.storeInfo.ot_price,e.posterTitle,(function(t){e.$set(e,"posterImage",t),e.$set(e,"posterImageStatus",!0),e.$set(e,"canvasStatus",!1),e.$set(e,"actionSheetHidden",!e.actionSheetHidden)}))}))}}):e.$util.Tips({title:"小程序二维码需要发布正式版后才能获取到"},(function(){e.posters=!1}))},copyCommand:function(){o.navigateToMiniProgram&&o.navigateToMiniProgram({appId:"wxb036cafe2994d7d0",path:"/publish/ugc-publish/ugc-publish",extraData:{productInfo:{title:this.storeInfo.store_name,path:"/pages/goods_details/index?id="+this.storeInfo.id,thumbUrl:this.storeInfo.image}}})},savePosterPath:function(){var e=this;t.getSetting({success:function(i){i.authSetting["scope.writePhotosAlbum"]?t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:"保存成功",icon:"success"})},fail:function(t){e.$util.Tips({title:"保存失败"})}}):t.authorize({scope:"scope.writePhotosAlbum",success:function(){t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:"保存成功",icon:"success"})},fail:function(t){e.$util.Tips({title:"保存失败"})}})}})}})},tabCouponType:function(t){this.$set(this.coupon,"type",t),this.getCouponList(t)},goDiscounts:function(){t.navigateTo({url:"/pages/goods_details/discountsGoodsList?id="+this.id})}}};e.default=v}).call(this,i("543d")["default"],i("bc2e")["default"])},ed23:function(t,e,i){"use strict";i.r(e);var o=i("9400"),s=i.n(o);for(var n in o)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(n);e["default"]=s.a}},[["9172","common/runtime","common/vendor"]]]);