1 line
7.7 KiB
JavaScript
1 line
7.7 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["home/pages/search"],{"0ea2":function(t,e,n){"use strict";n.r(e);var a=n("e926"),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},"16c9":function(t,e,n){"use strict";var a=n("82a2"),r=n.n(a);r.a},"4d45":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("b03e");a(n("66fd"));var r=a(n("a5b4"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"82a2":function(t,e,n){},a5b4:function(t,e,n){"use strict";n.r(e);var a=n("c411"),r=n("0ea2");for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n("16c9");var o=n("f0c5"),s=Object(o["a"])(r["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=s.exports},c411:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),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._isMounted||(t.e0=function(e){return t.$util.checkAuth({type:"userLocation"})},t.e1=function(e){return t.$util.goUrl({url:1,openType:"navigateBack"})}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:a}})},r=[]},e926:function(t,e,n){"use strict";(function(t){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("2eee")),i=a(n("9523")),o=a(n("278c")),s=a(n("c973")),u=n("26cb");function c(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?c(Object(n),!0).forEach((function(e){(0,i.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f={components:{uniSegmentedControl:function(){n.e("components/uni-segmented-control").then(function(){return resolve(n("49df"))}.bind(null,n)).catch(n.oe)}},data:function(){return{isLoad:!1,searchHeight:0,rankInd:0,rankList:[{id:1,title:"搜农场",methodKey:"home",method:"farmerList"},{id:2,title:"搜店铺",methodKey:"shop",method:"indexStoreList"},{id:3,title:"搜商品",methodKey:"shop",method:"goodsList"}],param:{page:1,long:"",lat:"",store_name:""},list:{data:[]},loading:!0,lockTap:!1,show_rank_item:!1,goodsInd:0,goodsInfo:{},subIndex:0,currentSpecs:{},currentNum:1,carIsHave:{id:0,isHave:!1}}},computed:(0,u.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}}),onLoad:function(){var t=this;return(0,s.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$util.setNavigationBarColor({color:"#ffffff",bg:""}),!t.isLoad){e.next=3;break}return e.abrupt("return");case 3:t.$util.showLoading(),t.initIndex();case 5:case"end":return e.stop()}}),e)})))()},onShow:function(){var e=this;return(0,s.default)(r.default.mark((function n(){var a,i,s,u;return r.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,i=(0,o.default)(a,2),s=i[0],u=i[1],!s&&u.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="/user/pages/store-list";return this.$util.log(e),{title:"",imageUrl:"",path:e}},methods:l(l(l({},(0,u.mapActions)(["getUserInfo"])),(0,u.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=this;return(0,s.default)(r.default.mark((function e(){var n;return r.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:if(n.lng){e.next=10;break}return t.loading=!1,t.isLoad=!0,e.abrupt("return");case 10:return e.next=12,t.getList();case 12:setTimeout((function(){t.toSetResHeight()}),200);case 13:case"end":return e.stop()}}),e)})))()},initRefresh:function(){var t=this;return(0,s.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.param.page=1,t.initIndex();case 2:case"end":return e.stop()}}),e)})))()},toSetResHeight:function(){var e=this;return(0,s.default)(r.default.mark((function n(){var a;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=t.createSelectorQuery(),a.select(".search-info").boundingClientRect((function(t){e.searchHeight=t.height})).exec();case 2:case"end":return n.stop()}}),n)})))()},handerTabChange:function(t){this.rankInd=t,this.$refs.rank_item.close(),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)},toSearch:function(t){this.param.page=1,this.param.store_name=t,this.getList()},getList:function(){var t=this;return(0,s.default)(r.default.mark((function e(){var n,a,i,o,s,u,c,l,f,d,p,h,g,m;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.list,a=t.param,i=t.location,o=t.rankList,s=t.rankInd,u=i.lat,c=void 0===u?0:u,l=i.lng,f=void 0===l?0:l,a=Object.assign({},a,{lat:c,lng:f}),d=o[s],p=d.id,h=d.methodKey,g=d.method,3==p&&(a.type=1),2!=p&&(1==p?a.title=a.store_name:a.goods_name=a.store_name,delete a.store_name),e.next=8,t.$api[h][g](a);case 8:m=e.sent,3!=p&&m.data.map((function(t){t.is_open=1,t.star_percent=(1*t.star/5*100).toFixed(2)+"%"})),1==t.param.page||(m.data=n.data.concat(m.data)),t.list=m,t.loading=!1,t.isLoad=!0,t.$util.hideAll();case 14:case"end":return e.stop()}}),e)})))()},toChooseLocation:function(e){var n=this;return(0,s.default)(r.default.mark((function e(){var a,i,s,u,c,l,f,d;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.$util.checkAuth({type:"userLocation"});case 2:return e.next=4,t.chooseLocation();case 4:if(a=e.sent,i=(0,o.default)(a,2),s=i[1],s=void 0===s?{}:s,u=s.address,c=void 0===u?"":u,l=s.longitude,f=s.latitude,l){e.next=11;break}return e.abrupt("return");case 11:d={lng:l,lat:f,address:c},n.updateUserItem({key:"location",val:d}),n.location=d,n.param.page=1,n.getList();case 16:case"end":return e.stop()}}),e)})))()},goDetail:function(t){var e=this;return(0,s.default)(r.default.mark((function n(){var a,i,o,s,u,c;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.list.data[t],i=a.id,o=a.store_id,s=void 0===o?0:o,u=e.rankList[e.rankInd].id,2===u&&(s=i),c={1:"/home/pages/farm/detail?id=".concat(i),2:"/shop/pages/store?id=".concat(s),3:"/shop/pages/detail?id=".concat(i)},e.$util.goUrl({url:c[u]});case 5:case"end":return n.stop()}}),n)})))()}})};e.default=f}).call(this,n("543d")["default"])}},[["4d45","common/runtime","common/vendor"]]]); |