search.js 3.0 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/search"],{"0a53":function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return r})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},"43d5":function(t,e,a){"use strict";a.r(e);var n=a("59ec"),r=a.n(n);for(var o in n)"default"!==o&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"59ec":function(t,e,a){"use strict";(function(t){function a(t){return i(t)||o(t)||r(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"===typeof t)return c(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?c(t,e):void 0}}function o(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function i(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s={data:function(){return{page:1,pages:0,isSearch:!0,keyword:"",shopList:[],searchList:[]}},methods:{goMessage:function(e,a){t.navigateTo({url:"/pages/index/details?id="+e.box_id+"&type="+a})},selectKeyword:function(t){this.page=1,this.isSearch=!1,this.keyword=t,this.getBoxListByCategory()},cancelKeyword:function(){t.navigateBack()},search:function(){this.page=1,this.shopList=[],this.isSearch=!1,this.keyword&&this.getBoxListByCategory()},getBoxListByCategory:function(){var t=this;this.$api.search({page:this.page,pagesize:"10",search:this.keyword,msg:"数据加载中"}).then((function(e){1===e.code&&(e.data.data.forEach((function(t){t.image=t.goods_images[0],t.right=[],t.bot=[],t.goods_images.forEach((function(e,a){a>0&&a<3&&t.right.push(e),a>2&&t.bot.push(e)}))})),t.getSearch(),t.shopList=1==t.page?e.data.data:[].concat(a(rhis.shopList),a(e.data.data)),t.pages=e.data.last_page,console.log(e.data))}))},getSearch:function(){var t=this;this.$api.searchHistory().then((function(e){1===e.code&&(t.searchList=e.data.history)}))}},onLoad:function(){this.getSearch()}};e.default=s}).call(this,a("543d")["default"])},"8cd3":function(t,e,a){"use strict";a.r(e);var n=a("0a53"),r=a("43d5");for(var o in r)"default"!==o&&function(t){a.d(e,t,(function(){return r[t]}))}(o);a("de97");var i,c=a("f0c5"),s=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],i);e["default"]=s.exports},ad87:function(t,e,a){},de97:function(t,e,a){"use strict";var n=a("ad87"),r=a.n(n);r.a},f62c:function(t,e,a){"use strict";(function(t){a("a940");n(a("66fd"));var e=n(a("8cd3"));function n(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=a,t(e.default)}).call(this,a("543d")["createPage"])}},[["f62c","common/runtime","common/vendor"]]]);