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
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.storeInfo.pinkPrice),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this,"attrValue",""),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.storeInfo.pinkPrice),this.$set(this.attr.productSelect,"stock",this.storeInfo.pinkStock),this.$set(this.attr.productSelect,"unique",this.storeInfo.unique||""),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择"))},getImageBase64:function(){var t=this;(0,s.imageBase64)(this.posterData.image,t.posterData.code).then((function(e){t.posterData.image=e.data.image,t.posterData.code=e.data.code}))},setPosterImageStatus:function(){this.posterImageStatus=!this.posterImageStatus},groupRule:function(t){var e=this;e.$yrouter.push({path:"/pages/activity/GroupRule/index",query:{id:t}})},goReply:function(){var t=this;t.$yrouter.push({path:"/pages/shop/EvaluateList/index",query:{id:t.storeInfo.product_id}})},setGroupListCount:function(){this.groupListCount=this.groupListCount+2},changeFun:function(t){"object"!==typeof t&&(t={});var e=t.action||"",r=void 0===t.value?"":t.value;this[e]&&this[e](r)},changeattr:function(t){var e=this;e.attr.cartAttr=t},ChangeCartNum:function(e){var r=this;r.attr.productSelect.cart_num=1,r.cartNum=1,t.showToast({title:"每人每次限购1"+r.storeInfo.unitName,icon:"none",duration:2e3})},ChangeAttr:function(t){var e=this.productValue[t.value];e?(this.attr.productAttr[t.indexw].index=t.indexn,this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.pinkPrice),this.$set(this.attr.productSelect,"stock",e.pinkStock),this.$set(this.attr.productSelect,"unique",e.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",t.value),this.$set(this,"attrTxt","已选择")):(this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.pinkPrice),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择"))},openTeam:function(){var e=this;if(0==e.attr.cartAttr)e.attr.cartAttr=!this.attr.cartAttr;else{var r={};r.productId=e.storeInfo.productId,r.cartNum=e.attr.productSelect.cart_num,r.uniqueId=e.attr.productSelect.unique,r.combinationId=e.storeInfo.id,r.new=1,(0,i.postCartAdd)(r).then((function(t){e.$yrouter.push({path:"/pages/order/OrderSubmission/index",query:{id:t.data.cartId}})})).catch((function(e){t.showToast({title:e.msg||e.response.data.msg||e.response.data.message,icon:"none",duration:2e3})}))}},selecAttrTap:function(){this.attr.cartAttr=!0,this.isOpen=!0}}};e.default=p}).call(this,r("543d")["default"])},"16d3":function(t,e,r){"use strict";var o;r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return s})),r.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,r=(t._self._c,t.formatPrice(t.storeInfo.price,0)),o=t.formatPrice(t.storeInfo.price,1),i=t.formatPrice(t.storeInfo.productPrice,0),s=t.formatPrice(t.storeInfo.productPrice,1),n=t.formatPrice(t.storeInfo.price,0),a=t.formatPrice(t.storeInfo.price,1);t.$mp.data=Object.assign({},{$root:{m0:r,m1:o,m2:i,m3:s,m4:n,m5:a}})},s=[]},"180f":function(t,e,r){"use strict";(function(t){r("ef82");o(r("66fd"));var e=o(r("a42a"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,r("543d")["createPage"])},"294c":function(t,e,r){"use strict";var o=r("4217"),i=r.n(o);i.a},4217:function(t,e,r){},a42a:function(t,e,r){"use strict";r.r(e);var o=r("16d3"),i=r("e0ba");for(var s in i)"default"!==s&&function(t){r.d(e,t,(function(){return i[t]}))}(s);r("294c");var n,a=r("f0c5"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"497fb666",null,!1,o["a"],n);e["default"]=c.exports},e0ba:function(t,e,r){"use strict";r.r(e);var o=r("077f"),i=r.n(o);for(var s in o)"default"!==s&&function(t){r.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a}},[["180f","common/runtime","common/vendor"]]]);