(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-index-page/diy-index-page"],{"41d1":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(){Promise.all([i.e("common/vendor"),i.e("components/ns-goods-item/ns-goods-item-row")]).then(function(){return resolve(i("7c7c"))}.bind(null,i)).catch(i.oe)},s=function(){i.e("components/ns-loading/ns-loading").then(function(){return resolve(i("b14a"))}.bind(null,i)).catch(i.oe)},n={props:{Bulge:{type:Boolean},value:{type:Object},scrollHeight:{type:String},scrollTopHeight:{type:String},bgUrl:{type:String}},components:{nsGoodsItemRow:o,nsLoading:s},data:function(){return{pageIndex:0,cateList:[{category_name:"首页"}],twoCategorylist:[],twoCategorylistId:0,goodsList:{},scrollTop:0,scrollTopCopy:0,isloading:!0,defaultImage:this.$util.getDefaultImage().default_goods_img}},computed:{maxPage:function(){var t=0;return this.twoCategorylist&&this.twoCategorylist.length&&(t=Math.ceil(this.twoCategorylist.length/10)),t},type:function(){return!!this.value}},watch:{type:function(t,e){console.log(t,e),t&&this.getCategoryList()}},mounted:function(){var t=this;this.getCategoryList(),setTimeout((function(){console.log(t.scrollHeight)}),3e3)},methods:{getCategoryList:function(){var t=this,e="/api/goodscategory/tree",i={level:3,template:2};this.$api.sendRequest({url:e,data:i,success:function(e){if(console.log(e),e.code>=0){var i=[],o={list:[],isAll:!1};console.log(123456789),console.log(t.value),o.category_name=t.value.title?t.value.title:"首页",i.push(o),t.cateList=i.concat(e.data),console.log(t.cateList),Object.keys(t.cateList).forEach((function(e,i){t.goodsList[e]={page:1,list:[],isAll:!1}})),t.twoCategorylist=t.cateList[t.pageIndex].child_list}}})},changePageIndex:function(t){var e=this;if(this.pageIndex=t,0!=t){this.twoCategorylist=this.cateList[this.pageIndex].child_list,this.twoCategorylist=this.cateList[this.pageIndex].child_list,this.cateList[this.pageIndex].child_list?(this.twoCategorylist=this.cateList[this.pageIndex].child_list,this.twoCategorylist.forEach((function(t){t.image?t.image=e.$util.img(t.image):t.image=e.$util.getDefaultImage().default_goods_img}))):this.twoCategorylist=!1;var i=t;this.goodsList[i]&&this.goodsList[i].length||(this.scrollTop=this.scrollTopCopy,this.$nextTick((function(){this.scrollTop=0})),this.getGoodsList())}},swiperChange:function(t){this.changePageIndex(t.detail.current)},swiperTocategoryChange:function(t){this.twoCategorylistId=t.detail.current},toDetail:function(t){this.$util.redirectTo("/pages/goods/detail/detail",{sku_id:t.sku_id})},scroll:function(t){this.scrollTopCopy=t.detail.scrollTop},getGoodsList:function(){var t=this,e=this.pageIndex,i={page:this.goodsList[e].page,page_size:10};i.category_id=this.cateList[this.pageIndex].category_id_1,i.category_level=1,this.$api.sendRequest({url:"/api/goodssku/page",data:i,success:function(i){t.isloading=!1,0==i.code&&i.data&&(t.goodsList[e].list=t.goodsList[e].list.concat(i.data.list),t.goodsList[e].list.length==i.data.count&&(t.goodsList[e].isAll=!0),t.goodsList[e].page+=1),t.$forceUpdate()}})},scrolltolower:function(){var t=this.pageIndex;this.goodsList[t].isAll||(this.isloading=!0,this.getGoodsList())},toCateGoodsList:function(t,e){this.$util.redirectTo("/pages/goods/list/list",{category_id:t,category_level:e})}}};e.default=n},"73ab":function(t,e,i){"use strict";var o={nsLoading:function(){return i.e("components/ns-loading/ns-loading").then(i.bind(null,"b14a"))}},s=function(){var t=this,e=t.$createElement,i=(t._self._c,t.$util.img(t.bgUrl)),o=t.$util.getDefaultImage(),s=t.__map(t.twoCategorylist,(function(e,i){var o=t.$util.img(e.image);return{$orig:t.__get_orig(e),g1:o}})),n=t.$util.getDefaultImage(),a=t.__map(t.twoCategorylist,(function(e,i){var o=t.$util.img(e.image);return{$orig:t.__get_orig(e),g3:o}})),l=t.$util.img(t.cateList[t.pageIndex].image_adv);t.$mp.data=Object.assign({},{$root:{g0:i,g2:o,l0:s,g4:n,l1:a,g5:l}})},n=[];i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return o}))},"77f1":function(t,e,i){"use strict";i.r(e);var o=i("73ab"),s=i("e1bb");for(var n in s)"default"!==n&&function(t){i.d(e,t,(function(){return s[t]}))}(n);i("b606");var a,l=i("f0c5"),g=Object(l["a"])(s["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=g.exports},"79d6":function(t,e,i){},b606:function(t,e,i){"use strict";var o=i("79d6"),s=i.n(o);s.a},e1bb:function(t,e,i){"use strict";i.r(e);var o=i("41d1"),s=i.n(o);for(var n in o)"default"!==n&&function(t){i.d(e,t,(function(){return o[t]}))}(n);e["default"]=s.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/diy-index-page/diy-index-page-create-component',
    {
        'components/diy-index-page/diy-index-page-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("77f1"))
        })
    },
    [['components/diy-index-page/diy-index-page-create-component']]
]);
