index.js 4.3 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["detail/discountsDetail/index"],{"1b58":function(t,e,n){"use strict";n.r(e);var i=n("79cd"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},"3de5":function(t,e,n){},4923:function(t,e,n){"use strict";var i=n("3de5"),a=n.n(i);a.a},"79cd":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("a767"),a=n("8a83"),o={options:{styleIsolation:"shared"},data:function(){return{longitude:"",latitude:"",destination:"",_mapContext:null,status:"more",list:[],btnText:"去使用",banner:"",menuId:"",query:{district:"",menuId:"",queryName:"",range:"","location.lat":0,"location.lon":0,pageCurrent:1,pageSize:10},location:"",tabList:[{id:1,label:"区域",list:[{id:1,label:"观山湖"},{id:2,label:"白云区"},{id:3,label:"花果山区"}]},{id:1,label:"全部分类",list:[{label:"甜点饮品"},{label:"特色美食"},{label:"风味小吃"}]},{id:1,label:"附近",list:[{id:5,label:"5KM"},{id:10,label:"10KM"},{id:20,label:"20KM"},{id:50,label:"50KM"}]}]}},methods:{filterData:function(t){return t.slice(0,2)},getMenu:function(t){var e=this;return new Promise((function(n,i){(0,a.getMenu)({currentPage:1,pageSize:10,status:2,parentId:t}).then((function(t){if("Success"==t.state){var n=[];t.content.records.map((function(t){n.push({id:t.id,label:t.menuName})})),e.tabList[1].list=n,console.log(e.tabList)}}))}))},chooseTab:function(t){console.log(t),this.query.range=t[2].id,t[0]?(this.query["location.lat"]=t[0].location.lat,this.query["location.lon"]=t[0].location.lng,this.query.range=50,this.query.district=t[0].label):t[0]||(this.query["location.lat"]=this.location.latitude,this.query["location.lon"]=this.location.longitude,this.query.district=""),t[1]?this.query.menuId=t[1].id:t[1]||(this.query.menuId=this.menuId),this.query.pageCurrent=1,this.status="more",this.list=[],this.search()},goDetail:function(e){t.setStorageSync("shopInfo",JSON.stringify(e)),t.navigateTo({url:"../shopDetail/shopDetail"})},loadMore:function(){this.search()},search:function(){var t=this;return new Promise((function(e,n){if("noMore"!=t.status){t.status="loading";var a=JSON.parse(JSON.stringify(t.query));a.range||delete a.range,(0,i.search)(a).then((function(n){"Success"==n.state&&(t.list=t.list.concat(n.content.records),t.list.length>=n.content.total?t.status="noMore":(t.status="more",t.query.pageCurrent++),e())}))}}))}},onPullDownRefresh:function(){this.query.pageCurrent=1,this.list=[],this.status="more",this.search().then((function(){t.stopPullDownRefresh()}))},onLoad:function(e){this.tabList[0].list=JSON.parse(t.getStorageSync("districtList")),this.menuId=e.id,this.getMenu(e.id);var n=this,i=this.getOpenerEventChannel();"{}"!==JSON.stringify(i)&&i.on("banner",(function(t){n.banner=t})),t.setNavigationBarTitle({title:e.title}),this.query.menuId=e.id,this.location=JSON.parse(t.getStorageSync("location")),this.query["location.lat"]=this.location.latitude,this.query["location.lon"]=this.location.longitude,this.search()}};e.default=o}).call(this,n("543d")["default"])},"95fa":function(t,e,n){"use strict";n.r(e);var i=n("9df0"),a=n("1b58");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("4923");var s=n("f0c5"),r=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=r.exports},"9df0":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var i={zsChooseTab:function(){return n.e("components/zs-choose-tab/index").then(n.bind(null,"6c4e"))},zsList:function(){return n.e("components/zs-list/index").then(n.bind(null,"7636"))},zsImg:function(){return Promise.all([n.e("common/vendor"),n.e("components/zs-img/index")]).then(n.bind(null,"3acd"))}},a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.list,(function(e,n){var i=t.__get_orig(e),a=t.filterData(e.goodsVos);return{$orig:i,l0:a}})));t.$mp.data=Object.assign({},{$root:{l1:n}})},o=[]},ff6f:function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("b7d7");i(n("66fd"));var a=i(n("95fa"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])}},[["ff6f","common/runtime","common/vendor"]]]);