1 line
3.3 KiB
JavaScript
1 line
3.3 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/search/search"],{1734:function(e,t,o){"use strict";(function(e){var n=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=n(o("7ca3")),r=o("8f59");function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}var i=null,u={data:function(){return{placeholder:"点击添加自定义食材",search_value:"",show_food_search:!1,food_search_list:[],picked_food:[],popular_food:{}}},computed:function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach((function(t){(0,c.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},(0,r.mapState)(["menu_search_value"])),watch:{search_value:function(e,t,o){var n=this;clearTimeout(i),""!=e?i=setTimeout((function(){n.$model.getFoodSearch({food_name:e}).then((function(e){0==e.code&&(n.food_search_list=e.data,n.show_food_search=!0)}))}),500):this.show_food_search=!1}},onLoad:function(){var e=this;this.$model.getSearchPopularFood({}).then((function(t){0==t.code&&(e.popular_food=t.data.food)}))},methods:{preventTouchMove:function(){},removePicked:function(e){var t=this.picked_food.findIndex((function(t){return t.id==e}));-1!=t&&(this.picked_food[t].parent&&(this.picked_food[t].parent.push(this.picked_food[t]),this.picked_food[t].parent=null),this.picked_food.splice(t,1))},addIngredients:function(e,t){if(this.picked_food.push(e),this.show_food_search=!1,t){e.parent=t;var o=t.findIndex((function(t){return t.id==e.id}));-1!=o&&t.splice(o,1)}},onSearchFood:function(){if(!(this.picked_food.length<=0)){var t=this.picked_food.map((function(e){return e.id}));this.$store.state.menu_search_value=t.join(","),e.switchTab({url:"/pages/menu/menu"})}}}};t.default=u}).call(this,o("df3c")["default"])},"5fe1":function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return c})),o.d(t,"a",(function(){}));var n=function(){var e=this,t=e.$createElement,o=(e._self._c,e.picked_food.length);e._isMounted||(e.e0=function(t){e.placeholder="输入自定义食材"},e.e1=function(t){e.placeholder="点击添加自定义食材"},e.e2=function(t){e.picked_food=[]}),e.$mp.data=Object.assign({},{$root:{g0:o}})},c=[]},"8d97":function(e,t,o){"use strict";o.r(t);var n=o("5fe1"),c=o("bece");for(var r in c)["default"].indexOf(r)<0&&function(e){o.d(t,e,(function(){return c[e]}))}(r);o("c3fd");var a=o("828b"),i=Object(a["a"])(c["default"],n["b"],n["c"],!1,null,"84d0456a",null,!1,n["a"],void 0);t["default"]=i.exports},a0c1:function(e,t,o){},a1e6:function(e,t,o){"use strict";(function(e,t){var n=o("47a9");o("6caf");n(o("3240"));var c=n(o("8d97"));e.__webpack_require_UNI_MP_PLUGIN__=o,t(c.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},bece:function(e,t,o){"use strict";o.r(t);var n=o("1734"),c=o.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(r);t["default"]=c.a},c3fd:function(e,t,o){"use strict";var n=o("a0c1"),c=o.n(n);c.a}},[["a1e6","common/runtime","common/vendor"]]]); |