Browse Source

1.故障报修界面
2.我的界面

FailedToRead 2 years ago
parent
commit
fade96d476

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

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

+ 55 - 0
miniprogram/component/faultItem/faultItem.ts

@@ -0,0 +1,55 @@
+// component/faultItem/faultItem.ts
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        //0=已完成 1=维修中 2=待维修
+        faultStatus: {
+            type: Number,
+            value: 0
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        status: 0,
+        statusText: ""
+    },
+    lifetimes: {
+        attached: function () {
+            // 在组件实例被从页面节点树添加时执行
+            let text = "";
+            switch (Number(this.properties.faultStatus)) {
+                case 0:
+                    text = "已完成";
+
+                    break;
+                case 1:
+                    text = "维修中";
+                    break;
+                case 2:
+                    text = "待维修";
+                    break;
+            }
+            this.setData({
+                status: this.properties.faultStatus,
+                statusText: text
+            })
+
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+
+        },
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 25 - 0
miniprogram/component/faultItem/faultItem.wxml

@@ -0,0 +1,25 @@
+<!--component/faultItem/faultItem.wxml-->
+
+<view class="item_bg">
+    <view class="{{faultStatus==2?'fault_status_wait':''}} {{status==0?'fault_status_over':''}}  {{status==1?'fault_status_repair':''}}">
+        <text class="fault_status_text">{{statusText}}</text>
+    </view>
+
+    <view class="fault_info_layout">
+        <view class="fault_info_layout_item_bg">
+            <image src="../../image/fault/fault_time.png" class="fault_info_layout_item_icon"></image>
+            <text class="fault_info_layout_item_text">提交时间:2021-12-20 18:02</text>
+        </view>
+        <view class="fault_info_layout_item_bg">
+            <image src=" ../../image/fault/fault_number.png" class="fault_info_layout_item_icon">
+            </image>
+            <text class=" fault_info_layout_item_text">报修单号:16832226565</text>
+        </view>
+        <view class="fault_info_layout_item_bg">
+            <image src="../../image/fault/fault_address.png" class="fault_info_layout_item_icon"></image>
+            <text class="fault_info_layout_item_text">详细地址:北京市-海淀区 第二小学 三年级2班</text>
+        </view>
+    </view>
+
+
+</view>

+ 81 - 0
miniprogram/component/faultItem/faultItem.wxss

@@ -0,0 +1,81 @@
+/* component/faultItem/faultItem.wxss */
+
+.item_bg {
+    width: 701rpx;
+    height: 169rpx;
+    background: #ffffff;
+    border-radius: 7px;
+    box-shadow: 0px 1px 17px 0px rgba(0, 0, 0, 0.16);
+    display: flex;
+    flex-direction: row;
+    margin-top: 30rpx;
+}
+
+.fault_status_wait {
+    width: 134rpx;
+    height: 169rpx;
+    background: #f5a725;
+    border-radius: 7px 0px 0px 7px;
+    box-shadow: 0px 1px 17px 0px rgba(0, 0, 0, 0.16);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.fault_status_repair {
+    width: 134rpx;
+    height: 169rpx;
+    background: #64C55A;
+    border-radius: 7px 0px 0px 7px;
+    box-shadow: 0px 1px 17px 0px rgba(0, 0, 0, 0.16);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.fault_status_over {
+    width: 134rpx;
+    height: 169rpx;
+    background: #CCCCCC;
+    border-radius: 7px 0px 0px 7px;
+    box-shadow: 0px 1px 17px 0px rgba(0, 0, 0, 0.16);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.fault_status_text {
+    font-size: 30rpx;
+    font-weight: 400;
+    color: #ffffff;
+    letter-spacing: 0.3rpx;
+    line-height: 42rpx;
+}
+
+.fault_info_layout {
+    height: 139rpx;
+    width: 567rpx;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    align-self: center;
+}
+
+.fault_info_layout_item_bg {
+    flex-direction: row;
+    display: flex;
+    justify-content: start;
+    align-items: center;
+    margin-left: 17rpx;
+}
+
+.fault_info_layout_item_icon {
+    width: 25rpx;
+    height: 25rpx;
+}
+
+.fault_info_layout_item_text {
+    margin-left: 19rpx;
+    font-size: 22rpx;
+    font-weight: 400;
+}

+ 58 - 1
miniprogram/component/myInfo/myInfo.ts

@@ -11,13 +11,70 @@ Component({
      * 组件的初始数据
      */
     data: {
-
+        region: ['北京市', '北京市', '海淀区'],
+        schoolArray: ['中国', '美国', '巴西', '日本'],
+        schoolIndex: 0,
+        classArray: ['一年级一班', '一年级2班', '一年级3班', '一年级4班'],
+        classIndex: 0,
+        isShowPassWord: true
     },
 
     /**
      * 组件的方法列表
      */
     methods: {
+        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
+            })
+        },
+        showPwdTab: function () {
+            if (this.data.isShowPassWord) {
+                this.setData({
+                    isShowPassWord: false
+                })
+            } else {
+                this.setData({
+                    isShowPassWord: true
+                })
+            }
 
+        }
     }
 })

+ 67 - 1
miniprogram/component/myInfo/myInfo.wxml

@@ -1,2 +1,68 @@
 <!--component/myInfo/myInfo.wxml-->
-<text>component/myInfo/myInfo.wxml</text>
+<view class="container">
+    <view class="page">
+        <!--输入姓名-->
+        <view class="item_input_bg">
+            <text class="item_input_title">姓名:</text>
+            <input class="item_input_content" maxlength="11" placeholder="请输入姓名" />
+        </view>
+        <!--输入姓名 end-->
+        <!--选择地区-->
+        <view class="item_input_bg">
+            <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">
+            <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">
+            <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">
+            <text class="item_input_title">设置密码:</text>
+            <input class="item_input_content" maxlength="11" password="{{isShowPassWord}}" placeholder="请输入密码" />
+            <view class="phonenum_pwd_icon" bindtap="showPwdTab">
+                <image src="../../image/login/account_show_pwd_icon.png" style="width:33rpx;height:22rpx;"></image>
+            </view>
+
+        </view>
+        <!--设置密码 end-->
+        <!-- 按钮-->
+        <view>
+            <view class="login_btn_layout" style="margin-left: 0rpx;margin-top: 267rpx;">
+                <button class="login_btn" style="width: 100%; margin-left: 0rpx;">确认</button>
+            </view>
+        </view>
+    </view>
+</view>

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

@@ -1 +1,4 @@
-/* component/myInfo/myInfo.wxss */
+/* component/myInfo/myInfo.wxss */
+@import "../../pages/register/register.wxss";
+@import "../../pages/login/login.wxss";
+

+ 3 - 1
miniprogram/component/teacher/teacherFault/teacherFault.json

@@ -1,4 +1,6 @@
 {
     "component": true,
-    "usingComponents": {}
+    "usingComponents": {
+        "fauleItem": "../../faultItem/faultItem"
+    }
 }

+ 14 - 1
miniprogram/component/teacher/teacherFault/teacherFault.wxml

@@ -1,2 +1,15 @@
 <!--component/teacher/teacherFault/teacherFault.wxml-->
-<text>component/teacher/teacherFault/teacherFault.wxml</text>
+<view class="container">
+    <view class="toptitle">
+        <text class="toptitle_left">报修记录</text>
+        <view class="toptitle_right">
+            <text class="toptitle_right_text">报修记录</text>
+            <image src="../../../image/teacher/dropdown_icon.png" class="toptitle_right_icon"></image>
+        </view>
+    </view>
+    <view style="display: flex;flex-direction: column; justify-content: center; align-items: center;">
+        <fauleItem faultStatus="0"></fauleItem>
+        <fauleItem faultStatus="1"></fauleItem>
+        <fauleItem faultStatus="2"></fauleItem>
+    </view>
+</view>

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

@@ -1 +1,40 @@
-/* component/teacher/teacherFault/teacherFault.wxss */
+/* component/teacher/teacherFault/teacherFault.wxss */
+
+.toptitle {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+}
+
+.toptitle_left {
+    margin-left: 36rpx;
+    font-weight: 600;
+    font-size: 36rpx;
+    color: #474747;
+}
+
+.toptitle_right {
+    width: 197rpx;
+    height: 56rpx;
+    background-color: #f5a725;
+    border-radius: 13rpx;
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    margin-right: 14rpx;
+}
+
+.toptitle_right_text {
+    font-size: 25rpx;
+    font-weight: 400;
+    color: #ffffff;
+    line-height: 31px;
+}
+
+.toptitle_right_icon {
+    width: 24rpx;
+    height: 24rpx;
+    margin-left: 20rpx;
+}

BIN
miniprogram/image/fault/fault_address.png


BIN
miniprogram/image/fault/fault_number.png


BIN
miniprogram/image/fault/fault_time.png