|
@@ -10,7 +10,7 @@
|
|
|
src="@/assets/images/change.png"
|
|
|
/>切换学生
|
|
|
<span v-if="childId == '76'">(当前已绑定小孩{{ childName }})</span
|
|
|
- ><span v-else>(当前未绑定小孩)</span>
|
|
|
+ ><span v-else>(当前未绑定小孩,请先绑定)</span>
|
|
|
</span>
|
|
|
|
|
|
<div class="logout" @click="loginOut">
|
|
@@ -144,7 +144,7 @@
|
|
|
</van-tabbar>
|
|
|
<div v-show="toChange" class="cover"></div>
|
|
|
<div class="change-stu" v-if="toChange">
|
|
|
- <van-icon @click="toChange = false" name="cross" size="0.4*13.3vw" />
|
|
|
+ <van-icon @click="toChange = false" name="cross" size="24" />
|
|
|
<h3>切换孩子</h3>
|
|
|
<div class="mt-17px">
|
|
|
<div
|
|
@@ -188,7 +188,6 @@ export default {
|
|
|
childData: [],
|
|
|
childId: "",
|
|
|
childName: "",
|
|
|
- initUserId: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -254,27 +253,31 @@ export default {
|
|
|
}).then((res) => {
|
|
|
if (res.code == "1") {
|
|
|
this.childData = res.data.info;
|
|
|
- if (this.childData.length == "0") {
|
|
|
+ if (
|
|
|
+ this.childData.length == "0" &&
|
|
|
+ this.userInfo.user_role_id == "77"
|
|
|
+ ) {
|
|
|
showToast("请先绑定孩子~");
|
|
|
}
|
|
|
- if (localStorage.getItem("childInfo_" + this.userInfo.user_id)) {
|
|
|
- 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;
|
|
|
- } else if (this.childData[0].user_id) {
|
|
|
- let userXx = this.childData[0];
|
|
|
- localStorage.setItem(
|
|
|
- "childInfo_" + this.userInfo.user_id,
|
|
|
- JSON.stringify(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);
|
|
|
+ if (this.userInfo.user_role_id == "77") {
|
|
|
+ if (localStorage.getItem("childInfo_" + this.userInfo.user_id)) {
|
|
|
+ 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;
|
|
|
+ } else if (this.childData[0].user_id) {
|
|
|
+ let userXx = this.childData[0];
|
|
|
+ localStorage.setItem(
|
|
|
+ "childInfo_" + this.userInfo.user_id,
|
|
|
+ JSON.stringify(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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|