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
7.8 KiB
1 lines
7.8 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/activity/SeckillDetails/index"],{"0401":function(t,e,r){"use strict";var s=r("514a"),i=r.n(s);i.a},"0a2a":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=r("70e6"),i=r("2df4"),o=(r("83c1"),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)},n=function(){r.e("components/ProductWindow").then(function(){return resolve(r("9157"))}.bind(null,r)).catch(r.oe)},u=function(){r.e("components/StorePoster").then(function(){return resolve(r("cd35"))}.bind(null,r)).catch(r.oe)},l={name:"SeckillDetails",components:{ProductConSwiper:a,CountDown:c,ProductWindow:n,StorePoster:u},props:{},data:function(){return{seckillStatus:"",domStatus:!1,posterData:{image:"",title:"",price:"",code:""},posterImageStatus:!1,action:"",imgUrls:[],storeInfo:[],replyCount:0,reply:[],cartNum:1,attrTxt:"请选择",productValue:[],attrValue:"",attr:{cartAttr:!1,productAttr:[],productSelect:{}},datatime:0,userCollect:!1}},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/GoodsSeckill/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}})},routerGo:function(t){this.$yrouter.push({path:"/pages/user/CustomerList/index"})},setCollect:function(){var t=this,e=t.storeInfo.id,r="product";t.userCollect?(0,o.getCollectDel)(e,r).then((function(){t.userCollect=!t.userCollect})):(0,o.getCollectAdd)(e,r).then((function(){t.userCollect=!t.userCollect}))},mountedStart:function(){var t=this;console.log(this);var e=t.$yroute.query.id;this.seckillStatus=t.$yroute.query.status,t.datatime=parseInt(t.$yroute.query.time),(0,s.getSeckillDetail)(e).then((function(e){t.userCollect=e.data.userCollect,e.data.storeInfo.description=e.data.storeInfo.description.replace(/\<img/gi,'<img style="max-width:100%;height:auto;"'),t.$set(t.attr,"productAttr",e.data.productAttr),t.$set(t,"productValue",e.data.productValue),t.$set(t,"storeInfo",e.data.storeInfo),t.$set(t,"imgUrls",e.data.storeInfo.sliderImageArr),t.$set(t,"replyCount",e.data.replyCount),t.$set(t,"reply",e.data.reply),t.posterData.image=t.storeInfo.image_base,t.updateTitle(),t.storeInfo.title.length>30?t.posterData.title=t.storeInfo.title.substring(0,30)+"...":t.posterData.title=t.storeInfo.title,t.posterData.price=t.storeInfo.price,t.posterData.code=t.storeInfo.code_base,t.domStatus=!0,t.DefaultSelect()}))},updateTitle:function(){},setPosterImageStatus:function(){this.posterImageStatus=!this.posterImageStatus},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 s=this.productValue[e.sort().join(",")];console.log(s),s&&t.length?(this.$set(this.attr.productSelect,"store_name",this.storeInfo.title),this.$set(this.attr.productSelect,"image",s.image),this.$set(this.attr.productSelect,"price",s.seckillPrice),this.$set(this.attr.productSelect,"stock",s.seckillStock),this.$set(this.attr.productSelect,"unique",s.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",e.sort().join(",")),this.$set(this,"attrTxt","已选择")):!s&&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.seckillPrice),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","请选择")):s||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.seckillPrice),this.$set(this.attr.productSelect,"stock",this.storeInfo.seckillStock),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","请选择"))},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(t){var e=this.productValue[this.attrValue];if(void 0!==e||this.attr.productAttr.length||(e=this.attr.productSelect),void 0!==e){var r=e.stock||0,s=this.attr.productSelect;t?(s.cart_num++,s.cart_num>r?(this.$set(this.attr.productSelect,"cart_num",r),this.$set(this,"cartNum",r)):(this.$set(this.attr.productSelect,"cart_num",s.cart_num),this.$set(this,"cartNum",s.cart_num))):(s.cart_num--,s.cart_num<1?(this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"cartNum",1)):(this.$set(this.attr.productSelect,"cart_num",s.cart_num),this.$set(this,"cartNum",s.cart_num)))}},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.seckillPrice),this.$set(this.attr.productSelect,"stock",e.seckillStock),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.seckillPrice),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","请选择"))},selecAttrTap:function(){this.attr.cartAttr=!0,this.isOpen=!0},tapBuy:function(){var e=this;if(0==e.attr.cartAttr)e.attr.cartAttr=!this.attr.attrcartAttr;else{var r={};r.productId=e.storeInfo.productId,r.cartNum=e.attr.productSelect.cart_num,r.uniqueId=e.attr.productSelect.unique,r.secKillId=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})}))}}}};e.default=l}).call(this,r("543d")["default"])},"1e95e":function(t,e,r){"use strict";(function(t){r("ef82");s(r("66fd"));var e=s(r("b324"));function s(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,r("543d")["createPage"])},"240c":function(t,e,r){},"514a":function(t,e,r){},5773:function(t,e,r){"use strict";r.r(e);var s=r("0a2a"),i=r.n(s);for(var o in s)"default"!==o&&function(t){r.d(e,t,(function(){return s[t]}))}(o);e["default"]=i.a},"819c":function(t,e,r){"use strict";var s;r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return s}));var i=function(){var t=this,e=t.$createElement,r=(t._self._c,t.formatPrice(t.storeInfo.price,0)),s=t.formatPrice(t.storeInfo.price,1);t.$mp.data=Object.assign({},{$root:{m0:r,m1:s}})},o=[]},b324:function(t,e,r){"use strict";r.r(e);var s=r("819c"),i=r("5773");for(var o in i)"default"!==o&&function(t){r.d(e,t,(function(){return i[t]}))}(o);r("d196"),r("0401");var a,c=r("f0c5"),n=Object(c["a"])(i["default"],s["b"],s["c"],!1,null,"aac1b160",null,!1,s["a"],a);e["default"]=n.exports},d196:function(t,e,r){"use strict";var s=r("240c"),i=r.n(s);i.a}},[["1e95e","common/runtime","common/vendor"]]]); |