From e135e918f9cc96b027e041beb485b7e41014eaa6 Mon Sep 17 00:00:00 2001 From: a <455919189@qq.com> Date: Mon, 9 May 2022 15:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'pages/teacherlogin'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/teacherlogin/teacherlogin.js | 82 ++++++++++++++++++++++++++ pages/teacherlogin/teacherlogin.json | 8 +++ pages/teacherlogin/teacherlogin.wxml | 29 +++++++++ pages/teacherlogin/teacherlogin.wxss | 88 ++++++++++++++++++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 pages/teacherlogin/teacherlogin.js create mode 100644 pages/teacherlogin/teacherlogin.json create mode 100644 pages/teacherlogin/teacherlogin.wxml create mode 100644 pages/teacherlogin/teacherlogin.wxss diff --git a/pages/teacherlogin/teacherlogin.js b/pages/teacherlogin/teacherlogin.js new file mode 100644 index 0000000..b42646d --- /dev/null +++ b/pages/teacherlogin/teacherlogin.js @@ -0,0 +1,82 @@ +//index.js +//获取应用实例 +const app = getApp() + +Page({ + data: { + username: '', + password: '' + }, + //事件处理函数 + bindViewTap: function() { + wx.navigateTo({ + url: '../logs/logs' + }) + }, + onShow: function () { + // 生命周期函数--监听页面显示 + wx.hideTabBar({}) + }, + onLoad: function () { + + }, + + + // 获取输入账号 + usernameInput: function (e) { + this.setData({ + username: e.detail.value + }) + }, + + // 获取输入密码 + passwordInput: function (e) { + this.setData({ + password: e.detail.value + }) + }, + + // 登录处理 + login: function () { + if (this.data.username=="123" || this.data.password=="123") + wx.redirectTo({ + url: '../../pages/teacher/teacher', + }) + }, + + + // wx.switchTab({ + // url: '../mine/mine/mine' + // }) + // wx.request({ + // url: app.globalData.globalReqUrl +'/login/login', // 仅为示例,并非真实的接口地址 + // method: 'post', + // data: { + // username: that.data.username, + // password: that.data.password + // }, + // header: { + // 'content-type': 'application/x-www-form-urlencoded' // 默认值 + // }, + // success(res) { + // if (res.data.code == "OK") { + // var unitName = res.data.data.User.unitName; + // var unitId = res.data.data.User.unitId; + // wx.setStorageSync('unitId', unitId); + // wx.setStorageSync('unitName', unitName); + // wx.switchTab({ + // url: '../mine/mine' + // }) + // } else { + // wx.showToast({ + // title: res.data.message, + // icon: 'none', + // duration: 2000 + // }) + // } + // } + // }) + + +}) + diff --git a/pages/teacherlogin/teacherlogin.json b/pages/teacherlogin/teacherlogin.json new file mode 100644 index 0000000..5ffa043 --- /dev/null +++ b/pages/teacherlogin/teacherlogin.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "van-popup": "../../components/vant/dist/popup/index" + }, + "navigationBarTitleText": "登陆", + "enablePullDownRefresh": true, + "backgroundTextStyle":"dark" +} \ No newline at end of file diff --git a/pages/teacherlogin/teacherlogin.wxml b/pages/teacherlogin/teacherlogin.wxml new file mode 100644 index 0000000..55cbe4b --- /dev/null +++ b/pages/teacherlogin/teacherlogin.wxml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/teacherlogin/teacherlogin.wxss b/pages/teacherlogin/teacherlogin.wxss new file mode 100644 index 0000000..555b177 --- /dev/null +++ b/pages/teacherlogin/teacherlogin.wxss @@ -0,0 +1,88 @@ +/* pages/teacherlogin/teacherlogin.wxss */ +page{ + height: 100%; + } + + .container { + height: 100%; + display: flex; + flex-direction: column; + padding: 0; + box-sizing: border-box; + /* background-color: rgb(156, 23, 78) */ + } + + /*登录图片*/ + .login-icon{ + flex: none; + } + + .login-img{ + width: 750rpx; + } + + /*表单内容*/ + .login-from { + margin-top: 20px; + flex: auto; + height:100%; + } + + .inputView { + /* background-color: #fff; */ + line-height: 45px; + border-radius:20px; + border:1px solid #999999; + } + + /*输入框*/ + .nameImage, .keyImage { + margin-left: 22px; + width: 18px; + height: 16px + } + + .loginLab { + margin: 15px 15px 15px 10px; + color: #545454; + font-size: 14px + } + + .inputText { + flex: block; + float: right; + text-align: right; + margin-right: 22px; + margin-top: 11px; + color: #cccccc; + font-size: 14px + } + .line { + margin-top: 8px; + } + + /* .line { + width: 100%; + height: 1px; + background-color: #cccccc; + margin-top: 1px; + } */ + + /*按钮*/ + .loginBtnView { + width: 100%; + height: auto; + /* background-color:#DCDCDC; */ + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; + } + + .loginBtn { + width: 90%; + margin-top: 40px; + border-radius:10px; + background-color: #206fff; + color: #ffffff; + } + \ No newline at end of file