Browse Source

1.tabBar组件
2.子组件给父组件传选定index值
3.禁止swiper手动滑动
4.增加教师端监控界面
5.增加教师端文件库,报修,我的待开发界面

FailedToRead 2 năm trước cách đây
mục cha
commit
951935a244
45 tập tin đã thay đổi với 505 bổ sung37 xóa
  1. 4 0
      miniprogram/component/myInfo/myInfo.json
  2. 23 0
      miniprogram/component/myInfo/myInfo.ts
  3. 2 0
      miniprogram/component/myInfo/myInfo.wxml
  4. 1 0
      miniprogram/component/myInfo/myInfo.wxss
  5. 4 0
      miniprogram/component/tabBar/tabBar.json
  6. 54 0
      miniprogram/component/tabBar/tabBar.ts
  7. 13 0
      miniprogram/component/tabBar/tabBar.wxml
  8. 56 0
      miniprogram/component/tabBar/tabBar.wxss
  9. 4 0
      miniprogram/component/teacher/teacherFault/teacherFault.json
  10. 23 0
      miniprogram/component/teacher/teacherFault/teacherFault.ts
  11. 2 0
      miniprogram/component/teacher/teacherFault/teacherFault.wxml
  12. 1 0
      miniprogram/component/teacher/teacherFault/teacherFault.wxss
  13. 5 0
      miniprogram/component/teacher/teacherFile/teacherFile.json
  14. 23 0
      miniprogram/component/teacher/teacherFile/teacherFile.ts
  15. 2 0
      miniprogram/component/teacher/teacherFile/teacherFile.wxml
  16. 1 0
      miniprogram/component/teacher/teacherFile/teacherFile.wxss
  17. 5 0
      miniprogram/component/teacher/teacherMonitor/monitor.json
  18. 77 0
      miniprogram/component/teacher/teacherMonitor/monitor.ts
  19. 62 0
      miniprogram/component/teacher/teacherMonitor/monitor.wxml
  20. 42 0
      miniprogram/component/teacher/teacherMonitor/monitor.wxss
  21. 1 1
      miniprogram/component/updatePassword/updatePassword.ts
  22. BIN
      miniprogram/image/dropDownSelection/dropDownSelection_icon.png
  23. BIN
      miniprogram/image/teacher/dropdown_icon.png
  24. BIN
      miniprogram/image/teacher/fault.png
  25. BIN
      miniprogram/image/teacher/fault_selected.png
  26. BIN
      miniprogram/image/teacher/file.png
  27. BIN
      miniprogram/image/teacher/file_selected.png
  28. BIN
      miniprogram/image/teacher/monitor.png
  29. BIN
      miniprogram/image/teacher/monitor_selected.png
  30. BIN
      miniprogram/image/teacher/my.png
  31. BIN
      miniprogram/image/teacher/my_selected.png
  32. BIN
      miniprogram/image/teacher/qrcode.png
  33. BIN
      miniprogram/image/teacher/start_monitor.png
  34. 1 1
      miniprogram/pages/index/index.json
  35. 3 0
      miniprogram/pages/index/index.ts
  36. 1 1
      miniprogram/pages/index/index.wxml
  37. 6 3
      miniprogram/pages/login/login.ts
  38. 1 1
      miniprogram/pages/login/login.wxml
  39. 6 6
      miniprogram/pages/register/register.wxml
  40. 1 0
      miniprogram/pages/register/register.wxss
  41. 8 1
      miniprogram/pages/teacher/index/index.json
  42. 34 17
      miniprogram/pages/teacher/index/index.ts
  43. 29 1
      miniprogram/pages/teacher/index/index.wxml
  44. 6 1
      miniprogram/pages/teacher/index/index.wxss
  45. 4 4
      miniprogram/utils/loginType.ts

+ 4 - 0
miniprogram/component/myInfo/myInfo.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 23 - 0
miniprogram/component/myInfo/myInfo.ts

@@ -0,0 +1,23 @@
+// component/myInfo/myInfo.ts
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 2 - 0
miniprogram/component/myInfo/myInfo.wxml

@@ -0,0 +1,2 @@
+<!--component/myInfo/myInfo.wxml-->
+<text>component/myInfo/myInfo.wxml</text>

+ 1 - 0
miniprogram/component/myInfo/myInfo.wxss

@@ -0,0 +1 @@
+/* component/myInfo/myInfo.wxss */

+ 4 - 0
miniprogram/component/tabBar/tabBar.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 54 - 0
miniprogram/component/tabBar/tabBar.ts

@@ -0,0 +1,54 @@
+// component/tabBar/tabBar.ts
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        //接收的json,用来显示tab
+        tabItemJson: {
+            type: Array,
+            value: []
+        },
+        //默认点击第几个(默认第一个)
+        initTabIndex: {
+            type: Number,
+            value: 0
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        currentTab: 0,
+    },
+
+    lifetimes: {
+        attached: function () {
+            // 在组件实例被从页面节点树添加时执行
+
+            this.initTab(this.properties.initTabIndex)
+
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+
+        },
+    },
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        //选择某一项并且给上层id
+        bindTabItem: function (event: any) {
+            this.initTab(Number(event.target.id))
+        },
+        initTab: function (index: any) {
+            this.setData({
+                currentTab: index
+            })
+            this.triggerEvent('selectItemIndex', { selectIndex: index });
+        }
+    }
+})
+

+ 13 - 0
miniprogram/component/tabBar/tabBar.wxml

@@ -0,0 +1,13 @@
+<!--component/tabBar/tabBar.wxml-->
+<view class="container" style="position: absolute; bottom: 0;left: 0;">
+    <view class="tabbar">
+        <view wx:for="{{tabItemJson}}" wx:key="index">
+            <view class="tabbar_item" bindtap="bindTabItem" id="{{index}}">
+
+                <image wx:if="{{currentTab==index}}" id="{{index}}" class="icon" src="{{item.selectedIcon}}"></image>
+                <image wx:else id="{{index}}" class="icon" src="{{item.icon}}"></image>
+                <view class="check_false_text {{currentTab==index?'check_true_text':''}}" id="{{index}}">{{item.title}}</view>
+            </view>
+        </view>
+    </view>
+</view>

+ 56 - 0
miniprogram/component/tabBar/tabBar.wxss

@@ -0,0 +1,56 @@
+/* component/tabBar/tabBar.wxss */
+
+.page {
+    height: 112rpx;
+    background-color: aqua;
+    display: flex;
+    justify-content: center;
+    flex-direction: row;
+    align-items: center;
+    width: 100%;
+}
+
+.icon {
+    width: 44rpx;
+    height: 44rpx;
+
+}
+
+.tabbar {
+    width: 750rpx;
+    height: 112rpx;
+    background: #ffffff;
+    box-shadow: 0px 0px 12px 1px rgba(0, 0, 0, 0.50);
+    display: flex;
+    flex-direction: row;
+    justify-content: space-around;
+    align-items: center;
+}
+
+.tabbar_item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+}
+
+
+
+.check_false_text {
+    font-size: 26rpx;
+    font-family: PingFangSC, PingFangSC-Regular;
+    font-weight: 400;
+    text-align: left;
+    color: #666666;
+    line-height: 37rpx;
+    letter-spacing: 0.26px;
+}
+
+.check_true_text {
+    font-size: 26rpx;
+    font-family: PingFangSC, PingFangSC-Semibold;
+    font-weight: 600;
+    text-align: left;
+    color: #ff9700;
+    line-height: 37rpx;
+    letter-spacing: 0.26px;
+}

+ 4 - 0
miniprogram/component/teacher/teacherFault/teacherFault.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 23 - 0
miniprogram/component/teacher/teacherFault/teacherFault.ts

@@ -0,0 +1,23 @@
+// component/teacher/teacherFault/teacherFault.ts
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 2 - 0
miniprogram/component/teacher/teacherFault/teacherFault.wxml

@@ -0,0 +1,2 @@
+<!--component/teacher/teacherFault/teacherFault.wxml-->
+<text>component/teacher/teacherFault/teacherFault.wxml</text>

+ 1 - 0
miniprogram/component/teacher/teacherFault/teacherFault.wxss

@@ -0,0 +1 @@
+/* component/teacher/teacherFault/teacherFault.wxss */

+ 5 - 0
miniprogram/component/teacher/teacherFile/teacherFile.json

@@ -0,0 +1,5 @@
+{
+    "component": true,
+    "usingComponents": {},
+    "navigationBarTitleText": "文件库"
+}

+ 23 - 0
miniprogram/component/teacher/teacherFile/teacherFile.ts

@@ -0,0 +1,23 @@
+// component/teacher/teacherFile/teacherFile.ts
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 2 - 0
miniprogram/component/teacher/teacherFile/teacherFile.wxml

@@ -0,0 +1,2 @@
+<!--component/teacher/teacherFile/teacherFile.wxml-->
+<text>component/teacher/teacherFile/teacherFile.wxml</text>

+ 1 - 0
miniprogram/component/teacher/teacherFile/teacherFile.wxss

@@ -0,0 +1 @@
+/* component/teacher/teacherFile/teacherFile.wxss */

+ 5 - 0
miniprogram/component/teacher/teacherMonitor/monitor.json

@@ -0,0 +1,5 @@
+{
+  "component": true,
+  "usingComponents": {},
+  "navigationBarTitleText": "开始上课"
+}

+ 77 - 0
miniprogram/component/teacher/teacherMonitor/monitor.ts

@@ -0,0 +1,77 @@
+// pages/teacher/monitor/monitor.ts
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        region: ['北京市', '北京市', '海淀区'],
+        schoolArray: ['中国', '美国', '巴西', '日本'],
+        schoolIndex: 0,
+        classArray: ['一年级一班', '一年级2班', '一年级3班', '一年级4班'],
+        classIndex: 0,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+
+    bindRegionChange: function (event: any) {
+        console.log('picker发送选择改变,携带值为', event.detail.value)
+        this.setData({
+            region: event.detail.value
+        })
+    },
+    bindSchoolPicker: function (event: any) {
+        let newArray;
+        switch (Number(event.detail.value)) {
+            case 0:
+                newArray = ["一", "二", "三"];
+                this.setData({
+                    classArray: newArray,
+                    classIndex: 0
+                })
+                break;
+            case 1:
+                newArray = ["4", "5", "6"];
+                this.setData({
+                    classArray: newArray,
+                    classIndex: 0
+                })
+                break;
+            case 2:
+                newArray = ["as", "ad", "af"];
+                this.setData({
+                    classArray: newArray,
+                    classIndex: 0
+                })
+                break;
+            case 3:
+                newArray = ["b1", "b2", "b3"];
+                this.setData({
+                    classArray: newArray,
+                    classIndex: 0
+                })
+                break;
+        }
+        this.setData({
+            schoolIndex: event.detail.value
+        })
+    },
+    bindClssPicker: function (event: any) {
+        this.setData({
+            classIndex: event.detail.value
+        })
+    },
+})

+ 62 - 0
miniprogram/component/teacher/teacherMonitor/monitor.wxml

@@ -0,0 +1,62 @@
+<!--pages/teacher/monitor/monitor.wxml-->
+<view class="container" style="background-color: #F4F4F4;">
+    <view class="qrcode_layout">
+        <view class="qrcode_layout_bg">
+            <image src="../../../image/teacher/qrcode.png" style="width:60rpx;height:60rpx"></image>
+            <text>扫一扫</text>
+        </view>
+    </view>
+    <view class="center_layout">
+        <text class="center_title">上课地点</text>
+        <view class="center_picker_layout">
+            <!--选择地区-->
+            <view class="item_input_bg" style=" margin-top: 0rpx;   box-shadow: 0px 1px 0px 0px #EEEEEE;">
+                <text class="item_input_title">地区:</text>
+                <picker mode="region" bindchange="bindRegionChange" value="{{region}}" class="item_picker_bg">
+                    <view class="item_picker_content">
+                        <p> {{region[0]}} </p>
+                        <p> {{region[1]}} </p>
+                        <p> {{region[2]}} </p>
+                    </view>
+                </picker>
+                <view class="item_picker_icon_layout">
+                    <image src="../../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
+                </view>
+            </view>
+            <!--选择地区 end-->
+            <!--选择学校-->
+            <view class="item_input_bg" style=" margin-top: 2rpx;box-shadow: 0px 1px 0px 0px #EEEEEE;">
+                <text class="item_input_title">学校:</text>
+                <picker bindchange="bindSchoolPicker" value="{{schoolIndex}}" range="{{schoolArray}}" class="item_picker_bg">
+                    <view class="item_picker_content">
+                        {{schoolArray[schoolIndex]}}
+                    </view>
+                </picker>
+                <view class="item_picker_icon_layout">
+                    <image src="../../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
+                </view>
+            </view>
+            <!--选择学校end-->
+            <!--选择班级-->
+            <view class="item_input_bg" style=" margin-top: 2rpx;box-shadow: 0px 1px 0px 0px #EEEEEE;">
+                <text class="item_input_title">班级:</text>
+                <picker bindchange="bindClssPicker" value="{{classIndex}}" range="{{classArray}}" class="item_picker_bg">
+                    <view class="item_picker_content">
+                        {{classArray[classIndex]}}
+                    </view>
+                </picker>
+                <view class="item_picker_icon_layout">
+                    <image src="../../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
+                </view>
+            </view>
+            <!--选择班级end-->
+            <view class="item_input_bg" style="margin-top: 1rpx;">
+                <text class="item_input_title">设备ID:</text>
+                <input class="item_input_content" placeholder="请输入设备ID" />
+            </view>
+        </view>
+        <view class="login_btn_layout" style="margin-left: 0rpx;margin-top: 190rpx;">
+            <button class="login_btn" style="width: 100%; margin-left: 0rpx;font-size: 36rpx;font-weight: 400;">开始上课</button>
+        </view>
+    </view>
+</view>

+ 42 - 0
miniprogram/component/teacher/teacherMonitor/monitor.wxss

@@ -0,0 +1,42 @@
+/* pages/teacher/monitor/monitor.wxss */
+
+@import "../../../pages/register/register.wxss";
+@import "../../../pages/login/login.wxss";
+
+.qrcode_layout {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: flex-end;
+    margin-top: 26rpx;
+    margin-right: 25rpx;
+}
+
+.qrcode_layout_bg {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+}
+
+.center_layout {
+    margin-top: 93rpx;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+}
+
+.center_title {
+    font-weight: 400;
+    color: #5090FE;
+    font-size: 32rpx;
+    line-height: 45px;
+}
+
+.center_picker_layout {
+    width: 674rpx;
+    height: 324rpx;
+    border-radius: 20rpx;
+    margin-top: 27rpx;
+}

+ 1 - 1
miniprogram/component/updatePassword/updatePassword.ts

@@ -59,7 +59,7 @@ Component({
                 })
             }
 
-            console.log("this.data.showAccPwd:" + this.data.showAccPwd)
+       
         },
 
         hideSelf: function (event: any) {

BIN
miniprogram/image/dropDownSelection/dropDownSelection_icon.png


BIN
miniprogram/image/teacher/dropdown_icon.png


BIN
miniprogram/image/teacher/fault.png


BIN
miniprogram/image/teacher/fault_selected.png


BIN
miniprogram/image/teacher/file.png


BIN
miniprogram/image/teacher/file_selected.png


BIN
miniprogram/image/teacher/monitor.png


BIN
miniprogram/image/teacher/monitor_selected.png


BIN
miniprogram/image/teacher/my.png


BIN
miniprogram/image/teacher/my_selected.png


BIN
miniprogram/image/teacher/qrcode.png


BIN
miniprogram/image/teacher/start_monitor.png


+ 1 - 1
miniprogram/pages/index/index.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
-
+  
   },
 
   "navigationBarTitleText": ""

+ 3 - 0
miniprogram/pages/index/index.ts

@@ -46,4 +46,7 @@ Page({
         })
     },
 
+
+
+
 })

+ 1 - 1
miniprogram/pages/index/index.wxml

@@ -2,7 +2,7 @@
 
 <view class="container">
     <view class="page">
-        <dropDownSelection></dropDownSelection>
+  
         <text style="margin-top: 200rpx;">请选择身份</text>
         <view class="layout">
             <view class="item_bg">

+ 6 - 3
miniprogram/pages/login/login.ts

@@ -14,6 +14,7 @@ Page({
   },
 
   onLoad(opention: any) {
+    console.log("opention.loginType:", opention.loginType)
     this.setData({
       login_check_tab: 0,
       loginType: opention.loginType
@@ -58,7 +59,6 @@ Page({
         showAccPwd: true
       })
     }
-    console.log("this.data.showAccPwd:" + this.data.showAccPwd)
   },
 
 
@@ -85,8 +85,8 @@ Page({
     })
   },
   toTabIndex: function () {
-    let toUrl = null
-    switch (this.data.loginType) {
+    let toUrl = '';
+    switch (Number(this.data.loginType)) {
       case loginType.Teacher:
         //教师(去教师的index页面)
         toUrl = "../teacher/index/index"
@@ -104,6 +104,9 @@ Page({
         toUrl = "../itadministrator/index/index"
         break;
     }
+    wx.navigateTo({
+      url: toUrl,
+    })
   }
 
 })

+ 1 - 1
miniprogram/pages/login/login.wxml

@@ -64,7 +64,7 @@
   <!-- 按钮-->
   <view>
     <view class="login_btn_layout">
-      <button class="login_btn" style="width: 100%;">登 录</button>
+      <button class="login_btn" style="width: 100%;" bindtap="toTabIndex">登 录</button>
       <text wx:if="{{loginType==0}}" style="margin-top: 21rpx;" bindtap="toRegisterPage">注册</text>
     </view>
   </view>

+ 6 - 6
miniprogram/pages/register/register.wxml

@@ -18,20 +18,20 @@
                 </view>
             </picker>
             <view class="item_picker_icon_layout">
-                <image src="../../image/dropDownSelection/dropDownSelection_icon.png" class="item_picker_icon"></image>
+                <image src="../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
             </view>
         </view>
         <!--选择地区 end-->
         <!--选择学校-->
         <view class="item_input_bg">
-            <text class="item_input_title">地区:</text>
+            <text class="item_input_title">学校:</text>
             <picker bindchange="bindSchoolPicker" value="{{schoolIndex}}" range="{{schoolArray}}" class="item_picker_bg">
                 <view class="item_picker_content">
                     {{schoolArray[schoolIndex]}}
                 </view>
             </picker>
             <view class="item_picker_icon_layout">
-                <image src="../../image/dropDownSelection/dropDownSelection_icon.png" class="item_picker_icon"></image>
+                <image src="../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
             </view>
         </view>
         <!--选择学校end-->
@@ -44,7 +44,7 @@
                 </view>
             </picker>
             <view class="item_picker_icon_layout">
-                <image src="../../image/dropDownSelection/dropDownSelection_icon.png" class="item_picker_icon"></image>
+                <image src="../../image/teacher/dropdown_icon.png" class="item_picker_icon"></image>
             </view>
         </view>
         <!--选择班级end-->
@@ -76,12 +76,12 @@
         </view>
         <!-- 按钮-->
         <view>
-            <view class="login_btn_layout" style="margin-left: 0rpx;margin-top: 267rpxrpx;">
+            <view class="login_btn_layout" style="margin-left: 0rpx;margin-top: 267rpx;">
                 <button class="login_btn" style="width: 100%; margin-left: 0rpx;">确认</button>
                 <text style="margin-top: 21rpx;" bindtap="exitPage">取消</text>
             </view>
         </view>
-    </view> 
+    </view>
 
 
 </view>

+ 1 - 0
miniprogram/pages/register/register.wxss

@@ -29,6 +29,7 @@
     height: auto;
     width: auto;
     margin-left: 43rpx;
+    font-size: 30rpx;
 }
 
 .item_input_content {

+ 8 - 1
miniprogram/pages/teacher/index/index.json

@@ -1,3 +1,10 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "tabBar": "../../../component/tabBar/tabBar",
+    "teacherMonitor": "../../../component/teacher/teacherMonitor/monitor",
+    "teacherFile": "../../../component/teacher/teacherFile/teacherFile",
+    "teacherFault": "../../../component/teacher/teacherFault/teacherFault",
+    "myInfo": "../../../component/myInfo/myInfo"
+  },
+  "navigationBarTitleText": "教师端"
 }

+ 34 - 17
miniprogram/pages/teacher/index/index.ts

@@ -5,14 +5,19 @@ Page({
      * 页面的初始数据
      */
     data: {
-
+        tabJson: [{ icon: "../../image/teacher/monitor.png", selectedIcon: "../../image/teacher/monitor_selected.png", title: "监控" },
+        { icon: "../../image/teacher/file.png", selectedIcon: "../../image/teacher/file_selected.png", title: "文件库" },
+        { icon: "../../image/teacher/fault.png", selectedIcon: "../../image/teacher/fault_selected.png", title: "报修" },
+        { icon: "../../image/teacher/my.png", selectedIcon: "../../image/teacher/my_selected.png", title: "我的" }
+        ],
+        currPageIndex: 0
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad() {
-
+        console.log(this.data.tabJson)
     },
 
     /**
@@ -43,24 +48,36 @@ Page({
 
     },
 
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
 
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
 
+    //禁止用户手滑选项卡
+    catchTouchMove: function () {
+        return false
     },
 
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
+    //选项卡滑动
+    selectItemIndex: function (event: any) {
+        console.log("click selected", event.detail.selectIndex)
+        let titleName = "";
+        switch (Number(event.detail.selectIndex)) {
+            case 0:
+                titleName = "开始上课"
+                break;
+            case 1:
+                titleName = "文件库"
+                break;
+            case 2:
+                titleName = "故障报修"
+                break;
+            case 3:
+                titleName = "我的"
+                break;
+        }
+        wx.setNavigationBarTitle({
+            title: titleName
+        })
+        this.setData({
+            currPageIndex: Number(event.detail.selectIndex)
+        })
     }
 })

+ 29 - 1
miniprogram/pages/teacher/index/index.wxml

@@ -1,2 +1,30 @@
 <!--pages/teacher/index/index.wxml-->
-<text>pages/teacher/index/index.wxml</text>
+<view class="container">
+    <!-- 根据选项卡选择的index显示界面 -->
+    <swiper class='swiper' current='{{currPageIndex}}' duration="0">
+        <!-- 监控界面 -->
+        <swiper-item capture-catch:touchmove="catchTouchMove">
+            <teacherMonitor></teacherMonitor>
+        </swiper-item>
+        <!-- 监控界面 -->
+        <!-- 文件库界面 -->
+        <swiper-item capture-catch:touchmove="catchTouchMove">
+            <teacherFile></teacherFile>
+        </swiper-item>
+        <!-- 文件库界面 -->
+        <!-- 故障报修界面 -->
+        <swiper-item capture-catch:touchmove="catchTouchMove">
+            <teacherFault></teacherFault>
+        </swiper-item>
+        <!-- 故障报修界面 -->
+        <!-- 我的界面 -->
+        <swiper-item capture-catch:touchmove="catchTouchMove">
+            <myInfo></myInfo>
+        </swiper-item>
+        <!-- 我的界面 -->
+    </swiper>
+    <!-- 根据选项卡选择的index显示界面 -->
+    <!-- 选项卡tab -->
+    <tabBar bind:selectItemIndex="selectItemIndex" tabItemJson="{{tabJson}}" initTabIndex="{{0}}"></tabBar>
+    <!-- 选项卡tab -->
+</view>

+ 6 - 1
miniprogram/pages/teacher/index/index.wxss

@@ -1 +1,6 @@
-/* pages/teacher/index/index.wxss */
+/* pages/teacher/index/index.wxss */
+
+.swiper {
+    width: 100%;
+    height: 100%;
+}

+ 4 - 4
miniprogram/utils/loginType.ts

@@ -1,7 +1,7 @@
 export const  enum loginType {
-    Teacher,
-    Installer,
-    Repairman,
-    IT
+    Teacher = 0,
+    Installer = 1,
+    Repairman = 2,
+    IT = 3
 }