徐总多门店
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
28 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_details/index"],{"0c5c":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return o}));var o={jyfParser:function(){return Promise.all([i.e("common/vendor"),i.e("components/jyf-parser/jyf-parser")]).then(i.bind(null,"a04c"))}},s=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__get_style([t.navBarStyle])),o=t.__get_style([t.menuButtonStyle]),s=t.__get_style([t.shareButtonStyle]),r=t.storeInfo.spec_type?t.skuArr.length:null,n=t.diyProduct.isOpen.includes(0),c=t.diyProduct.isOpen.includes(2),a=t.diyProduct.isOpen.includes(1),u=t.storeInfo.store_label&&t.storeInfo.store_label.length,d=t.storeInfo.rank>0&&t.diyProduct.showRank?t._f("rankType")(t.storeInfo.rank_type):null,l=t.activity.length&&t.diyProduct.showService.includes(0),h=t.attr.productAttr.length&&t.diyProduct.showService.includes(1),p=t.storeInfo.ensure&&t.storeInfo.ensure.length&&t.diyProduct.showService.includes(2),f=t.storeInfo.specs&&t.storeInfo.specs.length&&t.diyProduct.showService.includes(3),g=t.isMention&&Object.keys(t.storeList).length&&t.diyProduct.showService.includes(4),m=t.discountsData.length&&t.diyProduct.showMatch,v=m?t.discountsData.length:null,y=t.good_list.length&&t.diyProduct.showRecommend,_=y?t.good_list.length:null,$=t.diyProduct.menuList.includes(3),I=t.diyProduct.menuList.includes(4),S=t.diyProduct.menuList.includes(0)&&t.routineContact,C=S?null:t.diyProduct.menuList.includes(0)&&!t.routineContact,w=t.diyProduct.menuList.includes(1),b=t.diyProduct.menuList.includes(2),P=b?parseFloat(t.CartCount):null;t._isMounted||(t.e0=function(){t.showServiceDrawer=!0},t.e1=function(){t.showServiceDrawer=!1},t.e2=function(){t.showPerferentDrawer=!1},t.e3=function(e){t.H5ShareBox=!1}),t.$mp.data=Object.assign({},{$root:{s0:i,s1:o,s2:s,g0:r,g1:n,g2:c,g3:a,g4:u,f0:d,g5:l,g6:h,g7:p,g8:f,g9:g,g10:m,g11:v,g12:y,g13:_,g14:$,g15:I,g16:S,g17:C,g18:w,g19:b,m0:P}})},r=[]},"10c2":function(t,e,i){"use strict";(function(t,e){var o=i("47a9");i("7561");o(i("3240"));var s=o(i("3fbf"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"3fbf":function(t,e,i){"use strict";i.r(e);var o=i("0c5c"),s=i("5f97");for(var r in s)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(r);i("bbc8");var n=i("828b"),c=Object(n["a"])(s["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=c.exports},"5f97":function(t,e,i){"use strict";i.r(e);var o=i("eae2"),s=i.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(r);e["default"]=s.a},"71a8":function(t,e,i){},bbc8:function(t,e,i){"use strict";var o=i("71a8"),s=i.n(o);s.a},eae2:function(t,e,i){"use strict";(function(t,o){var s=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(i("7ca3")),n=i("ce7e"),c=i("77d7"),a=(i("a230"),i("152a")),u=i("7ba4"),d=i("8f59"),l=i("6975"),h=(i("d83b"),i("bad7")),p=i("b135"),f=s(i("cef6"));function g(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function m(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?g(Object(i),!0).forEach((function(e){(0,r.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var v=t.getSystemInfoSync().statusBarHeight,y=getApp(),_={components:{zbCode:function(){Promise.all([i.e("common/vendor"),i.e("components/zb-code/zb-code")]).then(function(){return resolve(i("dddb"))}.bind(null,i)).catch(i.oe)},productConSwiper:function(){i.e("components/productConSwiper/index").then(function(){return resolve(i("1d32"))}.bind(null,i)).catch(i.oe)},productWindow:function(){i.e("components/productWindow/index").then(function(){return resolve(i("3ffb"))}.bind(null,i)).catch(i.oe)},userEvaluation:function(){i.e("components/userEvaluation/index").then(function(){return resolve(i("31cb"))}.bind(null,i)).catch(i.oe)},shareRedPackets:function(){i.e("pages/goods_details/components/shareRedPackets/index").then(function(){return resolve(i("2c4e"))}.bind(null,i)).catch(i.oe)},kefuIcon:function(){i.e("components/kefuIcon/index").then(function(){return resolve(i("71a5"))}.bind(null,i)).catch(i.oe)},cusPreviewImg:function(){i.e("components/cusPreviewImg/index").then(function(){return resolve(i("2d84"))}.bind(null,i)).catch(i.oe)},specs:function(){i.e("components/specs/index").then(function(){return resolve(i("1d7b"))}.bind(null,i)).catch(i.oe)},countDown:function(){i.e("components/countDown/index").then(function(){return resolve(i("b347"))}.bind(null,i)).catch(i.oe)},homeList:function(){i.e("components/homeList/index").then(function(){return resolve(i("571d"))}.bind(null,i)).catch(i.oe)},serviceModal:function(){i.e("pages/goods_details/components/serviceModal/index").then(function(){return resolve(i("291c"))}.bind(null,i)).catch(i.oe)},preferentialModal:function(){i.e("pages/goods_details/components/preferentialModal/index").then(function(){return resolve(i("b94a"))}.bind(null,i)).catch(i.oe)}},directives:{trigger:{inserted:function(t,e){t.click()}}},mixins:[f.default],data:function(){return{showSkeleton:!0,isNodes:0,coupon:{type:-1,list:[],count:[]},attrTxt:"请选择",attrValue:"",animated:!1,id:0,replyCount:0,reply:[],storeInfo:{brand_name:""},productValue:[],cart_num:1,isOpen:!1,actionSheetHidden:!0,posterImageStatus:!1,storeImage:"",PromotionCode:"",canvasStatus:!1,posterImage:"",posterbackgd:"/static/images/posterbackgd.png",sharePacket:{isState:!0},uid:0,circular:!1,autoplay:!1,interval:3e3,duration:500,good_list:[],replyChance:0,CartCount:0,isDown:!0,posters:!1,weixinStatus:!1,ensureInfo:{show:!1,ensure:[],ensureTitle:""},specsInfo:{show:!1,specs:[],specsTitle:""},discountInfo:{show:!1,discount:[]},attr:{cartAttr:!1,productAttr:[],productSelect:{},deliveryType:[],isType:0,relation_id:0},limitInfo:{discount_price:0,price:0,discount:1,datatime:0},promotions_type:0,description:"",H5ShareBox:!1,activity:[],lock:!1,scrollTop:0,tagStyle:{img:"width:100%;display:block;",table:"width:100%",video:"width:100%"},returnShow:!0,diff:"",is_money_level:1,is_vip:0,routineContact:0,discountsData:[],siteName:"",themeColor:"",fontColor:"",isMention:!1,showAnimate:!0,skuArr:[],codeShow:!1,cid:"1",codeVal:"",size:200,unit:"upx",background:"#FFF",foreground:"#000",pdground:"#000",codeIcon:"",iconsize:40,lv:3,onval:!0,loadMake:!0,base64Show:0,shareQrcode:0,followCode:"",selectSku:{},currentPage:!1,sysHeight:v,isShow:0,imgHost:h.HTTP_REQUEST_URL,fromType:0,cartNum:0,addressId:"",store_id:"",store_name:"",delivery_type:0,is_store_buy:1,storeList:{},activityBg:"",posterTitle:"",showServiceDrawer:!1,showPerferentDrawer:!1,pageScrollStatus:!1,cartType:"",computedPrice:{deduction:{pay_price:0,sum_price:0,vip_price:0}},isSwiper:!0,productSwiper:[],productVideoLink:"",userInfo:{},storeId:0}},filters:{rankType:function(t){return{1:"销量排行榜",2:"好评排行榜",3:"收藏排行榜"}[t]}},computed:m(m({},(0,d.mapGetters)(["isLogin","diyProduct"])),{},{showVip:function(){return!this.is_money_level&&this.storeInfo.vip_price&&this.storeInfo.is_vip&&this.diyProduct.showSvip},cardBg:function(){return"url(".concat(this.activityBg,")")},showVipPrice:function(){if(this.storeInfo.vip_price>0&&1==this.storeInfo.is_vip&&"member"==this.storeInfo.price_type)return!0},computedPayPrice:function(){return this.computedPrice.deduction.pay_price},navBarStyle:function(){return{background:this.pageScrollStatus?"#fff":"transparent",paddingTop:2*this.sysHeight+"rpx"}},shareButtonStyle:function(){var t=o.getMenuButtonBoundingClientRect();return{width:t.height+"px",height:t.height+"px",top:t.top+"px",left:t.left-38+"px"}},menuButtonStyle:function(){var t=o.getMenuButtonBoundingClientRect();return{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:"11px",borderRadius:t.height+"px"}}}),watch:{isLogin:{handler:function(t,e){1==t&&this.getCartCount()},deep:!0}},onLoad:function(t){var e=getCurrentPages();if(this.returnShow=1!==e.length,this.id=t.id,this.isShow=t.isShow,this.promotions_type=t.promotions_type||0,this.fromType=t.fromType,t.scene){var i=this.$util.getUrlParams(decodeURIComponent(t.scene));i.id&&(t.id=i.id),i.spid&&(y.globalData.spid=i.spid)}if(!t.id)return this.showSkeleton=!1,this.$util.Tips({title:"缺少参数无法查看商品"},{tab:3,url:1});this.id=t.id,this.isLogin&&t.id&&this.downloadFilePromotionCode(),t.spid&&(y.globalData.spid=t.spid),this.getGoodsDetails(),this.colorData()},onReady:function(){this.isNodes++},onShow:function(){t.removeStorageSync("form_type_cart"),this.storeLists&&(this.storeList=this.storeLists,this.storeLists=null)},mounted:function(){var e=this;t.$off("activeFn"),t.$on("activeFn",(function(t){t&&(e.storeLists=t,e.storeId=t.id)}))},onShareAppMessage:function(){return this.$set(this,"actionSheetHidden",!this.actionSheetHidden),(0,c.userShare)(),{title:this.storeInfo.store_name||"",imageUrl:this.storeInfo.image||"",path:"/pages/goods_details/index?id="+this.id+"&spid="+this.uid}},onShareTimeline:function(){return this.$set(this,"actionSheetHidden",!this.actionSheetHidden),(0,c.userShare)(),{title:this.storeInfo.store_name||"",imageUrl:this.storeInfo.image||"",path:"/pages/goods_details/index?id="+this.id+"&spid="+this.uid}},methods:{deliveryFun:function(t){this.delivery_type=t},onAddressId:function(t){this.addressId=t.id},getStoreDetail:function(t,e){var i=this;(0,n.getProductStoreDetail)(e||this.id,{store_id:t}).then((function(t){var e=t.data.storeInfo;i.$set(i,"storeInfo",e),i.$set(i,"productValue",t.data.productValue),i.DefaultSelect()})).catch((function(t){return i.$util.Tips({title:t})}))},onstoreId:function(t,e){this.storeList=t,2==e||3==e?(this.store_id=t.id,this.storeId=t.id,this.store_name=t.name,this.getStoreDetail(t.id)):(this.store_id="",this.store_name="",this.getStoreDetail(0,this.storeInfo.pid))},showStoreList:function(){var e=this.storeInfo.pid?this.storeInfo.pid:this.storeInfo.id;t.navigateTo({url:"/pages/store/list/index?type=1&isCollage=1&storeId="+this.storeList.id+"&product_id="+e})},changeLogin:function(){(0,u.toLogin)()},seeEnsure:function(){this.ensureInfo.show=!0},seeSpecs:function(){this.specsInfo.show=!0},seeDiscount:function(){this.discountInfo.show=!0},moreNav:function(){this.currentPage=!this.currentPage},showImg:function(t){this.$refs.cusPreviewImg.open(this.selectSku.suk)},changeSwitch:function(t){var e=this,i=this.skuArr[t];this.$set(this,"selectSku",i);var o=i.suk.split(",");o.forEach((function(t,i){e.$set(e.attr.productAttr[i],"index",o[i])})),i&&(this.$set(this.attr.productSelect,"image",i.image),this.$set(this.attr.productSelect,"price",i.price),this.$set(this.attr.productSelect,"stock",i.stock),this.$set(this.attr.productSelect,"unique",i.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",i.vip_price),this.$set(this,"attrValue",i.suk),this.$set(this,"attrTxt","已选择"))},qrR:function(t){},boxStatus:function(t){this.showAnimate=t},followWX:function(){var t=this;(0,n.getProductCode)(this.id).then((function(e){t.followCode=e.data.code,t.getImageBase64(1)})).catch((function(e){t.$util.Tips({title:e})}))},getpreviewImage:function(){if(this.posterImage){var e=[];e.push(this.posterImage),t.previewImage({urls:e,current:this.posterImage})}else this.$util.Tips({title:"您的海报尚未生成"})},videoPause:function(){},closeChange:function(){this.$set(this.sharePacket,"isState",!0)},goActivity:function(e){var i=e;1==i.type?t.navigateTo({url:"/pages/activity/goods_details/index?id=".concat(i.id,"&type=1&time=").concat(i.time,"&status=1")}):2==i.type?t.navigateTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(i.id,"&spid=").concat(this.uid)}):t.navigateTo({url:"/pages/activity/goods_details/index?id=".concat(i.id,"&type=3")})},iptCartNum:function(t){this.$set(this.attr.productSelect,"cart_num",t)},backTap:function(){var e={id:this.id,cartNum:this.cartNum},i=getCurrentPages(),o=i[i.length-2];i.length>1?(this.fromType&&o.$vm.otherFun(e),t.navigateBack()):t.switchTab({url:"/pages/index/index"})},goDetail:function(e){0!=e.activity.length?e.activity&&2==e.activity.type?t.redirectTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(e.activity.id,"&spid=").concat(this.uid)}):e.activity&&3==e.activity.type?t.redirectTo({url:"/pages/activity/goods_details/index?id=".concat(e.activity.id,"&type=3")}):e.activity&&1==e.activity.type&&t.redirectTo({url:"/pages/activity/goods_details/index?id=".concat(e.activity.id,"&type=1&time=").concat(e.activity.time,"&status=1")}):t.redirectTo({url:"/pages/goods_details/index?id="+e.id})},getUserInfo:function(){var t=this;(0,c.getUserInfo)().then((function(e){t.$set(t.sharePacket,"isState",0==t.sharePacket.priceName),t.$set(t,"uid",e.data.uid),t.$set(t,"is_money_level",e.data.is_money_level),t.userInfo=e.data}))},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 i=e.stock||0,o=this.attr.productSelect;t?(o.cart_num++,o.cart_num>i&&(this.$set(this.attr.productSelect,"cart_num",i||1),this.$set(this,"cart_num",i||1))):(o.cart_num--,o.cart_num<1&&(this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"cart_num",1)))}},selectSwiper:function(){this.isSwiper=!0,this.$set(this,"productSwiper",this.storeInfo.slider_image),this.$set(this,"productVideoLink",this.storeInfo.video_link)},changeAttrPic:function(t,e){this.isSwiper=!1,this.ChangeAttr(t.suk),this.changeSwitch(e),this.$set(this,"productVideoLink",""),this.$set(this,"productSwiper",[t.image])},attrVal:function(t){this.$set(this.attr.productAttr[t.indexw],"index",this.attr.productAttr[t.indexw].attr_values[t.indexn])},ChangeAttr:function(t){var e=this.productValue[t];this.$set(this,"selectSku",e),e&&e.stock>=0?(this.$set(this.attr.productSelect,"delivery_price",e.delivery_price),this.$set(this.computedPrice.deduction,"pay_price",e.delivery_price),this.$set(this.computedPrice.deduction,"sum_price",e.price),this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.price),this.$set(this.attr.productSelect,"stock",e.stock),this.$set(this.attr.productSelect,"unique",e.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",e.vip_price),this.$set(this,"attrValue",t),this.$set(this,"attrTxt","已选择")):(this.$set(this.attr.productSelect,"delivery_price",this.storeInfo.price),this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this.attr.productSelect,"vip_price",this.storeInfo.vip_price),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择"))},getGoodsList:function(){var t=this,e=this;(0,n.getProductRecommend)(e.id).then((function(t){e.good_list=t.data||[]})).catch((function(e){return t.$util.Tips({title:e})}))},getGoodsCtivity:function(){var t=this,e=this;(0,n.getProductCtivity)(e.id,{promotions_type:this.promotions_type}).then((function(i){e.$set(e,"activityBg",i.data.activity_background.image||""),e.$set(e,"activity",i.data.activity?i.data.activity:[]),e.$set(e,"discountsData",i.data.discounts_products?i.data.discounts_products:[]);var o=i.data.promotions[0];if(e.$set(e,"promotions_type",i.data.promotions.length?o.promotions_type:0),i.data.promotions.length&&1==o.promotions_type){var s=e.$util.$h.Div(o.discount,100),r=e.$util.$h.Mul(s,t.storeInfo.price);e.$set(e.limitInfo,"price",t.storeInfo.price||0),e.$set(e.limitInfo,"datatime",o.stop_time||0),e.$set(e.limitInfo,"discount",s),e.$set(e.limitInfo,"discount_price",r)}e.$set(e.discountInfo,"discount",i.data.promotions),i.data.coupons.map((function(e){t.$set(e,"ruleshow",!1)})),e.$set(e.coupon,"list",i.data.coupons),e.$set(e,"computedPrice",i.data.computed)})).catch((function(e){return t.$util.Tips({title:e})}))},getGoodsDetails:function(){var e=this,i=this;(0,n.getProductDetail)(i.id,{promotions_type:this.promotions_type}).then((function(o){var s=o.data.storeInfo;1==s.type?-1!=s.delivery_type.indexOf("1")&&(s.delivery_type.sort((function(t,e){return t-e})),s.delivery_type.push(s.delivery_type.shift())):s.delivery_type.sort((function(t,e){return t-e})),i.$set(i.attr,"deliveryType",s.delivery_type),-1!=o.data.storeInfo.delivery_type.indexOf("2")&&i.$set(i,"isMention",!0),i.$set(i,"is_store_buy",o.data.is_store_buy||0),i.$set(i,"storeInfo",s),i.$set(i.attr,"isType",o.data.storeInfo.type),i.$set(i.attr,"relation_id",o.data.storeInfo.relation_id),i.$set(i,"productSwiper",s.slider_image),i.$set(i,"productVideoLink",s.video_link),i.$set(i.ensureInfo,"ensure",s.ensure);var r=[],n=[];for(var c in s.ensure.forEach((function(t){r.push(t.name)})),s.specs.forEach((function(t){n.push(t.name)})),i.$set(i.ensureInfo,"ensureTitle",r.join(" · ")),i.$set(i.specsInfo,"specsTitle",n.join(" · ")),i.$set(i.specsInfo,"specs",s.specs),i.$set(i,"description",s.description),e.description&&(e.description=e.description.replace(/<img/gi,'<img style="max-width:100%;height:auto;float:left;display:block" '),e.description=e.description.replace(/<video/gi,'<video style="width:100%;height:auto;display:block" ')),i.$set(i.attr,"productAttr",o.data.productAttr),i.$set(i,"productValue",o.data.productValue),o.data.productValue){var a=o.data.productValue[c];i.skuArr.push(a)}i.skuArr.length||(i.skuArr=[{image:e.storeInfo.image,suk:e.storeInfo.store_name,price:e.storeInfo.price}]),e.$set(e,"selectSku",i.skuArr[0]),i.$set(i,"is_vip",o.data.storeInfo.is_vip),i.siteName=o.data.site_name,i.posterTitle=o.data.product_poster_title,i.$set(i,"reply",o.data.reply),i.$set(i,"replyCount",o.data.replyCount),i.$set(i,"replyChance",o.data.replyChance),i.$set(i.sharePacket,"priceName",o.data.priceName),i.$set(i,"shareQrcode",o.data.share_qrcode),i.$set(i,"routineContact",Number(o.data.routine_contact_type)),t.setNavigationBarTitle({title:s.store_name.substring(0,13)+"..."}),i.$set(i,"diff",i.$util.$h.Sub(s.price,s.vip_price)),i.getGoodsList(),i.getGoodsCtivity(),i.isLogin&&i.getUserInfo(),i.downloadFilestoreImage(),i.DefaultSelect(),i.getCartCount(),i.preloadImage(),setTimeout((function(){e.showSkeleton=!1}),200)})).catch((function(t){return i.$util.Tips({title:t.toString()},{tab:3,url:1})}))},preloadImage:function(){t.downloadFile({url:this.imgHost+"/statics/images/poster_loading.png",success:function(t){}})},DefaultSelect:function(){var t=this,e=this.attr.productAttr,i=[],o=[];for(var s in this.productValue)if(this.productValue[s].stock>0){i=this.attr.productAttr.length?s.split(","):[];break}o=!i.length&&this.attr.productAttr.length?Object.keys(this.productValue)[0].split(","):i;for(var r=0;r<e.length;r++)this.$set(e[r],"index",o[r]);var n=this.productValue[o.join(",")];this.$set(this.attr.productSelect,"store_name",this.storeInfo.store_name),n&&e.length?(this.$set(this.attr.productSelect,"delivery_price",n.delivery_price),this.$set(this.attr.productSelect,"image",n.image),this.$set(this.attr.productSelect,"price",n.price),this.$set(this.attr.productSelect,"stock",n.stock),this.$set(this.attr.productSelect,"unique",n.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",o.join(",")),this.$set(this.attr.productSelect,"vip_price",n.vip_price),this.$set(this,"attrTxt","已选择")):!n&&e.length?(this.$set(this.attr.productSelect,"delivery_price",this.storeInfo.price),this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this.attr.productSelect,"vip_price",this.storeInfo.vip_price),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择")):n||e.length||(setTimeout((function(){t.$set(t.attr.productSelect,"delivery_price",t.computedPayPrice)}),1e3),this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"stock",this.storeInfo.stock),this.$set(this.attr.productSelect,"unique",this.storeInfo.unique||""),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",this.storeInfo.vip_price),this.$set(this,"attrValue",""),this.$set(this,"attrTxt","请选择"))},openPerferentDrawer:function(){this.showPerferentDrawer=!0},setCollect:(0,p.Debounce)((function(){if(!1===this.isLogin)(0,u.toLogin)();else{var t=this;this.storeInfo.userCollect?(0,n.collectDel)(this.storeInfo.id).then((function(e){return t.$set(t.storeInfo,"userCollect",!t.storeInfo.userCollect),t.$util.Tips({title:e.msg})})):(0,n.collectAdd)(this.storeInfo.id).then((function(e){return t.$set(t.storeInfo,"userCollect",!t.storeInfo.userCollect),t.$util.Tips({title:e.msg})}))}})),selecAttr:(0,p.Debounce)((function(){this.isLogin?(2!=this.storeInfo.delivery_type[0]&&3!=this.storeInfo.delivery_type[0]||t.getStorageSync("refuseLocation")||this.$refs.productWindow.showLocation(),this.currentPage=!1,this.$set(this.attr,"cartAttr",!0),this.$set(this,"isOpen",!0)):(0,u.toLogin)()})),onMyEvent:function(){this.$set(this.attr,"cartAttr",!1),this.$set(this,"isOpen",!1)},myEnsure:function(){this.$set(this.ensureInfo,"show",!1)},mySpecs:function(){this.$set(this.specsInfo,"show",!1)},myDiscount:function(){this.$set(this.discountInfo,"show",!1)},onConfirm:function(){this.$set(this.attr,"cartAttr",!1),this.isOpen=!0,"cart"==this.cartType?this.goCat(void 0,"cart"):this.goCat(!0,"buy")},joinCart:function(t){this.currentPage=!1,this.isLogin?this.goCat(void 0,"cart"):(0,u.toLogin)()},goCat:function(e,i){2!=this.storeInfo.delivery_type[0]&&3!=this.storeInfo.delivery_type[0]||t.getStorageSync("refuseLocation")||this.$refs.productWindow.showLocation();var o=this,s=o.productValue[this.attrValue];if(this.cartType=i,o.attrValue?o.attr.cartAttr=!o.isOpen:o.isOpen?o.attr.cartAttr=!0:o.attr.cartAttr=!o.attr.cartAttr,!0===o.attr.cartAttr&&!1===o.isOpen)return o.isOpen=!0;if(o.attr.productAttr.length&&void 0===s&&!0===o.isOpen)return o.$util.Tips({title:"产品库存不足,请选择其它属性"});if(o.attr.productSelect.cart_num<=0)return o.attr.productSelect.cart_num=1,o.isOpen=!1,o.$util.Tips({title:"请先选择属性"});var r={cartNum:o.attr.productSelect.cart_num,new:void 0===e?0:1,uniqueId:void 0!==o.attr.productSelect?o.attr.productSelect.unique:"",store_id:this.store_id,addressId:this.addressId,delivery_type:this.delivery_type};o.is_store_buy||2==this.delivery_type||3==this.delivery_type?r.productId=o.storeInfo.id:r.productId=o.id;var c=o.delivery_type;(0,n.postCartAdd)(r).then((function(i){o.isOpen=!1,o.attr.cartAttr=!1,e?t.navigateTo({url:"/pages/goods/order_confirm/index?new=1&cartId="+i.data.cartId+"&delivery_type="+c+"&addressId="+o.addressId+"&store_id="+o.store_id+"&store_name="+o.store_name+"&product_id="+o.storeInfo.id+"&is_store="+(o.store_id?1:0)}):o.$util.Tips({title:"添加购物车成功",success:function(){o.cartNum=i.data.cartNum,o.getCartCount(!0)}})})).catch((function(t){return o.isOpen=!1,o.$util.Tips({title:t})}))},getCartCount:function(t){var e=this,i=this,o=i.isLogin;o&&(0,a.getCartCounts)(0).then((function(o){i.CartCount=o.data.count,e.$store.commit("indexData/setCartNum",i.CartCount+""),t&&(i.animated=!0,setTimeout((function(){i.animated=!1}),500))}))},goBuy:function(t){this.currentPage=!1,this.isLogin?this.goCat(!0,"buy"):(0,u.toLogin)()},listenerActionSheet:function(){this.currentPage=!1,this.posters=!0,this.goPoster()},listenerActionClose:function(){this.posters=!1},posterImageClose:function(){this.posterImageStatus=!1,this.posters=!1},setDomain:function(t){return t=t?t.toString():"",t.indexOf("https://")>-1?t:t.replace("http://","https://")},downloadFilestoreImage:function(){var e=this;t.downloadFile({url:e.setDomain(e.storeInfo.image),success:function(t){e.storeImage=t.tempFilePath,e.base64Show=1},fail:function(){return e.$util.Tips({title:""})}})},downloadFilePromotionCode:function(e){var i=this;(0,n.getProductCode)(i.id).then((function(o){t.downloadFile({url:i.setDomain(o.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","")}))},getImageBase64:function(t){var e=this;(0,l.imageBase64)(e.storeImage,e.followCode).then((function(i){e.storeImage=i.data.image,t&&(e.PromotionCode=i.data.code),e.base64Show=1})).catch((function(){}))},goPoster:function(){var e=this;e.$set(e,"canvasStatus",!0);var i=[e.posterbackgd,e.storeImage,e.PromotionCode];return""!=e.PromotionCode||e.isDown?e.isDown?e.$util.Tips({title:"正在下载海报,请稍后再试!"},(function(){e.posters=!1})):void t.getImageInfo({src:e.PromotionCode,fail:function(t){return e.$util.Tips({title:"小程序二维码需要发布正式版后才能获取到"})},success:function(){""==i[2]?e.downloadFilePromotionCode((function(t){if(i[2]=t,""==i[2])return e.$util.Tips({title:"海报二维码生成失败!"});e.$nextTick((function(){setTimeout((function(){e.$util.PosterCanvas(e.fontColor,e.themeColor,e.siteName,i,e.storeInfo.store_name,e.storeInfo.price,e.storeInfo.ot_price,e.posterTitle,(function(t){e.$set(e,"posterImage",t),e.$set(e,"posterImageStatus",!0),e.$set(e,"canvasStatus",!1),e.$set(e,"actionSheetHidden",!e.actionSheetHidden)}))}),1e3)}))})):e.$nextTick((function(){setTimeout((function(){e.$util.PosterCanvas(e.fontColor,e.themeColor,e.siteName,i,e.storeInfo.store_name,e.storeInfo.price,e.storeInfo.ot_price,e.posterTitle,(function(t){e.$set(e,"posterImage",t),e.$set(e,"posterImageStatus",!0),e.$set(e,"canvasStatus",!1),e.$set(e,"actionSheetHidden",!e.actionSheetHidden)}))}),1e3)}))}}):e.$util.Tips({title:"小程序二维码需要发布正式版后才能获取到"},(function(){e.posters=!1}))},copyCommand:function(){o.navigateToMiniProgram&&o.navigateToMiniProgram({appId:"wxb036cafe2994d7d0",path:"/publish/ugc-publish/ugc-publish",extraData:{productInfo:{title:this.storeInfo.store_name,path:"/pages/goods_details/index?id="+this.storeInfo.id,thumbUrl:this.storeInfo.image}}})},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:"保存成功",icon:"success"})},fail:function(t){e.$util.Tips({title:"保存失败"})}}):t.authorize({scope:"scope.writePhotosAlbum",success:function(){t.saveImageToPhotosAlbum({filePath:e.posterImage,success:function(t){e.posterImageClose(),e.$util.Tips({title:"保存成功",icon:"success"})},fail:function(t){e.$util.Tips({title:"保存失败"})}})}})}})},goDiscounts:function(){t.navigateTo({url:"/pages/goods_details/discountsGoodsList?id="+this.id})},goPage:function(e,i){1==e?t.navigateTo({url:i}):2==e?t.switchTab({url:i}):3==e&&t.navigateBack()},ChangCouponsUseState:function(t){this.coupon.list[t].is_use=!0,this.$set(this.coupon,"list",this.coupon.list),this.$set(this.coupon,"coupon",!1)},ChangCoupons:function(t){},ruleToggle:function(t){this.coupon.list[t].ruleshow=!this.coupon.list[t].ruleshow},goGoodCall:function(){var t={};t="string"===typeof this.userInfo?JSON.parse(this.userInfo):this.userInfo;var e="/pages/extension/customer_list/chat?productId=".concat(this.id),i={store_name:this.storeInfo.store_name,path:"/pages/goods_details/index?id=".concat(this.storeInfo.id),image:this.storeInfo.image};this.$util.getCustomer(t,e,i,1)},colorData:function(){var t=this,e=[{themeColor:"#1DB0FC",fontColor:"#FD502F"},{themeColor:"#42CA4D",fontColor:"#FF7600"},{themeColor:"#e93323",fontColor:"#e93323"},{themeColor:"#FF448F",fontColor:"#FF448F"},{themeColor:"#FE5C2D",fontColor:"#FE5C2D"},{themeColor:"#E0A558",fontColor:"#DA8C18"}];setTimeout((function(){switch(t.colorNum){case 1:t.themeColor=e[0].themeColor,t.fontColor=e[0].fontColor;break;case 2:t.themeColor=e[1].themeColor,t.fontColor=e[1].fontColor;break;case 3:t.themeColor=e[2].themeColor,t.fontColor=e[2].fontColor;break;case 4:t.themeColor=e[3].themeColor,t.fontColor=e[3].fontColor;break;case 5:t.themeColor=e[4].themeColor,t.fontColor=e[4].fontColor;break;case 6:t.themeColor=e[5].themeColor,t.fontColor=e[5].fontColor;break;default:t.themeColor=e[2].themeColor,t.fontColor=e[2].fontColor;break}}),1)}},onPageScroll:function(e){this.$set(this,"currentPage",!1),e.scrollTop>340?this.pageScrollStatus=!0:e.scrollTop<340&&(this.pageScrollStatus=!1),t.$emit("scroll")}};e.default=_}).call(this,i("df3c")["default"],i("3223")["default"])}},[["10c2","common/runtime","common/vendor"]]]);