|
@@ -4,7 +4,7 @@
|
|
|
<span
|
|
|
v-if="userInfo.user_role_id == '77'"
|
|
|
class="changeStu"
|
|
|
- @click="changeStu()"
|
|
|
+ @click="childData.length != '0' ? (toChange = true) : (toChange = false)"
|
|
|
><img
|
|
|
class="w-12px h-13px inline-block mr-8px"
|
|
|
src="@/assets/images/change.png"
|
|
@@ -19,7 +19,7 @@
|
|
|
</div>
|
|
|
<div class="user-info">
|
|
|
<div class="user-shot">
|
|
|
- <img :src="userInfo.user_avatar.big" alt="" />
|
|
|
+ <!-- <img :src="userInfo.user_avatar.big" alt="" /> -->
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
<h3 class="user-name">
|
|
@@ -188,28 +188,7 @@ export default {
|
|
|
childData: [],
|
|
|
childId: "",
|
|
|
childName: "",
|
|
|
- stuList: [
|
|
|
- {
|
|
|
- user_id: "1",
|
|
|
- realname: "",
|
|
|
- isCheck: false,
|
|
|
- },
|
|
|
- {
|
|
|
- user_id: "2",
|
|
|
- realname: "",
|
|
|
- isCheck: false,
|
|
|
- },
|
|
|
- {
|
|
|
- user_id: "3",
|
|
|
- realname: "",
|
|
|
- isCheck: false,
|
|
|
- },
|
|
|
- {
|
|
|
- user_id: "4",
|
|
|
- realname: "",
|
|
|
- isCheck: false,
|
|
|
- },
|
|
|
- ],
|
|
|
+ initUserId: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -221,7 +200,6 @@ export default {
|
|
|
this.isManage = false;
|
|
|
}
|
|
|
});
|
|
|
- console.log(this.userInfo, 333);
|
|
|
},
|
|
|
loginOut() {
|
|
|
localStorage.clear();
|
|
@@ -276,11 +254,25 @@ export default {
|
|
|
}).then((res) => {
|
|
|
if (res.code == "1") {
|
|
|
this.childData = res.data.info;
|
|
|
- }
|
|
|
- if (this.childData.length != "0") {
|
|
|
- this.toChange = true;
|
|
|
- } else {
|
|
|
- showToast("请先绑定孩子~");
|
|
|
+ if (this.childData.length == "0") {
|
|
|
+ showToast("请先绑定孩子~");
|
|
|
+ }
|
|
|
+ if (localStorage.getItem("childInfo_")) {
|
|
|
+ let userXx = JSON.parse(localStorage.getItem("childInfo_"));
|
|
|
+ this.activeChild = userXx.user_id;
|
|
|
+ this.childId = userXx.user_role_id;
|
|
|
+ this.childName = userXx.user_realname;
|
|
|
+ } else if (this.childData[0].user_id) {
|
|
|
+ localStorage.setItem(
|
|
|
+ "childInfo_",
|
|
|
+ JSON.stringify(this.childData[0])
|
|
|
+ );
|
|
|
+ let userXx = this.childData[0];
|
|
|
+ this.activeChild = userXx.user_id;
|
|
|
+ this.childId = userXx.user_role_id;
|
|
|
+ this.childName = userXx.user_realname;
|
|
|
+ // console.log(this.childData[0].user_id, 2222);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -288,10 +280,7 @@ export default {
|
|
|
this.childId = item.user_role_id;
|
|
|
this.childName = item.user_realname;
|
|
|
this.activeChild = item.user_id;
|
|
|
- localStorage.setItem(
|
|
|
- "childInfo_" + this.userInfo.user_id,
|
|
|
- JSON.stringify(item)
|
|
|
- );
|
|
|
+ localStorage.setItem("childInfo_", JSON.stringify(item));
|
|
|
},
|
|
|
submitDM() {
|
|
|
showToast("切换成功~");
|
|
@@ -303,15 +292,21 @@ export default {
|
|
|
this.IsManage();
|
|
|
},
|
|
|
created() {
|
|
|
- let data = localStorage.getItem("childInfo_" + this.userInfo.user_id);
|
|
|
- if (data) {
|
|
|
- let userXx = JSON.parse(
|
|
|
- localStorage.getItem("childInfo_" + this.userInfo.user_id)
|
|
|
- );
|
|
|
- this.activeChild = userXx.user_id;
|
|
|
- this.childId = userXx.user_role_id;
|
|
|
- this.childName = userXx.user_realname;
|
|
|
- }
|
|
|
+ this.changeStu();
|
|
|
+
|
|
|
+ console.log(
|
|
|
+ this.userInfo,
|
|
|
+
|
|
|
+ 1111
|
|
|
+ );
|
|
|
+ // if (localStorage.getItem("childInfo_")) {
|
|
|
+ // let userXx = JSON.parse(
|
|
|
+ // localStorage.getItem("childInfo_" + this.userInfo.user_id)
|
|
|
+ // );
|
|
|
+ // this.activeChild = userXx.user_id;
|
|
|
+ // this.childId = userXx.user_role_id;
|
|
|
+ // this.childName = userXx.user_realname;
|
|
|
+ // }
|
|
|
},
|
|
|
};
|
|
|
</script>
|