You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
high-mini/unpackage/dist/build/mp-weixin/pages/goods/goods.js

1 lines
5.0 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods"],{"624a":function(t,e,o){},"64ed":function(t,e,o){"use strict";var n=o("624a"),s=o.n(n);s.a},"74df":function(t,e,o){"use strict";o.r(e);var n=o("c7cd"),s=o("84da");for(var i in s)"default"!==i&&function(t){o.d(e,t,(function(){return s[t]}))}(i);o("64ed");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},"84da":function(t,e,o){"use strict";o.r(e);var n=o("f0db"),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},bfec:function(t,e,o){"use strict";(function(t){o("eba6");n(o("66fd"));var e=n(o("74df"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},c7cd: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=[]},f0db:function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("b528"),s=function(){o.e("components/Authorize").then(function(){return resolve(o("4bac"))}.bind(null,o)).catch(o.oe)},i=getApp(),a={components:{authorize:s},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:i.globalData.imgUrl,user:""}},onLoad:function(t){this.desid=t.id,this.user=i.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:"已加入购物车"})},getPhoneNumber:function(e){var o=this,s={openId:i.globalData.openId,iv:e.detail.iv,encryptedData:e.detail.encryptedData};(0,n.GetPhoneNumber)(s).then((function(e){if("000000"==e.return_code){i.globalData.userInfo=e.return_data.object.highUser,t.setStorage({key:"user",data:e.return_data.object.highUser});var n=o;n.goodsData[0].stockCount?t.showToast({title:"提交订单...",icon:"none",duration:2e3,success:function(){t.navigateTo({url:"../order/confirmation?id="+n.goodsData[0].id})}}):t.showToast({title:"卡券数量不足",icon:"none",duration:2e3})}}))},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=a}).call(this,o("543d")["default"])}},[["bfec","common/runtime","common/vendor"]]]);