1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/goods_combination_details/index"],{3923:function(t,e,i){},"42f4":function(t,e,i){"use strict";i.r(e);var s=i("a5ca"),o=i.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(n);e["default"]=o.a},"87af":function(t,e,i){"use strict";(function(t,e){var s=i("4ea4");i("4789");s(i("66fd"));var o=s(i("c445"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},a5ca:function(t,e,i){"use strict";(function(t){var s=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i("26cb"),n=i("86eb"),r=i("84d8"),u=i("2a39"),a=(i("4e39"),i("d1ea")),c=s(i("19b6")),h=i("5bb2"),l=i("00a0"),d=getApp(),p=t.getSystemInfoSync().statusBarHeight+"px",f={components:{productConSwiper:function(){i.e("components/productConSwiper/index").then(function(){return resolve(i("bffb"))}.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)},authorize:function(){i.e("components/Authorize").then(function(){return resolve(i("ad23"))}.bind(null,i)).catch(i.oe)},"product-window":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)},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)},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)},menuIcon:function(){i.e("components/menuIcon").then(function(){return resolve(i("141a"))}.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)},swiperPrevie:function(){i.e("components/cusPreviewImg/swiperPrevie").then(function(){return resolve(i("fd5e"))}.bind(null,i)).catch(i.oe)}},computed:(0,o.mapGetters)({isLogin:"isLogin",userData:"userInfo"}),mixins:[c.default,h.sharePoster],data:function(){return{imgHost:l.HTTP_REQUEST_URL,dataShow:0,navH:"",id:0,userInfo:{},itemNew:[],indicatorDots:!1,circular:!0,autoplay:!0,interval:3e3,duration:500,attribute:{cartAttr:!1,productAttr:[],productSelect:{}},productValue:[],isOpen:!1,attr:this.$t("请选择"),attrValue:"",AllIndex:2,maxAllIndex:0,replyChance:"",limitNum:1,timeer:null,iSplus:!1,navList:[this.$t("商品"),this.$t("评价"),this.$t("详情")],opacity:0,scrollY:0,topArr:[],toView:"",height:0,heightArr:[],lock:!1,scrollTop:0,storeInfo:{},pink_ok_sum:0,pink:[],replyCount:0,reply:[],imgUrls:[],sharePacket:"",tagStyle:{img:"width:100%;display:block;",table:"width:100%",video:"width:100%"},posters:!1,weixinStatus:!1,posterImageStatus:!1,canvasStatus:!1,storeImage:"",PromotionCode:"",posterImage:"",posterbackgd:"/static/images/posterbackgd.png",navActive:0,actionSheetHidden:!1,attrTxt:"",cart_num:"",isAuto:!1,isShowAuth:!1,AllIndexDefault:0,homeTop:20,returnShow:!0,H5ShareBox:!1,routineContact:0,skuArr:[],selectSku:{},showMenuIcon:!1,currentPage:!1,sysHeight:p}},watch:{isLogin:{handler:function(t,e){t&&this.combinationDetail()},deep:!0}},onLoad:function(e){var i=this,s=this,o=getCurrentPages();if(s.returnShow=1!==o.length,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()})),this.navH=d.globalData.navHeight,t.getSystemInfo({success:function(t){s.height=t.windowHeight}}),e.scene){var r=this.$util.getUrlParams(decodeURIComponent(e.scene));r.id&&(e.id=r.id),r.pid&&(d.globalData.spid=r.pid)}if(!e.id&&!e.scene)return this.$util.Tips({title:this.$t("缺少参数无法查看商品")},{tab:3,url:1});if(e.spid&&(d.globalData.spid=e.spid),e.hasOwnProperty("id"))this.id=e.id,this.isLogin?this.combinationDetail():(this.$Cache.set("login_back_url","/pages/activity/goods_combination_details/index?id=".concat(e.id)),(0,n.toLogin)());else try{var u=t.getStorageSync("comGoodsId");""!=u&&(this.id=u,this.combinationDetail())}catch(a){t.showToast({title:this.$t("参数错误"),icon:"none",duration:1e3,mask:!0})}},onNavigationBarButtonTap:function(t){this.currentPage=!this.currentPage},methods:{moreNav:function(){this.currentPage=!this.currentPage},showSwiperImg:function(t){this.$refs.cusSwiperImg.open(t)},qrR:function(t){},showAll:function(){this.AllIndexDefault=this.AllIndex,this.AllIndex=this.pink.length},hideAll:function(){this.AllIndex=this.AllIndexDefault},authColse:function(t){this.isShowAuth=t},iptCartNum:function(t){this.$set(this.attribute.productSelect,"cart_num",t),this.$set(this,"cart_num",t)},returns:function(){return t.navigateBack({delta:1})},combinationDetail:function(){var e=this,i=this,s=i.id;(0,r.getCombinationDetail)(s).then((function(s){for(var o in i.dataShow=1,t.setNavigationBarTitle({title:s.data.storeInfo.title.substring(0,16)}),i.imgUrls=s.data.storeInfo.images,i.storeInfo=s.data.storeInfo,i.storeInfo.description=i.storeInfo.description.replace(/<img/gi,'<img style="max-width:100%;height:auto;float:left;display:block" '),i.attribute.productSelect.num=s.data.storeInfo.num,i.pink=s.data.pink,i.pinkAll=s.data.pinkAll,i.reply=s.data.reply?[s.data.reply]:[],i.replyCount=s.data.replyCount,i.itemNew=s.data.pink_ok_list,i.pink_ok_sum=s.data.pink_ok_sum,i.replyChance=s.data.replyChance,i.attribute.productAttr=s.data.productAttr,i.productValue=s.data.productValue,e.storeInfo.wechat_code&&i.$set(i,"PromotionCode",e.storeInfo.wechat_code),i.routineContact=Number(s.data.routine_contact_type),s.data.productValue){var n=s.data.productValue[o];i.skuArr.push(n)}i.$set(i,"selectSku",i.skuArr[0]);var r=[i.$t("商品"),i.$t("详情")];s.data.replyCount&&r.splice(1,0,i.$t("评价")),i.$set(i,"navList",r),i.storeImage=i.storeInfo.image,i.downloadFilestoreImage(),i.DefaultSelect(),setTimeout((function(){i.infoScroll()}),500)})).catch((function(t){i.$util.Tips({title:t},{tab:3})}))},downloadFileAppCode:function(){var e=this;t.downloadFile({url:e.setDomain(e.PromotionCode),success:function(t){e.PromotionCode=t.tempFilePath},fail:function(){return e.$util.Tips({title:""})}})},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",0),this.$set(this.attribute.productSelect,"product_stock",0),this.$set(this.attribute.productSelect,"unique",this.storeInfo.unique||""),this.$set(this.attribute.productSelect,"cart_num",1),this.$set(this,"attrValue",""),this.$set(this,"attrTxt",this.$t("请选择")))},infoScroll:function(){for(var e=this,i=[],s=[],o=0;o<e.navList.length;o++){var n=t.createSelectorQuery().in(this),r="#past"+o;this.replyCount||1!=o||(r="#past2"),n.select(r).boundingClientRect(),n.exec((function(t){var o=t[0].top,n=t[0].height;i.push(o),s.push(n),e.topArr=i,e.heightArr=s}))}},onLoadFun:function(t){this.userInfo=t,d.globalData.openPages="/pages/activity/goods_combination_details/index?id="+this.id+"&spid="+t.uid,this.combinationDetail()},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,n=this.storeInfo.num||0;if(void 0==e.cart_num&&(e.cart_num=1),t){o.cart_num++;var r=[];r.push(n),r.push(i),r.push(s);var u=Math.min.apply(null,r);o.cart_num>=u&&(this.$set(this.attribute.productSelect,"cart_num",u||1),this.$set(this,"cart_num",u||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("已选择"))},goProduct:function(){t.navigateTo({url:"/pages/goods_details/index?id="+this.storeInfo.product_id})},goCat:function(){var e=this;this.currentPage=!1;var i=this.productValue[this.attrValue];if(this.isOpen?this.attribute.cartAttr=!0:this.attribute.cartAttr=!this.attribute.cartAttr,!0===this.attribute.cartAttr&&0==this.isOpen)return this.isOpen=!0;if(this.attribute.productAttr.length&&void 0===i&&1==this.isOpen)return e.$util.Tips({title:this.$t("请选择")});var s={productId:e.storeInfo.product_id,secKillId:0,bargainId:0,combinationId:e.id,cartNum:e.cart_num,uniqueId:void 0!==i?i.unique:"",is_new:1};(0,u.postCartAdd)(s).then((function(i){e.isOpen=!1,t.navigateTo({url:"/pages/goods/order_confirm/index?new=1&cartId="+i.data.cartId})})).catch((function(e){t.showToast({title:e,icon:"none"})}))},setCollect:function(){var t=this;this.storeInfo.userCollect?(0,u.collectDel)([this.storeInfo.product_id]).then((function(e){t.storeInfo.userCollect=!t.storeInfo.userCollect})):(0,u.collectAdd)(this.storeInfo.product_id).then((function(e){t.storeInfo.userCollect=!t.storeInfo.userCollect}))},open:function(t){this.showMenuIcon=t},listenerActionSheet:function(){this.currentPage=!1,0==this.isLogin?(0,n.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://")},downloadFilePromotionCode:function(e){var i=this;(0,r.scombinationCode)(i.id).then((function(s){t.downloadFile({url:i.setDomain(s.data.code),success:function(t){i.$set(i,"isDown",!1),"function"==typeof e?e&&e(t.tempFilePath):i.$set(i,"PromotionCode",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","")}))},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:this.$t("保存成功"),icon:"success"})},fail:function(t){e.$util.Tips({title:this.$t("保存失败")})}}):t.authorize({scope:"scope.writePhotosAlbum",success:function(){t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:this.$t("保存成功"),icon:"success"})},fail:function(t){e.$util.Tips({title:this.$t("保存失败")})}})}})}})},setShareInfoStatus:function(){var t=this,e=this.storeInfo,i=location.href;this.$wechat.isWeixin()&&(0,a.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)}))},scroll:function(t){var e=t.detail.scrollTop,i=e/200;if(i=i>1?1:i,this.opacity=i,this.scrollY=e,this.$set(this,"showMenuIcon",!1),this.$set(this,"currentPage",!1),this.lock)this.lock=!1;else for(var s=0;s<this.topArr.length;s++)if(e<this.topArr[s]-d.globalData.navHeight/2+this.heightArr[s]){this.navActive=s;break}},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]-d.globalData.navHeight/2:this.topArr[e]},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.unique),this.$set(this.attribute.productSelect,"vipPrice",e.vipPrice),this.$set(this,"attrTxt",this.$t("已选择")),this.$set(this,"attrValue",e.suk))}},onShareAppMessage:function(){return{title:this.storeInfo.title,path:d.globalData.openPages,imageUrl:this.storeInfo.image}}};e.default=f}).call(this,i("543d")["default"])},c445:function(t,e,i){"use strict";i.r(e);var s=i("dd5b"),o=i("42f4");for(var n in o)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(n);i("e2a1");var r=i("f0c5"),u=Object(r["a"])(o["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);e["default"]=u.exports},dd5b: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,n=t.$t("¥"),r=t.$t("类型"),u=t.$t("人团"),a=t.$t("累计销量"),c=t.$t(t.storeInfo.unit_name)||"",h=t.$t("限量剩余"),l=t.$t(t.storeInfo.unit_name)||"",d=t.attribute.productAttr.length,p=d?t.skuArr.length:null,f=d&&p>1?t.skuArr.slice(0,4):null,m=d&&p>1?t.$t("共"):null,g=d&&p>1?t.skuArr.length:null,$=d&&p>1?t.$t("种规格可选"):null,b=t.$t("已拼"),v=t.$t("件"),S=t.__map(t.pink,(function(e,i){var s=t.__get_orig(e),o=i<t.AllIndex?t.$t("还差"):null,n=i<t.AllIndex?t.$t("人成团"):null,r=i<t.AllIndex?t.$t("去拼单"):null;return{$orig:s,m13:o,m14:n,m15:r}})),_=t.pink.length,I=_?t.pink.length:null,A=_&&I>t.AllIndex?t.$t("查看更多"):null,k=!_||I>t.AllIndex?null:t.pink.length===t.AllIndex&&t.pink.length!==t.AllIndexDefault,w=!_||I>t.AllIndex||!k?null:t.$t("收起"),x=t.$t("拼团玩法"),P=t.$t("开团/参团"),C=t.$t("邀请好友"),y=t.$t("满员发货"),T=t.replyCount?t.$t("用户评价"):null,q=t.replyCount?t.$t("好评率"):null,D=t.$t("产品介绍"),V=t.$t("首页"),L=t.$t("收藏"),O=t.$t("单独购买"),H=t.attribute.productSelect.product_stock>0&&t.attribute.productSelect.quota>0?t.$t("立即开团"):null,N=t.dataShow?null:t.$t("立即开团"),M=t.attribute.productSelect.quota<=0||t.attribute.productSelect.product_stock<=0?t.$t("已售罄"):null,U=t.$t("发送给朋友"),F=t.$t("生成海报"),B=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:n,m3:r,m4:u,m5:a,m6:c,m7:h,m8:l,g1:d,g2:p,l0:f,m9:m,g3:g,m10:$,m11:b,m12:v,l1:S,g4:_,g5:I,m16:A,g6:k,m17:w,m18:x,m19:P,m20:C,m21:y,m22:T,m23:q,m24:D,m25:V,m26:L,m27:O,m28:H,m29:N,m30:M,m31:U,m32:F,m33:B}})},o=[]},e2a1:function(t,e,i){"use strict";var s=i("3923"),o=i.n(s);o.a}},[["87af","common/runtime","common/vendor"]]]);
|