1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/list/list"],{1548:function(t,o,n){"use strict";(function(t){n("8748");a(n("66fd"));var o=a(n("a762"));function a(t){return t&&t.__esModule?t:{default:t}}t(o.default)}).call(this,n("543d")["createPage"])},"20ef":function(t,o,n){"use strict";n.r(o);var a=n("36db"),i=n.n(a);for(var e in a)"default"!==e&&function(t){n.d(o,t,(function(){return a[t]}))}(e);o["default"]=i.a},"36db":function(t,o,n){"use strict";(function(t){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var a=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-good-shop-recommendation/app-good-shop-recommendation")]).then(function(){return resolve(n("ac0f"))}.bind(null,n)).catch(n.oe)},i={name:"list",components:{appGoodShopRecommendation:a},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 o=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:o}}).then((function(n){if(0===n.code){var a=[o,0===n.data.list.length,t.list.concat(t.dataMap(n.data.list))];t.page=a[0],t.args=a[1],t.list=a[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 o=this;t.getLocation({type:"wgs84",success:function(t){var n=[t.latitude,t.longitude];o.latitude=n[0],o.longitude=n[1]},fail:function(t){console.warn(t)},complete:function(t){o.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(o){t.$hideLoading(),0===o.code&&(t.list=t.dataMap(o.data.list))})).catch((function(o){t.$hideLoading()}))},getCats:function(){var t=this;t.$request({url:t.$api.mch.category}).then((function(o){t.cat_list=o.data.list}))},navShop:function(o){t.navigateTo({url:"/plugins/mch/shop/shop?mch_id="+o})},navGoods:function(o,n){t.navigateTo({url:"/plugins/mch/goods/goods?id="+n+"&mch_id="+o})},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 o=[t,[],1,!1];this.mch_common_cat_id=o[0],this.list=o[1],this.page=o[2],this.catModel=o[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()}}};o.default=i}).call(this,n("543d")["default"])},3781:function(t,o,n){"use strict";var a=n("e9fc"),i=n.n(a);i.a},8242:function(t,o,n){"use strict";var a,i=function(){var t=this,o=t.$createElement;t._self._c},e=[];n.d(o,"b",(function(){return i})),n.d(o,"c",(function(){return e})),n.d(o,"a",(function(){return a}))},a762:function(t,o,n){"use strict";n.r(o);var a=n("8242"),i=n("20ef");for(var e in i)"default"!==e&&function(t){n.d(o,t,(function(){return i[t]}))}(e);n("3781");var c,d=n("f0c5"),s=Object(d["a"])(i["default"],a["b"],a["c"],!1,null,"4bdfa623",null,!1,a["a"],c);o["default"]=s.exports},e9fc:function(t,o,n){}},[["1548","common/runtime","common/vendor"]]]);
|