(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_cate/goods_cate3"],{"2d6c":function(t,e,i){"use strict";i.r(e);var r=i("4d61"),a=i("addc");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("3d4a");var c=i("f0c5"),n=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);e["default"]=n.exports},"3d4a":function(t,e,i){"use strict";var r=i("418a"),a=i.n(r);a.a},"418a":function(t,e,i){},"4d61":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return r}));var r={uniBadge:function(){return i.e("uni_modules/uni-badge/components/uni-badge/uni-badge").then(i.bind(null,"f8f0"))}},a=function(){var t=this.$createElement;this._self._c},s=[]},"8c4b6":function(t,e,i){"use strict";(function(t){var r=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=r(i("9523")),s=i("f8b7"),c=i("bcf5"),n=i("26cb"),o=i("3e4f"),u=i("8e8a");function h(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function d(t){for(var e=1;e0){e=this.attr.productAttr.length?i.split(","):[];break}for(var r=0;r0?(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,"vip_price",e.vip_price),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",t)):e&&0==e.stock?(this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.price),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"vip_price",e.vip_price),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this,"attrValue","")):(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,"vip_price",this.storeInfo.vip_price),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this,"attrValue",""))},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)},productslist:function(){var t=this;t.loadend||t.loading||(t.loading=!0,t.loadTitle="",(0,s.getProductslist)({page:t.page,limit:t.limit,type:1,cid:t.cid,sid:t.sid}).then((function(e){var i=e.data,r=i.lengthi)return r?(this.$set(this.attr.productSelect,"cart_num",i||1),this.$set(this,"cart_num",i||1)):(e.cart_num=i||0,this.$set(this,"tempArr",this.tempArr),this.$set(this.cartData,"cartList",this.cartData.cartList)),this.$util.Tips({title:"该产品没有更多库存了"});r||(c?(this.goCat(0,a,1,1,e.product_attr_unique),this.getTotalPrice()):this.goCat(0,a,1))}else e.cart_num--,0==e.cart_num&&(this.cartData.cartList.splice(s,1),r&&(this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"cart_num",1))),e.cart_num<0?r?(this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"cart_num",1)):(e.cart_num=0,this.$set(this,"tempArr",this.tempArr),this.$set(this.cartData,"cartList",this.cartData.cartList)):r||(c?(this.goCat(0,a,0,1,e.product_attr_unique),this.getTotalPrice()):this.goCat(0,a,0));this.tempArr.forEach((function(t){t.id==a&&(t.cart_num=e.cart_num)}))},goCatNum:function(){this.goCat(1,this.id,1)},goCat:function(t,e,i,r,a){var c=this;if(t){var n=c.productValue[this.attrValue];if(c.attr.productAttr.length&&void 0===n)return c.$util.Tips({title:"产品库存不足,请选择其它属性"})}var o={product_id:e,num:t?c.attr.productSelect.cart_num:1,type:i,unique:t?c.attr.productSelect.unique:r?a:""};(0,s.postCartNum)(o).then((function(e){t&&(c.attr.cartAttr=!1,c.$util.Tips({title:"添加购物车成功"}),c.tempArr.forEach((function(t,e){if(t.id==c.id){var i=c.attr.productSelect.stock,r=parseInt(t.cart_num)+parseInt(c.attr.productSelect.cart_num);t.cart_num=r>i?i:r}}))),c.getCartNum(),r||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,"cartAttr",!0)):this.getIsLogin()},getIsLogin:function(){(0,u.toLogin)()},getAttrs:function(t){var e=this;(0,s.getAttr)(t,0).then((function(t){e.$set(e.attr,"productAttr",t.data.productAttr),e.$set(e,"productValue",t.data.productValue),e.$set(e,"is_vip",t.data.storeInfo.is_vip),e.$set(e,"storeInfo",t.data.storeInfo),e.DefaultSelect()}))},goDetail:function(e){(0,o.goShopDetail)(e,this.uid).then((function(i){t.navigateTo({url:"/pages/goods_details/index?id=".concat(e.id,"&fromType=1")})}))},openTap:function(){this.iSlong=!1},closeTap:function(){this.iSlong=!0},getAllCategory:function(){var t=this;(0,s.getCategoryList)().then((function(e){var i=e.data;i.forEach((function(t){t.children.unshift({id:0,cate_name:"全部"})})),t.categoryTitle=i[0].cate_name,t.cid=i[0].id,t.sid=0,t.navActive=0,t.tabClick=0,t.categoryList=i,t.categoryErList=e.data[0].children?e.data[0].children:[],t.page=1,t.loadend=!1,t.tempArr=[],t.productslist()}))},tapNav:function(e,i){t.pageScrollTo({duration:0,scrollTop:0});var r=this.categoryList[e];this.navActive=e,this.categoryTitle=r.cate_name,this.categoryErList=i.children?i.children:[],this.tabClick=0,this.tabLeft=0,this.cid=r.id,this.sid=0,this.page=1,this.loadend=!1,this.tempArr=[],this.productslist()},longClick:function(t){this.categoryErList.length>3&&(this.tabLeft=(t-1)*(this.isWidth+6)),this.tabClick=t,this.iSlong=!0,this.sid=this.categoryErList[t].id,this.page=1,this.loadend=!1,this.tempArr=[],this.productslist()}},onReachBottom:function(){this.productslist()}};e.default=p}).call(this,i("543d")["default"])},addc:function(t,e,i){"use strict";i.r(e);var r=i("8c4b6"),a=i.n(r);for(var s in r)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(s);e["default"]=a.a}}]); ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ 'pages/goods_cate/goods_cate3-create-component', { 'pages/goods_cate/goods_cate3-create-component':(function(module, exports, __webpack_require__){ __webpack_require__('543d')['createComponent'](__webpack_require__("2d6c")) }) }, [['pages/goods_cate/goods_cate3-create-component']] ]);