index.js 18 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/goods_seckill_details/index"],{"056d":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){}));var s=function(){var t=this,e=t.$createElement,i=(t._self._c,t.$t("¥")),s=t.attribute.productAttr.length&&(t.attribute.productAttr.length?t.attribute.productAttr[0].attr_values.length:0)>1,o=s?t.$t("起"):null,r=t.$t("¥"),n=1==t.status?t.$t("距秒杀结束仅剩"):null,u=t.$t("累计销售"),a=t.$t(t.storeInfo.unit_name)||"",c=t.$t("限量剩余"),h=t.$t(t.storeInfo.unit_name)||"",l=t.attribute.productAttr.length,d=l?t.skuArr.length:null,p=l&&d>1?t.skuArr.slice(0,4):null,f=l&&d>1?t.$t("共"):null,m=l&&d>1?t.skuArr.length:null,g=l&&d>1?t.$t("种规格可选"):null,b=t.replyCount?t.$t("用户评价"):null,$=t.replyCount?t.$t("好评率"):null,S=t.$t("产品介绍"),v=t.$t("首页"),_=t.$t("收藏"),I=1==t.status&&t.attribute.productSelect.quota>0&&t.attribute.productSelect.product_stock>0?t.$t("单独购买"):null,w=1==t.status&&t.attribute.productSelect.quota>0&&t.attribute.productSelect.product_stock>0?t.$t("立即购买"):null,A=1==t.status&&t.attribute.productSelect.quota<=0||3==t.status&&t.attribute.productSelect.quota<=0||1==t.status&&t.attribute.productSelect.product_stock<=0||3==t.status&&t.attribute.productSelect.product_stock<=0?t.$t("单独购买"):null,k=1==t.status&&t.attribute.productSelect.quota<=0||3==t.status&&t.attribute.productSelect.quota<=0||1==t.status&&t.attribute.productSelect.product_stock<=0||3==t.status&&t.attribute.productSelect.product_stock<=0?t.$t("已售罄"):null,x=t.dataShow||1!=t.status?null:t.$t("单独购买"),C=t.dataShow||1!=t.status?null:t.$t("立即购买"),P=2==t.status?t.$t("单独购买"):null,y=2==t.status?t.$t("未开始"):null,q=0==t.status?t.$t("单独购买"):null,T=0==t.status?t.$t("已结束"):null,D=t.$t("发送给朋友"),V=t.$t("生成海报"),H=t.posterImageStatus?t.$t("保存到手机"):null;t._isMounted||(t.e0=function(e){t.H5ShareBox=!1}),t.$mp.data=Object.assign({},{$root:{m0:i,g0:s,m1:o,m2:r,m3:n,m4:u,m5:a,m6:c,m7:h,g1:l,g2:d,l0:p,m8:f,g3:m,m9:g,m10:b,m11:$,m12:S,m13:v,m14:_,m15:I,m16:w,m17:A,m18:k,m19:x,m20:C,m21:P,m22:y,m23:q,m24:T,m25:D,m26:V,m27:H}})},o=[]},"0a6c":function(t,e,i){"use strict";i.r(e);var s=i("056d"),o=i("5137");for(var r in o)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(r);i("30ab");var n=i("f0c5"),u=Object(n["a"])(o["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);e["default"]=u.exports},"30ab":function(t,e,i){"use strict";var s=i("b501"),o=i.n(s);o.a},5137:function(t,e,i){"use strict";i.r(e);var s=i("c158"),o=i.n(s);for(var r in s)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(r);e["default"]=o.a},b501:function(t,e,i){},c158:function(t,e,i){"use strict";(function(t,s){var o=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=o(i("9523")),u=i("26cb"),a=i("84d8"),c=i("2a39"),h=(i("4e39"),i("86eb")),l=i("d1ea"),d=o(i("19b6")),p=i("5bb2"),f=i("00a0"),m=getApp(),g=t.getSystemInfoSync().statusBarHeight+"px",b=(r={computed:(0,u.mapGetters)(["isLogin"]),mixins:[d.default,p.sharePoster],components:{productConSwiper:function(){i.e("components/productConSwiper/index").then(function(){return resolve(i("bffb"))}.bind(null,i)).catch(i.oe)},productWindow:function(){i.e("components/productWindow/index").then(function(){return resolve(i("6cd4"))}.bind(null,i)).catch(i.oe)},userEvaluation:function(){i.e("components/userEvaluation/index").then(function(){return resolve(i("ab5b"))}.bind(null,i)).catch(i.oe)},kefuIcon:function(){Promise.all([i.e("common/vendor"),i.e("components/kefuIcon/index")]).then(function(){return resolve(i("138b"))}.bind(null,i)).catch(i.oe)},menuIcon:function(){i.e("components/menuIcon").then(function(){return resolve(i("141a"))}.bind(null,i)).catch(i.oe)},countDown:function(){i.e("components/countDown/index").then(function(){return resolve(i("80f6"))}.bind(null,i)).catch(i.oe)},cusPreviewImg:function(){i.e("components/cusPreviewImg/index").then(function(){return resolve(i("3a6e"))}.bind(null,i)).catch(i.oe)},swiperPrevie:function(){i.e("components/cusPreviewImg/swiperPrevie").then(function(){return resolve(i("fd5e"))}.bind(null,i)).catch(i.oe)},parser:function(){Promise.all([i.e("common/vendor"),i.e("components/jyf-parser/jyf-parser")]).then(function(){return resolve(i("47fd"))}.bind(null,i)).catch(i.oe)},homeList:function(){i.e("components/homeList/index").then(function(){return resolve(i("3d2e"))}.bind(null,i)).catch(i.oe)},authorize:function(){i.e("components/Authorize").then(function(){return resolve(i("ad23"))}.bind(null,i)).catch(i.oe)}},data:function(){return{imgHost:f.HTTP_REQUEST_URL,showMenuIcon:!1,dataShow:0,id:0,time:0,countDownHour:"00",countDownMinute:"00",countDownSecond:"00",storeInfo:[],imgUrls:[],parameter:{navbar:"1",return:"1",title:this.$t("抢购详情页"),color:!1},attribute:{cartAttr:!1,productAttr:[],productSelect:{}},productValue:[],isOpen:!1,attr:this.$t("请选择"),attrValue:"",status:1,isAuto:!1,isShowAuth:!1,iShidden:!1,limitNum:1,iSplus:!1,replyCount:0,reply:[],replyChance:0,navH:"",navList:[this.$t("商品"),this.$t("评价"),this.$t("详情")],opacity:0,scrollY:0,topArr:[],toView:"",height:0,heightArr:[],lock:!1,scrollTop:0,tagStyle:{img:"width:100%;display:block;",table:"width:100%",video:"width:100%"},datatime:0,navActive:0,meunHeight:0,backH:"",posters:!1,weixinStatus:!1,posterImageStatus:!1,canvasStatus:!1,storeImage:"",PromotionCode:"",posterImage:"",posterbackgd:"/static/images/posterbackgd.png",actionSheetHidden:!1,cart_num:"",homeTop:20,returnShow:!0,H5ShareBox:!1,routineContact:0,skuArr:[],selectSku:{},currentPage:!1,sysHeight:g}}},(0,n.default)(r,"computed",(0,u.mapGetters)(["isLogin"])),(0,n.default)(r,"watch",{isLogin:{handler:function(t,e){t&&this.getSeckillDetail()},deep:!0}}),(0,n.default)(r,"onLoad",(function(e){var i=this,s=this,o=getCurrentPages();e.id&&(this.id=e.id,e.pid&&(m.globalData.spid=e.pid)),s.returnShow=1!==o.length,t.getSystemInfo({success:function(t){s.height=t.windowHeight,t.statusBarHeight}}),this.navH=m.globalData.navHeight;var r=t.getMenuButtonBoundingClientRect();if(this.meunHeight=r.height,this.backH=s.navH/2+this.meunHeight/2,e.scene){var n=this.$util.getUrlParams(decodeURIComponent(e.scene));if(!n.id)return this.$util.Tips({title:this.$t("缺少参数无法查看商品")},{tab:3,url:1});this.id=n.id,n.pid&&(m.globalData.spid=n.pid)}this.isLogin?this.getSeckillDetail():(0,h.toLogin)(),this.$nextTick((function(){var e=t.getMenuButtonBoundingClientRect(),s=t.createSelectorQuery().in(i);s.select("#home").boundingClientRect((function(t){i.homeTop=2*e.top+e.height-t.height})).exec()}))})),(0,n.default)(r,"onNavigationBarButtonTap",(function(t){this.currentPage=!this.currentPage})),(0,n.default)(r,"methods",{moreNav:function(){this.currentPage=!this.currentPage},iptCartNum:function(t){this.$set(this.attribute.productSelect,"cart_num",t),this.$set(this,"cart_num",t)},returns:function(){return t.navigateBack({delta:1})},onLoadFun:function(t){this.isAuto&&(this.isAuto=!1,this.isShowAuth=!1,this.getSeckillDetail())},getSeckillDetail:function(){var e=this,i=this;(0,a.getSeckillDetail)(i.id,{}).then((function(s){e.dataShow=1,e.status=s.data.storeInfo.status;var o=s.data.storeInfo.title;for(var r in e.storeInfo=s.data.storeInfo,e.datatime=Number(s.data.storeInfo.last_time),e.imgUrls=s.data.storeInfo.images,e.storeInfo.description=e.storeInfo.description.replace(/<img/gi,'<img style="max-width:100%;height:auto;float:left;display:block" '),e.storeInfo.description=e.storeInfo.description.replace(/<video/gi,'<video style="width:100%;height:300px;display:block" '),i.$set(i.attribute,"productAttr",s.data.productAttr),e.productValue=s.data.productValue,e.attribute.productSelect.num=s.data.storeInfo.num,e.attribute.productSelect.once_num=s.data.storeInfo.once_num,e.replyCount=s.data.replyCount,e.reply=s.data.reply?[s.data.reply]:[],e.replyChance=s.data.replyChance,i.routineContact=Number(s.data.routine_contact_type),t.setNavigationBarTitle({title:o.substring(0,7)+"..."}),s.data.productValue){var n=s.data.productValue[r];i.skuArr.push(n)}e.$set(e,"selectSku",i.skuArr[0]);var u=[i.$t("商品"),i.$t("详情")];s.data.replyCount&&u.splice(1,0,i.$t("评价")),i.$set(i,"navList",u),e.storeInfo.wechat_code&&i.$set(i,"PromotionCode",e.storeInfo.wechat_code),i.downloadFilestoreImage(),i.DefaultSelect(),setTimeout((function(){i.infoScroll()}),500),m.globalData.openPages="/pages/activity/goods_seckill_details/index?id="+i.id+"&spid="+i.storeInfo.uid})).catch((function(t){i.$util.Tips({title:t})}))},downloadFilePromotionCode:function(e){var i=this;(0,a.seckillCode)(i.id).then((function(s){t.downloadFile({url:i.setDomain(s.data.code),success:function(t){i.$set(i,"isDown",!1),i.$set(i,"PromotionCode",t.tempFilePath),"function"==typeof e&&e&&e(t.tempFilePath)},fail:function(){i.$set(i,"isDown",!1),i.$set(i,"PromotionCode","")}})})).catch((function(t){i.$set(i,"isDown",!1),i.$set(i,"PromotionCode","")}))},setShare:function(){this.$wechat.isWeixin()&&this.$wechat.wechatEvevt(["updateAppMessageShareData","updateTimelineShareData","onMenuShareAppMessage","onMenuShareTimeline"],{desc:this.storeInfo.info,title:this.storeInfo.title,link:location.href,imgUrl:this.storeInfo.image}).then((function(t){})).catch((function(t){}))},DefaultSelect:function(){var t=this.attribute.productAttr,e=[];for(var i in this.productValue)if(this.productValue[i].quota>0){e=this.attribute.productAttr.length?i.split(","):[];break}for(var s=0;s<t.length;s++)this.$set(t[s],"index",e[s]);var o=this.productValue[e.join(",")];o&&t.length?(this.$set(this.attribute.productSelect,"store_name",this.storeInfo.title),this.$set(this.attribute.productSelect,"image",o.image),this.$set(this.attribute.productSelect,"price",o.price),this.$set(this.attribute.productSelect,"stock",o.stock),this.$set(this.attribute.productSelect,"unique",o.unique),this.$set(this.attribute.productSelect,"quota",o.quota),this.$set(this.attribute.productSelect,"quota_show",o.quota_show),this.$set(this.attribute.productSelect,"product_stock",o.product_stock),this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this,"attrValue",e.join(",")),this.attrValue=e.join(",")):!o&&t.length?(this.$set(this.attribute.productSelect,"store_name",this.storeInfo.title),this.$set(this.attribute.productSelect,"image",this.storeInfo.image),this.$set(this.attribute.productSelect,"price",this.storeInfo.price),this.$set(this.attribute.productSelect,"quota",0),this.$set(this.attribute.productSelect,"quota_show",0),this.$set(this.attribute.productSelect,"product_stock",0),this.$set(this.attribute.productSelect,"stock",0),this.$set(this.attribute.productSelect,"unique",""),this.$set(this.attribute.productSelect,"cart_num",0),this.$set(this,"attrValue",""),this.$set(this,"attrTxt",this.$t("请选择"))):o||t.length||(this.$set(this.attribute.productSelect,"store_name",this.storeInfo.title),this.$set(this.attribute.productSelect,"image",this.storeInfo.image),this.$set(this.attribute.productSelect,"price",this.storeInfo.price),this.$set(this.attribute.productSelect,"stock",this.storeInfo.stock),this.$set(this.attribute.productSelect,"quota",this.storeInfo.quota),this.$set(this.attribute.productSelect,"product_stock",this.storeInfo.product_stock),this.$set(this.attribute.productSelect,"unique",this.storeInfo.unique||""),this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this.attribute.productSelect,"quota",o.quota),this.$set(this.attribute.productSelect,"product_stock",o.product_stock),this.$set(this,"attrValue",""),this.$set(this,"attrTxt",this.$t("请选择")))},selecAttr:function(){this.attribute.cartAttr=!0},onMyEvent:function(){this.$set(this.attribute,"cartAttr",!1),this.$set(this,"isOpen",!1)},ChangeCartNum:function(t){var e=this.productValue[this.attrValue];if(this.cart_num&&(e.cart_num=this.cart_num,this.attribute.productSelect.cart_num=this.cart_num),void 0!==e||this.attribute.productAttr.length||(e=this.attribute.productSelect),void 0!==e){e.stock,e.quota_show;var i=e.quota||0,s=e.product_stock||0,o=this.attribute.productSelect,r=this.storeInfo.num||0,n=this.storeInfo.once_num||0;if(void 0==e.cart_num&&(e.cart_num=1),t){o.cart_num++;var u=[];u.push(r),u.push(n),u.push(i),u.push(s);var a=Math.min.apply(null,u);o.cart_num>=a&&(this.$set(this.attribute.productSelect,"cart_num",a||1),this.$set(this,"cart_num",a||1)),this.$set(this,"cart_num",o.cart_num),this.$set(this.attribute.productSelect,"cart_num",o.cart_num)}else o.cart_num--,o.cart_num<1&&(this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this,"cart_num",1)),this.$set(this,"cart_num",o.cart_num),this.$set(this.attribute.productSelect,"cart_num",o.cart_num)}},attrVal:function(t){this.attribute.productAttr[t.indexw].index=this.attribute.productAttr[t.indexw].attr_values[t.indexn]},ChangeAttr:function(t){this.$set(this,"cart_num",1);var e=this.productValue[t];this.$set(this,"selectSku",e),e?(this.$set(this.attribute.productSelect,"image",e.image),this.$set(this.attribute.productSelect,"price",e.price),this.$set(this.attribute.productSelect,"stock",e.stock),this.$set(this.attribute.productSelect,"unique",e.unique),this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this.attribute.productSelect,"quota",e.quota),this.$set(this.attribute.productSelect,"quota_show",e.quota_show),this.$set(this,"attrValue",t),this.attrTxt=this.$t("已选择")):(this.$set(this.attribute.productSelect,"image",this.storeInfo.image),this.$set(this.attribute.productSelect,"price",this.storeInfo.price),this.$set(this.attribute.productSelect,"stock",0),this.$set(this.attribute.productSelect,"unique",""),this.$set(this.attribute.productSelect,"cart_num",0),this.$set(this.attribute.productSelect,"quota",0),this.$set(this.attribute.productSelect,"quota_show",0),this.$set(this,"attrValue",""),this.attrTxt=this.$t("已选择"))},scroll:function(t){var e=t.detail.scrollTop,i=e/200;if(i=i>1?1:i,this.opacity=i,this.scrollY=e,this.currentPage=!1,this.$set(this,"showMenuIcon",!1),this.lock)this.lock=!1;else for(var s=0;s<this.topArr.length;s++)if(e<this.topArr[s]-m.globalData.navHeight/2+this.heightArr[s]){this.navActive=s;break}},open:function(t){this.showMenuIcon=t},tap:function(t,e){var i=t.id;e=e;this.replyCount||"past1"!=i||(i="past2"),this.toView=i,this.navActive=e,this.lock=!0,this.scrollTop=e>0?this.topArr[e]-m.globalData.navHeight/2:this.topArr[e]},infoScroll:function(){for(var t=this,e=[],i=[],o=0;o<t.navList.length;o++){var r=s.createSelectorQuery().in(this),n="#past"+o;this.replyCount||1!=o||(n="#past2"),r.select(n).boundingClientRect(),r.exec((function(s){var o=s[0].top,r=s[0].height;e.push(o),i.push(r),t.topArr=e,t.heightArr=i}))}},setCollect:function(){var t=this;this.storeInfo.userCollect?(0,c.collectDel)([this.storeInfo.product_id]).then((function(e){t.storeInfo.userCollect=!t.storeInfo.userCollect})):(0,c.collectAdd)(this.storeInfo.product_id).then((function(e){t.storeInfo.userCollect=!t.storeInfo.userCollect}))},openAlone:function(){t.navigateTo({url:"/pages/goods_details/index?id=".concat(this.storeInfo.product_id)})},goCat:function(){var e=this;this.currentPage=!1;var i=this.productValue[this.attrValue];return this.isOpen?this.attribute.cartAttr=!0:this.attribute.cartAttr=!this.attribute.cartAttr,!0===this.attribute.cartAttr&&0==this.isOpen?this.isOpen=!0:this.attribute.productAttr.length&&void 0===i&&1==this.isOpen?m.$util.Tips({title:this.$t("请选择属性")}):void(0,c.postCartAdd)({productId:this.storeInfo.product_id,secKillId:this.id,bargainId:0,combinationId:0,cartNum:this.cart_num,uniqueId:void 0!==i?i.unique:"",new:1}).then((function(i){e.isOpen=!1,t.navigateTo({url:"/pages/goods/order_confirm/index?new=1&cartId="+i.data.cartId})})).catch((function(t){return e.$util.Tips({title:t})}))},listenerActionSheet:function(){!1===this.isLogin?(0,h.toLogin)():this.posters=!0},listenerActionClose:function(){this.posters=!1},posterImageClose:function(){this.posterImageStatus=!1},setDomain:function(t){return t=t?t.toString():"",t.indexOf("https://")>-1?t:t.replace("http://","https://")},goFriend:function(){this.posters=!1},savePosterPath:function(){var e=this;t.getSetting({success:function(i){i.authSetting["scope.writePhotosAlbum"]?t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:e.$t("保存成功"),icon:"success"})},fail:function(t){e.$util.Tips({title:e.$t("保存失败")})}}):t.authorize({scope:"scope.writePhotosAlbum",success:function(){t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:e.$t("保存成功"),icon:"success"})},fail:function(t){e.$util.Tips({title:e.$t("保存失败")})}})}})}})},setShareInfoStatus:function(){var t=this,e=this.storeInfo,i=location.href;this.$wechat.isWeixin()&&(this.posters=!0,(0,l.getUserInfo)().then((function(s){i=-1===i.indexOf("?")?i+"?spread="+s.data.uid:i+"&spread="+s.data.uid;var o={desc:e.store_info,title:e.store_name,link:i,imgUrl:e.image};t.$wechat.wechatEvevt(["updateAppMessageShareData","updateTimelineShareData"],o)})))},showImg:function(t){this.$refs.cusPreviewImg.open(this.selectSku.suk)},changeSwitch:function(t){var e=this.skuArr[t];this.$set(this,"selectSku",e);var i=e.suk.split(",");this.$set(this.attribute.productAttr[0],"index",i[0]),2==i.length?(this.$set(this.attribute.productAttr[0],"index",i[0]),this.$set(this.attribute.productAttr[1],"index",i[1])):3==i.length?(this.$set(this.attribute.productAttr[0],"index",i[0]),this.$set(this.attribute.productAttr[1],"index",i[1]),this.$set(this.attribute.productAttr[2],"index",i[2])):4==i.length&&(this.$set(this.attribute.productAttr[0],"index",i[0]),this.$set(this.attribute.productAttr[1],"index",i[1]),this.$set(this.attribute.productAttr[2],"index",i[2]),this.$set(this.attribute.productAttr[3],"index",i[3])),e&&(this.$set(this.attribute.productSelect,"image",e.image),this.$set(this.attribute.productSelect,"price",e.price),this.$set(this.attribute.productSelect,"stock",e.stock),this.$set(this.attribute.productSelect,"unique",e.id),this.$set(this.attribute.productSelect,"vipPrice",e.vipPrice),this.$set(this,"attrTxt",this.$t("已选择")),this.$set(this,"attrValue",e.suk))},showSwiperImg:function(t){this.$refs.cusSwiperImg.open(t)}}),(0,n.default)(r,"onShareAppMessage",(function(){return{title:this.storeInfo.title,path:m.globalData.openPages,imageUrl:this.storeInfo.image}})),r);e.default=b}).call(this,i("543d")["default"],i("bc2e")["default"])},eec2:function(t,e,i){"use strict";(function(t,e){var s=i("4ea4");i("4789");s(i("66fd"));var o=s(i("0a6c"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])}},[["eec2","common/runtime","common/vendor"]]]);