1 line
6.5 KiB
JavaScript
1 line
6.5 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/land"],{"67f7":function(t,e,n){},"740a":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("b03e");a(n("66fd"));var i=a(n("f611"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"772c":function(t,e,n){"use strict";var a=n("67f7"),i=n.n(a);i.a},8494:function(t,e,n){"use strict";(function(t){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("2eee")),r=a(n("9523")),o=a(n("278c")),c=a(n("c973")),s=n("26cb");function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,r.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f={components:{},data:function(){return{isLoad:!1,options:{},rankInd:0,rankList:[{id:1,title:"综合排序"},{id:2,title:"销量优先"},{id:3,title:"距离优先"}],tabList:[],activeIndex:0,cate_id:0,param:{page:1},list:{data:[]},loading:!0,lockTap:!1,show_rank_item:!1}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo},location:function(t){return t.user.location},loginType:function(t){return t.user.loginType}}),onLoad:function(){var t=this;return(0,c.default)(i.default.mark((function e(){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoad){e.next=2;break}return e.abrupt("return");case 2:t.$util.showLoading(),t.initIndex();case 4:case"end":return e.stop()}}),e)})))()},onShow:function(){var e=this;return(0,c.default)(i.default.mark((function n(){var a,r,c,s;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.isLoad&&(!e.location.lat||2==e.rankInd)){n.next=2;break}return n.abrupt("return");case 2:return n.next=4,t.getSetting();case 4:if(a=n.sent,r=(0,o.default)(a,2),c=r[0],s=r[1],!c&&s.authSetting["scope.userLocation"]){n.next=10;break}return n.abrupt("return");case 10:e.initIndex();case 11:case"end":return n.stop()}}),n)})))()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},onShareAppMessage:function(t){var e=this.userInfo.id,n="/pages/land?pid=".concat(e);return this.$util.log(n),{title:"",imageUrl:"",path:n}},methods:l(l(l({},(0,s.mapActions)(["getConfigInfo"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,c.default)(i.default.mark((function n(){var a,r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=t.length>0&&void 0!==t[0]&&t[0],e.configInfo.id&&!a){n.next=5;break}return n.next=4,e.getConfigInfo();case 4:"apple"==e.loginType&&e.updateUserItem({key:"isShowLogin",val:!1});case 5:return n.next=7,e.getLocation();case 7:return n.next=9,e.$api.claim.claimCateList({type:1});case 9:r=n.sent,r.unshift({id:0,title:"全部"}),e.isLoad=!0,e.tabList=r,e.param.page=1,e.getList();case 15:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.$refs.rank_item.close(),this.initIndex(!0)},getLocation:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.location,n.lat){e.next=6;break}return e.next=4,t.$util.getBmapLocation();case 4:n=e.sent,t.updateUserItem({key:"location",val:n});case 6:case"end":return e.stop()}}),e)})))()},handerTabChange:function(t,e){this[e]=t,this.$refs.rank_item.close(),"activeIndex"==e&&(this.cate_id=this.tabList[t].id),this.$util.showLoading(),this.param.page=1,this.list.data=[],this.getList()},toShowRank:function(){var t=this,e=this.show_rank_item;this.lockTap||(this.lockTap=!0,setTimeout((function(){var n=e?"close":"open";t.$refs.rank_item[n]()}),500))},popupChange:function(t){var e=this,n=t.show;this.show_rank_item=n,setTimeout((function(){e.lockTap=!1}),200)},getList:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,a,r,o,c,s,u,l,f,d,p,h,g,v,m;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.list,a=t.param,r=t.tabList,t.activeIndex,c=t.rankList,s=t.rankInd,u=t.cate_id,l=r.findIndex((function(t){return t.id==u})),u=-1==l?0:u,o=-1==l?0:l,t.cate_id=u,t.activeIndex=o,f=c[s].id,3!=f||t.location.lat){e.next=12;break}return t.$util.hideAll(),e.next=11,t.getLocation();case 11:return e.abrupt("return");case 12:return d=t.location,p=d.lng,h=void 0===p?0:p,g=d.lat,v=void 0===g?0:g,a=Object.assign({},a,{cate_id:u,sort:f}),3===f&&(a.lat=v,a.lng=h),e.next=17,t.$api.land.landList(a);case 17:m=e.sent,1==t.param.page||(m.data=n.data.concat(m.data)),t.list=m,t.loading=!1,t.$util.hideAll();case 21:case"end":return e.stop()}}),e)})))()},goDetail:function(t){var e=this;return(0,c.default)(i.default.mark((function n(){var a,r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.list.data[t].id,r="/land/pages/detail?id=".concat(a),e.$util.toCheckLogin({url:r});case 3:case"end":return n.stop()}}),n)})))()}})};e.default=f}).call(this,n("543d")["default"])},d738:function(t,e,n){"use strict";n.r(e);var a=n("8494"),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a},f611:function(t,e,n){"use strict";n.r(e);var a=n("f7e6"),i=n("d738");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("772c");var o=n("f0c5"),c=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=c.exports},f7e6:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.isLoad&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null),a=t.isLoad?!t.loading&&t.list.data.length<=0&&1==t.list.current_page:null;t.$mp.data=Object.assign({},{$root:{g0:n,g1:a}})},i=[]}},[["740a","common/runtime","common/vendor"]]]); |