examTeamApp/unpackage/dist/build/mp-weixin/pageTwo/my/userInfo.js

1 line
6.3 KiB
JavaScript
Raw Normal View History

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageTwo/my/userInfo"],{6683:function(e,t,i){"use strict";i.r(t);var n=i("737a"),o=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(s);t["default"]=o.a},"737a":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("7ca3")),s=i("8f59");function d(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 a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){(0,o.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var r={data:function(){return{isEdit:!1,fields:"",sexItem:["男","女"],memInfo:{measure_model:2,birthday:"",gender:1,nickname:"",grade:"nothing",height:"",weight:"",address:"",identity_name:"陌生人",identity_id:"P0"},visible:!1,province:[],city:[],area:[],value:[2,0],headimg:"",identityIndex:0,gradeIndex:0,indicatorStyle:"height: 45px;"}},computed:a(a({},(0,s.mapState)(["user","familayList","cityList","gradeList","identityList"])),{},{endDate:function(){return this.$tools.getDate("start")},startDate:function(){return this.$tools.GetDateStr(-90)}}),onLoad:function(e){var t=this;if(t.handleIdentityList(),e.info){var i=JSON.parse(e.info);t.memInfo=i,console.log("that.memInfo ",t.memInfo),t.gradeIndex=t.gradeList.findIndex((function(e){return e.id===t.memInfo.grade})),t.memInfo.grade=t.gradeList[t.gradeIndex].id,t.identityIndex=t.identityList.findIndex((function(e){return e.id===t.memInfo.identity_id})),console.log("1111111111",t.identityList,t.identityIndex),t.isEdit=!0}t.fields="day"},methods:{confirmInfo:function(){var e=this;if(e.memInfo.nickname)if(e.memInfo.height)if(e.memInfo.weight)if(e.memInfo.birthday)if(1!=e.memInfo.measure_model||e.memInfo.identity_id){if(1!=e.memInfo.measure_model||e.memInfo.address){var t=e.isEdit?e.$model.getEditUser(e.memInfo):e.$model.getAddUser(e.memInfo);return t.then((function(t){console.log("成功",t),0==t.code?(e.$tools.msg("提交成功"),e.handleUserList(t.data.aud_id)):e.$tools.msg(t.msg)}))}e.$tools.msg("请选择所属地区")}else e.$tools.msg("请选择身份信息");else e.$tools.msg("请选择出生日期");else e.$tools.msg("请选择体重");else e.$tools.msg("请选择身高");else e.$tools.msg("请输入姓名")},handleUserList:function(t){var i=this;i.$model.getUserList({type:2}).then((function(n){console.log("成员列表",n),i.$store.commit("changeFamilay",n.data);var o="",s=getCurrentPages();s[s.length-2];i.isEdit&&i.memInfo.id==e.getStorageSync("userid")&&(console.log("修改用户"),o=e.getStorageSync("userid")),i.isEdit||(console.log("添加用户"),e.setStorageSync("userid",t),e.setStorageSync("gender",i.memInfo.gender),o=t),i.handlePublicRecord(o),i.$store.dispatch("getUserInfo",{aud_id:o}),i.$store.dispatch("getResult",{aud_id:o}),console.log("familayList个数",i.familayList.length),i.isEdit||1!=i.familayList.length?e.navigateBack():(e.setStorageSync("isBle",!0),e.switchTab({url:"/pages/home/home"}))})).catch((function(e){}))},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)}))},maskClick:function(e){console.log("出生日期",e.detail.value),this.memInfo.birthday=e.detail.value},onsexArr:function(e){this.memInfo.gender="男"==this.sexItem[e.target.value]?1:2},changegType:function(e){this.gradeIndex=e.detail.value,this.memInfo.grade=this.gradeList[e.target.value].id},changegIdentity:function(e){this.identityIndex=e.detail.value,this.memInfo.identity_id=this.identityList[e.detail.value].id,this.memInfo.identity_name=this.identityLis