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 lines
4.7 KiB
1 lines
4.7 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods"],{4096:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement;t._self._c},s=[]},"624a":function(t,e,n){},"64ed":function(t,e,n){"use strict";var o=n("624a"),i=n.n(o);i.a},"74df":function(t,e,n){"use strict";n.r(e);var o=n("4096"),i=n("84da");for(var s in i)"default"!==s&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("64ed");var a,c=n("f0c5"),r=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=r.exports},"84da":function(t,e,n){"use strict";n.r(e);var o=n("f0db"),i=n.n(o);for(var s in o)"default"!==s&&function(t){n.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a},bfec:function(t,e,n){"use strict";(function(t){n("eba6");o(n("66fd"));var e=o(n("74df"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},f0db:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("b528"),i=getApp(),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()},onReady:function(){},onPageScroll:function(t){},onReachBottom:function(){},mounted:function(){},methods:{getCouponById:function(){var e=this;t.showLoading({title:"加载中..."});var n={couponId:this.desid};(0,o.getCouponById)(n).then((function(n){"000000"==n.return_code?(e.goodsData=[n.return_data],e.swiperList=n.return_data.couponCarouselImg.split(","),e.couponDesc=n.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(n){if(n.code){n.code;t.getUserInfo({success:function(n){var s={openId:i.globalData.openId,iv:n.iv,encryptedData:n.encryptedData};(0,o.getUserInfo)(s).then((function(n){"000000"==n.return_code?(t.hideLoading(),i.globalData.userInfo=n.return_data.object.highUser,i.globalData.token=n.return_data.uniqueCode,t.setStorage({key:"user",data:n.return_data.object.highUser}),t.setStorage({key:"token",data:n.return_data.uniqueCode}),e.buy()):(t.hideLoading(),t.showToast({title:n.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 n=t.createSelectorQuery().select("#comments");n.boundingClientRect((function(n){var o=0,i=t.upx2px(100);e.anchorlist[1].top=n.top-i-o,e.anchorlist[2].top=n.bottom-i-o})).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=s}).call(this,n("543d")["default"])}},[["bfec","common/runtime","common/vendor"]]]); |