1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/home/home"],{"0657":function(e,t,i){"use strict";i.r(t);var n=i("ab3d"),o=i("8346");for(var a in o)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(a);i("6f29");var s=i("828b"),c=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"329106f8",null,!1,n["a"],void 0);t["default"]=c.exports},"1e39":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("bad8");n(i("3240"));var o=n(i("0657"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"67fb":function(e,t,i){"use strict";(function(e){var n=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,a=n(i("7ca3")),s=i("8f59");i("4d79");function c(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 l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?c(Object(i),!0).forEach((function(t){(0,a.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var r={data:function(){return{rtype:0,transition:1.6,isShow:!0,infoListTop:{},activeHeight:0,deviceName:"",deviceId:"",serviceId:"",write:"",notify:"",isCoupon:!1,notices:[],banner:[],pop:[],devicesList:[],islink:0,textLink:"",proposalnd:1,toollist:[{icon:"/static/q2.png",title:"中招估分",path:"/pages/score/score"},{icon:"/static/q4.png",title:"BMI测评",path:"/pageTwo/home/bmi"},{icon:"/static/q6.png",title:"遗传身高",path:"/pageTwo/home/inheritHeighet"},{icon:"/static/q1.png",title:"智能跳绳",path:"/pages/skiping/skip?acd_id=6"},{icon:"/static/q10.png",title:"肺活训练",path:"/pages/lunging/vitalcapacity?acd_id=8"},{icon:"/static/q8.png",title:"历史体重",path:"/pageTwo/history/history?acd_id=2"},{icon:"/static/q3.png",title:"减脂对比",path:"/pageTwo/compk/contrast?acd_id=2"},{icon:"/static/q5.png",title:"曲线/目标",path:"/pages/body/body?acd_id=2"},{icon:"/static/q7.png",title:"手动记录",path:""},{icon:"/static/q9.png",title:"成员管理",path:"/pageTwo/my/manage"}],unit:""}},components:{record:function(){i.e("element/manuallyAdd/record").then(function(){return resolve(i("39d2"))}.bind(null,i)).catch(i.oe)},headerIndex:function(){i.e("element/headerIndex").then(function(){return resolve(i("3e96"))}.bind(null,i)).catch(i.oe)}},computed:l(l({},(0,s.mapState)(["user","familayList","MeasureResult","isConnected","isBluetoothTyle"])),{},{userInfo:function(){return this.user},userList:function(){return this.familayList},cplist:function(){return console.log("this.MeasureResult.cplist",this.MeasureResult.cplist),this.MeasureResult.cplist},info:function(){return this.infoListTop=this.MeasureResult.top_list[0]?this.MeasureResult.top_list[0]:{},this.activeHeight=0,this.MeasureResult}}),onLoad:function(t){var i=this;i.handleoginversion(),e.onBluetoothAdapterStateChange((function(e){i.$store.commit("changeBluetooth",e.available)})),i.onBLEConnectionStateChange()},onPullDownRefresh:function(){this.isShow=!0,this.handleUserList(),this.onBLEConnectionStateChange(),e.stopPullDownRefresh()},watch:{isConnected:function(){console.log("------------Home:isConnected-",this.isConnected),this.isConnected||(this.textLink="开始连接",this.islink=-1)},isBluetoothTyle:function(){console.log("-------------Home:isBluetoothTyle-",this.isBluetoothTyle),this.isBluetoothTyle||(this.textLink="开始连接",this.islink=-1)}},onShow:function(){var t=this;console.log("onShow",e.getStorageSync("isBle")),e.onBluetoothAdapterStateChange((function(e){t.$store.commit("changeBluetooth",e.available)})),e.getStorageSync("isBle")&&1==e.getStorageSync("isBle")&&(t.openBluetoothAdapter(),e.setStorageSync("isBle",!1),console.log("首次添加玩用户后初始化蓝牙",e.getStorageSync("isBle")))},methods:{handleoginversion:function(){var t=this;t.$model.getloginversion({}).then((function(i){0==i.code?(t.handleUserList(),t.handleBannerList()):(e.setStorageSync("token",null),e.setStorageSync("aan_id",null),e.clearStorageSync(),e.reLaunch({url:"/pageTwo/login/login"}))}))},handleUserList:function(){var t=this;t.$model.getUserList({type:2}).then((function(i){if(t.isShow=!0,console.log("用户列表",i,e.getStorageSync("userid")),0==i.code){if(t.$store.commit("changeFamilay",i.data),i.data.length){var n="";if(e.getStorageSync("userid")){var o=i.data.find((function(t){return t.id==e.getStorageSync("userid")}));void 0!==o?n=o.id:(n=i.data[0].id,e.setStorageSync("userid",i.data[0].id))}else n=i.data[0].id,e.setStorageSync("userid",i.data[0].id);console.log("正确userid",n),t.$store.dispatch("getUserInfo",{aud_id:n}),t.$store.dispatch("getResult",{aud_id:n}),t.handleLabelList(n),t.handlePublicRecord(n),t.openBluetoothAdapter()}}else t.$tools.msg(i.msg)})).catch((function(e){}))},handleLabelList:function(e){var t=this;t.$model.getLabelList({aud_id:e}).then((function(e){console.log("公共卡片项目",e),0==e.code&&t.$store.commit("changeLabelList",e.data)}))},handlePublicRecord:function(e){var t=this;t.$model.getPublicRecord({aud_id:e}).then((function(e){console.log("公共手动记录",e),0==e.code&&t.$store.commit("changePublicRecord",e.data)}))},handleBannerList:function(){var e=this;e.$model.getBannerList({}).then((function(t){0==t.code?(e.notices=t.data.notice,e.banner=t.data.banner,e.pop=t.data.pop,e.isCoupon=!!t.data.pop.length):e.$tools.msg(t.msg)}))},detail:function(t){e.navigateTo({url:"/pageTwo/webview/webview?id="+t.id+"&url="+t.jump_url})},handleCard:function(){e.navigateTo({url:"/pageTwo/cardList/card"})},handleTool:function(e,t){8==e?this.handlerRecord(2):this.navTo(t)},handlerReport:function(t){console.log("item",t);var i=t.device_determine?1:0;e.navigateTo({url:t.page_url_report+"?acd_id="+t.acd_id+"&device="+i})},handlerRecord:function(e){this.rtype=e,this.$store.commit("changeRecord",!0)},handleAddUser:function(){e.navigateTo({url:"/pageTwo/my/userInfo"})},handleToggleTop:function(e,t){this.infoListTop=e,this.activeHeight=t},navTo:function(t){console.log("url",t),e.navigateTo({url:t})},openBluetoothAdapter:function(){var t=this;t.devicesList=[],e.openBluetoothAdapter({success:function(e){t.islink=0,t.textLink="蓝牙搜索中",console.log("蓝牙初始化成功"),t.startBluetoothDeviceDiscovery()},fail:function(e){t.islink=-1,t.textLink=t.$tools.getBluetoothAdapter(e),console.log("初始化蓝牙失败:"+e)}})},startBluetoothDeviceDiscovery:function(){var t=this;e.startBluetoothDevicesDiscovery({allowDuplicatesKey:!0,interval:200,success:function(e){console.log("搜索设备"),t.onBluetoothDeviceFound()},fail:function(e){}})},onBluetoothDeviceFound:function(){var t=this;e.onBluetoothDeviceFound((function(e){e.devices.forEach((function(e){if(console.log("name",e.name),e.name||e.localName)return-1!=e.name.indexOf("G02")||-1!=e.name.indexOf("Chipsea_BLE")?(clearTimeout(o),t.deviceId=e.deviceId,t.$Bluetooth.stopBluetoothDevicesDiscovery(),void t.handleDevice(e)):-1!=e.name.indexOf("YPC")?(clearTimeout(o),e.deviceId=e.deviceId,t.$Bluetooth.stopBluetoothDevicesDiscovery(),void t.handleDevice(e)):-1!=e.name.toLowerCase().indexOf("da")?(clearTimeout(o),e.deviceId=e.deviceId,void t.handleDevice(e)):-1!=e.name.toLowerCase().indexOf("pcl")||e.localName&&-1!=e.localName.toLowerCase().indexOf("pcl")?(clearTimeout(o),t.deviceName=e.name,t.deviceId=e.deviceId,void t.handleDevice(e)):-1!=e.name.toLowerCase().indexOf("ailink")||-1!=e.name.toLowerCase().indexOf("pcf01")||e.localName&&(-1!=e.localName.toLowerCase().indexOf("ailink")||-1!=e.localName.toLowerCase().indexOf("pcf01"))?(clearTimeout(o),t.deviceId=e.deviceId,t.$Bluetooth.stopBluetoothDevicesDiscovery(),void t.handleDevice(e)):void 0;e.advertisData=e.advertisData?e.advertisData:"";var i=t.$tools.ab2hex(e.advertisData,""),n=i.substring(0,2),a=i.substring(12,16);"c0"==n.toLowerCase()&&(console.log(i,"id",a),clearTimeout(o),t.deviceName="c00002",e.deviceId=e.deviceId,t.handleDevice(e))}))})),t.handleMyTime()},handleDevice:function(t){var i=this.devicesList,n=this.$tools.inArray(i,"deviceId",t.deviceId);if(-1===n){if(-1!=t.name.toLowerCase().indexOf("pcl"))return this.devicesList.push(t),void e.navigateTo({url:"/pageTwo/devices/PCL?deviceId="+t.deviceId});if("c00002"==this.deviceName)return this.devicesList.push(t),void e.navigateTo({url:"/pageTwo/devices/PCL22?deviceId="+t.deviceId});if("da"==t.name.toLowerCase())return this.devicesList.push(t),void e.navigateTo({url:"/pageTwo/devices/PCL22S?deviceId="+t.deviceId});if(-1!=t.name.indexOf("G02"))return this.devicesList.push(t),void e.navigateTo({url:"/pageTwo/devices/G02?deviceId="+t.deviceId});if(-1!=t.name.indexOf("YPC"))return this.devicesList.push(t),void e.navigateTo({url:"/pages/skiping/skip?deviceId="+t.deviceId});if(-1!=t.name.indexOf("Chipsea_BLE"))return this.devicesList.push(t),void e.navigateTo({url:"/pageTwo/devices/B20?deviceId="+t.deviceId});if(-1!=t.name.toLowerCase().indexOf("ailink")||-1!=t.name.toLowerCase().indexOf("pcf01")||t.localName&&(-1!=t.localName.toLowerCase().indexOf("ailink")||-1!=t.localName.toLowerCase().indexOf("pcf01"))){this.devicesList.push(t),this.$Bluetooth.stopBluetoothDevicesDiscovery();var o=this.$store.state.devicesList2,a=this.$tools.inArray(o,"deviceId",t.deviceId);return-1===a?this.$store.state.devicesList2.push(t):this.$store.state.devicesList2[a]=t,void e.navigateTo({url:"/pageTwo/devices/F01PRO?deviceId="+t.deviceId})}}},handleMyTime:function(){var e=this;o=setTimeout((function(){e.devicesList.length||(e.islink=-1,e.textLink="未搜索到有效设备,重新搜索",clearTimeout(o),e.$Bluetooth.stopBluetoothDevicesDiscovery())}),5e4)},getBlereload:function(){this.islink=-1,this.textLink="重新测量"},onBLEConnectionStateChange:function(){var t=this;e.onBLEConnectionStateChange((function(e){console.log("监听蓝牙连接状态",e.connected),t.$store.commit("changeConnected",e.connected)}))},closeBluetoothAdapter:function(){e.closeBluetoothAdapter({success:function(e){console.log("蓝牙模块关闭成功")}})},closeBLEConnection:function(){var t=this;e.closeBLEConnection({deviceId:t.deviceId,success:function(e){console.log("断开蓝牙连接成功"),t.$store.commit("changeConnected",!1)}})}}};t.default=r}).call(this,i("df3c")["default"])},"6f29":function(e,t,i){"use strict";var n=i("bb82"),o=i.n(n);o.a},8346:function(e,t,i){"use strict";i.r(t);var n=i("67fb"),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},ab3d: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={uniCollapse:function(){return i.e("uni_modules/uni-collapse/components/uni-collapse/uni-collapse").then(i.bind(null,"36a9"))},uniCollapseItem:function(){return i.e("uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item").then(i.bind(null,"ed7b"))},uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"02bf"))}},o=function(){var e=this,t=e.$createElement,i=(e._self._c,e.userList.length),n=e.notices.length,o=e.banner.length,a=e.info&&e.info.top_list.length,s=e.info&&e.info.top_list.length,c=s&&e.infoListTop&&e.infoListTop.list?e.infoListTop.list.length:null,l=s&&e.infoListTop&&e.infoListTop.list?e.__map(e.infoListTop.list,(function(t,i){var n=e.__get_orig(t),o=e.infoListTop.list.length;return{$orig:n,g6:o}})):null,r=e.info&&e.info.bottom_list.length,d=e.info&&e.info.bottom_list.length,u=d?e.__map(e.info.bottom_list,(function(t,i){var n=e.__get_orig(t),o=t.list?t.list.length:null,a=t.list&&"基础代谢"!=t.title?e.__map(t.list,(function(i,n){var o=e.__get_orig(i),a=t.list.length;return{$orig:o,g10:a}})):null,s=t.list&&"基础代谢"==t.title?t.list&&t.list.length:null;return{$orig:n,g9:o,l1:a,g11:s}})):null,h=e.info.literature.length,g=e.cplist.sleeplist.length||e.cplist.nutritionlist.length,p=g?1==e.proposalnd&&e.cplist.nutritionlist.length:null,f=g?2==e.proposalnd&&e.cplist.sleeplist.length:null,v=g?3==e.proposalnd&&e.cplist.sportlist.length:null,m=g?4==e.proposalnd&&e.cplist.moodlist.length:null,L=e.user?e.user.card_data_list.length:null,_=e.user?e.__map(e.user.card_data_list,(function(t,i){var n=e.__get_orig(t),o=t.inside_data.length,a=t.inside_data.length;return{$orig:n,g19:o,g20:a}})):null,b=e.userList.length&&1==e.user.measure_model;e._isMounted||(e.e0=function(t,i){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];i=o.item;return e.$tools.NewsPtype(i)},e.e1=function(t,i){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];i=o.image;return e.$tools.NewsPtype(i)},e.e2=function(t){e.proposalnd=1},e.e3=function(t){e.proposalnd=2},e.e4=function(t){e.proposalnd=3},e.e5=function(t){e.proposalnd=4},e.e6=function(t,i){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];i=o.item;return e.$Bluetooth.handleDevicesMac(i.device_determine,i.acd_id)},e.e7=function(t){e.isCoupon=!1},e.e8=function(t,i){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];i=o.ite;return e.$tools.NewsPtype(i)},e.e9=function(t){e.isCoupon=!1}),e.$mp.data=Object.assign({},{$root:{g0:i,g1:n,g2:o,g3:a,g4:s,g5:c,l0:l,g7:r,g8:d,l2:u,g12:h,g13:g,g14:p,g15:f,g16:v,g17:m,g18:L,l3:_,g21:b}})},a=[]},bb82:function(e,t,i){}},[["1e39","common/runtime","common/vendor"]]]); |