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.
1 line
5.0 KiB
1 line
5.0 KiB
4 years ago
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods"],{"18cb":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=[]},"2f40":function(t,e,o){"use strict";o.r(e);var n=o("354b"),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},"354b":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("524d"),s=function(){o.e("components/Authorize").then(function(){return resolve(o("0a4b"))}.bind(null,o)).catch(o.oe)},i=getApp(),a={components:{authorize:s},data:function(){return{beforeHeaderzIndex:11,afterHeaderzIndex:10,beforeHeaderOpacity:1,afterHeaderOpacity:0,swiperList:[],currentSwiper:0,anchorlist:[],selectAnchor:0,serviceClass:"",specClass:"",shareClass:"",goodsData:"",selectSpec:null,isKeep:!1,descriptionStr:"",desid:"",imageUrl:i.globalData.imgUrl,user:""}},onLoad:function(t){this.desid=t.id,this.user=i.globalData.userInfo,this.getCouponById(),this.showBack=!1,console.log(t.cid)},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:"加载中..."}),t.showLoading({});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.descriptionStr=o.return_data.couponDesc,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){"000000"==e.return_code&&(i.globalData.userInfo=e.return_data.object.highUser,t.setStorage({key:"user",data:e.return_data.object.highUser}),o.buy())}))},buy:function(){var e=this;t.showLoading({title:"正在提交订单..."});var o={highChildOrderList:[{goodsType:1,goodsId:this.goodsData[0].id,saleCount:1}]};(0,n.addOrder)(o).then((function(o){"000000"==o.return_code?(t.hideLoading(),t.redirectTo({url:"../pay/payment/payment?amount="+e.goodsData[0].discountPrice+"&paytype="+e.goodsData[0].payType+"&orderId="+o.return_data.id})):t.showToast({title:o.return_msg,icon:"none"})}))},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="h
|