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"],{1648:function(t,e,r){"use strict";var o=r("5d47"),i=r.n(o);i.a},4567: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=[]},"5d47":function(t,e,r){},"7d94":function(t,e,r){"use strict";r.r(e);var o=r("d239"),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},"9d55":function(t,e,r){"use strict";(function(t){r("0371");o(r("66fd"));var e=o(r("a872"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,r("543d")["createPage"])},a872:function(t,e,r){"use strict";r.r(e);var o=r("4567"),i=r("7d94");for(var s in i)"default"!==s&&function(t){r.d(e,t,(function(){return i[t]}))}(s);r("1648");var n,a=r("f0c5"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"012697d3",null,!1,o["a"],n);e["default"]=c.exports},d239:function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r("8c03"),i=r("fc49"),s=r("63e5"),n=r("6e63"),a=function(){r.e("components/ProductConSwiper").then(function(){return resolve(r("61db"))}.bind(null,r)).catch(r.oe)},c=function(){r.e("components/CountDown").then(function(){return resolve(r("7e6d"))}.bind(null,r)).catch(r.oe)},u=function(){r.e("components/UserEvaluation").then(function(){return resolve(r("913e"))}.bind(null,r)).catch(r.oe)},l=function(){r.e("components/ProductWindow").then(function(){return resolve(r("70c8"))}.bind(null,r)).catch(r.oe)},d=function(){r.e("components/StorePoster").then(function(){return resolve(r("39fd"))}.bind(null,r)).catch(r.oe)},h="GroupDetails",p={name:"GroupDetails",components:{ProductConSwiper:a,CountDown:c,UserEvaluation:u,ProductWindow:l,StorePoster:d},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===h&&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"])}},[["9d55","common/runtime","common/vendor"]]]);