(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_details/index"],{"0c5c":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return r})),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,"a04c"))}},s=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__get_style([t.navBarStyle])),o=t.__get_style([t.menuButtonStyle]),s=t.__get_style([t.shareButtonStyle]),r=t.storeInfo.spec_type?t.skuArr.length:null,n=t.diyProduct.isOpen.includes(0),c=t.diyProduct.isOpen.includes(2),a=t.diyProduct.isOpen.includes(1),u=t.storeInfo.store_label&&t.storeInfo.store_label.length,d=t.storeInfo.rank>0&&t.diyProduct.showRank?t._f("rankType")(t.storeInfo.rank_type):null,l=t.activity.length&&t.diyProduct.showService.includes(0),h=t.attr.productAttr.length&&t.diyProduct.showService.includes(1),p=t.storeInfo.ensure&&t.storeInfo.ensure.length&&t.diyProduct.showService.includes(2),f=t.storeInfo.specs&&t.storeInfo.specs.length&&t.diyProduct.showService.includes(3),g=t.isMention&&Object.keys(t.storeList).length&&t.diyProduct.showService.includes(4),m=t.discountsData.length&&t.diyProduct.showMatch,v=m?t.discountsData.length:null,y=t.good_list.length&&t.diyProduct.showRecommend,_=y?t.good_list.length:null,$=t.diyProduct.menuList.includes(3),I=t.diyProduct.menuList.includes(4),S=t.diyProduct.menuList.includes(0)&&t.routineContact,C=S?null:t.diyProduct.menuList.includes(0)&&!t.routineContact,w=t.diyProduct.menuList.includes(1),b=t.diyProduct.menuList.includes(2),P=b?parseFloat(t.CartCount):null;t._isMounted||(t.e0=function(){t.showServiceDrawer=!0},t.e1=function(){t.showServiceDrawer=!1},t.e2=function(){t.showPerferentDrawer=!1},t.e3=function(e){t.H5ShareBox=!1}),t.$mp.data=Object.assign({},{$root:{s0:i,s1:o,s2:s,g0:r,g1:n,g2:c,g3:a,g4:u,f0:d,g5:l,g6:h,g7:p,g8:f,g9:g,g10:m,g11:v,g12:y,g13:_,g14:$,g15:I,g16:S,g17:C,g18:w,g19:b,m0:P}})},r=[]},"10c2":function(t,e,i){"use strict";(function(t,e){var o=i("47a9");i("7561");o(i("3240"));var s=o(i("3fbf"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"3fbf":function(t,e,i){"use strict";i.r(e);var o=i("0c5c"),s=i("5f97");for(var r in s)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(r);i("bbc8");var n=i("828b"),c=Object(n["a"])(s["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=c.exports},"5f97":function(t,e,i){"use strict";i.r(e);var o=i("eae2"),s=i.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(r);e["default"]=s.a},"71a8":function(t,e,i){},bbc8:function(t,e,i){"use strict";var o=i("71a8"),s=i.n(o);s.a},eae2:function(t,e,i){"use strict";(function(t,o){var s=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(i("7ca3")),n=i("ce7e"),c=i("77d7"),a=(i("a230"),i("152a")),u=i("7ba4"),d=i("8f59"),l=i("6975"),h=(i("d83b"),i("bad7")),p=i("b135"),f=s(i("cef6"));function g(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function m(t){for(var e=1;e0&&1==this.storeInfo.is_vip&&"member"==this.storeInfo.price_type)return!0},computedPayPrice:function(){return this.computedPrice.deduction.pay_price},navBarStyle:function(){return{background:this.pageScrollStatus?"#fff":"transparent",paddingTop:2*this.sysHeight+"rpx"}},shareButtonStyle:function(){var t=o.getMenuButtonBoundingClientRect();return{width:t.height+"px",height:t.height+"px",top:t.top+"px",left:t.left-38+"px"}},menuButtonStyle:function(){var t=o.getMenuButtonBoundingClientRect();return{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:"11px",borderRadius:t.height+"px"}}}),watch:{isLogin:{handler:function(t,e){1==t&&this.getCartCount()},deep:!0}},onLoad:function(t){var e=getCurrentPages();if(this.returnShow=1!==e.length,this.id=t.id,this.isShow=t.isShow,this.promotions_type=t.promotions_type||0,this.fromType=t.fromType,t.scene){var i=this.$util.getUrlParams(decodeURIComponent(t.scene));i.id&&(t.id=i.id),i.spid&&(y.globalData.spid=i.spid)}if(!t.id)return this.showSkeleton=!1,this.$util.Tips({title:"缺少参数无法查看商品"},{tab:3,url:1});this.id=t.id,this.isLogin&&t.id&&this.downloadFilePromotionCode(),t.spid&&(y.globalData.spid=t.spid),this.getGoodsDetails(),this.colorData()},onReady:function(){this.isNodes++},onShow:function(){t.removeStorageSync("form_type_cart"),this.storeLists&&(this.storeList=this.storeLists,this.storeLists=null)},mounted:function(){var e=this;t.$off("activeFn"),t.$on("activeFn",(function(t){t&&(e.storeLists=t,e.storeId=t.id)}))},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:{deliveryFun:function(t){this.delivery_type=t},onAddressId:function(t){this.addressId=t.id},getStoreDetail:function(t,e){var i=this;(0,n.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,2==e||3==e?(this.store_id=t.id,this.storeId=t.id,this.store_name=t.name,this.getStoreDetail(t.id)):(this.store_id="",this.store_name="",this.getStoreDetail(0,this.storeInfo.pid))},showStoreList:function(){var e=this.storeInfo.pid?this.storeInfo.pid:this.storeInfo.id;t.navigateTo({url:"/pages/store/list/index?type=1&isCollage=1&storeId="+this.storeList.id+"&product_id="+e})},changeLogin:function(){(0,u.toLogin)()},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,n.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:"您的海报尚未生成"})},videoPause:function(){},closeChange:function(){this.$set(this.sharePacket,"isState",!0)},goActivity:function(e){var i=e;1==i.type?t.navigateTo({url:"/pages/activity/goods_details/index?id=".concat(i.id,"&type=1&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_details/index?id=".concat(i.id,"&type=3")})},iptCartNum:function(t){this.$set(this.attr.productSelect,"cart_num",t)},backTap:function(){var e={id:this.id,cartNum:this.cartNum},i=getCurrentPages(),o=i[i.length-2];i.length>1?(this.fromType&&o.$vm.otherFun(e),t.navigateBack()):t.switchTab({url:"/pages/index/index"})},goDetail:function(e){0!=e.activity.length?e.activity&&2==e.activity.type?t.redirectTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(e.activity.id,"&spid=").concat(this.uid)}):e.activity&&3==e.activity.type?t.redirectTo({url:"/pages/activity/goods_details/index?id=".concat(e.activity.id,"&type=3")}):e.activity&&1==e.activity.type&&t.redirectTo({url:"/pages/activity/goods_details/index?id=".concat(e.activity.id,"&type=1&time=").concat(e.activity.time,"&status=1")}):t.redirectTo({url:"/pages/goods_details/index?id="+e.id})},getUserInfo:function(){var t=this;(0,c.getUserInfo)().then((function(e){t.$set(t.sharePacket,"isState",0==t.sharePacket.priceName),t.$set(t,"uid",e.data.uid),t.$set(t,"is_money_level",e.data.is_money_level),t.userInfo=e.data}))},ChangeCartNum:function(t){var e=this.productValue[this.attrValue];if(void 0!==e||this.attr.productAttr.length||(e=this.attr.productSelect),void 0!==e){var i=e.stock||0,o=this.attr.productSelect;t?(o.cart_num++,o.cart_num>i&&(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)))}},selectSwiper:function(){this.isSwiper=!0,this.$set(this,"productSwiper",this.storeInfo.slider_image),this.$set(this,"productVideoLink",this.storeInfo.video_link)},changeAttrPic:function(t,e){this.isSwiper=!1,this.ChangeAttr(t.suk),this.changeSwitch(e),this.$set(this,"productVideoLink",""),this.$set(this,"productSwiper",[t.image])},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,"delivery_price",e.delivery_price),this.$set(this.computedPrice.deduction,"pay_price",e.delivery_price),this.$set(this.computedPrice.deduction,"sum_price",e.price),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,"delivery_price",this.storeInfo.price),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","请选择"))},getGoodsList:function(){var t=this,e=this;(0,n.getProductRecommend)(e.id).then((function(t){e.good_list=t.data||[]})).catch((function(e){return t.$util.Tips({title:e})}))},getGoodsCtivity:function(){var t=this,e=this;(0,n.getProductCtivity)(e.id,{promotions_type:this.promotions_type}).then((function(i){e.$set(e,"activityBg",i.data.activity_background.image||""),e.$set(e,"activity",i.data.activity?i.data.activity:[]),e.$set(e,"discountsData",i.data.discounts_products?i.data.discounts_products:[]);var o=i.data.promotions[0];if(e.$set(e,"promotions_type",i.data.promotions.length?o.promotions_type:0),i.data.promotions.length&&1==o.promotions_type){var s=e.$util.$h.Div(o.discount,100),r=e.$util.$h.Mul(s,t.storeInfo.price);e.$set(e.limitInfo,"price",t.storeInfo.price||0),e.$set(e.limitInfo,"datatime",o.stop_time||0),e.$set(e.limitInfo,"discount",s),e.$set(e.limitInfo,"discount_price",r)}e.$set(e.discountInfo,"discount",i.data.promotions),i.data.coupons.map((function(e){t.$set(e,"ruleshow",!1)})),e.$set(e.coupon,"list",i.data.coupons),e.$set(e,"computedPrice",i.data.computed)})).catch((function(e){return t.$util.Tips({title:e})}))},getGoodsDetails:function(){var e=this,i=this;(0,n.getProductDetail)(i.id,{promotions_type:this.promotions_type}).then((function(o){var s=o.data.storeInfo;1==s.type?-1!=s.delivery_type.indexOf("1")&&(s.delivery_type.sort((function(t,e){return t-e})),s.delivery_type.push(s.delivery_type.shift())):s.delivery_type.sort((function(t,e){return t-e})),i.$set(i.attr,"deliveryType",s.delivery_type),-1!=o.data.storeInfo.delivery_type.indexOf("2")&&i.$set(i,"isMention",!0),i.$set(i,"is_store_buy",o.data.is_store_buy||0),i.$set(i,"storeInfo",s),i.$set(i.attr,"isType",o.data.storeInfo.type),i.$set(i.attr,"relation_id",o.data.storeInfo.relation_id),i.$set(i,"productSwiper",s.slider_image),i.$set(i,"productVideoLink",s.video_link),i.$set(i.ensureInfo,"ensure",s.ensure);var r=[],n=[];for(var c in s.ensure.forEach((function(t){r.push(t.name)})),s.specs.forEach((function(t){n.push(t.name)})),i.$set(i.ensureInfo,"ensureTitle",r.join(" · ")),i.$set(i.specsInfo,"specsTitle",n.join(" · ")),i.$set(i.specsInfo,"specs",s.specs),i.$set(i,"description",s.description),e.description&&(e.description=e.description.replace(/0){i=this.attr.productAttr.length?s.split(","):[];break}o=!i.length&&this.attr.productAttr.length?Object.keys(this.productValue)[0].split(","):i;for(var r=0;r-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,n.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,l.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(){setTimeout((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)}))}),1e3)}))})):e.$nextTick((function(){setTimeout((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)}))}),1e3)}))}}):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:"保存失败"})}})}})}})},goDiscounts:function(){t.navigateTo({url:"/pages/goods_details/discountsGoodsList?id="+this.id})},goPage:function(e,i){1==e?t.navigateTo({url:i}):2==e?t.switchTab({url:i}):3==e&&t.navigateBack()},ChangCouponsUseState:function(t){this.coupon.list[t].is_use=!0,this.$set(this.coupon,"list",this.coupon.list),this.$set(this.coupon,"coupon",!1)},ChangCoupons:function(t){},ruleToggle:function(t){this.coupon.list[t].ruleshow=!this.coupon.list[t].ruleshow},goGoodCall:function(){var t={};t="string"===typeof this.userInfo?JSON.parse(this.userInfo):this.userInfo;var e="/pages/extension/customer_list/chat?productId=".concat(this.id),i={store_name:this.storeInfo.store_name,path:"/pages/goods_details/index?id=".concat(this.storeInfo.id),image:this.storeInfo.image};this.$util.getCustomer(t,e,i,1)},colorData:function(){var t=this,e=[{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(t.colorNum){case 1:t.themeColor=e[0].themeColor,t.fontColor=e[0].fontColor;break;case 2:t.themeColor=e[1].themeColor,t.fontColor=e[1].fontColor;break;case 3:t.themeColor=e[2].themeColor,t.fontColor=e[2].fontColor;break;case 4:t.themeColor=e[3].themeColor,t.fontColor=e[3].fontColor;break;case 5:t.themeColor=e[4].themeColor,t.fontColor=e[4].fontColor;break;case 6:t.themeColor=e[5].themeColor,t.fontColor=e[5].fontColor;break;default:t.themeColor=e[2].themeColor,t.fontColor=e[2].fontColor;break}}),1)}},onPageScroll:function(e){this.$set(this,"currentPage",!1),e.scrollTop>340?this.pageScrollStatus=!0:e.scrollTop<340&&(this.pageScrollStatus=!1),t.$emit("scroll")}};e.default=_}).call(this,i("df3c")["default"],i("3223")["default"])}},[["10c2","common/runtime","common/vendor"]]]);