1 line
6.5 KiB
JavaScript
1 line
6.5 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"578c":function(e,t,n){},"8bc3":function(e,t,n){"use strict";n.r(t);var o=n("fb4d"),i=n("c7dd");for(var a in i)"default"!==a&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("f88e");var c,r=n("f0c5"),s=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"346ba189",null,!1,o["a"],c);t["default"]=s.exports},c6be:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("26cb");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=function(){n.e("components/userLogin").then(function(){return resolve(n("b06c"))}.bind(null,n)).catch(n.oe)},s=function(){n.e("components/drawer/drawer").then(function(){return resolve(n("2ae8"))}.bind(null,n)).catch(n.oe)},u=function(){n.e("components/target/manuaRecord").then(function(){return resolve(n("d95c"))}.bind(null,n)).catch(n.oe)},l={components:{leftdrawer:s,userLogin:r,manuaRecord:u},computed:a({},(0,o.mapState)(["user","MeasureResult"])),onLoad:function(t){var n=this;n.token=e.getStorageSync("token"),t&&t.t&&(n.devType=t.t,n.deviceId=t.sn),n.login()},onShow:function(){this.token=e.getStorageSync("token")},onTabItemTap:function(){this.$store.commit("changeDrawe",!1),this.$store.commit("changeRecord",!1)},watch:{MeasureResult:function(){this.handleToggle(0)}},methods:{login:function(){var t=this;e.login({success:function(n){n.code&&(n.errMsg="login:ok")&&t.$model.onlogin({code:n.code}).then((function(n){if(2==n.code)return e.clearStorageSync(),e.removeStorageSync("token"),e.removeStorageSync("changeUser"),t.$store.commit("changeLogout",!1),e.setStorageSync("tenantid",n.data.tenantid),e.setStorageSync("sessionid",n.data.sessionid),void e.setStorageSync("iswxphone",n.data.iswxphone);0==n.code&&(t.token=n.data.token,e.setStorageSync("token",n.data.token),e.setStorageSync("tenantid",n.data.tenantid),e.setStorageSync("sessionid",n.data.sessionid),e.setStorageSync("iswxphone",n.data.iswxphone),e.setStorageSync("refreshtoken",n.data.refreshtoken),t.getFamilyList())})).catch((function(e){}))}})},getFamilyList:function(){var e=this;e.$model.getFamilyList({}).then((function(t){e.$store.commit("changeFamilay",t),e.$store.dispatch("getUserInfo",{familyid:t[0].familyid}),e.$store.dispatch("getResult",{birthday:t[0].birthday,familyid:t[0].familyid,height:t[0].height,sex:t[0].sex}),e.GetTplList(),e.GetSubscribeInfo()})).catch((function(e){}))},GetSubscribeInfo:function(){var e=this;e.$model.GetSubscribeInfo({}).then((function(t){0==t.code&&(console.log("获取消息订阅状态",t),e.isShowEle=t.data.type)}))},GetTplList:function(){var e=this;e.$model.GetTplList({}).then((function(t){0==t.code&&t.data.forEach((function(t){e.tmplIdList.push(t.id)}))}))},switch1Change:function(e){var t=this;t.isShowEle!=e?wx.requestSubscribeMessage({tmplIds:t.tmplIdList,success:function(n){var o={},i=[];t.tmplIdList.forEach((function(e){o={tplId:e,status:n[e]}})),i.push(o),t.$model.GetSubscribe({type:e,list:i}).then((function(n){console.log("res",n),0==n.code&&(t.isShowEle=e)}))},fail:function(e){console.log("res失败",e),t.$tools.msg("订阅失败")}}):t.$model.Getunsubscribe({type:1}).then((function(e){if(0==e.code)return t.$tools.msg("取消提醒成功"),void(t.isShowEle=0)}))},getBannerList:function(){var e=this;this.$model.GetAdBannerList({page:1,pagesize:10}).then((function(t){e.fimages=t.data.items}))},handleBluetoothClick:function(){var t=this,n=this;n.token?e.openBluetoothAdapter({success:function(t){n.$store.commit("changeBluetooth",!0),n.devType&&n.deviceId?n.$tools.handlePages(n.devType,n.deviceId):(e.navigateTo({url:"/pages/search/devType"}),console.log("初始化蓝牙成功:"+t.errMsg))},fail:function(e){return console.log("初始化蓝牙失败:"+e.errMsg),t.$tools.getBluetoothAdapter(e)}}):n.$store.commit("changeUserLogin",!0)},handleToggle:function(e){var t=this;if(t.MeasureResult){for(var n=this.weightInfo.infoList(t.MeasureResult).slice(1,14),o=0;o<n.length;o++)n[o].showCon=o==e&&!n[o].showCon;t.infoList=this.weightInfo.infoList(t.MeasureResult).slice(1,14)}},clickTool:function(t){var n=this;n.token?0!=t?1!=t?2!=t?3!=t||e.navigateTo({url:"/pageTwo/me/history"}):e.navigateToMiniProgram({appId:"wx3e83b37ba682faf5",path:"pages/index/index",extraData:{}}):e.navigateTo({url:"/pageTwo/survey/survey"}):n.$store.commit("changeRecord",!0):n.$store.commit("changeUserLogin",!0)},detail:function(t){1!=t.type?2!=t.type?3!=t.type||e.navigateToMiniProgram({appId:t.content,path:"",extraData:{}}):e.navigateTo({url:"/pageTwo/zixun/detail?url="+t.content}):e.navigateTo({url:"/pageTwo/zixun/detail?id="+t.id})},handleLogin:function(){this.$store.commit("changeUserLogin",!0)},handleDrawer:function(){this.$store.commit("changeDrawe",!0)}},data:function(){return{fimages:[],token:null,devType:"",deviceId:"",isShowEle:0,infoList:[],tmplIdList:[],toollist:[{icon:"/static/tool1.png",title:"手动记录",id:0},{icon:"/static/tool2.png",title:"体质评估",id:1},{icon:"/static/tool3.png",title:"儿童测量",id:2},{icon:"/static/tool4.png",title:"历史记录",id:3}],checkList:[{title:"每周提醒",index:1},{title:"每月提醒",index:2},{title:"半年提醒",index:3},{title:"一年提醒",index:4}]}}};t.default=l}).call(this,n("543d")["default"])},c7dd:function(e,t,n){"use strict";n.r(t);var o=n("c6be"),i=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},dabf:function(e,t,n){"use strict";(function(e){n("0d2f");o(n("66fd"));var t=o(n("8bc3"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])},f88e:function(e,t,n){"use strict";var o=n("578c"),i=n.n(o);i.a},fb4d:function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var i=function(){var e=this,t=e.$createElement;e._self._c},a=[]}},[["dabf","common/runtime","common/vendor"]]]); |