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 line
21 KiB
1 line
21 KiB
8 months ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-distributor-index"],{"16a7":function(t,i,e){"use strict";var a=e("9fb6"),r=e.n(a);r.a},"2b00":function(t,i,e){"use strict";e("7a82");var a=e("4ea4").default;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,e("a9e3");var r=e("6859"),s=e("f823"),o=e("736f"),n=a(e("b739")),d=e("26cb"),c=e("f26a"),u={components:{ProductWindow:n.default},computed:(0,d.mapGetters)(["viewColor","keyColor"]),data:function(){return{domain:c.HTTP_REQUEST_URL,explainShow:!1,menus:[],fastList:[],userInfo:{},distribution:[],explainTxt:"",attr:{cartAttr:!1,productAttr:[],productSelect:{}},productValue:[],storeInfo:{},attrValue:"",attrTxt:"请选择",cart_num:1,id:0,loadend:!1,loading:!1,loadTitle:"加载更多",where:{page:1,limit:20},openActivity:!1}},onLoad:function(){},onShow:function(){this.bagExplain(),this.productBag(),this.bagRecommend(),this.getUserInfo()},onReachBottom:function(){this.productBag()},methods:{goBuy:function(t){this.id=t.product_id,this.getGoodsDetails(t)},onMyEvent:function(){this.$set(this.attr,"cartAttr",!1)},getGoodsDetails:function(t){uni.showLoading({title:"加载中",mask:!0});var i=this;(0,o.getProductDetail)(t.product_id).then((function(t){uni.hideLoading(),i.attr.cartAttr=!0;var e=t.data;i.$set(i,"storeInfo",e),i.$set(i.attr,"productAttr",t.data.attr),i.$set(i,"productValue",t.data.sku),i.DefaultSelect()})).catch((function(t){uni.hideLoading()}))},ChangeAttr:function(t){var i=this.productValue[t];i&&i.stock>0?(this.$set(this.attr.productSelect,"image",i.image),this.$set(this.attr.productSelect,"price",i.price),this.$set(this.attr.productSelect,"svip_price",i.svip_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,"attrValue",t),this.$set(this,"attrTxt","已选择")):(this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"svip_price",i.svip_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,"attrValue",""),this.$set(this,"attrTxt","请选择"))},DefaultSelect:function(){var t=this.attr.productAttr,i=[];for(var e in this.productValue)if(this.productValue[e].stock>0){i=this.attr.productAttr.length?e.split(","):[];break}for(var a=0;a<t.length;a++)this.$set(t[a],"index",i[a]);var r=this.productValue[i.join(",")];r&&t.length?(this.$set(this.attr.productSelect,"store_name",this.storeInfo.store_name),this.$set(this.attr.productSelect,"image",r.image),this.$set(this.attr.productSelect,"price",r.price),this.$set(this.attr.productSelect,"svip_price",r.svip_price),this.$set(this.attr.productSelect,"stock",r.stock),this.$set(this.attr.productSelect,"unique",r.unique),this.$set(this,"attrValue",i.join(",")),this.$set(this,"attrTxt","已选择"),0==r.stock?this.$set(this.attr.productSelect,"cart_num",0):this.$set(this.attr.productSelect,"cart_num",1)):!r&&t.length?(this.$set(this.attr.productSelect,"store_name",this.storeInfo.store_name),this.$set(this.attr.productSelect,"image",this.storeInfo.image),this.$set(this.attr.productSelect,"price",this.storeInfo.price),this.$set(this.attr.productSelect,"svip_price",r.svip_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,"attrValue",""),this.$set(this,"attrTxt","请选择")):r||t.length?r&&!t.length&&(this.$set(this.attr.productSelect,"store_name",this.storeInfo.store_name),this.$set(this.attr.productSelect,"image",r.image),this.$set(this.attr.productSelect,"price",r.price),this.$set(this.attr.productSelect,"svip_price",r.svip_price),this.$set(this.attr.productSelect,"stock",r.stock),this.$set(this.attr.productSelect,"unique",r.unique),this.$set(this,"attrValue",i.join(",")),this.$set(this,"attrTxt","已选择"),0==r.stock?this.$set(this.attr.productSelect
|