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
8.2 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/activity/GroupDetails/index"],{"077f":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r("70e6"),i=r("2df4"),s=r("83c1"),n=r("aa63"),a=function(){r.e("components/ProductConSwiper").then(function(){return resolve(r("a7e0"))}.bind(null,r)).catch(r.oe)},c=function(){r.e("components/CountDown").then(function(){return resolve(r("fdd5"))}.bind(null,r)).catch(r.oe)},u=function(){r.e("components/UserEvaluation").then(function(){return resolve(r("bb09"))}.bind(null,r)).catch(r.oe)},l=function(){r.e("components/ProductWindow").then(function(){return resolve(r("9157"))}.bind(null,r)).catch(r.oe)},h=function(){r.e("components/StorePoster").then(function(){return resolve(r("cd35"))}.bind(null,r)).catch(r.oe)},d="GroupDetails",p={name:"GroupDetails",components:{ProductConSwiper:a,CountDown:c,UserEvaluation:u,ProductWindow:l,StorePoster:h},props:{},data:function(){return{domStatus:!1,posterData:{image:"",title:"",price:"",code:""},posterImageStatus:!1,reply:[],replyCount:0,replyChance:0,imgUrls:[],storeInfo:{},itemNew:{},groupListCount:2,groupList:{},attrTxt:"请选择",productValue:[],attrValue:"",swiperTip:{direction:"vertical",autoplay:{disableOnInteraction:!1,delay:2e3},loop:!0,speed:1e3,observer:!0,observeParents:!0},attr:{cartAttr:!1,productAttr:[],productSelect:{}},cartNum:1,userCollect:!1}},computed:{},watch:{$yroute:function(t){var e=this;t.name===d&&e.mountedStart()}},onShow:function(){this.mountedStart()},methods:{formatPrice:function(t,e){return console.log(t),t?t.split(".")[e]:""},onShareAppMessage:function(){return{title:this.storeInfo.title,imageUrl:this.storeInfo.image,path:"pages/activity/GroupDetails/index?id="+this.storeInfo.id+"&spread="+t.getStorageSync("uid")+"&pageType=good&codeType=routine",success:function(e){t.showToast({title:"分享成功"})},fail:function(e){t.showToast({title:"分享失败",icon:"none"})}}},openAlone:function(){this.$yrouter.push({path:"/pages/shop/GoodsCon/index",query:{id:this.storeInfo.productId}})},setCollect:function(){var t=this,e=t.storeInfo.id,r="product";t.userCollect?(0,n.getCollectDel)(e,r).then((function(){t.userCollect=!t.userCollect})):(0,n.getCollectAdd)(e,r).then((function(){t.userCollect=!t.userCollect}))},mountedStart:function(){var t=this,e=this,r=e.$yroute.query.id;(0,o.getCombinationDetail)(r).then((function(r){e.userCollect=r.data.userCollect,r.data.storeInfo.description=r.data.storeInfo.description.replace(/\<img/gi,'<img style="max-width:100%;height:auto;"'),e.$set(e.attr,"productAttr",r.data.productAttr),e.$set(e,"productValue",r.data.productValue),e.$set(e,"storeInfo",r.data.storeInfo),e.$set(e,"imgUrls",r.data.storeInfo.sliderImageArr),e.$set(e,"itemNew",r.data.pinkOkList),e.$set(e,"groupList",r.data.pink),e.$set(e,"reply",[r.data.reply]),e.$set(e,"replyCount",r.data.replyCount),e.$set(e,"replyChance",r.data.replyChance),e.posterData.image=e.storeInfo.image,e.storeInfo.title.length>30?e.posterData.title=e.storeInfo.title.substring(0,30)+"...":e.posterData.title=e.storeInfo.title,e.posterData.price=e.storeInfo.pinkPrice,e.posterData.code=e.storeInfo.code_base,e.domStatus=!0,console.log(t.storeInfo),e.DefaultSelect()}))},DefaultSelect:function(){for(var t=this.attr.productAttr,e=[],r=0;r<t.length;r++)this.$set(t[r],"index",0),e.push(t[r].attrValueArr[0]);var o=this.productValue[e.sort().join(",")];console.log(o),o&&t.length?(this.$set(this.attr.productSelect,"store_name",this.storeInfo.title),this.$set(this.attr.productSelect,"image",o.image),this.$set(this.attr.productSelect,"price",o.pinkPrice),this.$set(this.attr.productSelect,"stock",o.pinkStock),this.$set(this.attr.productSelect,"unique",o.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",e.sort().join(",")),this.$set(this,"attrTxt","已选择")):!o&&t.length?(this.$set(this.attr.productSelect,"store_name",this.storeInfo.title),this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.stor