(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageTwo/count/food"],{"01f9":function(t,e,i){"use strict";i.r(e);var n=i("b7b0"),o=i("a8c8");for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);i("d573");var s=i("828b"),c=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"52207f7f",null,!1,n["a"],void 0);e["default"]=c.exports},4343:function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(i("af34")),a=n(i("7ca3")),s=i("8f59");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function r(t){for(var e=1;e=this.lastPage?t.showToast({title:"没有更多数据!",icon:"none"}):(this.page++,this.menu2.length&&this.handleHomeInfo())},handleSearch:function(e){var i=this;i.$model.getFoodSearch({food_name:e}).then((function(e){0==e.code?(i.index=3,i.menu2=[],i.menu3=e.data):t.showToast({title:e.msg,icon:"error"})}))},handleVoiceSearch:function(){""!=this.autoSearchContent&&(this.$refs.search.searchByName(this.autoSearchContent),this.showAutoSearchDlg=!1,this.autoSearchContent="")},handleDetail:function(t){this.myvalue=[],this.activeType=t,this.activeType.weight=0,this.weightKcal=this.activeType.kcal,this.isShop=!1,this.isBle=!0,console.log("选中的商品",t)},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(e){0==e.code&&t.navigateBack({delta:1})}))},handledelactive:function(t){this.ActiveList.splice(this.ActiveList.indexOf(t),1)},NumberCk:function(t){if(this.myvalue="."==this.myvalue[0]?[0,"."].concat(t):this.myvalue.concat(t),-1!=this.myvalue.toString().indexOf(".")){var e=this.myvalue.indexOf(".");this.myvalue=this.myvalue.slice(0,e+2)}-1==this.myvalue.toString().indexOf(".")&&this.myvalue.length>3&&(this.myvalue=["9","9","9"]),this.activeType.weight=this.myvalue.join("")},Tuige:function(){var t=this.myvalue;t.length>=1&&("."!=t[t.length-2]?this.myvalue=t.slice(0,t.length-1):this.myvalue=t.slice(0,t.length-2)),this.activeType.weight=this.myvalue.join("")},Cancelword:function(){this.IsWeight=!1,this.myvalue=[],this.activeType={}},Changeword:function(){this.wordType=1==this.wordType?2:1},Clear:function(){this.myvalue=[],this.activeType.weight=null},Next:function(){var t=this.activeType;if(this.IsWeight=!1,-1==this.ActiveList.indexOf(t))this.ActiveList.push(t);else{var e=this.ActiveList.indexOf(t);this.ActiveList[e].weight=this.activeType.weight,this.ActiveList[e].unit=this.activeType.unit}console.log("保存",this.ActiveList)},rulerChange:function(t){this.activeType=Object.assign({},this.activeType,{weight:t})},handleWeight:function(){this.weightKcal=this.activeType.kcal,this.isBle=!0,this.IsWeight=!1},handleMannulWeight:function(){this.isBle=!1,this.IsWeight=!0},handleBle:function(t,e,i){this.isBle=!1,this.activeType.weight=t,this.activeType.unit=e,this.activeType.kcal=i,this.Next(),console.log("返回",this.activeType,t,e,i)},realTimeWeight:function(t,e){this.IsWeight||(this.activeType=Object.assign({},this.activeType,{weight:this.convertToGrams(t,e)}))},onShowSearchType:function(t){this.autoSearchType=t,1==t?this.showAutoSearchDlg=!0:2==t&&this.selectPhoto()},retrySearch:function(){this.autoSearchContent="",2==this.autoSearchType&&(this.showAutoSearchDlg=!1,this.selectPhoto())},selectPhoto:function(){var e=this;t.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],sizeType:["compressed"],camera:"back",success:function(i){var n=i.tempFiles[0].tempFilePath;t.getFileSystemManager().readFile({filePath:n,encoding:"base64",success:function(i){var n="data:image/jpeg;base64,"+i.data;t.showLoading({title:"图片识别中...",mask:!0}),e.$model.getPhotoSearch({img_str:n}).then((function(i){t.hideLoading(),0==i.code&&(e.autoSearchContent=i.data.name,e.showAutoSearchDlg=!0)}))},fail:function(t){console.error("读取文件失败:",t)}})},fail:function(t){console.error("拍照失败:",t)}})},onVoiceTouchStart:function(){this.mic_touch=!0,this.voiceManager.start({duration:6e4,lang:"zh_CN"})},onVoiceTouchEnd:function(){this.mic_touch=!1,this.voiceManager.stop()},unitConversion:function(t){return"kcal"==t?"千卡":"g"==t?"克":t},convertToGrams:function(t,e){var i={lb:453.59237,oz:28.349523125,kg:1e3,g:1};return i.hasOwnProperty(e)?t*i[e]:""}}};e.default=h}).call(this,i("df3c")["default"])},a8c8:function(t,e,i){"use strict";i.r(e);var n=i("4343"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=o.a},b7b0:function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var n={uniDrawer:function(){return i.e("uni_modules/uni-drawer/components/uni-drawer/uni-drawer").then(i.bind(null,"39d1"))},uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"5de9"))}},o=function(){var t=this,e=t.$createElement,i=(t._self._c,t.menu3.length),n=t.ActiveList.length,o=n?t.ActiveList.length:null,a=t.isShop?t.ActiveList.length:null,s=t.isShop?t.ActiveList.length:null,c=Number(t.activeType.kcal*t.activeType.weight/100).toFixed(1),r=Math.floor(t.activeType.kcal*t.activeType.weight/100),u=t.activeType.nutrients_four?t.activeType.nutrients_four.slice(1):null,h=t.__map(t.activeFoodDetail.nutrients_list,(function(e,i){var n=t.__get_orig(e),o=Number(e.value*t.activeType.weight/100).toFixed(2);return{$orig:n,g7:o}})),l=t.IsWeight&&!t.IsFoodDetail?t.__map(t.activeType.nutrients_four,(function(e,i){var n=t.__get_orig(e),o=t.unitConversion(e.unit),a=Number(t.activeType.weight/100*e.value).toFixed(1);return{$orig:n,m0:o,g8:a}})):null,d=t.IsWeight&&!t.IsFoodDetail&&t.activeType.weight?Number(t.activeType.weight).toFixed(1):null,f=t.__map(t.activeType.nutrients_four,(function(e,i){var n=t.__get_orig(e),o=t.unitConversion(e.unit),a=Number(t.activeType.weight/100*e.value).toFixed(1);return{$orig:n,m1:o,g10:a}}));t._isMounted||(t.e0=function(e){t.isShop=!t.isShop},t.e1=function(e){t.isShop=!1},t.e2=function(e){t.IsWeight=!1},t.e3=function(e){t.isBle=!1},t.e4=function(e){t.isBle=!1},t.e5=function(e){t.showAutoSearchDlg=!1}),t.$mp.data=Object.assign({},{$root:{g0:i,g1:n,g2:o,g3:a,g4:s,g5:c,g6:r,l0:u,l1:h,l2:l,g9:d,l3:f}})},a=[]},c70d:function(t,e,i){},d573:function(t,e,i){"use strict";var n=i("c70d"),o=i.n(n);o.a},d8da:function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("6c4c");n(i("3240"));var o=n(i("01f9"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])}},[["d8da","common/runtime","common/vendor"]]]);