(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageTwo/count/food"],{"0c25":function(e,t,i){},"10fe":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"6c3a"))}},o=function(){var e=this,t=e.$createElement,i=(e._self._c,e.menu3.length),n=e.ActiveList.length,o=n?e.ActiveList.length:null,a=e.isShop?e.ActiveList.length:null,c=e.isShop?e.ActiveList.length:null;e._isMounted||(e.e0=function(t){e.isShop=!e.isShop},e.e1=function(t){e.isShop=!1},e.e2=function(t){e.IsWeight=!1},e.e3=function(t){e.isBle=!1},e.e4=function(t){e.isBle=!1},e.e5=function(t){e.showAutoSearchDlg=!1}),e.$mp.data=Object.assign({},{$root:{g0:i,g1:n,g2:o,g3:a,g4:c}})},a=[]},"2ea5":function(e,t,i){"use strict";i.r(t);var n=i("e058"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=o.a},"55fc":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("6caf");n(i("3240"));var o=n(i("a788"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"62f3":function(e,t,i){"use strict";var n=i("0c25"),o=i.n(n);o.a},a788:function(e,t,i){"use strict";i.r(t);var n=i("10fe"),o=i("2ea5");for(var a in o)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(a);i("62f3");var c=i("828b"),s=Object(c["a"])(o["default"],n["b"],n["c"],!1,null,"415f9e0f",null,!1,n["a"],void 0);t["default"]=s.exports},e058:function(e,t,i){"use strict";(function(e){var n=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(i("af34")),a=n(i("7ca3")),c=i("8f59");function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function h(e){for(var t=1;t=this.lastPage?e.showToast({title:"没有更多数据!",icon:"none"}):(this.page++,this.menu2.length&&this.handleHomeInfo())},handleSearch:function(t){var i=this;i.$model.getFoodSearch({food_name:t}).then((function(t){0==t.code?(i.index=3,i.menu2=[],i.menu3=t.data):e.showToast({title:t.msg,icon:"error"})}))},handleVoiceSearch:function(){""!=this.autoSearchContent&&(this.$refs.search.searchByName(this.autoSearchContent),this.showAutoSearchDlg=!1,this.autoSearchContent="")},handleDetail:function(e){this.myvalue=[],this.activeType=e,this.activeType.weight=100,this.weightKcal=this.activeType.kcal,this.isShop=!1,this.isBle=!0,console.log("选中的商品",e)},handlesubbtn:function(){this.ActiveList.length<=0||this.$model.getAddIntakeFood({aud_id:this.user.aud_id,meals_type:this.typename,food_list:this.ActiveList}).then((function(t){0==t.code&&e.navigateBack({delta:1})}))},handledelactive:function(e){this.ActiveList.splice(this.ActiveList.indexOf(e),1)},NumberCk:function(e){if(this.myvalue="."==this.myvalue[0]?[0,"."].concat(e):this.myvalue.concat(e),-1!=this.myvalue.toString().indexOf(".")){var t=this.myvalue.indexOf(".");this.myvalue=this.myvalue.slice(0,t+2)}-1==this.myvalue.toString().indexOf(".")&&this.myvalue.length>3&&(this.myvalue=["9","9","9"]),this.activeType.weight=this.myvalue.join("")},Tuige:function(){var e=this.myvalue;e.length>=1&&("."!=e[e.length-2]?this.myvalue=e.slice(0,e.length-1):this.myvalue=e.slice(0,e.length-2)),this.activeType.weight=this.myvalue.join("")},Cancelword:function(){this.IsWeight=!1,this.myvalue=[],this.activeType={}},Clear:function(){this.myvalue=[],this.activeType.weight=null},Next:function(){var e=this.activeType;if(this.IsWeight=!1,-1==this.ActiveList.indexOf(e))this.ActiveList.push(e);else{var t=this.ActiveList.indexOf(e);this.ActiveList[t].weight=this.activeType.weight,this.ActiveList[t].unit=this.activeType.unit}console.log("保存",this.ActiveList)},handleWeight:function(){this.weightKcal=this.activeType.kcal,this.isBle=!0,this.IsWeight=!1},handleMannulWeight:function(){this.isBle=!1,this.IsWeight=!0},handleBle:function(e,t,i){this.isBle=!1,this.activeType.weight=e,this.activeType.unit=t,this.activeType.kcal=i,this.Next(),console.log("返回",this.activeType,e,t,i)},onShowSearchType:function(e){this.autoSearchType=e,1==e?this.showAutoSearchDlg=!0:2==e&&this.selectPhoto()},retrySearch:function(){this.autoSearchContent="",2==this.autoSearchType&&(this.showAutoSearchDlg=!1,this.selectPhoto())},selectPhoto:function(){var t=this;e.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],sizeType:["compressed"],camera:"back",success:function(i){var n=i.tempFiles[0].tempFilePath;e.getFileSystemManager().readFile({filePath:n,encoding:"base64",success:function(i){var n="data:image/jpeg;base64,"+i.data;e.showLoading({title:"图片识别中...",mask:!0}),t.$model.getPhotoSearch({img_str:n}).then((function(i){e.hideLoading(),0==i.code&&(t.autoSearchContent=i.data.name,t.showAutoSearchDlg=!0)}))},fail:function(e){console.error("读取文件失败:",e)}})},fail:function(e){console.error("拍照失败:",e)}})},onVoiceTouchStart:function(){this.mic_touch=!0,this.voiceManager.start({duration:6e4,lang:"zh_CN"})},onVoiceTouchEnd:function(){this.mic_touch=!1,this.voiceManager.stop()}}};t.default=l}).call(this,i("df3c")["default"])}},[["55fc","common/runtime","common/vendor"]]]);