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

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/behalf/common/vendor"],{a28f:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=i("e727"),r={data:function(){return{attr:{cartAttr:!1,productAttr:[],productSelect:{},deliveryType:[]},productValue:[],id:0}},created:function(){},methods:{DefaultSelect:function(){var t=this.attr.productAttr,e=[],i=[];for(var s in this.productValue)if(this.productValue[s].stock>0){e=this.attr.productAttr.length?s.split(","):[];break}i=!e.length&&this.attr.productAttr.length?Object.keys(this.productValue)[0].split(","):e;for(var r=0;r<t.length;r++)this.$set(t[r],"index",i[r]);var c=this.productValue[i.join(",")];this.$set(this.attr.productSelect,"store_name",this.storeInfo.store_name),c&&t.length?(this.$set(this.attr.productSelect,"image",c.image),this.$set(this.attr.productSelect,"price",c.price),this.$set(this.attr.productSelect,"stock",c.stock),this.$set(this.attr.productSelect,"unique",c.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",i.join(",")),this.$set(this.attr.productSelect,"vip_price",c.vip_price),this.$set(this,"attrTxt","已选择")):!c&&t.length?(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","请选择")):c||t.length||(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","请选择"))},ChangeAttr:function(t){var e=this.productValue[t];this.$set(this,"selectSku",e),e&&e.stock>=0?(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,"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","请选择"))},attrVal:function(t){this.$set(this.attr.productAttr[t.indexw],"index",this.attr.productAttr[t.indexw].attr_values[t.indexn])},iptCartNum:function(t){this.$set(this.attr.productSelect,"cart_num",t)},onMyEvent:function(){this.$set(this.attr,"cartAttr",!1)},ChangeCartNumDuo:function(t){if(t){if(this.attr.productSelect.cart_num==this.attr.productSelect.stock)return this.$util.Tips({title:"该产品没有更多库存了"});this.attr.productSelect.cart_num++}else{if(1==this.attr.productSelect.cart_num)return;this.attr.productSelect.cart_num--}},goCatNum:function(t){this.goCartChange(!0,null,t)},goCartChange:function(e,i,r){var c=this,a={productId:e?this.id:i,cartNum:e?this.attr.productSelect.cart_num:1,uniqueId:e?this.attr.productSelect.unique:"",new:r,tourist_uid:this.touristId};(0,s.adminCartAdd)(this.userId,a).then((function(i){e&&(c.attr.cartAttr=!1),r&&t.navigateTo({url:"/pages/behalf/order_confirm/index?cartId=".concat(i.data.cartId,"&uid=").concat(c.userId,"&news=1&delivery_type=").concat(c.delivery_type,"&addressId=").concat(c.addressId,"&store_id=").concat(c.store_id)}),c.$util.Tips({title:"加入购物车成功"}),c.getCartList(1)})).catch((function(t){return c.$util.Tips({title:t})}))},goCartDuo:function(t){this.isLogin?(this.storeName=t.store_name,this.getAttrs(t.id),this.$set(this,"id",t.id),this.$set(this.attr,"isType",t.type),this.$set(this.attr,"deliveryType",t.delivery_type),this.$set(this.attr,"cartAttr",!0)):toLogin()},goCartDan:function(t){this.isLogin?this.goCartChange(!1,t.id,1==t.cart_button?0:1):this.getIsLogin()},closeList:function(t){this.$set(this.cartData,"iScart",t)},selectitem:function(t){this.cartData.cartList[t].select=!this.cartData.cartList[t].select;var e=this.cartData.cartList.filter((function(t){return 1==t.select}));e.length==this.cartData.cartList.length?this.$refs.cartPopup.allSelect=!0:this.$refs.cartPopup.allSelect=!1},selectAll:function(t){var e=this;this.cartData.cartList.map((function(i){e.$set(i,"select",!t)}))},cartDelChange:function(){var t=this,e=[];if(this.cartData.cartList.forEach((function(t){t.select&&e.push(t.id)})),!e.length)return this.$util.Tips({title:"请先选择商品"});(0,s.adminCartDel)(this.userId,{ids:e.toString(),tourist_uid:this.touristId}).then((function(e){t.getCartList(0),t.$util.Tips({title:err})})).catch((function(e){return t.$util.Tips({title:e})}))},cartNumChange:function(t){var e=this;if(t.type){if(t.item.cart_num==t.item.productInfo.attrInfo.stock)return this.$util.Tips({title:"该产品没有更多库存了"})}else if(1==t.item.cart_num)return;(0,s.adminCartNum)(this.userId,{id:t.item.id,number:t.type?t.item.cart_num+1:t.item.cart_num-1,tourist_uid:this.touristId}).then((function(i){t.type?e.cartData.cartList[t.index].cart_num++:e.cartData.cartList[t.index].cart_num--,e.getTotalPrice(),e.$util.Tips({title:i.msg})})).catch((function(t){return e.$util.Tips({title:t})}))}}};e.default=r}).call(this,i("df3c")["default"])}}]);