(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/list/list"],{2635:function(t,e,o){"use strict";var n=o("81cd"),i=o.n(n);i.a},"2bd3":function(t,e,o){"use strict";o.r(e);var n=o("72f2"),i=o("b353");for(var a in i)"default"!==a&&function(t){o.d(e,t,(function(){return i[t]}))}(a);o("2635");var c,r=o("f0c5"),u=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,"2d1c2912",null,!1,n["a"],c);e["default"]=u.exports},"47fc":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("2f62");function i(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}function a(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach((function(e){c(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function c(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var r=function(){o.e("components/page-component/app-good-shop-recommendation/app-good-shop-recommendation").then(function(){return resolve(o("e818"))}.bind(null,o)).catch(o.oe)},u={name:"list",components:{appGoodShopRecommendation:r},data:function(){return{catModel:!1,toSearch:!1,list:[],cat_list:[],page:1,keyword:"",mch_common_cat_id:0,load:!1,args:!1,latitude:0,longitude:0,page_loading:!1,getFocus:!1}},onLoad:function(t){this.getLocation(),this.getCats()},onReachBottom:function(){var t=this;if(!t.args&&!t.load){t.load=!0;var e=t.page+1;t.$request({url:t.$api.mch.index,data:{keyword:t.keyword,latitude:t.latitude,longitude:t.longitude,mch_common_cat_id:t.mch_common_cat_id,page:e}}).then((function(o){if(0===o.code){var n=[e,0===o.data.list.length,t.list.concat(t.dataMap(o.data.list))];t.page=n[0],t.args=n[1],t.list=n[2]}t.load=!1}))}},onShareAppMessage:function(t){return this.$shareAppMessage({title:"好店推荐",path:"/plugins/mch/list/list",params:{}})},methods:{dataMap:function(t){if(t)return t.forEach((function(t){t.pic_url=t.store.cover_url,t.name=t.store.name,t.goods_num=t.goods_count,t.order_num=t.order_goods_count,t.goodsList=t.goods,t.goodsList.forEach((function(t){t.picUrl=t.goodsWarehouse.cover_pic}))})),t},getLocation:function(){var e=this;t.getLocation({type:"wgs84",success:function(t){var o=[t.latitude,t.longitude];e.latitude=o[0],e.longitude=o[1]},complete:function(){e.loadData()}})},loadData:function(){var t=this;t.$showLoading(),t.$request({url:t.$api.mch.index,data:{keyword:t.keyword,latitude:t.latitude,longitude:t.longitude,mch_common_cat_id:t.mch_common_cat_id}}).then((function(e){t.$hideLoading(),0===e.code&&(t.list=t.dataMap(e.data.list))})).catch((function(e){t.$hideLoading()}))},getCats:function(){var t=this;t.$request({url:t.$api.mch.category}).then((function(e){t.cat_list=e.data.list}))},navShop:function(e){t.navigateTo({url:"/plugins/mch/shop/shop?mch_id="+e})},navGoods:function(e,o){t.navigateTo({url:"/plugins/mch/goods/goods?id="+o+"&mch_id="+e})},beSearch:function(t){0===this.keyword.length&&(this.toSearch=!this.toSearch,this.getFocus=this.toSearch)},bindConfirm:function(){var t=[1,0,!1,[]];this.page=t[0],this.mch_common_cat_id=t[1],this.catModel=t[2],this.list=t[3],this.loadData()},cat:function(t){var e=[t,[],1,!1];this.mch_common_cat_id=e[0],this.list=e[1],this.page=e[2],this.catModel=e[3],this.loadData()},changeCat:function(){this.catModel=!this.catModel},bindInput:function(t){this.keyword=t.detail.value},cancelPrint:function(){this.keyword="",this.toSearch=!1,this.bindConfirm()}},computed:a({},(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"}))};e.default=u}).call(this,o("543d")["default"])},"72f2":function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement;t._self._c},a=[]},"81cd":function(t,e,o){},b353:function(t,e,o){"use strict";o.r(e);var n=o("47fc"),i=o.n(n);for(var a in n)"default"!==a&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=i.a},df0d:function(t,e,o){"use strict";(function(t){o("b8bc");n(o("66fd"));var e=n(o("2bd3"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])}},[["df0d","common/runtime","common/vendor"]]]);