1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cats/cats"],{2437:function(t,e,a){"use strict";var i;a.d(e,"b",(function(){return s})),a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){return i}));var s=function(){var t=this,e=t.$createElement;t._self._c},n=[]},4282:function(t,e,a){"use strict";a.r(e);var i=a("50eb"),s=a.n(i);for(var n in i)"default"!==n&&function(t){a.d(e,t,(function(){return i[t]}))}(n);e["default"]=s.a},"50eb":function(t,e,a){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=c(a("a34a")),s=a("2f62"),n=c(a("c799"));function c(t){return t&&t.__esModule?t:{default:t}}function r(t,e,a,i,s,n,c){try{var r=t[n](c),o=r.value}catch(l){return void a(l)}r.done?e(o):Promise.resolve(o).then(i,s)}function o(t){return function(){var e=this,a=arguments;return new Promise((function(i,s){var n=t.apply(e,a);function c(t){r(n,i,s,c,o,"next",t)}function o(t){r(n,i,s,c,o,"throw",t)}c(void 0)}))}}function l(t){return _(t)||h(t)||u(t)||d()}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"===typeof t)return f(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?f(t,e):void 0}}function h(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _(t){if(Array.isArray(t))return f(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function g(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function p(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?g(Object(a),!0).forEach((function(e){v(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):g(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function v(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var y=function(){a.e("pages/cats/style-one").then(function(){return resolve(a("4a60"))}.bind(null,a)).catch(a.oe)},b=function(){a.e("pages/cats/style-two").then(function(){return resolve(a("5240"))}.bind(null,a)).catch(a.oe)},m=function(){a.e("pages/cats/style-three").then(function(){return resolve(a("efff"))}.bind(null,a)).catch(a.oe)},w=function(){a.e("pages/cats/style-four").then(function(){return resolve(a("c9d8"))}.bind(null,a)).catch(a.oe)},x=function(){a.e("pages/cats/style-five").then(function(){return resolve(a("190d"))}.bind(null,a)).catch(a.oe)},$=function(){a.e("pages/cats/style-six").then(function(){return resolve(a("4b4c"))}.bind(null,a)).catch(a.oe)},k=function(){a.e("pages/cats/style-seven").then(function(){return resolve(a("34b9"))}.bind(null,a)).catch(a.oe)},O=function(){a.e("pages/cats/style-eight").then(function(){return resolve(a("a464"))}.bind(null,a)).catch(a.oe)},q=function(){a.e("pages/cats/style-nine").then(function(){return resolve(a("9861"))}.bind(null,a)).catch(a.oe)},I=function(){a.e("pages/cats/style-ten").then(function(){return resolve(a("bddf"))}.bind(null,a)).catch(a.oe)},P=function(){a.e("pages/cats/style-eleven").then(function(){return resolve(a("f22d"))}.bind(null,a)).catch(a.oe)},j=function(){a.e("components/page-component/app-search-for/app-search-for").then(function(){return resolve(a("83e7"))}.bind(null,a)).catch(a.oe)},S=function(){a.e("components/page-component/app-attr/app-attr").then(function(){return resolve(a("58fd"))}.bind(null,a)).catch(a.oe)},A={components:{"app-search-for":j,"style-one":y,"style-two":b,"style-three":m,"style-four":w,"style-five":x,"style-six":$,"style-seven":k,"style-eight":O,"style-nine":q,"style-ten":I,"style-eleven":P,"app-attr":S},data:function(){return{search_bool:!0,list:[],goods:[],request:!0,page:1,classId:0,activeIndex:0,activeIndexTwo:0,over:!1,scrollHeight:0,tabbarbool:!0,cat_id:0,cat_ids:[],againLower:!0,goods_list:[],page_count:1,select_cat_id:0,first_id:0,loading:!1,selectAttr:{},previewUrl:"",submitUrl:"",show:0,attrGroup:[],item:{}}},computed:p(p(p(p({},(0,s.mapGetters)("mallConfig",{cat_style:"getCatStyle"})),(0,s.mapState)("gConfig",{windowHeight:function(t){return t.systemInfo.windowHeight},windowWidth:function(t){return t.systemInfo.windowWidth}})),(0,s.mapGetters)("iPhoneX",{botHeight:"getBotHeight"})),{},{setHeight:function(){var t=0;return this.tabbarbool&&(t=this.botHeight),this.windowHeight*(750/this.windowWidth)-t-88}}),onReachBottom:function(){var e=this;"3"!==this.cat_style.cat_style&&"1"!==this.cat_style.cat_style&&(this.page<this.page_count?(this.page++,this.$request({url:this.$api.default.goods_list,method:"get",data:{page:this.page,cat_id:this.cat_id}}).then((function(t){var a;0===t.code&&("8"===e.cat_style.cat_style||"5"===e.cat_style.cat_style?e.dataProcessing(t.data.list):(a=e.goods_list).push.apply(a,l(t.data.list)))}))):t.showToast({title:"暂无更多商品",icon:"none"}))},methods:{onAttr:function(t){this.selectAttr=t},attr:function(t,e,a,i){this.previewUrl=t,this.submitUrl=e,this.attrGroup=a,this.item=i,this.show=Math.random()},route_advert:function(t){(0,n.default)({open_type:t.advert_open_type,params:t.advert_params,page_url:t.advert_url})},active:function(t){var e=this;this.page=1,this.goods_list=[],this.cat_id=t.id,this.select_cat_id=t.id;for(var a=0;a<this.list.length;a++)this.list[a].active!==t.active&&(this.list[a].active=!1),this.list[a].id===t.id&&(this.list[a].active=!0);this.$request({url:"".concat(this.$api.default.goods_list,"&page=").concat(this.page,"&cat_id=").concat(t.id)}).then((function(t){0===t.code&&(e.dataProcessing(t.data.list),e.page_count=t.data.pagination.page_count)}))},req:function(){var t=this;this.$request({url:"".concat(this.$api.default.goods_list,"&page=").concat(this.page,"&cat_id=").concat(this.classId)}).then((function(e){var a;e.data.list.length>0?"8"===t.cat_style.cat_style||"5"===t.cat_style.cat_style?t.dataProcessing(e.data.list):(a=t.goods).push.apply(a,l(e.data.list)):t.over=!0}))},activeOne:function(t){var e=this;this.page=1,this.activeIndexTwo=0,this.cat_id=t.id,this.select_cat_id=t.id;for(var a=0;a<this.list.length;a++)this.list[a].active!==t.active&&(this.list[a].active=!1),this.list[a].id===t.id&&(this.list[a].active=!0,this.activeIndex=a);"5"===this.cat_style.cat_style&&(this.goods_list=[]),0===this.list[this.activeIndex].child.length?this.$request({url:"".concat(this.$api.default.goods_list,"&page=").concat(this.page,"&cat_id=").concat(t.id)}).then((function(a){var i=a.data,s=i.list,n=i.pagination;"8"===e.cat_style.cat_style||"5"===e.cat_style.cat_style?(e.goods_list=[],e.dataProcessing(s)):e.goods_list=s,e.page=1,e.cat_id=t.id,e.select_cat_id=t.id,e.page_count=n.page_count})):this.$request({url:"".concat(this.$api.default.goods_list,"&page=").concat(this.page,"&cat_id=").concat(this.list[this.activeIndex].child[0].id)}).then((function(a){var i=a.data,s=i.list,n=i.pagination;"8"===e.cat_style.cat_style||"5"===e.cat_style.cat_style?(e.goods_list=[],e.dataProcessing(s)):e.goods_list=s,e.page=1,e.cat_id=e.list[e.activeIndex].child[0].id,e.select_cat_id=t.id,e.page_count=n.page_count}))},activeTwo:function(t,e){var a=this;return o(i.default.mark((function s(){var n,c,r,o;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return a.page=1,a.activeIndexTwo=e,a.select_cat_id=t.id,a.cat_id=t.id,a.select_cat_id=t.id,i.next=7,a.$request({url:a.$api.default.goods_list,method:"get",data:{page:1,cat_id:t.id}});case 7:n=i.sent,0===n.code&&(c=n.data,r=c.list,o=c.pagination,a.goods_list=[],"5"===a.cat_style.cat_style?(a.goods_list=[],a.dataProcessing(r)):a.goods_list=r,a.page_count=o.page_count);case 9:case"end":return i.stop()}}),s)})))()},activeThree:function(t){this.cat_id=t.id,this.select_cat_id=t.id;for(var e=0;e<this.list.length;e++)this.list[e].active!==t.active&&(this.list[e].active=!1),this.list[e].id===t.id&&(this.list[e].active=!0,this.activeIndex=e)},catLower:function(){var t=this;return o(i.default.mark((function e(){var a,s,n,c;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.againLower){e.next=2;break}return e.abrupt("return");case 2:return t.againLower=!1,a=t.goods_list[t.goods_list.length-1],e.next=6,t.$request({url:t.$api.default.cat_goods,method:"get",data:{cat_ids:JSON.stringify(t.cat_ids),cat_id:a.id,offset:a.offset}});case 6:if(s=e.sent,0===s.code){for(s.data.list[0].id===a.id&&s.data.list[0].goods_list.length>0&&((n=t.goods_list[t.goods_list.length-1].goods_list).push.apply(n,l(s.data.list[0].goods_list)),t.goods_list[t.goods_list.length-1].offset=s.data.list[0].offset),c=1;c<s.data.list.length;c++)t.goods_list.push(s.data.list[c]);t.againLower=!0}case 8:case"end":return e.stop()}}),e)})))()},activeRequest:function(t){this.goods_list=[],0!==t.child.length&&this.requestCatList(t.child[0],0)},requestCatList:function(t,e){var a=this;return o(i.default.mark((function s(){var n,c;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a.page=1,a.cat_id=t.id,a.select_cat_id=t.id,a.activeIndexTwo=e,a.goods_list=[],0===t.child.length){i.next=12;break}for(a.cat_ids=[],n=0;n<t.child.length;n++)a.cat_ids.push(t.child[n].id);return i.next=10,a.$request({url:a.$api.default.cat_goods,method:"get",data:{cat_ids:JSON.stringify(a.cat_ids),cat_id:t.child[0].id,offset:0}});case 10:c=i.sent,0===c.code&&(a.goods_list=c.data.list);case 12:case"end":return i.stop()}}),s)})))()},requestGoods:function(t,e){var a=this;return o(i.default.mark((function s(){var n;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return a.page=1,a.cat_id=t.id,a.select_cat_id=t.id,a.goods_list=[],console.log("10"===a.cat_style.cat_style),console.log(e),"10"===a.cat_style.cat_style&&void 0!==e&&0!==a.list[e].child.length&&(a.activeIndexTwo=0,a.cat_id=a.list[e].child[0].id,console.log(a.cat_id)),i.next=9,a.$request({url:a.$api.default.goods_list,method:"get",data:{page:a.page,cat_id:a.cat_id}});case 9:n=i.sent,0===n.code&&(a.goods_list=n.data.list,a.page_count=n.data.pagination.page_count);case 11:case"end":return i.stop()}}),s)})))()},lower:function(e){var a=this;return o(i.default.mark((function s(){var n,c;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(console.log(e),!(a.page<a.page_count)){i.next=9;break}return a.page++,i.next=5,a.$request({url:a.$api.default.goods_list,method:"get",data:{page:a.page,cat_id:e.id}});case 5:n=i.sent,0===n.code&&(c=a.goods_list).push.apply(c,l(n.data.list)),i.next=10;break;case 9:t.showToast({title:"暂无更多商品",icon:"none"});case 10:case"end":return i.stop()}}),s)})))()},dataProcessing:function(t){for(var e=0;e<t.length;e+=2)e+1!==t.length?this.goods_list.push([t[e],t[e+1]]):this.goods_list.push([t[e]])},requestCat:function(t,e){var a=this;return o(i.default.mark((function s(){var n,c,r,o,l,d,u,h,_;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return a.loading=!1,i.next=3,a.$request({url:a.$api.default.cat_list,method:"get",data:{cat_id:t||"",select_cat_id:e||""}});case 3:if(n=i.sent,0!==n.code){i.next=66;break}if(a.list=n.data.list,"1"!==a.cat_style.cat_style||0!==a.list.length){i.next=9;break}return a.search_bool=!1,i.abrupt("return");case 9:if("2"!==a.cat_style.cat_style&&"1"!==a.cat_style.cat_style){i.next=12;break}return i.abrupt("return");case 12:if("3"!==a.cat_style.cat_style||0!==a.list.length){i.next=16;break}return a.search_bool=!1,i.abrupt("return");case 16:if(!t&&!e){i.next=44;break}if("11"!==a.cat_style.cat_style){i.next=30;break}if(a.cat_ids=[],a.list.map((function(t,e){t.active&&(a.activeIndex=e)})),0!==a.list[a.activeIndex].child.length){i.next=22;break}return i.abrupt("return");case 22:for(c=0;c<a.list[a.activeIndex].child[0].child.length;c++)a.cat_ids.push(a.list[a.activeIndex].child[0].child[c].id);if(0!==a.cat_ids.length){i.next=25;break}return i.abrupt("return");case 25:return i.next=27,a.$request({url:a.$api.default.cat_goods,method:"get",data:{cat_ids:JSON.stringify(a.cat_ids),cat_id:a.cat_ids[0],offset:0}});case 27:return r=i.sent,0===r.code&&(a.goods_list=r.data.list),i.abrupt("return");case 30:if("6"!==a.cat_style.cat_style&&"7"!==a.cat_style.cat_style){i.next=33;break}return a.list.map((function(t,e){t.active&&(a.activeIndex=e)})),i.abrupt("return");case 33:if(a.list.length>0)for(o=0;o<a.list.length;o++)a.list[o].active&&(a.cat_id=a.list[o].id);if(("5"===a.cat_style.cat_style||"10"===a.cat_style.cat_style)&&a.list.length>0&&a.list[0].child.length>0)for(l=0;l<a.list.length;l++)a.list[l].active&&(a.cat_id=a.list[l].child[0].id);if(0!==a.list.length||"4"!==a.cat_style.cat_style){i.next=38;break}return a.search_bool=!1,i.abrupt("return");case 38:return i.next=40,a.$request({url:a.$api.default.goods_list,method:"get",data:{page:1,cat_id:a.cat_id}});case 40:d=i.sent,0===d.code&&("8"===a.cat_style.cat_style||"5"===a.cat_style.cat_style?a.dataProcessing(d.data.list):a.goods_list=d.data.list,a.page_count=d.data.pagination.page_count,0===a.list.length&&0===a.goods_list.length&&(a.search_bool=!1)),i.next=66;break;case 44:if(!(a.list.length>0)){i.next=65;break}if("11"!==a.cat_style.cat_style){i.next=57;break}if(a.cat_ids=[],0!==a.list.length&&0!==a.list[0].child.length){i.next=49;break}return i.abrupt("return");case 49:for(u=0;u<a.list[0].child[0].child.length;u++)a.cat_ids.push(a.list[0].child[0].child[u].id);if(0!==a.cat_ids.length){i.next=52;break}return i.abrupt("return");case 52:return i.next=54,a.$request({url:a.$api.default.cat_goods,method:"get",data:{cat_ids:JSON.stringify(a.cat_ids),cat_id:a.cat_ids[0],offset:0}});case 54:return h=i.sent,0===h.code&&(a.goods_list=h.data.list),i.abrupt("return");case 57:return a.cat_id=a.list[0].id,("5"===a.cat_style.cat_style||"10"===a.cat_style.cat_style)&&a.list[0].child.length>0&&(a.cat_id=a.list[0].child[0].id),i.next=61,a.$request({url:a.$api.default.goods_list,method:"get",data:{page:1,cat_id:a.cat_id}});case 61:_=i.sent,0===_.code&&("8"===a.cat_style.cat_style||"5"===a.cat_style.cat_style?a.dataProcessing(_.data.list):a.goods_list=_.data.list,a.page_count=_.data.pagination.page_count),i.next=66;break;case 65:a.search_bool=!1;case 66:case"end":return i.stop()}}),s)})))()}},onLoad:function(t){var e=this;setTimeout((function(){e.tabbarbool=e.$children[0].tabbarbool}),500),this.cat_id=t.cat_id,this.first_id=t.cat_id,t.first_id&&t.select_cat_id?this.requestCat(t.first_id,t.select_cat_id).then((function(){e.loading=!0})):!t.first_id&&t.select_cat_id?this.requestCat("",t.select_cat_id).then((function(){e.loading=!0})):t.first_id||t.select_cat_id||this.requestCat(t.cat_id).then((function(){e.loading=!0}))},onShareAppMessage:function(){return this.$shareAppMessage({path:"/pages/cats/cats",title:this.$children[0].navigationBarTitle,params:{cat_id:this.first_id,first_id:this.first_id,select_cat_id:this.select_cat_id}})}};e.default=A}).call(this,a("543d")["default"])},"62d4":function(t,e,a){},"755f":function(t,e,a){"use strict";a.r(e);var i=a("2437"),s=a("4282");for(var n in s)"default"!==n&&function(t){a.d(e,t,(function(){return s[t]}))}(n);a("bf14");var c,r=a("f0c5"),o=Object(r["a"])(s["default"],i["b"],i["c"],!1,null,"02ca8ce2",null,!1,i["a"],c);e["default"]=o.exports},bf14:function(t,e,a){"use strict";var i=a("62d4"),s=a.n(i);s.a},ccd0:function(t,e,a){"use strict";(function(t){a("ecb4");i(a("66fd"));var e=i(a("755f"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,a("543d")["createPage"])}},[["ccd0","common/runtime","common/vendor"]]]);
|