WINDOWS-7IFQK7E\EDY 2 jaren geleden
bovenliggende
commit
cfce850546
2 gewijzigde bestanden met toevoegingen van 34 en 32 verwijderingen
  1. 9 10
      src/components.d.ts
  2. 25 22
      src/pages/_user/index.vue

+ 9 - 10
src/components.d.ts

@@ -13,24 +13,23 @@ declare module '@vue/runtime-core' {
     RouterView: typeof import('vue-router')['RouterView']
     VanButton: typeof import('vant/es')['Button']
     VanCard: typeof import('vant/es')['Card']
+    VanCellGroup: typeof import('vant/es')['CellGroup']
     VanCheckbox: typeof import('vant/es')['Checkbox']
+    VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
+    VanCollapse: typeof import('vant/es')['Collapse']
+    VanCollapseItem: typeof import('vant/es')['CollapseItem']
     VanConfigProvider: typeof import('vant/es')['ConfigProvider']
-    VanCountDown: typeof import('vant/es')['CountDown']
-    VanDivider: typeof import('vant/es')['Divider']
+    VanField: typeof import('vant/es')['Field']
+    VanForm: typeof import('vant/es')['Form']
     VanGrid: typeof import('vant/es')['Grid']
     VanGridItem: typeof import('vant/es')['GridItem']
     VanIcon: typeof import('vant/es')['Icon']
-    VanImage: typeof import('vant/es')['Image']
     VanList: typeof import('vant/es')['List']
     VanNavBar: typeof import('vant/es')['NavBar']
-    VanPicker: typeof import('vant/es')['Picker']
-    VanPopup: typeof import('vant/es')['Popup']
+    VanOverlay: typeof import('vant/es')['Overlay']
     VanPullRefresh: typeof import('vant/es')['PullRefresh']
-    VanSkeleton: typeof import('vant/es')['Skeleton']
-    VanStep: typeof import('vant/es')['Step']
-    VanSteps: typeof import('vant/es')['Steps']
-    VanSticky: typeof import('vant/es')['Sticky']
-    VanSubmitBar: typeof import('vant/es')['SubmitBar']
+    VanRadio: typeof import('vant/es')['Radio']
+    VanRadioGroup: typeof import('vant/es')['RadioGroup']
     VanSwipe: typeof import('vant/es')['Swipe']
     VanSwipeItem: typeof import('vant/es')['SwipeItem']
     VanTab: typeof import('vant/es')['Tab']

+ 25 - 22
src/pages/_user/index.vue

@@ -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);
+            }
           }
         }
       });