(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods"],{"6b0c":function(t,e,o){"use strict";var n=o("df7b"),s=o.n(n);s.a},"7c35":function(t,e,o){"use strict";o.r(e);var n=o("ab20"),s=o("b3d6");for(var i in s)"default"!==i&&function(t){o.d(e,t,(function(){return s[t]}))}(i);o("6b0c");var a,c=o("f0c5"),r=Object(c["a"])(s["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],a);e["default"]=r.exports},ab20:function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return s})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return n}));var s=function(){var t=this,e=t.$createElement;t._self._c},i=[]},aea1:function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("53e0"),s=getApp(),i={data:function(){return{beforeHeaderzIndex:11,afterHeaderzIndex:10,beforeHeaderOpacity:1,afterHeaderOpacity:0,swiperList:[],couponDesc:[],currentSwiper:0,anchorlist:[],selectAnchor:0,serviceClass:"",specClass:"",shareClass:"",goodsData:"",selectSpec:null,isKeep:!1,desid:"",imageUrl:s.globalData.imgUrl,user:""}},onLoad:function(t){this.desid=t.id,this.user=s.globalData.userInfo,this.getCouponById(),this.showBack=!1},onReady:function(){this.calcAnchor()},onPageScroll:function(t){this.selectAnchor=t.scrollTop>=this.anchorlist[2].top?2:t.scrollTop>=this.anchorlist[1].top?1:0;var e=375;t.scrollTop=t.scrollTop>e?375:t.scrollTop,this.afterHeaderOpacity=t.scrollTop*(1/e),this.beforeHeaderOpacity=1-this.afterHeaderOpacity,this.beforeHeaderzIndex=t.scrollTop>0?10:11,this.afterHeaderzIndex=t.scrollTop>0?11:10},onReachBottom:function(){},mounted:function(){},methods:{getCouponById:function(){var e=this;t.showLoading({title:"加载中..."});var o={couponId:this.desid};(0,n.getCouponById)(o).then((function(o){"000000"==o.return_code?(e.goodsData=[o.return_data],e.swiperList=o.return_data.couponCarouselImg.split(","),e.couponDesc=o.return_data.couponDesc.split(","),t.hideLoading()):t.hideLoading()}))},jumpstore:function(){t.navigateTo({url:"./store-list/store-list?id="+this.desid})},swiperChange:function(t){this.currentSwiper=t.detail.current},toMsg:function(){t.navigateTo({url:"../msg/msg"})},toChat:function(){},share:function(){this.shareClass="show"},hideShare:function(){var t=this;this.shareClass="hide",setTimeout((function(){t.shareClass="none"}),150)},keep:function(){this.isKeep=!this.isKeep},joinCart:function(){if(null==this.selectSpec)return this.showSpec((function(){t.showToast({title:"已加入购物车"})}));t.showToast({title:"已加入购物车"})},getuserinfo:function(){t.showLoading({title:"提交中..."});var e=this;wx.login({success:function(o){if(o.code){o.code;t.getUserInfo({success:function(o){var i={openId:s.globalData.openId,iv:o.iv,encryptedData:o.encryptedData};(0,n.getUserInfo)(i).then((function(o){"000000"==o.return_code?(t.hideLoading(),s.globalData.userInfo=o.return_data.object.highUser,s.globalData.token=o.return_data.uniqueCode,t.setStorage({key:"user",data:o.return_data.object.highUser}),t.setStorage({key:"token",data:o.return_data.uniqueCode}),e.buy()):(t.hideLoading(),t.showToast({title:o.return_msg,icon:"none",duration:2e3}))}))},fail:function(e){t.hideLoading(),t.showToast({title:"微信登录授权失败",icon:"none"})}})}},fail:function(e){t.hideLoading()}})},buy:function(){var e=this;e.goodsData[0].stockCount?t.showToast({title:"提交订单...",icon:"none",duration:2e3,success:function(){t.navigateTo({url:"../order/confirmation?id="+e.goodsData[0].id})}}):t.showToast({title:"卡券数量不足",icon:"none",duration:2e3})},toRatings:function(){t.navigateTo({url:"ratings/ratings"})},showComments:function(t){},setSelectSpec:function(t){this.selectSpec=t},sub:function(){this.goodsData.number<=1||this.goodsData.number--},add:function(){this.goodsData.number++},toAnchor:function(e){this.selectAnchor=e,t.pageScrollTo({scrollTop:this.anchorlist[e].top,duration:200})},calcAnchor:function(){var e=this;this.anchorlist=[{name:"主图",top:0},{name:"评价",top:0},{name:"详情",top:0}];var o=t.createSelectorQuery().select("#comments");o.boundingClientRect((function(o){var n=0,s=t.upx2px(100);e.anchorlist[1].top=o.top-s-n,e.anchorlist[2].top=o.bottom-s-n})).exec()},back:function(){t.navigateBack()},showService:function(){console.log("show"),this.serviceClass="show"},hideService:function(){var t=this;this.serviceClass="hide",setTimeout((function(){t.serviceClass="none"}),200)},showSpec:function(t){console.log("show"),this.specClass="show",this.specCallback=t},specCallback:function(){},hideSpec:function(){var t=this;this.specClass="hide",this.selectSpec&&this.specCallback&&this.specCallback(),this.specCallback=!1,setTimeout((function(){t.specClass="none"}),200)},discard:function(){}}};e.default=i}).call(this,o("543d")["default"])},b3d6:function(t,e,o){"use strict";o.r(e);var n=o("aea1"),s=o.n(n);for(var i in n)"default"!==i&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=s.a},df7b:function(t,e,o){},e456:function(t,e,o){"use strict";(function(t){o("e5b1");n(o("66fd"));var e=n(o("7c35"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])}},[["e456","common/runtime","common/vendor"]]]);