integral_goods_details.js 14 KB

1
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/points_mall/integral_goods_details"],{"3a73":function(t,e,i){"use strict";i.r(e);var s=i("b6d8"),r=i.n(s);for(var u in s)["default"].indexOf(u)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(u);e["default"]=r.a},4740:function(t,e,i){"use strict";(function(t,e){var s=i("4ea4");i("4789");s(i("66fd"));var r=s(i("7562"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(r.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},4908:function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return u})),i.d(e,"a",(function(){return s}));var s={jyfParser:function(){return Promise.all([i.e("common/vendor"),i.e("components/jyf-parser/jyf-parser")]).then(i.bind(null,"47fd"))}},r=function(){var t=this,e=t.$createElement,i=(t._self._c,t.$t("积分")),s=t.storeInfo.num>0?t.$t("最多可兑换"):null,r=t.storeInfo.num>0?t.$t(t.storeInfo.unit_name):null,u=t.$t("划线价"),o=t.$t("限量"),n=t.$t("已兑换"),a=t.attribute.productAttr.length,c=a?t.skuArr.length:null,h=a&&c>1?t.skuArr.slice(0,4):null,l=a&&c>1?t.$t("共"):null,d=a&&c>1?t.skuArr.length:null,p=a&&c>1?t.$t("种规格可选"):null,f=t.$t("产品介绍"),m=t.$t("首页"),b=t.attribute.productSelect.quota>0&&t.attribute.productSelect.product_stock>0?t.$t("立即兑换"):null,g=t.attribute.productSelect.quota>0&&t.attribute.productSelect.product_stock>0?null:t.$t("无法兑换");t.$mp.data=Object.assign({},{$root:{m0:i,m1:s,m2:r,m3:u,m4:o,m5:n,g0:a,g1:c,l0:h,m6:l,g2:d,m7:p,m8:f,m9:m,m10:b,m11:g}})},u=[]},7562:function(t,e,i){"use strict";i.r(e);var s=i("4908"),r=i("3a73");for(var u in r)["default"].indexOf(u)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(u);i("8179");var o=i("f0c5"),n=Object(o["a"])(r["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);e["default"]=n.exports},8179:function(t,e,i){"use strict";var s=i("8598"),r=i.n(s);r.a},8598:function(t,e,i){},b6d8:function(t,e,i){"use strict";(function(t){var s=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,u=s(i("9523")),o=i("26cb"),n=i("84d8"),a=(i("4e39"),i("86eb")),c=(i("d1ea"),s(i("19b6"))),h=getApp(),l=t.getSystemInfoSync().statusBarHeight+"px",d=(r={computed:(0,o.mapGetters)(["isLogin"]),mixins:[c.default],data:function(){return{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("详情")],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:"",navActive:0,meunHeight:0,backH:"",posters:!1,weixinStatus:!1,posterImageStatus:!1,storeImage:"",PromotionCode:"",posterImage:"",actionSheetHidden:!1,cart_num:1,homeTop:20,returnShow:!0,H5ShareBox:!1,routineContact:0,skuArr:[],selectSku:{},currentPage:!1,sysHeight:l}},components:{productConSwiper:function(){i.e("components/productConSwiper/index").then(function(){return resolve(i("bffb"))}.bind(null,i)).catch(i.oe)},productWindow:function(){i.e("pages/points_mall/component/productWindow").then(function(){return resolve(i("dabf"))}.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)},"jyf-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)},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)},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)}}},(0,u.default)(r,"computed",(0,o.mapGetters)(["isLogin"])),(0,u.default)(r,"watch",{isLogin:{handler:function(t,e){t&&this.getIntegralProductDetail()},deep:!0}}),(0,u.default)(r,"onLoad",(function(e){var i=this,s=this,r=getCurrentPages();s.returnShow=1!==r.length,t.getSystemInfo({success:function(t){s.height=t.windowHeight,t.statusBarHeight}}),this.navH=h.globalData.navHeight;var u=t.getMenuButtonBoundingClientRect();if(this.meunHeight=u.height,this.backH=s.navH/2+this.meunHeight/2,e.scene){var o=this.$util.getUrlParams(decodeURIComponent(e.scene));if(!o.id)return this.$util.Tips({title:this.$t("缺少参数无法查看商品")},{tab:3,url:1});this.id=o.id,o.pid&&(h.globalData.spid=o.pid),o.time&&(this.datatime=o.time)}e.id&&(this.id=e.id,this.datatime=Number(e.time),this.status=e.status),this.isLogin?this.getIntegralProductDetail():(0,a.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,u.default)(r,"onNavigationBarButtonTap",(function(t){this.currentPage=!this.currentPage})),(0,u.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.getIntegralProductDetail())},getIntegralProductDetail:function(){var e=this,i=this;(0,n.getIntegralProductDetail)(i.id).then((function(s){e.dataShow=1;var r=s.data.storeInfo.title;for(var u in e.storeInfo=s.data.storeInfo,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.attribute.productAttr=s.data.productAttr,e.productValue=s.data.productValue,e.attribute.productSelect.num=s.data.storeInfo.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),s.data.productValue){var o=s.data.productValue[u];i.skuArr.push(o)}e.$set(e,"selectSku",i.skuArr[0]),t.setNavigationBarTitle({title:r.substring(0,7)+"..."}),i.DefaultSelect(),h.globalData.openPages="/pages/activity/goods_seckill_details/index?id="+i.id+"&time="+i.time+"&status="+i.status+"&scene="+i.storeInfo.uid})).catch((function(t){i.$util.Tips({title:t},{tab:3})}))},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 r=this.productValue[e.join(",")];r&&t.length?(this.$set(this.attribute.productSelect,"store_name",this.storeInfo.title),this.$set(this.attribute.productSelect,"image",r.image),this.$set(this.attribute.productSelect,"price",r.price),this.$set(this.attribute.productSelect,"stock",r.stock),this.$set(this.attribute.productSelect,"unique",r.unique),this.$set(this.attribute.productSelect,"quota",r.quota),this.$set(this.attribute.productSelect,"quota_show",r.quota_show),this.$set(this.attribute.productSelect,"product_stock",r.product_stock),this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this,"attrValue",e.join(",")),this.attrValue=e.join(",")):!r&&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("请选择"))):r||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",r.quota),this.$set(this.attribute.productSelect,"product_stock",r.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,e.quota,e.product_stock;var i=this.attribute.productSelect;this.storeInfo.num;if(void 0==e.cart_num&&(e.cart_num=1),t)i.cart_num<this.attribute.productSelect.quota&&(i.cart_num++,this.$set(this.attribute.productSelect,"cart_num",i.cart_num),this.$set(this,"cart_num",i.cart_num),this.$set(this.attribute.productSelect,"cart_num",i.cart_num));else{if(1==i.cart_num)return;i.cart_num--,this.$set(this,"cart_num",i.cart_num),this.$set(this.attribute.productSelect,"cart_num",i.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.currentPage=!1,this.scrollY=e,this.lock)this.lock=!1;else for(var s=0;s<this.topArr.length;s++)if(e<this.topArr[s]-h.globalData.navHeight/2+this.heightArr[s]){this.navActive=s;break}},tap:function(t,e){var i=t.id;e=e;this.toView=i,this.navActive=e,this.lock=!0,this.scrollTop=e>0?this.topArr[e]-h.globalData.navHeight/2:this.topArr[e]},showImg:function(t){this.$refs.cusPreviewImg.open(this.selectSku.suk)},listenerActionSheet:function(){if(this.currentPage=!1,!1===this.isLogin)(0,a.toLogin)();else{if(this.posterImage)return void(this.posters=!0);this.downloadFilePromotionCode(),this.posters=!0}},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.unique),this.$set(this.attribute.productSelect,"vipPrice",e.vipPrice),this.$set(this,"attrTxt",this.$t("已选择")),this.$set(this,"attrValue",e.suk))},goCat:function(){this.currentPage=!1;var e=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===e&&1==this.isOpen?h.$util.Tips({title:this.$t("请选择属性")}):this.cart_num<=0?h.$util.Tips({title:this.$t("请选择数量")}):(this.isOpen=!1,void t.navigateTo({url:"/pages/points_mall/integral_order?unique=".concat(e.unique,"&num=").concat(this.cart_num||1)}))}}),r);e.default=d}).call(this,i("543d")["default"])}},[["4740","common/runtime","common/vendor"]]]);